@actual-app/web 23.7.1 → 23.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/asset-manifest.json +24 -16
- package/build/data/migrations/1688841238000_add_account_type.sql +5 -0
- package/build/data-file-index.txt +2 -1
- package/build/index.html +1 -1
- package/build/kcab/kcab.worker.73a03b9f0217ad62df42.js +3 -0
- package/build/kcab/kcab.worker.73a03b9f0217ad62df42.js.map +1 -0
- package/build/static/css/{main.1037ae74.css → main.90cc2688.css} +2 -2
- package/build/static/css/main.90cc2688.css.map +1 -0
- package/build/static/js/281.6bb03bd1.chunk.js +2 -0
- package/build/static/js/281.6bb03bd1.chunk.js.map +1 -0
- package/build/static/js/383.1b04bac1.chunk.js +2 -0
- package/build/static/js/383.1b04bac1.chunk.js.map +1 -0
- package/build/static/js/457.4c255aed.chunk.js +2 -0
- package/build/static/js/457.4c255aed.chunk.js.map +1 -0
- package/build/static/js/876.00fe0e63.chunk.js +2 -0
- package/build/static/js/876.00fe0e63.chunk.js.map +1 -0
- package/build/static/js/969.b56f4e53.chunk.js +2 -0
- package/build/static/js/{969.98ab5142.chunk.js.map → 969.b56f4e53.chunk.js.map} +1 -1
- package/build/static/js/main.f758b66a.js +3 -0
- package/build/static/js/main.f758b66a.js.map +1 -0
- package/build/static/js/narrow-components.55a3b7fd.chunk.js +2 -0
- package/build/static/js/narrow-components.55a3b7fd.chunk.js.map +1 -0
- package/build/static/js/reports.d1b97437.chunk.js +2 -0
- package/build/static/js/reports.d1b97437.chunk.js.map +1 -0
- package/build/static/js/resize-observer-polyfill.68c3249b.chunk.js +2 -0
- package/build/static/js/{resize-observer-polyfill.a2fa22b1.chunk.js.map → resize-observer-polyfill.68c3249b.chunk.js.map} +1 -1
- package/build/static/js/wide-components.6cb72932.chunk.js +2 -0
- package/build/static/js/wide-components.6cb72932.chunk.js.map +1 -0
- package/package.json +4 -4
- package/build/kcab/kcab.worker.da48d4e200de78e1dbd9.js +0 -3
- package/build/kcab/kcab.worker.da48d4e200de78e1dbd9.js.map +0 -1
- package/build/static/css/main.1037ae74.css.map +0 -1
- package/build/static/js/457.e2e3c7b2.chunk.js +0 -2
- package/build/static/js/457.e2e3c7b2.chunk.js.map +0 -1
- package/build/static/js/969.98ab5142.chunk.js +0 -2
- package/build/static/js/main.2d8f36b6.js +0 -3
- package/build/static/js/main.2d8f36b6.js.map +0 -1
- package/build/static/js/reports.c9bf4be9.chunk.js +0 -2
- package/build/static/js/reports.c9bf4be9.chunk.js.map +0 -1
- package/build/static/js/resize-observer-polyfill.a2fa22b1.chunk.js +0 -2
- package/build/static/media/Inter.var.c2fe3cb2b7c746f7966a.woff2 +0 -0
- package/build/static/media/bg.42987350d58d04897ed83a3ce50df2d5.svg +0 -1
- /package/build/data/migrations/{1685375406832_transaction_filters.sql → 1688749527273_transaction_filters.sql} +0 -0
- /package/build/kcab/{kcab.worker.da48d4e200de78e1dbd9.js.LICENSE.txt → kcab.worker.73a03b9f0217ad62df42.js.LICENSE.txt} +0 -0
- /package/build/static/js/{main.2d8f36b6.js.LICENSE.txt → main.f758b66a.js.LICENSE.txt} +0 -0
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
/*! For license information please see kcab.worker.da48d4e200de78e1dbd9.js.LICENSE.txt */
|
|
2
|
-
var backend;(()=>{var __webpack_modules__={7804:(e,t,r)=>{e=r.nmd(e);var n=r(9142),o=r(9033).Buffer,i=void 0,a=function(t){return i||(i=new Promise((function(i,a){var s,u=(s=void 0!==t?t:{}).onAbort;s.onAbort=function(e){a(new Error(e)),u&&u(e)},s.postRun=s.postRun||[],s.postRun.push((function(){i(s)})),e=void 0,s||(s=void 0!==s?s:{}),s.onRuntimeInitialized=function(){function e(e,t){this.Qa=e,this.db=t,this.Pa=1,this.wb=[]}function t(e,t){if(this.db=t,t=Y(e)+1,this.hb=Ve(t),null===this.hb)throw Error("Unable to allocate memory for the SQL string");G(e,U,this.hb,t),this.sb=this.hb,this.eb=this.Mb=null}function r(e){let{filename:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!1===t?(this.filename="dbfile_"+(4294967295*Math.random()>>>0),this.Xc=!0,null!=e&&De.zb("/",this.filename,e,!0,!0)):this.filename=e,this.handleError(i(this.filename,n)),this.db=N(n,"i32"),ee(this.db),this.nb={},this.Xa={}}var n=Xe(4),o=s.cwrap,i=o("sqlite3_open","number",["string","number"]),a=o("sqlite3_close_v2","number",["number"]),u=o("sqlite3_exec","number",["number","string","number","number","number"]),l=o("sqlite3_changes","number",["number"]),c=o("sqlite3_prepare_v2","number",["number","string","number","number","number"]),f=o("sqlite3_sql","string",["number"]),d=o("sqlite3_normalized_sql","string",["number"]),g=o("sqlite3_prepare_v2","number",["number","number","number","number","number"]),p=o("sqlite3_bind_text","number",["number","number","number","number","number"]),h=o("sqlite3_bind_blob","number",["number","number","number","number","number"]),y=o("sqlite3_bind_double","number",["number","number","number"]),m=o("sqlite3_bind_int","number",["number","number","number"]),b=o("sqlite3_bind_parameter_index","number",["number","string"]),_=o("sqlite3_step","number",["number"]),w=o("sqlite3_errmsg","string",["number"]),E=o("sqlite3_column_count","number",["number"]),v=o("sqlite3_data_count","number",["number"]),S=o("sqlite3_column_double","number",["number","number"]),T=o("sqlite3_column_text","string",["number","number"]),O=o("sqlite3_column_blob","number",["number","number"]),D=o("sqlite3_column_bytes","number",["number","number"]),j=o("sqlite3_column_type","number",["number","number"]),k=o("sqlite3_column_name","string",["number","number"]),C=o("sqlite3_reset","number",["number"]),M=o("sqlite3_clear_bindings","number",["number"]),L=o("sqlite3_finalize","number",["number"]),B=o("sqlite3_create_function_v2","number","number string number number number number number number number".split(" ")),P=o("sqlite3_value_type","number",["number"]),W=o("sqlite3_value_bytes","number",["number"]),H=o("sqlite3_value_text","string",["number"]),z=o("sqlite3_value_blob","number",["number"]),V=o("sqlite3_value_double","number",["number"]),$=o("sqlite3_result_double","",["number","number"]),Z=o("sqlite3_result_null","",["number"]),K=o("sqlite3_result_text","",["number","string","number","number"]),J=o("sqlite3_result_blob","",["number","number","number","number"]),X=o("sqlite3_result_int","",["number","number"]),Q=o("sqlite3_result_error","",["number","string","number"]),ee=o("RegisterExtensionFunctions","number",["number"]);e.prototype.bind=function(e){if(!this.Qa)throw"Statement closed";return this.reset(),Array.isArray(e)?this.vc(e):null==e||"object"!=typeof e||this.wc(e)},e.prototype.step=function(){if(!this.Qa)throw"Statement closed";this.Pa=1;var e=_(this.Qa);switch(e){case 100:return!0;case 101:return!1;default:throw this.db.handleError(e)}},e.prototype.Pc=function(e){return null==e&&(e=this.Pa,this.Pa+=1),S(this.Qa,e)},e.prototype.Qc=function(e){return null==e&&(e=this.Pa,this.Pa+=1),T(this.Qa,e)},e.prototype.getBlob=function(e){null==e&&(e=this.Pa,this.Pa+=1);var t=D(this.Qa,e);e=O(this.Qa,e);for(var r=new Uint8Array(t),n=0;n<t;n+=1)r[n]=F[e+n];return r},e.prototype.get=function(e){null!=e&&this.bind(e)&&this.step(),e=[];for(var t=v(this.Qa),r=0;r<t;r+=1)switch(j(this.Qa,r)){case 1:case 2:e.push(this.Pc(r));break;case 3:e.push(this.Qc(r));break;case 4:e.push(this.getBlob(r));break;default:e.push(null)}return e},e.prototype.getColumnNames=function(){for(var e=[],t=E(this.Qa),r=0;r<t;r+=1)e.push(k(this.Qa,r));return e},e.prototype.getAsObject=function(e){e=this.get(e);for(var t=this.getColumnNames(),r={},n=0;n<t.length;n+=1)r[t[n]]=e[n];return r},e.prototype.getSQL=function(){return f(this.Qa)},e.prototype.getNormalizedSQL=function(){return d(this.Qa)},e.prototype.run=function(e){return null!=e&&this.bind(e),this.step(),this.reset()},e.prototype.zc=function(e,t){null==t&&(t=this.Pa,this.Pa+=1);var r=x(e=We(e));this.wb.push(r),this.db.handleError(p(this.Qa,t,r,e.length-1,0))},e.prototype.uc=function(e,t){null==t&&(t=this.Pa,this.Pa+=1);var r=x(e);this.wb.push(r),this.db.handleError(h(this.Qa,t,r,e.length,0))},e.prototype.yc=function(e,t){null==t&&(t=this.Pa,this.Pa+=1),this.db.handleError((e===(0|e)?m:y)(this.Qa,t,e))},e.prototype.xc=function(e){null==e&&(e=this.Pa,this.Pa+=1),h(this.Qa,e,0,0,0)},e.prototype.Tb=function(e,t){switch(null==t&&(t=this.Pa,this.Pa+=1),typeof e){case"string":return void this.zc(e,t);case"number":case"boolean":return void this.yc(e+0,t);case"object":if(null===e)return void this.xc(t);if(null!=e.length)return void this.uc(e,t)}throw"Wrong API use : tried to bind a value of an unknown type ("+e+")."},e.prototype.wc=function(e){var t=this;return Object.keys(e).forEach((function(r){var n=b(t.Qa,r);0!==n&&t.Tb(e[r],n)})),!0},e.prototype.vc=function(e){for(var t=0;t<e.length;t+=1)this.Tb(e[t],t+1);return!0},e.prototype.reset=function(){return 0===M(this.Qa)&&0===C(this.Qa)},e.prototype.freemem=function(){for(var e;void 0!==(e=this.wb.pop());)$e(e)},e.prototype.free=function(){var e=0===L(this.Qa);return delete this.db.nb[this.Qa],this.Qa=0,e},t.prototype.next=function(){if(null===this.hb)return{done:!0};if(null!==this.eb&&(this.eb.free(),this.eb=null),!this.db.db)throw this.Bb(),Error("Database closed");var t=Ke(),r=Xe(4);R(n),R(r);try{this.db.handleError(g(this.db.db,this.sb,-1,n,r)),this.sb=N(r,"i32");var o=N(n,"i32");return 0===o?(this.Bb(),{done:!0}):(this.eb=new e(o,this.db),this.db.nb[o]=this.eb,{value:this.eb,done:!1})}catch(e){throw this.Mb=q(this.sb),this.Bb(),e}finally{Je(t)}},t.prototype.Bb=function(){$e(this.hb),this.hb=null},t.prototype.getRemainingSQL=function(){return null!==this.Mb?this.Mb:q(this.sb)},"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator&&(t.prototype[Symbol.iterator]=function(){return this}),r.prototype.run=function(e,t){if(!this.db)throw"Database closed";if(t){e=this.prepare(e,t);try{e.step()}finally{e.free()}}else this.handleError(u(this.db,e,0,0,n));return this},r.prototype.exec=function(t,r){if(!this.db)throw"Database closed";var o=Ke(),i=null;try{var a=Y(t)+1,s=Xe(a);G(t,F,s,a);var u=s,l=Xe(4);for(t=[];0!==N(u,"i8");){R(n),R(l),this.handleError(g(this.db,u,-1,n,l));var c=N(n,"i32");if(u=N(l,"i32"),0!==c){for(a=null,i=new e(c,this),null!=r&&i.bind(r);i.step();)null===a&&(a={columns:i.getColumnNames(),values:[]},t.push(a)),a.values.push(i.get());i.free()}}return t}catch(e){throw i&&i.free(),e}finally{Je(o)}},r.prototype.each=function(e,t,r,n){"function"==typeof t&&(n=r,r=t,t=void 0),e=this.prepare(e,t);try{for(;e.step();)r(e.getAsObject())}finally{e.free()}if("function"==typeof n)return n()},r.prototype.prepare=function(t,r){if(R(n),this.handleError(c(this.db,t,-1,n,0)),0===(t=N(n,"i32")))throw"Nothing to prepare";var o=new e(t,this);return null!=r&&o.bind(r),this.nb[t]=o},r.prototype.iterateStatements=function(e){return new t(e,this)},r.prototype.export=function(){Object.values(this.nb).forEach((function(e){e.free()})),Object.values(this.Xa).forEach(A),this.Xa={},this.handleError(a(this.db));var e=De.readFile(this.filename,{encoding:"binary"});return this.handleError(i(this.filename,n)),this.db=N(n,"i32"),e},r.prototype.close=function(){null!==this.db&&(Object.values(this.nb).forEach((function(e){e.free()})),Object.values(this.Xa).forEach(A),this.Xa={},this.handleError(a(this.db)),this.Xc&&De.unlink("/"+this.filename),this.db=null)},r.prototype.handleError=function(e){if(0===e)return null;throw e=w(this.db),Error(e)},r.prototype.getRowsModified=function(){return l(this.db)},r.prototype.create_function=function(e,t){Object.prototype.hasOwnProperty.call(this.Xa,e)&&(A(this.Xa[e]),delete this.Xa[e]);var r=I((function(e,r,n){for(var o,i=[],a=0;a<r;a+=1){var s=N(n+4*a,"i32"),u=P(s);if(1===u||2===u)s=V(s);else if(3===u)s=H(s);else if(4===u){s=W(u=s),u=z(u);for(var l=new Uint8Array(s),c=0;c<s;c+=1)l[c]=F[u+c];s=l}else s=null;i.push(s)}try{o=t.apply(null,i)}catch(t){return void Q(e,t,-1)}switch(typeof o){case"boolean":X(e,o?1:0);break;case"number":$(e,o);break;case"string":K(e,o,-1,-1);break;case"object":null===o?Z(e):null!=o.length?(r=x(o),J(e,r,o.length,-1),$e(r)):Q(e,"Wrong API use : tried to return a value of an unknown type ("+o+").",-1);break;default:Z(e)}}),"viii");return this.Xa[e]=r,this.handleError(B(this.db,e,t.length,1,0,r,0,0,0)),this},s.Database=r;var te=new Map;s.register_for_idb=e=>{let t=I((function(t,r){return t=te.get(t),e.lock(t,r)?0:5}),"iii"),r=I((function(t,r){return t=te.get(t),e.unlock(t,r),0}),"iii"),n=I((function(e,t){e=q(e),te.set(t,e)}),"vii");s._register_for_idb(t,r,n)},s.cleanup_file=e=>{let t=[...te.entries()].find((t=>t[1]===e));te.delete(t[0])},s.reset_filesystem=()=>{De.root=null,De.lc()}};var l,c={};for(l in s)s.hasOwnProperty(l)&&(c[l]=s[l]);var f,d,g,p,h,y="./this.program",m="object"==typeof window,b="function"==typeof importScripts,_="object"==typeof n&&"object"==typeof n.versions&&"string"==typeof n.versions.node,w="";_?(w=b?r(5724).dirname(w)+"/":"//",f=function(e,t){return p||(p=r(1275)),h||(h=r(5724)),e=h.normalize(e),p.readFileSync(e,t?null:"utf8")},g=function(e){return(e=f(e,!0)).buffer||(e=new Uint8Array(e)),k(e.buffer),e},d=function(e,t,n){p||(p=r(1275)),h||(h=r(5724)),e=h.normalize(e),p.readFile(e,(function(e,r){e?n(e):t(r.buffer)}))},1<n.argv.length&&(y=n.argv[1].replace(/\\/g,"/")),n.argv.slice(2),e.exports=s,s.inspect=function(){return"[Emscripten Module object]"}):(m||b)&&(b?w=self.location.href:"undefined"!=typeof document&&document.currentScript&&(w=document.currentScript.src),w=0!==w.indexOf("blob:")?w.substr(0,w.lastIndexOf("/")+1):"",f=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},b&&(g=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),d=function(e,t,r){var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=function(){200==n.status||0==n.status&&n.response?t(n.response):r()},n.onerror=r,n.send(null)});var E=s.print||console.log.bind(console),v=s.printErr||console.warn.bind(console);for(l in c)c.hasOwnProperty(l)&&(s[l]=c[l]);c=null,s.thisProgram&&(y=s.thisProgram);var S,T,O=[];function A(e){S.delete(J.get(e)),O.push(e)}function I(e,t){if(!S){S=new WeakMap;for(var r=0;r<J.length;r++){var n=J.get(r);n&&S.set(n,r)}}if(S.has(e))e=S.get(e);else{if(O.length)r=O.pop();else{try{J.grow(1)}catch(e){if(!(e instanceof RangeError))throw e;throw"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH."}r=J.length-1}try{J.set(r,e)}catch(s){if(!(s instanceof TypeError))throw s;if("function"==typeof WebAssembly.Function){var o={i:"i32",j:"i64",f:"f32",d:"f64"},i={parameters:[],results:"v"==t[0]?[]:[o[t[0]]]};for(n=1;n<t.length;++n)i.parameters.push(o[t[n]]);t=new WebAssembly.Function(i,e)}else{o=[1,0,1,96],i=t.slice(0,1),t=t.slice(1);var a={i:127,j:126,f:125,d:124};for(o.push(t.length),n=0;n<t.length;++n)o.push(a[t[n]]);"v"==i?o.push(0):o=o.concat([1,a[i]]),o[1]=o.length-2,t=new Uint8Array([0,97,115,109,1,0,0,0].concat(o,[2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0])),t=new WebAssembly.Module(t),t=new WebAssembly.Instance(t,{e:{f:e}}).exports.f}J.set(r,t)}S.set(e,r),e=r}return e}function R(e){var t="i32";switch("*"===t.charAt(t.length-1)&&(t="i32"),t){case"i1":case"i8":F[e>>0]=0;break;case"i16":P[e>>1]=0;break;case"i32":W[e>>2]=0;break;case"i64":oe=[0,(ne=0,1<=+Math.abs(ne)?0<ne?(0|Math.min(+Math.floor(ne/4294967296),4294967295))>>>0:~~+Math.ceil((ne-+(~~ne>>>0))/4294967296)>>>0:0)],W[e>>2]=oe[0],W[e+4>>2]=oe[1];break;case"float":H[e>>2]=0;break;case"double":z[e>>3]=0;break;default:fe("invalid type for setValue: "+t)}}function N(e,t){switch("*"===(t=t||"i8").charAt(t.length-1)&&(t="i32"),t){case"i1":case"i8":return F[e>>0];case"i16":return P[e>>1];case"i32":case"i64":return W[e>>2];case"float":return H[e>>2];case"double":return z[e>>3];default:fe("invalid type for getValue: "+t)}return null}s.wasmBinary&&(T=s.wasmBinary),s.noExitRuntime,"object"!=typeof WebAssembly&&fe("no native wasm support detected");var D,j=!1;function k(e,t){e||fe("Assertion failed: "+t)}function C(e){var t=s["_"+e];return k(t,"Cannot call unknown function "+e+", make sure it is exported"),t}var M=0,L=1;function x(e){var t=M==L?Xe(e.length):Ve(e.length);return e.subarray||e.slice?U.set(e,t):U.set(new Uint8Array(e),t),t}var B,F,U,P,W,H,z,V="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function $(e,t,r){var n=t+r;for(r=t;e[r]&&!(r>=n);)++r;if(16<r-t&&e.subarray&&V)return V.decode(e.subarray(t,r));for(n="";t<r;){var o=e[t++];if(128&o){var i=63&e[t++];if(192==(224&o))n+=String.fromCharCode((31&o)<<6|i);else{var a=63&e[t++];65536>(o=224==(240&o)?(15&o)<<12|i<<6|a:(7&o)<<18|i<<12|a<<6|63&e[t++])?n+=String.fromCharCode(o):(o-=65536,n+=String.fromCharCode(55296|o>>10,56320|1023&o))}}else n+=String.fromCharCode(o)}return n}function q(e,t){return e?$(U,e,t):""}function G(e,t,r,n){if(!(0<n))return 0;var o=r;n=r+n-1;for(var i=0;i<e.length;++i){var a=e.charCodeAt(i);if(55296<=a&&57343>=a&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++i)),127>=a){if(r>=n)break;t[r++]=a}else{if(2047>=a){if(r+1>=n)break;t[r++]=192|a>>6}else{if(65535>=a){if(r+2>=n)break;t[r++]=224|a>>12}else{if(r+3>=n)break;t[r++]=240|a>>18,t[r++]=128|a>>12&63}t[r++]=128|a>>6&63}t[r++]=128|63&a}}return t[r]=0,r-o}function Y(e){for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);55296<=n&&57343>=n&&(n=65536+((1023&n)<<10)|1023&e.charCodeAt(++r)),127>=n?++t:t=2047>=n?t+2:65535>=n?t+3:t+4}return t}function Z(e){var t=Y(e)+1,r=Ve(t);return r&&G(e,F,r,t),r}function K(){var e=D.buffer;B=e,s.HEAP8=F=new Int8Array(e),s.HEAP16=P=new Int16Array(e),s.HEAP32=W=new Int32Array(e),s.HEAPU8=U=new Uint8Array(e),s.HEAPU16=new Uint16Array(e),s.HEAPU32=new Uint32Array(e),s.HEAPF32=H=new Float32Array(e),s.HEAPF64=z=new Float64Array(e)}var J,X=[],Q=[],ee=[];function te(){var e=s.preRun.shift();X.unshift(e)}var re,ne,oe,ie,ae=0,se=null,ue=null;function le(){ae++,s.monitorRunDependencies&&s.monitorRunDependencies(ae)}function ce(){if(ae--,s.monitorRunDependencies&&s.monitorRunDependencies(ae),0==ae&&(null!==se&&(clearInterval(se),se=null),ue)){var e=ue;ue=null,e()}}function fe(e){throw s.onAbort&&s.onAbort(e),v(e),j=!0,new WebAssembly.RuntimeError("abort("+e+"). Build with -s ASSERTIONS=1 for more info.")}function de(){return re.startsWith("data:application/octet-stream;base64,")}if(s.preloadedImages={},s.preloadedAudios={},re="sql-wasm.wasm",!de()){var ge=re;re=s.locateFile?s.locateFile(ge,w):w+ge}function pe(){var e=re;try{if(e==re&&T)return new Uint8Array(T);if(g)return g(e);throw"both async and sync fetching of the wasm failed"}catch(e){fe(e)}}function he(e){for(;0<e.length;){var t=e.shift();if("function"==typeof t)t(s);else{var r=t.pd;"number"==typeof r?void 0===t.yb?J.get(r)():J.get(r)(t.yb):r(void 0===t.yb?null:t.yb)}}}function ye(e,t){for(var r=0,n=e.length-1;0<=n;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r;r--)e.unshift("..");return e}function me(e){var t="/"===e.charAt(0),r="/"===e.substr(-1);return(e=ye(e.split("/").filter((function(e){return!!e})),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e}function be(e){var t=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1);return e=t[0],t=t[1],e||t?(t&&(t=t.substr(0,t.length-1)),e+t):"."}function _e(e){if("/"===e)return"/";var t=(e=(e=me(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)}function we(e,t){return me(e+"/"+t)}function Ee(){for(var e="",t=!1,r=arguments.length-1;-1<=r&&!t;r--){if("string"!=typeof(t=0<=r?arguments[r]:De.cwd()))throw new TypeError("Arguments to path.resolve must be strings");if(!t)return"";e=t+"/"+e,t="/"===t.charAt(0)}return(t?"/":"")+(e=ye(e.split("/").filter((function(e){return!!e})),!t).join("/"))||"."}function ve(e,t){function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var r=e.length-1;0<=r&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=Ee(e).substr(1),t=Ee(t).substr(1),e=r(e.split("/")),t=r(t.split("/"));for(var n=Math.min(e.length,t.length),o=n,i=0;i<n;i++)if(e[i]!==t[i]){o=i;break}for(n=[],i=o;i<e.length;i++)n.push("..");return(n=n.concat(t.slice(o))).join("/")}var Se=[];function Te(e,t){Se[e]={input:[],output:[],gb:t},De.Qb(e,Oe)}var Oe={open:function(e){var t=Se[e.node.rdev];if(!t)throw new De.ErrnoError(43);e.tty=t,e.seekable=!1},close:function(e){e.tty.gb.flush(e.tty)},flush:function(e){e.tty.gb.flush(e.tty)},read:function(e,t,r,n){if(!e.tty||!e.tty.gb.cc)throw new De.ErrnoError(60);for(var o=0,i=0;i<n;i++){try{var a=e.tty.gb.cc(e.tty)}catch(e){throw new De.ErrnoError(29)}if(void 0===a&&0===o)throw new De.ErrnoError(6);if(null==a)break;o++,t[r+i]=a}return o&&(e.node.timestamp=Date.now()),o},write:function(e,t,r,n){if(!e.tty||!e.tty.gb.Nb)throw new De.ErrnoError(60);try{for(var o=0;o<n;o++)e.tty.gb.Nb(e.tty,t[r+o])}catch(e){throw new De.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),o}},Ae={cc:function(e){if(!e.input.length){var t=null;if(_){var r=o.alloc(256),i=0;try{i=p.readSync(n.stdin.fd,r,0,256,null)}catch(e){if(!e.toString().includes("EOF"))throw e;i=0}t=0<i?r.slice(0,i).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(t=window.prompt("Input: "))&&(t+="\n"):"function"==typeof readline&&null!==(t=readline())&&(t+="\n");if(!t)return null;e.input=We(t,!0)}return e.input.shift()},Nb:function(e,t){null===t||10===t?(E($(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&0<e.output.length&&(E($(e.output,0)),e.output=[])}},Ie={Nb:function(e,t){null===t||10===t?(v($(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&0<e.output.length&&(v($(e.output,0)),e.output=[])}};function Re(e){e=65536*Math.ceil(e/65536);var t=Qe(65536,e);return t?(U.fill(0,t,t+e),t):0}var Ne={Va:null,mount:function(){return Ne.createNode(null,"/",16895,0)},createNode:function(e,t,r,n){if(De.Rc(r)||De.isFIFO(r))throw new De.ErrnoError(63);return Ne.Va||(Ne.Va={dir:{node:{getattr:Ne.node_ops.getattr,setattr:Ne.node_ops.setattr,lookup:Ne.node_ops.lookup,mknod:Ne.node_ops.mknod,rename:Ne.node_ops.rename,unlink:Ne.node_ops.unlink,rmdir:Ne.node_ops.rmdir,readdir:Ne.node_ops.readdir,symlink:Ne.node_ops.symlink},stream:{llseek:Ne.stream_ops.llseek}},file:{node:{getattr:Ne.node_ops.getattr,setattr:Ne.node_ops.setattr},stream:{llseek:Ne.stream_ops.llseek,read:Ne.stream_ops.read,write:Ne.stream_ops.write,allocate:Ne.stream_ops.allocate,mmap:Ne.stream_ops.mmap,msync:Ne.stream_ops.msync}},link:{node:{getattr:Ne.node_ops.getattr,setattr:Ne.node_ops.setattr,readlink:Ne.node_ops.readlink},stream:{}},Vb:{node:{getattr:Ne.node_ops.getattr,setattr:Ne.node_ops.setattr},stream:De.Cc}}),r=De.createNode(e,t,r,n),De.isDir(r.mode)?(r.node_ops=Ne.Va.dir.node,r.stream_ops=Ne.Va.dir.stream,r.Na={}):De.isFile(r.mode)?(r.node_ops=Ne.Va.file.node,r.stream_ops=Ne.Va.file.stream,r.Ra=0,r.Na=null):De.fb(r.mode)?(r.node_ops=Ne.Va.link.node,r.stream_ops=Ne.Va.link.stream):De.pb(r.mode)&&(r.node_ops=Ne.Va.Vb.node,r.stream_ops=Ne.Va.Vb.stream),r.timestamp=Date.now(),e&&(e.Na[t]=r,e.timestamp=r.timestamp),r},qd:function(e){return e.Na?e.Na.subarray?e.Na.subarray(0,e.Ra):new Uint8Array(e.Na):new Uint8Array(0)},Zb:function(e,t){var r=e.Na?e.Na.length:0;r>=t||(t=Math.max(t,r*(1048576>r?2:1.125)>>>0),0!=r&&(t=Math.max(t,256)),r=e.Na,e.Na=new Uint8Array(t),0<e.Ra&&e.Na.set(r.subarray(0,e.Ra),0))},gd:function(e,t){if(e.Ra!=t)if(0==t)e.Na=null,e.Ra=0;else{var r=e.Na;e.Na=new Uint8Array(t),r&&e.Na.set(r.subarray(0,Math.min(t,e.Ra))),e.Ra=t}},node_ops:{getattr:function(e){var t={};return t.dev=De.pb(e.mode)?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,De.isDir(e.mode)?t.size=4096:De.isFile(e.mode)?t.size=e.Ra:De.fb(e.mode)?t.size=e.link.length:t.size=0,t.atime=new Date(e.timestamp),t.mtime=new Date(e.timestamp),t.ctime=new Date(e.timestamp),t.Ac=4096,t.blocks=Math.ceil(t.size/t.Ac),t},setattr:function(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&Ne.gd(e,t.size)},lookup:function(){throw De.Db[44]},mknod:function(e,t,r,n){return Ne.createNode(e,t,r,n)},rename:function(e,t,r){if(De.isDir(e.mode)){try{var n=De.lookupNode(t,r)}catch(e){}if(n)for(var o in n.Na)throw new De.ErrnoError(55)}delete e.parent.Na[e.name],e.parent.timestamp=Date.now(),e.name=r,t.Na[r]=e,t.timestamp=e.parent.timestamp,e.parent=t},unlink:function(e,t){delete e.Na[t],e.timestamp=Date.now()},rmdir:function(e,t){var r,n=De.lookupNode(e,t);for(r in n.Na)throw new De.ErrnoError(55);delete e.Na[t],e.timestamp=Date.now()},readdir:function(e){var t,r=[".",".."];for(t in e.Na)e.Na.hasOwnProperty(t)&&r.push(t);return r},symlink:function(e,t,r){return(e=Ne.createNode(e,t,41471,0)).link=r,e},readlink:function(e){if(!De.fb(e.mode))throw new De.ErrnoError(28);return e.link}},stream_ops:{read:function(e,t,r,n,o){var i=e.node.Na;if(o>=e.node.Ra)return 0;if(8<(e=Math.min(e.node.Ra-o,n))&&i.subarray)t.set(i.subarray(o,o+e),r);else for(n=0;n<e;n++)t[r+n]=i[o+n];return e},write:function(e,t,r,n,o,i){if(t.buffer===F.buffer&&(i=!1),!n)return 0;if((e=e.node).timestamp=Date.now(),t.subarray&&(!e.Na||e.Na.subarray)){if(i)return e.Na=t.subarray(r,r+n),e.Ra=n;if(0===e.Ra&&0===o)return e.Na=t.slice(r,r+n),e.Ra=n;if(o+n<=e.Ra)return e.Na.set(t.subarray(r,r+n),o),n}if(Ne.Zb(e,o+n),e.Na.subarray&&t.subarray)e.Na.set(t.subarray(r,r+n),o);else for(i=0;i<n;i++)e.Na[o+i]=t[r+i];return e.Ra=Math.max(e.Ra,o+n),n},llseek:function(e,t,r){if(1===r?t+=e.position:2===r&&De.isFile(e.node.mode)&&(t+=e.node.Ra),0>t)throw new De.ErrnoError(28);return t},allocate:function(e,t,r){Ne.Zb(e.node,t+r),e.node.Ra=Math.max(e.node.Ra,t+r)},mmap:function(e,t,r,n,o,i){if(0!==t)throw new De.ErrnoError(28);if(!De.isFile(e.node.mode))throw new De.ErrnoError(43);if(e=e.node.Na,2&i||e.buffer!==B){if((0<n||n+r<e.length)&&(e=e.subarray?e.subarray(n,n+r):Array.prototype.slice.call(e,n,n+r)),n=!0,!(r=Re(r)))throw new De.ErrnoError(48);F.set(e,r)}else n=!1,r=e.byteOffset;return{ed:r,vb:n}},msync:function(e,t,r,n,o){if(!De.isFile(e.node.mode))throw new De.ErrnoError(43);return 2&o||Ne.stream_ops.write(e,t,0,n,r,!1),0}}},De={root:null,mb:[],Xb:{},streams:[],Zc:1,Ua:null,Wb:"/",Hb:!1,hc:!0,Sa:{},nc:{kc:{qc:1,rc:2}},ErrnoError:null,Db:{},Lc:null,tb:0,lookupPath:function(e,t){if(t=t||{},!(e=Ee(De.cwd(),e)))return{path:"",node:null};var r,n={Cb:!0,Pb:0};for(r in n)void 0===t[r]&&(t[r]=n[r]);if(8<t.Pb)throw new De.ErrnoError(32);e=ye(e.split("/").filter((function(e){return!!e})),!1);var o=De.root;for(n="/",r=0;r<e.length;r++){var i=r===e.length-1;if(i&&t.parent)break;if(o=De.lookupNode(o,e[r]),n=we(n,e[r]),De.ab(o)&&(!i||i&&t.Cb)&&(o=o.lb.root),!i||t.Ta)for(i=0;De.fb(o.mode);)if(o=De.readlink(n),n=Ee(be(n),o),o=De.lookupPath(n,{Pb:t.Pb}).node,40<i++)throw new De.ErrnoError(32)}return{path:n,node:o}},Ya:function(e){for(var t;;){if(De.isRoot(e))return e=e.mount.jc,t?"/"!==e[e.length-1]?e+"/"+t:e+t:e;t=t?e.name+"/"+t:e.name,e=e.parent}},Gb:function(e,t){for(var r=0,n=0;n<t.length;n++)r=(r<<5)-r+t.charCodeAt(n)|0;return(e+r>>>0)%De.Ua.length},ec:function(e){var t=De.Gb(e.parent.id,e.name);e.cb=De.Ua[t],De.Ua[t]=e},fc:function(e){var t=De.Gb(e.parent.id,e.name);if(De.Ua[t]===e)De.Ua[t]=e.cb;else for(t=De.Ua[t];t;){if(t.cb===e){t.cb=e.cb;break}t=t.cb}},lookupNode:function(e,t){var r=De.Vc(e);if(r)throw new De.ErrnoError(r,e);for(r=De.Ua[De.Gb(e.id,t)];r;r=r.cb){var n=r.name;if(r.parent.id===e.id&&n===t)return r}return De.lookup(e,t)},createNode:function(e,t,r,n){return e=new De.FSNode(e,t,r,n),De.ec(e),e},Ab:function(e){De.fc(e)},isRoot:function(e){return e===e.parent},ab:function(e){return!!e.lb},isFile:function(e){return 32768==(61440&e)},isDir:function(e){return 16384==(61440&e)},fb:function(e){return 40960==(61440&e)},pb:function(e){return 8192==(61440&e)},Rc:function(e){return 24576==(61440&e)},isFIFO:function(e){return 4096==(61440&e)},isSocket:function(e){return 49152==(49152&e)},Mc:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},Yc:function(e){var t=De.Mc[e];if(void 0===t)throw Error("Unknown file open mode: "+e);return t},$b:function(e){var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t},Za:function(e,t){return De.hc?0:!t.includes("r")||292&e.mode?t.includes("w")&&!(146&e.mode)||t.includes("x")&&!(73&e.mode)?2:0:2},Vc:function(e){return De.Za(e,"x")||(e.node_ops.lookup?0:2)},Lb:function(e,t){try{return De.lookupNode(e,t),20}catch(e){}return De.Za(e,"wx")},qb:function(e,t,r){try{var n=De.lookupNode(e,t)}catch(e){return e.Oa}if(e=De.Za(e,"wx"))return e;if(r){if(!De.isDir(n.mode))return 54;if(De.isRoot(n)||De.Ya(n)===De.cwd())return 10}else if(De.isDir(n.mode))return 31;return 0},Wc:function(e,t){return e?De.fb(e.mode)?32:De.isDir(e.mode)&&("r"!==De.$b(t)||512&t)?31:De.Za(e,De.$b(t)):44},oc:4096,$c:function(e,t){for(t=t||De.oc,e=e||0;e<=t;e++)if(!De.streams[e])return e;throw new De.ErrnoError(33)},$a:function(e){return De.streams[e]},Jc:function(e,t,r){De.ub||(De.ub=function(){},De.ub.prototype={object:{get:function(){return this.node},set:function(e){this.node=e}}});var n,o=new De.ub;for(n in e)o[n]=e[n];return e=o,t=De.$c(t,r),e.fd=t,De.streams[t]=e},Dc:function(e){De.streams[e]=null},Cc:{open:function(e){e.stream_ops=De.Oc(e.node.rdev).stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:function(){throw new De.ErrnoError(70)}},Kb:function(e){return e>>8},sd:function(e){return 255&e},bb:function(e,t){return e<<8|t},Qb:function(e,t){De.Xb[e]={stream_ops:t}},Oc:function(e){return De.Xb[e]},bc:function(e){var t=[];for(e=[e];e.length;){var r=e.pop();t.push(r),e.push.apply(e,r.mb)}return t},mc:function(e,t){function r(e){return De.tb--,t(e)}function n(e){if(e){if(!n.Kc)return n.Kc=!0,r(e)}else++i>=o.length&&r(null)}"function"==typeof e&&(t=e,e=!1),De.tb++,1<De.tb&&v("warning: "+De.tb+" FS.syncfs operations in flight at once, probably just doing extra work");var o=De.bc(De.root.mount),i=0;o.forEach((function(t){if(!t.type.mc)return n(null);t.type.mc(t,e,n)}))},mount:function(e,t,r){var n="/"===r,o=!r;if(n&&De.root)throw new De.ErrnoError(10);if(!n&&!o){var i=De.lookupPath(r,{Cb:!1});if(r=i.path,i=i.node,De.ab(i))throw new De.ErrnoError(10);if(!De.isDir(i.mode))throw new De.ErrnoError(54)}return t={type:e,vd:t,jc:r,mb:[]},(e=e.mount(t)).mount=t,t.root=e,n?De.root=e:i&&(i.lb=t,i.mount&&i.mount.mb.push(t)),e},yd:function(e){if(e=De.lookupPath(e,{Cb:!1}),!De.ab(e.node))throw new De.ErrnoError(28);var t=(e=e.node).lb,r=De.bc(t);Object.keys(De.Ua).forEach((function(e){for(e=De.Ua[e];e;){var t=e.cb;r.includes(e.mount)&&De.Ab(e),e=t}})),e.lb=null,e.mount.mb.splice(e.mount.mb.indexOf(t),1)},lookup:function(e,t){return e.node_ops.lookup(e,t)},mknod:function(e,t,r){var n=De.lookupPath(e,{parent:!0}).node;if(!(e=_e(e))||"."===e||".."===e)throw new De.ErrnoError(28);var o=De.Lb(n,e);if(o)throw new De.ErrnoError(o);if(!n.node_ops.mknod)throw new De.ErrnoError(63);return n.node_ops.mknod(n,e,t,r)},create:function(e,t){return De.mknod(e,4095&(void 0!==t?t:438)|32768,0)},mkdir:function(e,t){return De.mknod(e,1023&(void 0!==t?t:511)|16384,0)},td:function(e,t){e=e.split("/");for(var r="",n=0;n<e.length;++n)if(e[n]){r+="/"+e[n];try{De.mkdir(r,t)}catch(e){if(20!=e.Oa)throw e}}},rb:function(e,t,r){return void 0===r&&(r=t,t=438),De.mknod(e,8192|t,r)},symlink:function(e,t){if(!Ee(e))throw new De.ErrnoError(44);var r=De.lookupPath(t,{parent:!0}).node;if(!r)throw new De.ErrnoError(44);t=_e(t);var n=De.Lb(r,t);if(n)throw new De.ErrnoError(n);if(!r.node_ops.symlink)throw new De.ErrnoError(63);return r.node_ops.symlink(r,t,e)},rename:function(e,t){var r=be(e),n=be(t),o=_e(e),i=_e(t),a=De.lookupPath(e,{parent:!0}),s=a.node;if(a=(a=De.lookupPath(t,{parent:!0})).node,!s||!a)throw new De.ErrnoError(44);if(s.mount!==a.mount)throw new De.ErrnoError(75);var u=De.lookupNode(s,o);if("."!==(n=ve(e,n)).charAt(0))throw new De.ErrnoError(28);if("."!==(n=ve(t,r)).charAt(0))throw new De.ErrnoError(55);try{var l=De.lookupNode(a,i)}catch(e){}if(u!==l){if(r=De.isDir(u.mode),o=De.qb(s,o,r))throw new De.ErrnoError(o);if(o=l?De.qb(a,i,r):De.Lb(a,i))throw new De.ErrnoError(o);if(!s.node_ops.rename)throw new De.ErrnoError(63);if(De.ab(u)||l&&De.ab(l))throw new De.ErrnoError(10);if(a!==s&&(o=De.Za(s,"w")))throw new De.ErrnoError(o);try{De.Sa.willMovePath&&De.Sa.willMovePath(e,t)}catch(r){v("FS.trackingDelegate['willMovePath']('"+e+"', '"+t+"') threw an exception: "+r.message)}De.fc(u);try{s.node_ops.rename(u,a,i)}catch(e){throw e}finally{De.ec(u)}try{De.Sa.onMovePath&&De.Sa.onMovePath(e,t)}catch(r){v("FS.trackingDelegate['onMovePath']('"+e+"', '"+t+"') threw an exception: "+r.message)}}},rmdir:function(e){var t=De.lookupPath(e,{parent:!0}).node,r=_e(e),n=De.lookupNode(t,r),o=De.qb(t,r,!0);if(o)throw new De.ErrnoError(o);if(!t.node_ops.rmdir)throw new De.ErrnoError(63);if(De.ab(n))throw new De.ErrnoError(10);try{De.Sa.willDeletePath&&De.Sa.willDeletePath(e)}catch(t){v("FS.trackingDelegate['willDeletePath']('"+e+"') threw an exception: "+t.message)}t.node_ops.rmdir(t,r),De.Ab(n);try{De.Sa.onDeletePath&&De.Sa.onDeletePath(e)}catch(t){v("FS.trackingDelegate['onDeletePath']('"+e+"') threw an exception: "+t.message)}},readdir:function(e){if(!(e=De.lookupPath(e,{Ta:!0}).node).node_ops.readdir)throw new De.ErrnoError(54);return e.node_ops.readdir(e)},unlink:function(e){var t=De.lookupPath(e,{parent:!0}).node,r=_e(e),n=De.lookupNode(t,r),o=De.qb(t,r,!1);if(o)throw new De.ErrnoError(o);if(!t.node_ops.unlink)throw new De.ErrnoError(63);if(De.ab(n))throw new De.ErrnoError(10);try{De.Sa.willDeletePath&&De.Sa.willDeletePath(e)}catch(t){v("FS.trackingDelegate['willDeletePath']('"+e+"') threw an exception: "+t.message)}t.node_ops.unlink(t,r),De.Ab(n);try{De.Sa.onDeletePath&&De.Sa.onDeletePath(e)}catch(t){v("FS.trackingDelegate['onDeletePath']('"+e+"') threw an exception: "+t.message)}},readlink:function(e){if(!(e=De.lookupPath(e).node))throw new De.ErrnoError(44);if(!e.node_ops.readlink)throw new De.ErrnoError(28);return Ee(De.Ya(e.parent),e.node_ops.readlink(e))},stat:function(e,t){if(!(e=De.lookupPath(e,{Ta:!t}).node))throw new De.ErrnoError(44);if(!e.node_ops.getattr)throw new De.ErrnoError(63);return e.node_ops.getattr(e)},lstat:function(e){return De.stat(e,!0)},chmod:function(e,t,r){if(!(e="string"==typeof e?De.lookupPath(e,{Ta:!r}).node:e).node_ops.setattr)throw new De.ErrnoError(63);e.node_ops.setattr(e,{mode:4095&t|-4096&e.mode,timestamp:Date.now()})},lchmod:function(e,t){De.chmod(e,t,!0)},fchmod:function(e,t){if(!(e=De.$a(e)))throw new De.ErrnoError(8);De.chmod(e.node,t)},chown:function(e,t,r,n){if(!(e="string"==typeof e?De.lookupPath(e,{Ta:!n}).node:e).node_ops.setattr)throw new De.ErrnoError(63);e.node_ops.setattr(e,{timestamp:Date.now()})},lchown:function(e,t,r){De.chown(e,t,r,!0)},fchown:function(e,t,r){if(!(e=De.$a(e)))throw new De.ErrnoError(8);De.chown(e.node,t,r)},truncate:function(e,t){if(0>t)throw new De.ErrnoError(28);if(!(e="string"==typeof e?De.lookupPath(e,{Ta:!0}).node:e).node_ops.setattr)throw new De.ErrnoError(63);if(De.isDir(e.mode))throw new De.ErrnoError(31);if(!De.isFile(e.mode))throw new De.ErrnoError(28);var r=De.Za(e,"w");if(r)throw new De.ErrnoError(r);e.node_ops.setattr(e,{size:t,timestamp:Date.now()})},Nc:function(e,t){if(!(e=De.$a(e)))throw new De.ErrnoError(8);if(0==(2097155&e.flags))throw new De.ErrnoError(28);De.truncate(e.node,t)},kd:function(e,t,r){(e=De.lookupPath(e,{Ta:!0}).node).node_ops.setattr(e,{timestamp:Math.max(t,r)})},open:function(e,t,r,n,o){if(""===e)throw new De.ErrnoError(44);if(r=64&(t="string"==typeof t?De.Yc(t):t)?4095&(void 0===r?438:r)|32768:0,"object"==typeof e)var i=e;else{e=me(e);try{i=De.lookupPath(e,{Ta:!(131072&t)}).node}catch(e){}}var a=!1;if(64&t)if(i){if(128&t)throw new De.ErrnoError(20)}else i=De.mknod(e,r,0),a=!0;if(!i)throw new De.ErrnoError(44);if(De.pb(i.mode)&&(t&=-513),65536&t&&!De.isDir(i.mode))throw new De.ErrnoError(54);if(!a&&(r=De.Wc(i,t)))throw new De.ErrnoError(r);512&t&&De.truncate(i,0),t&=-131713,(n=De.Jc({node:i,path:De.Ya(i),flags:t,seekable:!0,position:0,stream_ops:i.stream_ops,jd:[],error:!1},n,o)).stream_ops.open&&n.stream_ops.open(n),!s.logReadFiles||1&t||(De.Ob||(De.Ob={}),e in De.Ob||(De.Ob[e]=1,v("FS.trackingDelegate error on read file: "+e)));try{De.Sa.onOpenFile&&(o=0,1!=(2097155&t)&&(o|=De.nc.kc.qc),0!=(2097155&t)&&(o|=De.nc.kc.rc),De.Sa.onOpenFile(e,o))}catch(t){v("FS.trackingDelegate['onOpenFile']('"+e+"', flags) threw an exception: "+t.message)}return n},close:function(e){if(De.kb(e))throw new De.ErrnoError(8);e.Fb&&(e.Fb=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{De.Dc(e.fd)}e.fd=null},kb:function(e){return null===e.fd},llseek:function(e,t,r){if(De.kb(e))throw new De.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new De.ErrnoError(70);if(0!=r&&1!=r&&2!=r)throw new De.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,r),e.jd=[],e.position},read:function(e,t,r,n,o){if(0>n||0>o)throw new De.ErrnoError(28);if(De.kb(e))throw new De.ErrnoError(8);if(1==(2097155&e.flags))throw new De.ErrnoError(8);if(De.isDir(e.node.mode))throw new De.ErrnoError(31);if(!e.stream_ops.read)throw new De.ErrnoError(28);var i=void 0!==o;if(i){if(!e.seekable)throw new De.ErrnoError(70)}else o=e.position;return t=e.stream_ops.read(e,t,r,n,o),i||(e.position+=t),t},write:function(e,t,r,n,o,i){if(0>n||0>o)throw new De.ErrnoError(28);if(De.kb(e))throw new De.ErrnoError(8);if(0==(2097155&e.flags))throw new De.ErrnoError(8);if(De.isDir(e.node.mode))throw new De.ErrnoError(31);if(!e.stream_ops.write)throw new De.ErrnoError(28);e.seekable&&1024&e.flags&&De.llseek(e,0,2);var a=void 0!==o;if(a){if(!e.seekable)throw new De.ErrnoError(70)}else o=e.position;t=e.stream_ops.write(e,t,r,n,o,i),a||(e.position+=t);try{e.path&&De.Sa.onWriteToFile&&De.Sa.onWriteToFile(e.path)}catch(t){v("FS.trackingDelegate['onWriteToFile']('"+e.path+"') threw an exception: "+t.message)}return t},allocate:function(e,t,r){if(De.kb(e))throw new De.ErrnoError(8);if(0>t||0>=r)throw new De.ErrnoError(28);if(0==(2097155&e.flags))throw new De.ErrnoError(8);if(!De.isFile(e.node.mode)&&!De.isDir(e.node.mode))throw new De.ErrnoError(43);if(!e.stream_ops.allocate)throw new De.ErrnoError(138);e.stream_ops.allocate(e,t,r)},mmap:function(e,t,r,n,o,i){if(0!=(2&o)&&0==(2&i)&&2!=(2097155&e.flags))throw new De.ErrnoError(2);if(1==(2097155&e.flags))throw new De.ErrnoError(2);if(!e.stream_ops.mmap)throw new De.ErrnoError(43);return e.stream_ops.mmap(e,t,r,n,o,i)},msync:function(e,t,r,n,o){return e&&e.stream_ops.msync?e.stream_ops.msync(e,t,r,n,o):0},ud:function(){return 0},ic:function(e,t,r){if(!e.stream_ops.ic)throw new De.ErrnoError(59);return e.stream_ops.ic(e,t,r)},readFile:function(e,t){if((t=t||{}).flags=t.flags||0,t.encoding=t.encoding||"binary","utf8"!==t.encoding&&"binary"!==t.encoding)throw Error('Invalid encoding type "'+t.encoding+'"');var r,n=De.open(e,t.flags);e=De.stat(e).size;var o=new Uint8Array(e);return De.read(n,o,0,e,0),"utf8"===t.encoding?r=$(o,0):"binary"===t.encoding&&(r=o),De.close(n),r},writeFile:function(e,t,r){if((r=r||{}).flags=r.flags||577,e=De.open(e,r.flags,r.mode),"string"==typeof t){var n=new Uint8Array(Y(t)+1);t=G(t,n,0,n.length),De.write(e,n,0,t,void 0,r.Bc)}else{if(!ArrayBuffer.isView(t))throw Error("Unsupported data type");De.write(e,t,0,t.byteLength,void 0,r.Bc)}De.close(e)},cwd:function(){return De.Wb},chdir:function(e){if(null===(e=De.lookupPath(e,{Ta:!0})).node)throw new De.ErrnoError(44);if(!De.isDir(e.node.mode))throw new De.ErrnoError(54);var t=De.Za(e.node,"x");if(t)throw new De.ErrnoError(t);De.Wb=e.path},Fc:function(){De.mkdir("/tmp"),De.mkdir("/home"),De.mkdir("/home/web_user")},Ec:function(){De.mkdir("/dev"),De.Qb(De.bb(1,3),{read:function(){return 0},write:function(e,t,r,n){return n}}),De.rb("/dev/null",De.bb(1,3)),Te(De.bb(5,0),Ae),Te(De.bb(6,0),Ie),De.rb("/dev/tty",De.bb(5,0)),De.rb("/dev/tty1",De.bb(6,0));var e=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var e=new Uint8Array(1);return function(){return crypto.getRandomValues(e),e[0]}}if(_)try{var t=r(2074);return function(){return t.randomBytes(1)[0]}}catch(e){}return function(){fe("randomDevice")}}();De.Wa("/dev","random",e),De.Wa("/dev","urandom",e),De.mkdir("/dev/shm"),De.mkdir("/dev/shm/tmp")},Hc:function(){De.mkdir("/proc");var e=De.mkdir("/proc/self");De.mkdir("/proc/self/fd"),De.mount({mount:function(){var t=De.createNode(e,"fd",16895,73);return t.node_ops={lookup:function(e,t){var r=De.$a(+t);if(!r)throw new De.ErrnoError(8);return(e={parent:null,mount:{jc:"fake"},node_ops:{readlink:function(){return r.path}}}).parent=e}},t}},{},"/proc/self/fd")},Ic:function(){s.stdin?De.Wa("/dev","stdin",s.stdin):De.symlink("/dev/tty","/dev/stdin"),s.stdout?De.Wa("/dev","stdout",null,s.stdout):De.symlink("/dev/tty","/dev/stdout"),s.stderr?De.Wa("/dev","stderr",null,s.stderr):De.symlink("/dev/tty1","/dev/stderr"),De.open("/dev/stdin",0),De.open("/dev/stdout",1),De.open("/dev/stderr",1)},Yb:function(){De.ErrnoError||(De.ErrnoError=function(e,t){this.node=t,this.hd=function(e){this.Oa=e},this.hd(e),this.message="FS error"},De.ErrnoError.prototype=Error(),De.ErrnoError.prototype.constructor=De.ErrnoError,[44].forEach((function(e){De.Db[e]=new De.ErrnoError(e),De.Db[e].stack="<generic error, no stack>"})))},lc:function(){De.Yb(),De.Ua=Array(4096),De.mount(Ne,{},"/"),De.Fc(),De.Ec(),De.Hc(),De.Lc={MEMFS:Ne}},jb:function(e,t,r){De.jb.Hb=!0,De.Yb(),s.stdin=e||s.stdin,s.stdout=t||s.stdout,s.stderr=r||s.stderr,De.Ic()},wd:function(){De.jb.Hb=!1;var e=s._fflush;for(e&&e(0),e=0;e<De.streams.length;e++){var t=De.streams[e];t&&De.close(t)}},Eb:function(e,t){var r=0;return e&&(r|=365),t&&(r|=146),r},od:function(e,t){return(e=De.xb(e,t)).exists?e.object:null},xb:function(e,t){try{var r=De.lookupPath(e,{Ta:!t});e=r.path}catch(e){}var n={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,ad:!1,cd:null,bd:null};try{r=De.lookupPath(e,{parent:!0}),n.ad=!0,n.cd=r.path,n.bd=r.node,n.name=_e(e),r=De.lookupPath(e,{Ta:!t}),n.exists=!0,n.path=r.path,n.object=r.node,n.name=r.node.name,n.isRoot="/"===r.path}catch(e){n.error=e.Oa}return n},md:function(e,t){for(e="string"==typeof e?e:De.Ya(e),t=t.split("/").reverse();t.length;){var r=t.pop();if(r){var n=we(e,r);try{De.mkdir(n)}catch(e){}e=n}}return n},Gc:function(e,t,r,n,o){return e=we("string"==typeof e?e:De.Ya(e),t),De.create(e,De.Eb(n,o))},zb:function(e,t,r,n,o,i){if(e=t?we("string"==typeof e?e:De.Ya(e),t):e,n=De.Eb(n,o),o=De.create(e,n),r){if("string"==typeof r){e=Array(r.length),t=0;for(var a=r.length;t<a;++t)e[t]=r.charCodeAt(t);r=e}De.chmod(o,146|n),e=De.open(o,577),De.write(e,r,0,r.length,0,i),De.close(e),De.chmod(o,n)}return o},Wa:function(e,t,r,n){e=we("string"==typeof e?e:De.Ya(e),t),t=De.Eb(!!r,!!n),De.Wa.Kb||(De.Wa.Kb=64);var o=De.bb(De.Wa.Kb++,0);return De.Qb(o,{open:function(e){e.seekable=!1},close:function(){n&&n.buffer&&n.buffer.length&&n(10)},read:function(e,t,n,o){for(var i=0,a=0;a<o;a++){try{var s=r()}catch(e){throw new De.ErrnoError(29)}if(void 0===s&&0===i)throw new De.ErrnoError(6);if(null==s)break;i++,t[n+a]=s}return i&&(e.node.timestamp=Date.now()),i},write:function(e,t,r,o){for(var i=0;i<o;i++)try{n(t[r+i])}catch(e){throw new De.ErrnoError(29)}return o&&(e.node.timestamp=Date.now()),i}}),De.rb(e,t,o)},ac:function(e){if(e.Ib||e.Sc||e.link||e.Na)return!0;if("undefined"!=typeof XMLHttpRequest)throw Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!f)throw Error("Cannot load without read() or XMLHttpRequest.");try{e.Na=We(f(e.url),!0),e.Ra=e.Na.length}catch(e){throw new De.ErrnoError(29)}},ld:function(e,t,r,n,o){function i(){this.Jb=!1,this.ob=[]}if(i.prototype.get=function(e){if(!(e>this.length-1||0>e)){var t=e%this.chunkSize;return this.dc(e/this.chunkSize|0)[t]}},i.prototype.pc=function(e){this.dc=e},i.prototype.Ub=function(){var e=new XMLHttpRequest;if(e.open("HEAD",r,!1),e.send(null),!(200<=e.status&&300>e.status||304===e.status))throw Error("Couldn't load "+r+". Status: "+e.status);var t,n=Number(e.getResponseHeader("Content-length")),o=(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t;e=(t=e.getResponseHeader("Content-Encoding"))&&"gzip"===t;var i=1048576;o||(i=n);var a=this;a.pc((function(e){var t=e*i,o=(e+1)*i-1;if(o=Math.min(o,n-1),void 0===a.ob[e]){var s=a.ob;if(t>o)throw Error("invalid range ("+t+", "+o+") or no bytes requested!");if(o>n-1)throw Error("only "+n+" bytes available! programmer error!");var u=new XMLHttpRequest;if(u.open("GET",r,!1),n!==i&&u.setRequestHeader("Range","bytes="+t+"-"+o),"undefined"!=typeof Uint8Array&&(u.responseType="arraybuffer"),u.overrideMimeType&&u.overrideMimeType("text/plain; charset=x-user-defined"),u.send(null),!(200<=u.status&&300>u.status||304===u.status))throw Error("Couldn't load "+r+". Status: "+u.status);t=void 0!==u.response?new Uint8Array(u.response||[]):We(u.responseText||"",!0),s[e]=t}if(void 0===a.ob[e])throw Error("doXHR failed!");return a.ob[e]})),!e&&n||(i=n=1,i=n=this.dc(0).length,E("LazyFiles on gzip forces download of the whole file when length is accessed")),this.tc=n,this.sc=i,this.Jb=!0},"undefined"!=typeof XMLHttpRequest){if(!b)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var a=new i;Object.defineProperties(a,{length:{get:function(){return this.Jb||this.Ub(),this.tc}},chunkSize:{get:function(){return this.Jb||this.Ub(),this.sc}}}),a={Ib:!1,Na:a}}else a={Ib:!1,url:r};var s=De.Gc(e,t,a,n,o);a.Na?s.Na=a.Na:a.url&&(s.Na=null,s.url=a.url),Object.defineProperties(s,{Ra:{get:function(){return this.Na.length}}});var u={};return Object.keys(s.stream_ops).forEach((function(e){var t=s.stream_ops[e];u[e]=function(){return De.ac(s),t.apply(null,arguments)}})),u.read=function(e,t,r,n,o){if(De.ac(s),o>=(e=e.node.Na).length)return 0;if(n=Math.min(e.length-o,n),e.slice)for(var i=0;i<n;i++)t[r+i]=e[o+i];else for(i=0;i<n;i++)t[r+i]=e.get(o+i);return n},s.stream_ops=u,s},nd:function(e,t,r,n,o,i,a,u,l,c){function f(r){function f(r){c&&c(),u||De.zb(e,t,r,n,o,l),i&&i(),ce()}var d=!1;s.preloadPlugins.forEach((function(e){!d&&e.canHandle(g)&&(e.handle(r,g,f,(function(){a&&a(),ce()})),d=!0)})),d||f(r)}(void 0).jb();var g=t?Ee(we(e,t)):e;le(),"string"==typeof r?function(e,t,r){var n="al "+e;d(e,(function(t){k(t,'Loading data file "'+e+'" failed (no arrayBuffer).'),f(new Uint8Array(t)),n&&ce()}),(function(){if(!r)throw'Loading data file "'+e+'" failed.';r()})),n&&le()}(r,0,a):f(r)},indexedDB:function(){return window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB},Rb:function(){return"EM_FS_"+window.location.pathname},Sb:20,ib:"FILE_DATA",xd:function(e,t,r){t=t||function(){},r=r||function(){};var n=De.indexedDB();try{var o=n.open(De.Rb(),De.Sb)}catch(e){return r(e)}o.onupgradeneeded=function(){E("creating db"),o.result.createObjectStore(De.ib)},o.onsuccess=function(){var n=o.result.transaction([De.ib],"readwrite"),i=n.objectStore(De.ib),a=0,s=0,u=e.length;e.forEach((function(e){(e=i.put(De.xb(e).object.Na,e)).onsuccess=function(){++a+s==u&&(0==s?t():r())},e.onerror=function(){s++,a+s==u&&(0==s?t():r())}})),n.onerror=r},o.onerror=r},rd:function(e,t,r){t=t||function(){},r=r||function(){};var n=De.indexedDB();try{var o=n.open(De.Rb(),De.Sb)}catch(e){return r(e)}o.onupgradeneeded=r,o.onsuccess=function(){var n=o.result;try{var i=n.transaction([De.ib],"readonly")}catch(e){return void r(e)}var a=i.objectStore(De.ib),s=0,u=0,l=e.length;e.forEach((function(e){var n=a.get(e);n.onsuccess=function(){De.xb(e).exists&&De.unlink(e),De.zb(be(e),_e(e),n.result,!0,!0,!0),++s+u==l&&(0==u?t():r())},n.onerror=function(){u++,s+u==l&&(0==u?t():r())}})),i.onerror=r},o.onerror=r}},je={};function ke(e,t,r){try{var n=e(t)}catch(e){if(e&&e.node&&me(t)!==me(De.Ya(e.node)))return-54;throw e}return W[r>>2]=n.dev,W[r+4>>2]=0,W[r+8>>2]=n.ino,W[r+12>>2]=n.mode,W[r+16>>2]=n.nlink,W[r+20>>2]=n.uid,W[r+24>>2]=n.gid,W[r+28>>2]=n.rdev,W[r+32>>2]=0,oe=[n.size>>>0,(ne=n.size,1<=+Math.abs(ne)?0<ne?(0|Math.min(+Math.floor(ne/4294967296),4294967295))>>>0:~~+Math.ceil((ne-+(~~ne>>>0))/4294967296)>>>0:0)],W[r+40>>2]=oe[0],W[r+44>>2]=oe[1],W[r+48>>2]=4096,W[r+52>>2]=n.blocks,W[r+56>>2]=n.atime.getTime()/1e3|0,W[r+60>>2]=0,W[r+64>>2]=n.mtime.getTime()/1e3|0,W[r+68>>2]=0,W[r+72>>2]=n.ctime.getTime()/1e3|0,W[r+76>>2]=0,oe=[n.ino>>>0,(ne=n.ino,1<=+Math.abs(ne)?0<ne?(0|Math.min(+Math.floor(ne/4294967296),4294967295))>>>0:~~+Math.ceil((ne-+(~~ne>>>0))/4294967296)>>>0:0)],W[r+80>>2]=oe[0],W[r+84>>2]=oe[1],0}var Ce,Me=void 0;function Le(){return W[(Me+=4)-4>>2]}function xe(e){if(!(e=De.$a(e)))throw new De.ErrnoError(8);return e}Ce=_?function(){var e=n.hrtime();return 1e3*e[0]+e[1]/1e6}:function(){return performance.now()};var Be,Fe={};function Ue(){if(!Be){var e,t={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:y||"./this.program"};for(e in Fe)void 0===Fe[e]?delete t[e]:t[e]=Fe[e];var r=[];for(e in t)r.push(e+"="+t[e]);Be=r}return Be}function Pe(e,t,r,n){e||(e=this),this.parent=e,this.mount=e.mount,this.lb=null,this.id=De.Zc++,this.name=t,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=n}function We(e,t){var r=Array(Y(e)+1);return e=G(e,r,0,r.length),t&&(r.length=e),r}Object.defineProperties(Pe.prototype,{read:{get:function(){return 365==(365&this.mode)},set:function(e){e?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146==(146&this.mode)},set:function(e){e?this.mode|=146:this.mode&=-147}},Sc:{get:function(){return De.isDir(this.mode)}},Ib:{get:function(){return De.pb(this.mode)}}}),De.FSNode=Pe,De.lc();var He={a:function(e,t,r,n){fe("Assertion failed: "+q(e)+", at: "+[t?q(t):"unknown filename",r,n?q(n):"unknown function"])},u:function(e,t){!function(){function e(e){return(e=e.toTimeString().match(/\(([A-Za-z ]+)\)$/))?e[1]:"GMT"}if(!ie){ie=!0;var t=(new Date).getFullYear(),r=new Date(t,0,1),n=new Date(t,6,1);t=r.getTimezoneOffset();var o=n.getTimezoneOffset(),i=Math.max(t,o);W[Ze()>>2]=60*i,W[Ye()>>2]=Number(t!=o),r=e(r),n=e(n),r=Z(r),n=Z(n),o<t?(W[Ge()>>2]=r,W[Ge()+4>>2]=n):(W[Ge()>>2]=n,W[Ge()+4>>2]=r)}}(),e=new Date(1e3*W[e>>2]),W[t>>2]=e.getSeconds(),W[t+4>>2]=e.getMinutes(),W[t+8>>2]=e.getHours(),W[t+12>>2]=e.getDate(),W[t+16>>2]=e.getMonth(),W[t+20>>2]=e.getFullYear()-1900,W[t+24>>2]=e.getDay();var r=new Date(e.getFullYear(),0,1);W[t+28>>2]=(e.getTime()-r.getTime())/864e5|0,W[t+36>>2]=-60*e.getTimezoneOffset();var n=new Date(e.getFullYear(),6,1).getTimezoneOffset();return e=0|(n!=(r=r.getTimezoneOffset())&&e.getTimezoneOffset()==Math.min(r,n)),W[t+32>>2]=e,e=W[Ge()+(e?4:0)>>2],W[t+40>>2]=e,t},m:function(e,t){try{var r;if(e=q(e),-8&t)var n=-28;else(r=De.lookupPath(e,{Ta:!0}).node)?(e="",4&t&&(e+="r"),2&t&&(e+="w"),1&t&&(e+="x"),n=e&&De.Za(r,e)?-2:0):n=-44;return n}catch(e){return void 0!==De&&e instanceof De.ErrnoError||fe(e),-e.Oa}},A:function(e,t){try{return e=q(e),De.chmod(e,t),0}catch(e){return void 0!==De&&e instanceof De.ErrnoError||fe(e),-e.Oa}},H:function(e,t,r){try{return e=q(e),De.chown(e,t,r),0}catch(e){return void 0!==De&&e instanceof De.ErrnoError||fe(e),-e.Oa}},B:function(e,t){try{return De.fchmod(e,t),0}catch(e){return void 0!==De&&e instanceof De.ErrnoError||fe(e),-e.Oa}},I:function(e,t,r){try{return De.fchown(e,t,r),0}catch(e){return void 0!==De&&e instanceof De.ErrnoError||fe(e),-e.Oa}},b:function(e,t,r){Me=r;try{var n=xe(e);switch(t){case 0:var o=Le();return 0>o?-28:De.open(n.path,n.flags,0,o).fd;case 1:case 2:case 13:case 14:return 0;case 3:return n.flags;case 4:return o=Le(),n.flags|=o,0;case 12:return o=Le(),P[o+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return W[ze()>>2]=28,-1}}catch(e){return void 0!==De&&e instanceof De.ErrnoError||fe(e),-e.Oa}},E:function(e,t){try{var r=xe(e);return ke(De.stat,r.path,t)}catch(e){return void 0!==De&&e instanceof De.ErrnoError||fe(e),-e.Oa}},n:function(e,t,r){try{return De.Nc(e,r),0}catch(e){return void 0!==De&&e instanceof De.ErrnoError||fe(e),-e.Oa}},l:function(e,t){try{if(0===t)return-28;var r=De.cwd();return t<Y(r)+1?-68:(G(r,U,e,t),e)}catch(e){return void 0!==De&&e instanceof De.ErrnoError||fe(e),-e.Oa}},G:function(){return 0},d:function(){return 42},z:function(e,t){try{return e=q(e),ke(De.lstat,e,t)}catch(e){return void 0!==De&&e instanceof De.ErrnoError||fe(e),-e.Oa}},C:function(e,t){try{return"/"===(e=me(e=q(e)))[e.length-1]&&(e=e.substr(0,e.length-1)),De.mkdir(e,t,0),0}catch(e){return void 0!==De&&e instanceof De.ErrnoError||fe(e),-e.Oa}},y:function(e,t,r,n,o,i){try{e:{i<<=12;var a=!1;if(0!=(16&n)&&0!=e%65536)var s=-28;else{if(0!=(32&n)){var u=Re(t);if(!u){s=-48;break e}a=!0}else{var l=De.$a(o);if(!l){s=-8;break e}var c=De.mmap(l,e,t,i,r,n);u=c.ed,a=c.vb}je[u]={Uc:u,Tc:t,vb:a,fd:o,dd:r,flags:n,offset:i},s=u}}return s}catch(e){return void 0!==De&&e instanceof De.ErrnoError||fe(e),-e.Oa}},x:function(e,t){try{var r=je[e];if(0!==t&&r){if(t===r.Tc){var n=De.$a(r.fd);if(n&&2&r.dd){var o=r.flags,i=r.offset,a=U.slice(e,e+t);De.msync(n,a,i,t,o)}je[e]=null,r.vb&&$e(r.Uc)}var s=0}else s=-28;return s}catch(e){return void 0!==De&&e instanceof De.ErrnoError||fe(e),-e.Oa}},w:function(e,t,r){Me=r;try{var n=q(e),o=r?Le():0;return De.open(n,t,o).fd}catch(e){return void 0!==De&&e instanceof De.ErrnoError||fe(e),-e.Oa}},J:function(e,t,r){try{if(e=q(e),0>=r)var n=-28;else{var o=De.readlink(e),i=Math.min(r,Y(o)),a=F[t+i];G(o,U,t,r+1),F[t+i]=a,n=i}return n}catch(e){return void 0!==De&&e instanceof De.ErrnoError||fe(e),-e.Oa}},F:function(e){try{return e=q(e),De.rmdir(e),0}catch(e){return void 0!==De&&e instanceof De.ErrnoError||fe(e),-e.Oa}},e:function(e,t){try{return e=q(e),ke(De.stat,e,t)}catch(e){return void 0!==De&&e instanceof De.ErrnoError||fe(e),-e.Oa}},i:function(e){try{return e=q(e),De.unlink(e),0}catch(e){return void 0!==De&&e instanceof De.ErrnoError||fe(e),-e.Oa}},v:function(){return 2147483648},p:function(e,t,r){U.copyWithin(e,t,t+r)},c:function(e){var t=U.length;if(2147483648<(e>>>=0))return!1;for(var r=1;4>=r;r*=2){var n=t*(1+.2/r);n=Math.min(n,e+100663296),0<(n=Math.max(e,n))%65536&&(n+=65536-n%65536);e:{try{D.grow(Math.min(2147483648,n)-B.byteLength+65535>>>16),K();var o=1;break e}catch(e){}o=void 0}if(o)return!0}return!1},t:function(e){for(var t=Ce();Ce()-t<e;);},r:function(e,t){try{var r=0;return Ue().forEach((function(n,o){var i=t+r;for(o=W[e+4*o>>2]=i,i=0;i<n.length;++i)F[o++>>0]=n.charCodeAt(i);F[o>>0]=0,r+=n.length+1})),0}catch(e){return void 0!==De&&e instanceof De.ErrnoError||fe(e),e.Oa}},s:function(e,t){try{var r=Ue();W[e>>2]=r.length;var n=0;return r.forEach((function(e){n+=e.length+1})),W[t>>2]=n,0}catch(e){return void 0!==De&&e instanceof De.ErrnoError||fe(e),e.Oa}},f:function(e){try{var t=xe(e);return De.close(t),0}catch(e){return void 0!==De&&e instanceof De.ErrnoError||fe(e),e.Oa}},q:function(e,t){try{var r=xe(e),n=r.tty?2:De.isDir(r.mode)?3:De.fb(r.mode)?7:4;return F[t>>0]=n,0}catch(e){return void 0!==De&&e instanceof De.ErrnoError||fe(e),e.Oa}},j:function(e,t,r,n){try{e:{for(var o=xe(e),i=e=0;i<r;i++){var a=W[t+(8*i+4)>>2],s=De.read(o,F,W[t+8*i>>2],a,void 0);if(0>s){var u=-1;break e}if(e+=s,s<a)break}u=e}return W[n>>2]=u,0}catch(e){return void 0!==De&&e instanceof De.ErrnoError||fe(e),e.Oa}},o:function(e,t,r,n,o){try{var i=xe(e);return-9007199254740992>=(e=4294967296*r+(t>>>0))||9007199254740992<=e?-61:(De.llseek(i,e,n),oe=[i.position>>>0,(ne=i.position,1<=+Math.abs(ne)?0<ne?(0|Math.min(+Math.floor(ne/4294967296),4294967295))>>>0:~~+Math.ceil((ne-+(~~ne>>>0))/4294967296)>>>0:0)],W[o>>2]=oe[0],W[o+4>>2]=oe[1],i.Fb&&0===e&&0===n&&(i.Fb=null),0)}catch(e){return void 0!==De&&e instanceof De.ErrnoError||fe(e),e.Oa}},k:function(e){try{var t=xe(e);return t.stream_ops&&t.stream_ops.fsync?-t.stream_ops.fsync(t):0}catch(e){return void 0!==De&&e instanceof De.ErrnoError||fe(e),e.Oa}},g:function(e,t,r,n){try{e:{for(var o=xe(e),i=e=0;i<r;i++){var a=De.write(o,F,W[t+8*i>>2],W[t+(8*i+4)>>2],void 0);if(0>a){var s=-1;break e}e+=a}s=e}return W[n>>2]=s,0}catch(e){return void 0!==De&&e instanceof De.ErrnoError||fe(e),e.Oa}},h:function(e){var t=Date.now();return W[e>>2]=t/1e3|0,W[e+4>>2]=t%1e3*1e3|0,0},K:function(e){var t=Date.now()/1e3|0;return e&&(W[e>>2]=t),t},D:function(e,t){if(t){var r=t+8;t=1e3*W[r>>2],t+=W[r+4>>2]/1e3}else t=Date.now();e=q(e);try{De.kd(e,t,t);var n=0}catch(e){if(!(e instanceof De.ErrnoError)){e:{if(!(n=Error()).stack){try{throw Error()}catch(e){n=e}if(!n.stack){n="(no stack trace available)";break e}}n=n.stack.toString()}throw s.extraStackTrace&&(n+="\n"+s.extraStackTrace()),n=function(e){return e.replace(/\b_Z[\w\d_]+/g,(function(e){return e==e?e:e+" ["+e+"]"}))}(n),e+" : "+n}n=e.Oa,W[ze()>>2]=n,n=-1}return n}};!function(){function e(e){s.asm=e.exports,D=s.asm.L,K(),J=s.asm.Da,Q.unshift(s.asm.M),ce()}function t(t){e(t.instance)}function r(e){return function(){if(!T&&(m||b)){if("function"==typeof fetch&&!re.startsWith("file://"))return fetch(re,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+re+"'";return e.arrayBuffer()})).catch((function(){return pe()}));if(d)return new Promise((function(e,t){d(re,(function(t){e(new Uint8Array(t))}),t)}))}return Promise.resolve().then((function(){return pe()}))}().then((function(e){return WebAssembly.instantiate(e,n)})).then(e,(function(e){v("failed to asynchronously prepare wasm: "+e),fe(e)}))}var n={a:He};if(le(),s.instantiateWasm)try{return s.instantiateWasm(n,e)}catch(e){return v("Module.instantiateWasm callback failed with error: "+e),!1}T||"function"!=typeof WebAssembly.instantiateStreaming||de()||re.startsWith("file://")||"function"!=typeof fetch?r(t):fetch(re,{credentials:"same-origin"}).then((function(e){return WebAssembly.instantiateStreaming(e,n).then(t,(function(e){return v("wasm streaming compile failed: "+e),v("falling back to ArrayBuffer instantiation"),r(t)}))}))}(),s.___wasm_call_ctors=function(){return(s.___wasm_call_ctors=s.asm.M).apply(null,arguments)},s._sqlite3_vfs_find=function(){return(s._sqlite3_vfs_find=s.asm.N).apply(null,arguments)},s._sqlite3_free=function(){return(s._sqlite3_free=s.asm.O).apply(null,arguments)};var ze=s.___errno_location=function(){return(ze=s.___errno_location=s.asm.P).apply(null,arguments)};s._sqlite3_finalize=function(){return(s._sqlite3_finalize=s.asm.Q).apply(null,arguments)},s._sqlite3_reset=function(){return(s._sqlite3_reset=s.asm.R).apply(null,arguments)},s._sqlite3_clear_bindings=function(){return(s._sqlite3_clear_bindings=s.asm.S).apply(null,arguments)},s._sqlite3_value_blob=function(){return(s._sqlite3_value_blob=s.asm.T).apply(null,arguments)},s._sqlite3_value_text=function(){return(s._sqlite3_value_text=s.asm.U).apply(null,arguments)},s._sqlite3_value_bytes=function(){return(s._sqlite3_value_bytes=s.asm.V).apply(null,arguments)},s._sqlite3_value_double=function(){return(s._sqlite3_value_double=s.asm.W).apply(null,arguments)},s._sqlite3_value_int=function(){return(s._sqlite3_value_int=s.asm.X).apply(null,arguments)},s._sqlite3_value_type=function(){return(s._sqlite3_value_type=s.asm.Y).apply(null,arguments)},s._sqlite3_result_blob=function(){return(s._sqlite3_result_blob=s.asm.Z).apply(null,arguments)},s._sqlite3_result_double=function(){return(s._sqlite3_result_double=s.asm._).apply(null,arguments)},s._sqlite3_result_error=function(){return(s._sqlite3_result_error=s.asm.$).apply(null,arguments)},s._sqlite3_result_int=function(){return(s._sqlite3_result_int=s.asm.aa).apply(null,arguments)},s._sqlite3_result_int64=function(){return(s._sqlite3_result_int64=s.asm.ba).apply(null,arguments)},s._sqlite3_result_null=function(){return(s._sqlite3_result_null=s.asm.ca).apply(null,arguments)},s._sqlite3_result_text=function(){return(s._sqlite3_result_text=s.asm.da).apply(null,arguments)},s._sqlite3_step=function(){return(s._sqlite3_step=s.asm.ea).apply(null,arguments)},s._sqlite3_column_count=function(){return(s._sqlite3_column_count=s.asm.fa).apply(null,arguments)},s._sqlite3_data_count=function(){return(s._sqlite3_data_count=s.asm.ga).apply(null,arguments)},s._sqlite3_column_blob=function(){return(s._sqlite3_column_blob=s.asm.ha).apply(null,arguments)},s._sqlite3_column_bytes=function(){return(s._sqlite3_column_bytes=s.asm.ia).apply(null,arguments)},s._sqlite3_column_double=function(){return(s._sqlite3_column_double=s.asm.ja).apply(null,arguments)},s._sqlite3_column_text=function(){return(s._sqlite3_column_text=s.asm.ka).apply(null,arguments)},s._sqlite3_column_type=function(){return(s._sqlite3_column_type=s.asm.la).apply(null,arguments)},s._sqlite3_column_name=function(){return(s._sqlite3_column_name=s.asm.ma).apply(null,arguments)},s._sqlite3_bind_blob=function(){return(s._sqlite3_bind_blob=s.asm.na).apply(null,arguments)},s._sqlite3_bind_double=function(){return(s._sqlite3_bind_double=s.asm.oa).apply(null,arguments)},s._sqlite3_bind_int=function(){return(s._sqlite3_bind_int=s.asm.pa).apply(null,arguments)},s._sqlite3_bind_text=function(){return(s._sqlite3_bind_text=s.asm.qa).apply(null,arguments)},s._sqlite3_bind_parameter_index=function(){return(s._sqlite3_bind_parameter_index=s.asm.ra).apply(null,arguments)},s._sqlite3_sql=function(){return(s._sqlite3_sql=s.asm.sa).apply(null,arguments)},s._sqlite3_normalized_sql=function(){return(s._sqlite3_normalized_sql=s.asm.ta).apply(null,arguments)},s._sqlite3_errmsg=function(){return(s._sqlite3_errmsg=s.asm.ua).apply(null,arguments)},s._sqlite3_exec=function(){return(s._sqlite3_exec=s.asm.va).apply(null,arguments)},s._sqlite3_prepare_v2=function(){return(s._sqlite3_prepare_v2=s.asm.wa).apply(null,arguments)},s._sqlite3_changes=function(){return(s._sqlite3_changes=s.asm.xa).apply(null,arguments)},s._sqlite3_close_v2=function(){return(s._sqlite3_close_v2=s.asm.ya).apply(null,arguments)},s._sqlite3_create_function_v2=function(){return(s._sqlite3_create_function_v2=s.asm.za).apply(null,arguments)},s._sqlite3_open=function(){return(s._sqlite3_open=s.asm.Aa).apply(null,arguments)};var Ve=s._malloc=function(){return(Ve=s._malloc=s.asm.Ba).apply(null,arguments)},$e=s._free=function(){return($e=s._free=s.asm.Ca).apply(null,arguments)};s._RegisterExtensionFunctions=function(){return(s._RegisterExtensionFunctions=s.asm.Ea).apply(null,arguments)},s._register_for_idb=function(){return(s._register_for_idb=s.asm.Fa).apply(null,arguments)};var qe,Ge=s.__get_tzname=function(){return(Ge=s.__get_tzname=s.asm.Ga).apply(null,arguments)},Ye=s.__get_daylight=function(){return(Ye=s.__get_daylight=s.asm.Ha).apply(null,arguments)},Ze=s.__get_timezone=function(){return(Ze=s.__get_timezone=s.asm.Ia).apply(null,arguments)},Ke=s.stackSave=function(){return(Ke=s.stackSave=s.asm.Ja).apply(null,arguments)},Je=s.stackRestore=function(){return(Je=s.stackRestore=s.asm.Ka).apply(null,arguments)},Xe=s.stackAlloc=function(){return(Xe=s.stackAlloc=s.asm.La).apply(null,arguments)},Qe=s._memalign=function(){return(Qe=s._memalign=s.asm.Ma).apply(null,arguments)};function et(){function e(){if(!qe&&(qe=!0,s.calledRun=!0,!j)){if(s.noFSInit||De.jb.Hb||De.jb(),De.hc=!1,he(Q),s.onRuntimeInitialized&&s.onRuntimeInitialized(),s.postRun)for("function"==typeof s.postRun&&(s.postRun=[s.postRun]);s.postRun.length;){var e=s.postRun.shift();ee.unshift(e)}he(ee)}}if(!(0<ae)){if(s.preRun)for("function"==typeof s.preRun&&(s.preRun=[s.preRun]);s.preRun.length;)te();he(X),0<ae||(s.setStatus?(s.setStatus("Running..."),setTimeout((function(){setTimeout((function(){s.setStatus("")}),1),e()}),1)):e())}}if(s.cwrap=function(e,t,r,n){var o=(r=r||[]).every((function(e){return"number"===e}));return"string"!==t&&o&&!n?C(e):function(){return function(e,t,r,n){var o,i={string:function(e){var t=0;if(null!=e&&0!==e){var r=1+(e.length<<2);t=Xe(r),G(e,U,t,r)}return t},array:function(e){var t=Xe(e.length);return F.set(e,t),t}},a=C(e),s=[];if(e=0,n)for(var u=0;u<n.length;u++){var l=i[r[u]];l?(0===e&&(e=Ke()),s[u]=l(n[u])):s[u]=n[u]}return o=r=a.apply(null,s),r="string"===t?q(o):"boolean"===t?!!o:o,0!==e&&Je(e),r}(e,t,r,arguments)}},s.UTF8ToString=q,s.FS=De,s.stackSave=Ke,s.stackRestore=Je,s.stackAlloc=Xe,ue=function e(){qe||et(),qe||(ue=e)},s.run=et,s.preInit)for("function"==typeof s.preInit&&(s.preInit=[s.preInit]);0<s.preInit.length;)s.preInit.pop()();return et(),s})),i)};e.exports=a,e.exports.default=a},2449:(e,t,r)=>{var n=r(9033).Buffer,o=r(9142);const i=r(1335),a=r(5724),s=r(1308),u=r(2808),l=(e,t)=>"boolean"==typeof e?e:t,c=(e,t)=>"string"==typeof e?e:t,f={noSort:!1,readEntries:!1,method:i.Constants.NONE,fs:null};e.exports=function(e,t){let r=null;const d=Object.assign(Object.create(null),f);e&&"object"==typeof e&&(e instanceof Uint8Array||(Object.assign(d,e),e=d.input?d.input:void 0,d.input&&delete d.input),n.isBuffer(e)&&(r=e,d.method=i.Constants.BUFFER,e=void 0)),Object.assign(d,t);const g=new i(d);if(e&&"string"==typeof e){if(!g.fs.existsSync(e))throw new Error(i.Errors.INVALID_FILENAME);d.method=i.Constants.FILE,d.filename=e,r=g.fs.readFileSync(e)}const p=new u(r,d),{canonical:h,sanitize:y}=i;function m(e){var t;return e&&p&&("string"==typeof e&&(t=p.getEntry(e)),"object"==typeof e&&void 0!==e.entryName&&void 0!==e.header&&(t=p.getEntry(e.entryName)),t)?t:null}function b(e){const{join:t,normalize:r,sep:n}=a.posix;return t(".",r(n+e.split("\\").join(n)+n))}return{readFile:function(e,t){var r=m(e);return r&&r.getData(t)||null},readFileAsync:function(e,t){var r=m(e);r?r.getDataAsync(t):t(null,"getEntry failed for:"+e)},readAsText:function(e,t){var r=m(e);if(r){var n=r.getData();if(n&&n.length)return n.toString(t||"utf8")}return""},readAsTextAsync:function(e,t,r){var n=m(e);n?n.getDataAsync((function(e,n){n?t(e,n):e&&e.length?t(e.toString(r||"utf8")):t("")})):t("")},deleteFile:function(e){var t=m(e);t&&p.deleteEntry(t.entryName)},addZipComment:function(e){p.comment=e},getZipComment:function(){return p.comment||""},addZipEntryComment:function(e,t){var r=m(e);r&&(r.comment=t)},getZipEntryComment:function(e){var t=m(e);return t&&t.comment||""},updateFile:function(e,t){var r=m(e);r&&r.setData(t)},addLocalFile:function(e,t,r,n){if(!g.fs.existsSync(e))throw new Error(i.Errors.FILE_NOT_FOUND.replace("%s",e));{t=t?b(t):"";var o=e.split("\\").join("/").split("/").pop();t+=r||o;const i=g.fs.statSync(e);this.addFile(t,g.fs.readFileSync(e),n,i)}},addLocalFolder:function(e,t,r,o){var s;if(r instanceof RegExp?(s=r,r=function(e){return s.test(e)}):"function"!=typeof r&&(r=function(){return!0}),t=t?b(t):"",e=a.normalize(e),!g.fs.existsSync(e))throw new Error(i.Errors.FILE_NOT_FOUND.replace("%s",e));{const i=g.findFiles(e),s=this;i.length&&i.forEach((function(i){var u=a.relative(e,i).split("\\").join("/");if(r(u)){var l=g.fs.statSync(i);l.isFile()?s.addFile(t+u,g.fs.readFileSync(i),"",o||l):s.addFile(t+u+"/",n.alloc(0),"",o||l)}}))}},addLocalFolderAsync:function(e,t,r,s){var u;s instanceof RegExp?(u=s,s=function(e){return u.test(e)}):"function"!=typeof s&&(s=function(){return!0}),r=r?b(r):"",e=a.normalize(e);var l=this;g.fs.open(e,"r",(function(u){if(u&&"ENOENT"===u.code)t(void 0,i.Errors.FILE_NOT_FOUND.replace("%s",e));else if(u)t(void 0,u);else{var c=g.findFiles(e),f=-1,d=function(){if((f+=1)<c.length){var i=c[f],u=a.relative(e,i).split("\\").join("/");u=u.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^\x20-\x7E]/g,""),s(u)?g.fs.stat(i,(function(e,o){e&&t(void 0,e),o.isFile()?g.fs.readFile(i,(function(e,n){e?t(void 0,e):(l.addFile(r+u,n,"",o),d())})):(l.addFile(r+u+"/",n.alloc(0),"",o),d())})):o.nextTick((()=>{d()}))}else t(!0,void 0)};d()}}))},addLocalFolderPromise:function(e,t){return new Promise(((r,n)=>{const{filter:o,zipPath:i}=Object.assign({},t);this.addLocalFolderAsync(e,((e,t)=>{t&&n(t),e&&r(this)}),i,o)}))},addFile:function(e,t,r,n){let o=m(e);const i=null!=o;i||(o=new s,o.entryName=e),o.comment=r||"";const a="object"==typeof n&&n instanceof g.fs.Stats;a&&(o.header.time=n.mtime);var u=o.isDirectory?16:0;let l=o.isDirectory?16384:32768;l|=a?4095&n.mode:"number"==typeof n?4095&n:o.isDirectory?493:420,u=(u|l<<16)>>>0,o.attr=u,o.setData(t),i||p.setEntry(o)},getEntries:function(){return p?p.entries:[]},getEntry:function(e){return m(e)},getEntryCount:function(){return p.getEntryCount()},forEach:function(e){return p.forEach(e)},extractEntryTo:function(e,t,r,n,o,s){n=l(n,!1),o=l(o,!1),r=l(r,!0),s=c(s,c(o,void 0));var u=m(e);if(!u)throw new Error(i.Errors.NO_ENTRY);var f=h(u.entryName),d=y(t,s&&!u.isDirectory?s:r?f:a.basename(f));if(u.isDirectory)return p.getEntryChildren(u).forEach((function(e){if(e.isDirectory)return;var s=e.getData();if(!s)throw new Error(i.Errors.CANT_EXTRACT_FILE);var u=h(e.entryName),l=y(t,r?u:a.basename(u));const c=o?e.header.fileAttr:void 0;g.writeFileTo(l,s,n,c)})),!0;var b=u.getData();if(!b)throw new Error(i.Errors.CANT_EXTRACT_FILE);if(g.fs.existsSync(d)&&!n)throw new Error(i.Errors.CANT_OVERRIDE);const _=o?e.header.fileAttr:void 0;return g.writeFileTo(d,b,n,_),!0},test:function(e){if(!p)return!1;for(var t in p.entries)try{if(t.isDirectory)continue;if(!p.entries[t].getData(e))return!1}catch(e){return!1}return!0},extractAllTo:function(e,t,r,n){if(t=l(t,!1),n=c(r,n),r=l(r,!1),!p)throw new Error(i.Errors.NO_ZIP);p.entries.forEach((function(o){var a=y(e,h(o.entryName.toString()));if(o.isDirectory)return void g.makeDir(a);var s=o.getData(n);if(!s)throw new Error(i.Errors.CANT_EXTRACT_FILE);const u=r?o.header.fileAttr:void 0;g.writeFileTo(a,s,t,u);try{g.fs.utimesSync(a,o.header.time,o.header.time)}catch(e){throw new Error(i.Errors.CANT_EXTRACT_FILE)}}))},extractAllToAsync:function(e,t,r,n){if(t=l(t,!1),"function"!=typeof r||n||(n=r),r=l(r,!1),n||(n=function(e){throw new Error(e)}),!p)return void n(new Error(i.Errors.NO_ZIP));e=a.resolve(e);const o=t=>y(e,a.normalize(h(t.entryName.toString()))),s=(e,t)=>new Error(e+': "'+t+'"'),u=[],c=new Set;p.entries.forEach((e=>{e.isDirectory?u.push(e):c.add(e)}));for(const e of u){const t=o(e),i=r?e.header.fileAttr:void 0;try{g.makeDir(t),i&&g.fs.chmodSync(t,i),g.fs.utimesSync(t,e.header.time,e.header.time)}catch(e){n(s("Unable to create folder",t))}}const f=()=>{0===c.size&&n()};for(const o of c.values()){const u=a.normalize(h(o.entryName.toString())),l=y(e,u);o.getDataAsync((function(e,a){if(a)n(new Error(a));else if(e){const i=r?o.header.fileAttr:void 0;g.writeFileToAsync(l,e,t,i,(function(e){e?g.fs.utimes(l,o.header.time,o.header.time,(function(e){e?n(s("Unable to set times",l)):(c.delete(o),f())})):n(s("Unable to write file",l))}))}else n(new Error(i.Errors.CANT_EXTRACT_FILE))}))}f()},writeZip:function(e,t){if(1===arguments.length&&"function"==typeof e&&(t=e,e=""),!e&&d.filename&&(e=d.filename),e){var r=p.compressToBuffer();if(r){var n=g.writeFileTo(e,r,!0);"function"==typeof t&&t(n?null:new Error("failed"),"")}}},writeZipPromise:function(e,t){const{overwrite:r,perm:n}=Object.assign({overwrite:!0},t);return new Promise(((t,o)=>{!e&&d.filename&&(e=d.filename),e||o("ADM-ZIP: ZIP File Name Missing"),this.toBufferPromise().then((i=>{g.writeFileToAsync(e,i,r,n,(e=>e?t(e):o("ADM-ZIP: Wasn't able to write zip file")))}),o)}))},toBufferPromise:function(){return new Promise(((e,t)=>{p.toAsyncBuffer(e,t)}))},toBuffer:function(e,t,r,n){return this.valueOf=2,"function"==typeof e?(p.toAsyncBuffer(e,t,r,n),null):p.compressToBuffer()}}}},1746:(e,t,r)=>{var n=r(9033).Buffer,o=r(1335),i=o.Constants;e.exports=function(){var e=20,t=10,r=0,a=0,s=0,u=0,l=0,c=0,f=0,d=0,g=0,p=0,h=0,y=0,m=0;e|=o.isWin?2560:768,r|=i.FLG_EFS;var b={};function _(e){e=new Date(e),s=(e.getFullYear()-1980&127)<<25|e.getMonth()+1<<21|e.getDate()<<16|e.getHours()<<11|e.getMinutes()<<5|e.getSeconds()>>1}return _(+new Date),{get made(){return e},set made(t){e=t},get version(){return t},set version(e){t=e},get flags(){return r},set flags(e){r=e},get method(){return a},set method(e){switch(e){case i.STORED:this.version=10;case i.DEFLATED:default:this.version=20}a=e},get time(){return new Date(1980+(s>>25&127),(s>>21&15)-1,s>>16&31,s>>11&31,s>>5&63,(31&s)<<1)},set time(e){_(e)},get crc(){return u},set crc(e){u=Math.max(0,e)>>>0},get compressedSize(){return l},set compressedSize(e){l=Math.max(0,e)>>>0},get size(){return c},set size(e){c=Math.max(0,e)>>>0},get fileNameLength(){return f},set fileNameLength(e){f=e},get extraLength(){return d},set extraLength(e){d=e},get commentLength(){return g},set commentLength(e){g=e},get diskNumStart(){return p},set diskNumStart(e){p=Math.max(0,e)>>>0},get inAttr(){return h},set inAttr(e){h=Math.max(0,e)>>>0},get attr(){return y},set attr(e){y=Math.max(0,e)>>>0},get fileAttr(){return y?(y>>>0|0)>>16&4095:0},get offset(){return m},set offset(e){m=Math.max(0,e)>>>0},get encripted(){return 1==(1&r)},get entryHeaderSize(){return i.CENHDR+f+d+g},get realDataOffset(){return m+i.LOCHDR+b.fnameLen+b.extraLen},get dataHeader(){return b},loadDataHeaderFromBinary:function(e){var t=e.slice(m,m+i.LOCHDR);if(t.readUInt32LE(0)!==i.LOCSIG)throw new Error(o.Errors.INVALID_LOC);b={version:t.readUInt16LE(i.LOCVER),flags:t.readUInt16LE(i.LOCFLG),method:t.readUInt16LE(i.LOCHOW),time:t.readUInt32LE(i.LOCTIM),crc:t.readUInt32LE(i.LOCCRC),compressedSize:t.readUInt32LE(i.LOCSIZ),size:t.readUInt32LE(i.LOCLEN),fnameLen:t.readUInt16LE(i.LOCNAM),extraLen:t.readUInt16LE(i.LOCEXT)}},loadFromBinary:function(n){if(n.length!==i.CENHDR||n.readUInt32LE(0)!==i.CENSIG)throw new Error(o.Errors.INVALID_CEN);e=n.readUInt16LE(i.CENVEM),t=n.readUInt16LE(i.CENVER),r=n.readUInt16LE(i.CENFLG),a=n.readUInt16LE(i.CENHOW),s=n.readUInt32LE(i.CENTIM),u=n.readUInt32LE(i.CENCRC),l=n.readUInt32LE(i.CENSIZ),c=n.readUInt32LE(i.CENLEN),f=n.readUInt16LE(i.CENNAM),d=n.readUInt16LE(i.CENEXT),g=n.readUInt16LE(i.CENCOM),p=n.readUInt16LE(i.CENDSK),h=n.readUInt16LE(i.CENATT),y=n.readUInt32LE(i.CENATX),m=n.readUInt32LE(i.CENOFF)},dataHeaderToBinary:function(){var e=n.alloc(i.LOCHDR);return e.writeUInt32LE(i.LOCSIG,0),e.writeUInt16LE(t,i.LOCVER),e.writeUInt16LE(r,i.LOCFLG),e.writeUInt16LE(a,i.LOCHOW),e.writeUInt32LE(s,i.LOCTIM),e.writeUInt32LE(u,i.LOCCRC),e.writeUInt32LE(l,i.LOCSIZ),e.writeUInt32LE(c,i.LOCLEN),e.writeUInt16LE(f,i.LOCNAM),e.writeUInt16LE(d,i.LOCEXT),e},entryHeaderToBinary:function(){var o=n.alloc(i.CENHDR+f+d+g);return o.writeUInt32LE(i.CENSIG,0),o.writeUInt16LE(e,i.CENVEM),o.writeUInt16LE(t,i.CENVER),o.writeUInt16LE(r,i.CENFLG),o.writeUInt16LE(a,i.CENHOW),o.writeUInt32LE(s,i.CENTIM),o.writeUInt32LE(u,i.CENCRC),o.writeUInt32LE(l,i.CENSIZ),o.writeUInt32LE(c,i.CENLEN),o.writeUInt16LE(f,i.CENNAM),o.writeUInt16LE(d,i.CENEXT),o.writeUInt16LE(g,i.CENCOM),o.writeUInt16LE(p,i.CENDSK),o.writeUInt16LE(h,i.CENATT),o.writeUInt32LE(y,i.CENATX),o.writeUInt32LE(m,i.CENOFF),o.fill(0,i.CENHDR),o},toJSON:function(){const n=function(e){return e+" bytes"};return{made:e,version:t,flags:r,method:o.methodToString(a),time:this.time,crc:"0x"+u.toString(16).toUpperCase(),compressedSize:n(l),size:n(c),fileNameLength:n(f),extraLength:n(d),commentLength:n(g),diskNumStart:p,inAttr:h,attr:y,offset:m,entryHeaderSize:n(i.CENHDR+f+d+g)}},toString:function(){return JSON.stringify(this.toJSON(),null,"\t")}}}},3688:(e,t,r)=>{t.EntryHeader=r(1746),t.MainHeader=r(4371)},4371:(e,t,r)=>{var n=r(9033).Buffer,o=r(1335),i=o.Constants;e.exports=function(){var e=0,t=0,r=0,a=0,s=0;return{get diskEntries(){return e},set diskEntries(r){e=t=r},get totalEntries(){return t},set totalEntries(r){t=e=r},get size(){return r},set size(e){r=e},get offset(){return a},set offset(e){a=e},get commentLength(){return s},set commentLength(e){s=e},get mainHeaderSize(){return i.ENDHDR+s},loadFromBinary:function(n){if((n.length!==i.ENDHDR||n.readUInt32LE(0)!==i.ENDSIG)&&(n.length<i.ZIP64HDR||n.readUInt32LE(0)!==i.ZIP64SIG))throw new Error(o.Errors.INVALID_END);n.readUInt32LE(0)===i.ENDSIG?(e=n.readUInt16LE(i.ENDSUB),t=n.readUInt16LE(i.ENDTOT),r=n.readUInt32LE(i.ENDSIZ),a=n.readUInt32LE(i.ENDOFF),s=n.readUInt16LE(i.ENDCOM)):(e=o.readBigUInt64LE(n,i.ZIP64SUB),t=o.readBigUInt64LE(n,i.ZIP64TOT),r=o.readBigUInt64LE(n,i.ZIP64SIZE),a=o.readBigUInt64LE(n,i.ZIP64OFF),s=0)},toBinary:function(){var o=n.alloc(i.ENDHDR+s);return o.writeUInt32LE(i.ENDSIG,0),o.writeUInt32LE(0,4),o.writeUInt16LE(e,i.ENDSUB),o.writeUInt16LE(t,i.ENDTOT),o.writeUInt32LE(r,i.ENDSIZ),o.writeUInt32LE(a,i.ENDOFF),o.writeUInt16LE(s,i.ENDCOM),o.fill(" ",i.ENDHDR),o},toJSON:function(){return{diskEntries:e,totalEntries:t,size:r+" bytes",offset:function(e,t){let r=e.toString(16).toUpperCase();for(;r.length<4;)r="0"+r;return"0x"+r}(a),commentLength:s}},toString:function(){return JSON.stringify(this.toJSON(),null,"\t")}}}},5194:(e,t,r)=>{var n=r(9033).Buffer;e.exports=function(e){var t=r(7611),o={chunkSize:1024*(parseInt(e.length/1024)+1)};return{deflate:function(){return t.deflateRawSync(e,o)},deflateAsync:function(r){var i=t.createDeflateRaw(o),a=[],s=0;i.on("data",(function(e){a.push(e),s+=e.length})),i.on("end",(function(){var e=n.alloc(s),t=0;e.fill(0);for(var o=0;o<a.length;o++){var i=a[o];i.copy(e,t),t+=i.length}r&&r(e)})),i.end(e)}}}},286:(e,t,r)=>{t.Deflater=r(5194),t.Inflater=r(5936),t.ZipCrypto=r(4088)},5936:(e,t,r)=>{var n=r(9033).Buffer;e.exports=function(e){var t=r(7611);return{inflate:function(){return t.inflateRawSync(e)},inflateAsync:function(r){var o=t.createInflateRaw(),i=[],a=0;o.on("data",(function(e){i.push(e),a+=e.length})),o.on("end",(function(){var e=n.alloc(a),t=0;e.fill(0);for(var o=0;o<i.length;o++){var s=i[o];s.copy(e,t),t+=s.length}r&&r(e)})),o.end(e)}}}},4088:(e,t,r)=>{"use strict";var n=r(9033).Buffer;const{randomFillSync:o}=r(1214),i=new Uint32Array(256).map(((e,t)=>{for(let e=0;e<8;e++)0!=(1&t)?t=t>>>1^3988292384:t>>>=1;return t>>>0})),a=(e,t)=>Math.imul(e,t)>>>0,s=(e,t)=>i[255&(e^t)]^e>>>8,u=()=>"function"==typeof o?o(n.alloc(12)):u.node();u.node=()=>{const e=n.alloc(12),t=e.length;for(let r=0;r<t;r++)e[r]=256*Math.random()&255;return e};const l={genSalt:u};function c(e){const t=n.isBuffer(e)?e:n.from(e);this.keys=new Uint32Array([305419896,591751049,878082192]);for(let e=0;e<t.length;e++)this.updateKeys(t[e])}c.prototype.updateKeys=function(e){const t=this.keys;return t[0]=s(t[0],e),t[1]+=255&t[0],t[1]=a(t[1],134775813)+1,t[2]=s(t[2],t[1]>>>24),e},c.prototype.next=function(){const e=(2|this.keys[2])>>>0;return a(e,1^e)>>8&255},e.exports={decrypt:function(e,t,r){if(!e||!n.isBuffer(e)||e.length<12)return n.alloc(0);const o=function(e){const t=new c(e);return function(e){const r=n.alloc(e.length);let o=0;for(let n of e)r[o++]=t.updateKeys(n^t.next());return r}}(r);if(o(e.slice(0,12))[11]!==t.crc>>>24)throw"ADM-ZIP: Wrong Password";return o(e.slice(12))},encrypt:function(e,t,r){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==e&&(e=n.alloc(0)),n.isBuffer(e)||(e=n.from(e.toString()));const i=function(e){const t=new c(e);return function(e,r){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;r||(r=n.alloc(e.length));for(let n of e){const e=t.next();r[o++]=n^e,t.updateKeys(n)}return r}}(r),a=l.genSalt();a[11]=t.crc>>>24&255,o&&(a[10]=t.crc>>>16&255);const s=n.alloc(e.length+12);return i(a,s),i(e,s,12)},_salter:function(e){n.isBuffer(e)&&e.length>=12?l.genSalt=function(){return e.slice(0,12)}:l.genSalt="node"===e?u.node:u}}},7100:e=>{e.exports={LOCHDR:30,LOCSIG:67324752,LOCVER:4,LOCFLG:6,LOCHOW:8,LOCTIM:10,LOCCRC:14,LOCSIZ:18,LOCLEN:22,LOCNAM:26,LOCEXT:28,EXTSIG:134695760,EXTHDR:16,EXTCRC:4,EXTSIZ:8,EXTLEN:12,CENHDR:46,CENSIG:33639248,CENVEM:4,CENVER:6,CENFLG:8,CENHOW:10,CENTIM:12,CENCRC:16,CENSIZ:20,CENLEN:24,CENNAM:28,CENEXT:30,CENCOM:32,CENDSK:34,CENATT:36,CENATX:38,CENOFF:42,ENDHDR:22,ENDSIG:101010256,ENDSUB:8,ENDTOT:10,ENDSIZ:12,ENDOFF:16,ENDCOM:20,END64HDR:20,END64SIG:117853008,END64START:4,END64OFF:8,END64NUMDISKS:16,ZIP64SIG:101075792,ZIP64HDR:56,ZIP64LEAD:12,ZIP64SIZE:4,ZIP64VEM:12,ZIP64VER:14,ZIP64DSK:16,ZIP64DSKDIR:20,ZIP64SUB:24,ZIP64TOT:32,ZIP64SIZB:40,ZIP64OFF:48,ZIP64EXTRA:56,STORED:0,SHRUNK:1,REDUCED1:2,REDUCED2:3,REDUCED3:4,REDUCED4:5,IMPLODED:6,DEFLATED:8,ENHANCED_DEFLATED:9,PKWARE:10,BZIP2:12,LZMA:14,IBM_TERSE:18,IBM_LZ77:19,AES_ENCRYPT:99,FLG_ENC:1,FLG_COMP1:2,FLG_COMP2:4,FLG_DESC:8,FLG_ENH:16,FLG_PATCH:32,FLG_STR:64,FLG_EFS:2048,FLG_MSK:4096,FILE:2,BUFFER:1,NONE:0,EF_ID:0,EF_SIZE:2,ID_ZIP64:1,ID_AVINFO:7,ID_PFS:8,ID_OS2:9,ID_NTFS:10,ID_OPENVMS:12,ID_UNIX:13,ID_FORK:14,ID_PATCH:15,ID_X509_PKCS7:20,ID_X509_CERTID_F:21,ID_X509_CERTID_C:22,ID_STRONGENC:23,ID_RECORD_MGT:24,ID_X509_PKCS7_RL:25,ID_IBM1:101,ID_IBM2:102,ID_POSZIP:18064,EF_ZIP64_OR_32:4294967295,EF_ZIP64_OR_16:65535,EF_ZIP64_SUNCOMP:0,EF_ZIP64_SCOMP:8,EF_ZIP64_RHO:16,EF_ZIP64_DSN:24}},1164:e=>{e.exports={INVALID_LOC:"Invalid LOC header (bad signature)",INVALID_CEN:"Invalid CEN header (bad signature)",INVALID_END:"Invalid END header (bad signature)",NO_DATA:"Nothing to decompress",BAD_CRC:"CRC32 checksum failed",FILE_IN_THE_WAY:"There is a file in the way: %s",UNKNOWN_METHOD:"Invalid/unsupported compression method",AVAIL_DATA:"inflate::Available inflate data did not terminate",INVALID_DISTANCE:"inflate::Invalid literal/length or distance code in fixed or dynamic block",TO_MANY_CODES:"inflate::Dynamic block code description: too many length or distance codes",INVALID_REPEAT_LEN:"inflate::Dynamic block code description: repeat more than specified lengths",INVALID_REPEAT_FIRST:"inflate::Dynamic block code description: repeat lengths with no first length",INCOMPLETE_CODES:"inflate::Dynamic block code description: code lengths codes incomplete",INVALID_DYN_DISTANCE:"inflate::Dynamic block code description: invalid distance code lengths",INVALID_CODES_LEN:"inflate::Dynamic block code description: invalid literal/length code lengths",INVALID_STORE_BLOCK:"inflate::Stored block length did not match one's complement",INVALID_BLOCK_TYPE:"inflate::Invalid block type (type == 3)",CANT_EXTRACT_FILE:"Could not extract the file",CANT_OVERRIDE:"Target file already exists",NO_ZIP:"No zip file was loaded",NO_ENTRY:"Entry doesn't exist",DIRECTORY_CONTENT_ERROR:"A directory cannot have content",FILE_NOT_FOUND:"File not found: %s",NOT_IMPLEMENTED:"Not implemented",INVALID_FILENAME:"Invalid filename",INVALID_FORMAT:"Invalid or unsupported zip format. No END header found"}},5964:(e,t,r)=>{const n=r(4433).require(),o=r(5724);n.existsSync=n.existsSync||o.existsSync,e.exports=function(e){var t=e||"",r={directory:!1,readonly:!1,hidden:!1,executable:!1,mtime:0,atime:0},i=null;return t&&n.existsSync(t)?(i=n.statSync(t),r.directory=i.isDirectory(),r.mtime=i.mtime,r.atime=i.atime,r.executable=0!=(73&i.mode),r.readonly=0==(128&i.mode),r.hidden="."===o.basename(t)[0]):console.warn("Invalid path: "+t),{get directory(){return r.directory},get readOnly(){return r.readonly},get hidden(){return r.hidden},get mtime(){return r.mtime},get atime(){return r.atime},get executable(){return r.executable},decodeAttributes:function(){},encodeAttributes:function(){},toJSON:function(){return{path:t,isDirectory:r.directory,isReadOnly:r.readonly,isHidden:r.hidden,isExecutable:r.executable,mTime:r.mtime,aTime:r.atime}},toString:function(){return JSON.stringify(this.toJSON(),null,"\t")}}}},4433:(e,t,r)=>{var n=r(9142);t.require=function(){if("object"==typeof n&&n.versions&&n.versions.electron)try{const e=r(Object(function(){var e=new Error("Cannot find module 'original-fs'");throw e.code="MODULE_NOT_FOUND",e}()));if(Object.keys(e).length>0)return e}catch(e){}return r(1275)}},1335:(e,t,r)=>{e.exports=r(8564),e.exports.Constants=r(7100),e.exports.Errors=r(1164),e.exports.FileAttr=r(5964)},8564:(e,t,r)=>{var n=r(9142),o=r(9033).Buffer;const i=r(4433).require(),a=r(5724),s=r(7100),u=r(1164),l="object"==typeof n&&"win32"===n.platform,c=e=>e&&"object"==typeof e,f=new Uint32Array(256).map(((e,t)=>{for(let e=0;e<8;e++)0!=(1&t)?t=3988292384^t>>>1:t>>>=1;return t>>>0}));function d(e){this.sep=a.sep,this.fs=i,c(e)&&c(e.fs)&&"function"==typeof e.fs.statSync&&(this.fs=e.fs)}e.exports=d,d.prototype.makeDir=function(e){const t=this;!function(e){let r=e.split(t.sep)[0];e.split(t.sep).forEach((function(e){if(e&&":"!==e.substr(-1,1)){var n;r+=t.sep+e;try{n=t.fs.statSync(r)}catch(e){t.fs.mkdirSync(r)}if(n&&n.isFile())throw u.FILE_IN_THE_WAY.replace("%s",r)}}))}(e)},d.prototype.writeFileTo=function(e,t,r,n){const o=this;if(o.fs.existsSync(e)){if(!r)return!1;if(o.fs.statSync(e).isDirectory())return!1}var i,s=a.dirname(e);o.fs.existsSync(s)||o.makeDir(s);try{i=o.fs.openSync(e,"w",438)}catch(t){o.fs.chmodSync(e,438),i=o.fs.openSync(e,"w",438)}if(i)try{o.fs.writeSync(i,t,0,t.length,0)}finally{o.fs.closeSync(i)}return o.fs.chmodSync(e,n||438),!0},d.prototype.writeFileToAsync=function(e,t,r,n,o){"function"==typeof n&&(o=n,n=void 0);const i=this;i.fs.exists(e,(function(s){if(s&&!r)return o(!1);i.fs.stat(e,(function(r,u){if(s&&u.isDirectory())return o(!1);var l=a.dirname(e);i.fs.exists(l,(function(r){r||i.makeDir(l),i.fs.open(e,"w",438,(function(r,a){r?i.fs.chmod(e,438,(function(){i.fs.open(e,"w",438,(function(r,a){i.fs.write(a,t,0,t.length,0,(function(){i.fs.close(a,(function(){i.fs.chmod(e,n||438,(function(){o(!0)}))}))}))}))})):a?i.fs.write(a,t,0,t.length,0,(function(){i.fs.close(a,(function(){i.fs.chmod(e,n||438,(function(){o(!0)}))}))})):i.fs.chmod(e,n||438,(function(){o(!0)}))}))}))}))}))},d.prototype.findFiles=function(e){const t=this;return function e(r,n,o){"boolean"==typeof n&&(o=n,n=void 0);let i=[];return t.fs.readdirSync(r).forEach((function(s){var u=a.join(r,s);t.fs.statSync(u).isDirectory()&&o&&(i=i.concat(e(u,n,o))),n&&!n.test(u)||i.push(a.normalize(u)+(t.fs.statSync(u).isDirectory()?t.sep:""))})),i}(e,void 0,!0)},d.prototype.getAttributes=function(){},d.prototype.setAttributes=function(){},d.crc32update=function(e,t){return f[255&(e^t)]^e>>>8},d.crc32=function(e){"string"==typeof e&&(e=o.from(e,"utf8")),f.length||genCRCTable();let t=e.length,r=-1;for(let n=0;n<t;)r=d.crc32update(r,e[n++]);return~r>>>0},d.methodToString=function(e){switch(e){case s.STORED:return"STORED ("+e+")";case s.DEFLATED:return"DEFLATED ("+e+")";default:return"UNSUPPORTED ("+e+")"}},d.canonical=function(e){if(!e)return"";var t=a.posix.normalize("/"+e.split("\\").join("/"));return a.join(".",t)},d.sanitize=function(e,t){e=a.resolve(a.normalize(e));for(var r=t.split("/"),n=0,o=r.length;n<o;n++){var i=a.normalize(a.join(e,r.slice(n,o).join(a.sep)));if(0===i.indexOf(e))return i}return a.normalize(a.join(e,a.basename(t)))},d.toBuffer=function(e){return o.isBuffer(e)?e:e instanceof Uint8Array?o.from(e):"string"==typeof e?o.from(e,"utf8"):o.alloc(0)},d.readBigUInt64LE=function(e,t){var r=o.from(e.slice(t,t+8));return r.swap64(),parseInt(`0x${r.toString("hex")}`)},d.isWin=l,d.crcTable=f},1308:(e,t,r)=>{var n=r(9033).Buffer,o=r(1335),i=r(3688),a=o.Constants,s=r(286);e.exports=function(e){var t=new i.EntryHeader,r=n.alloc(0),u=n.alloc(0),l=!1,c=null,f=n.alloc(0);function d(){return e&&n.isBuffer(e)?(t.loadDataHeaderFromBinary(e),e.slice(t.realDataOffset,t.realDataOffset+t.compressedSize)):n.alloc(0)}function g(e){return 8==(8&t.flags)||o.crc32(e)===t.dataHeader.crc}function p(e,i,a){if(void 0===i&&"string"==typeof e&&(a=e,e=void 0),l)return e&&i&&i(n.alloc(0),o.Errors.DIRECTORY_CONTENT_ERROR),n.alloc(0);var u=d();if(0===u.length)return e&&i&&i(u),u;if(t.encripted){if("string"!=typeof a&&!n.isBuffer(a))throw new Error("ADM-ZIP: Incompatible password parameter");u=s.ZipCrypto.decrypt(u,t,a)}var c=n.alloc(t.size);switch(t.method){case o.Constants.STORED:if(u.copy(c),g(c))return e&&i&&i(c),c;throw e&&i&&i(c,o.Errors.BAD_CRC),new Error(o.Errors.BAD_CRC);case o.Constants.DEFLATED:var f=new s.Inflater(u);if(!e){if(f.inflate(c).copy(c,0),!g(c))throw new Error(o.Errors.BAD_CRC+" "+r.toString());return c}f.inflateAsync((function(e){e.copy(e,0),i&&(g(e)?i(e):i(e,o.Errors.BAD_CRC))}));break;default:throw e&&i&&i(n.alloc(0),o.Errors.UNKNOWN_METHOD),new Error(o.Errors.UNKNOWN_METHOD)}}function h(r,i){if((!c||!c.length)&&n.isBuffer(e))return r&&i&&i(d()),d();if(c.length&&!l){var a;switch(t.method){case o.Constants.STORED:return t.compressedSize=t.size,a=n.alloc(c.length),c.copy(a),r&&i&&i(a),a;default:case o.Constants.DEFLATED:var u=new s.Deflater(c);if(!r){var f=u.deflate();return t.compressedSize=f.length,f}u.deflateAsync((function(e){a=n.alloc(e.length),t.compressedSize=e.length,e.copy(a),i&&i(a)})),u=null}}else{if(!r||!i)return n.alloc(0);i(n.alloc(0))}}function y(e,t){return(e.readUInt32LE(t+4)<<4)+e.readUInt32LE(t)}function m(e){var r,n,o,i;e.length>=a.EF_ZIP64_SCOMP&&(r=y(e,a.EF_ZIP64_SUNCOMP),t.size===a.EF_ZIP64_OR_32&&(t.size=r)),e.length>=a.EF_ZIP64_RHO&&(n=y(e,a.EF_ZIP64_SCOMP),t.compressedSize===a.EF_ZIP64_OR_32&&(t.compressedSize=n)),e.length>=a.EF_ZIP64_DSN&&(o=y(e,a.EF_ZIP64_RHO),t.offset===a.EF_ZIP64_OR_32&&(t.offset=o)),e.length>=a.EF_ZIP64_DSN+4&&(i=e.readUInt32LE(a.EF_ZIP64_DSN),t.diskNumStart===a.EF_ZIP64_OR_16&&(t.diskNumStart=i))}return{get entryName(){return r.toString()},get rawEntryName(){return r},set entryName(e){var n=(r=o.toBuffer(e))[r.length-1];l=47===n||92===n,t.fileNameLength=r.length},get extra(){return f},set extra(e){f=e,t.extraLength=e.length,function(e){for(var t,r,n,o=0;o<e.length;)t=e.readUInt16LE(o),o+=2,r=e.readUInt16LE(o),o+=2,n=e.slice(o,o+r),o+=r,a.ID_ZIP64===t&&m(n)}(e)},get comment(){return u.toString()},set comment(e){u=o.toBuffer(e),t.commentLength=u.length},get name(){var e=r.toString();return l?e.substr(e.length-1).split("/").pop():e.split("/").pop()},get isDirectory(){return l},getCompressedData:function(){return h(!1,null)},getCompressedDataAsync:function(e){h(!0,e)},setData:function(e){c=o.toBuffer(e),!l&&c.length?(t.size=c.length,t.method=o.Constants.DEFLATED,t.crc=o.crc32(e),t.changed=!0):t.method=o.Constants.STORED},getData:function(e){return t.changed?c:p(!1,null,e)},getDataAsync:function(e,r){t.changed?e(c):p(!0,e,r)},set attr(e){t.attr=e},get attr(){return t.attr},set header(e){t.loadFromBinary(e)},get header(){return t},packHeader:function(){var e=t.entryHeaderToBinary(),n=o.Constants.CENHDR;return r.copy(e,n),n+=r.length,t.extraLength&&(f.copy(e,n),n+=t.extraLength),t.commentLength&&u.copy(e,n),e},toJSON:function(){const r=function(e){return"<"+(e&&e.length+" bytes buffer"||"null")+">"};return{entryName:this.entryName,name:this.name,comment:this.comment,isDirectory:this.isDirectory,header:t.toJSON(),compressedData:r(e),data:r(c)}},toString:function(){return JSON.stringify(this.toJSON(),null,"\t")}}}},2808:(e,t,r)=>{var n=r(9033).Buffer;const o=r(1308),i=r(3688),a=r(1335);e.exports=function(e,t){var r=[],s={},u=n.alloc(0),l=new i.MainHeader,c=!1;const f=Object.assign(Object.create(null),t),{noSort:d}=f;function g(){c=!0,s={},r=new Array(l.diskEntries);for(var t=l.offset,n=0;n<r.length;n++){var i=t,u=new o(e);u.header=e.slice(i,i+=a.Constants.CENHDR),u.entryName=e.slice(i,i+=u.header.fileNameLength),u.header.extraLength&&(u.extra=e.slice(i,i+=u.header.extraLength)),u.header.commentLength&&(u.comment=e.slice(i,i+u.header.commentLength)),t+=u.header.entryHeaderSize,r[n]=u,s[u.entryName]=u}}function p(){r.length>1&&!d&&r.sort(((e,t)=>e.entryName.toLowerCase().localeCompare(t.entryName.toLowerCase())))}return e?function(t){for(var r=e.length-a.Constants.ENDHDR,n=Math.max(0,r-65535),o=n,i=e.length,s=-1,c=0;r>=o;r--)if(80===e[r])if(e.readUInt32LE(r)!==a.Constants.ENDSIG)if(e.readUInt32LE(r)!==a.Constants.END64SIG){if(e.readUInt32LE(r)===a.Constants.ZIP64SIG){s=r,i=r+a.readBigUInt64LE(e,r+a.Constants.ZIP64SIZE)+a.Constants.ZIP64LEAD;break}}else o=n;else s=r,c=r,i=r+a.Constants.ENDHDR,o=r-a.Constants.END64HDR;if(!~s)throw new Error(a.Errors.INVALID_FORMAT);l.loadFromBinary(e.slice(s,i)),l.commentLength&&(u=e.slice(c+a.Constants.ENDHDR)),t&&g()}(f.readEntries):c=!0,{get entries(){return c||g(),r},get comment(){return u.toString()},set comment(e){u=a.toBuffer(e),l.commentLength=u.length},getEntryCount:function(){return c?r.length:l.diskEntries},forEach:function(t){c?r.forEach(t):function(t){const r=l.diskEntries;let n=l.offset;for(let i=0;i<r;i++){let r=n;const i=new o(e);i.header=e.slice(r,r+=a.Constants.CENHDR),i.entryName=e.slice(r,r+=i.header.fileNameLength),n+=i.header.entryHeaderSize,t(i)}}(t)},getEntry:function(e){return c||g(),s[e]||null},setEntry:function(e){c||g(),r.push(e),s[e.entryName]=e,l.totalEntries=r.length},deleteEntry:function(e){c||g();var t=s[e];if(t&&t.isDirectory){var n=this;this.getEntryChildren(t).forEach((function(t){t.entryName!==e&&n.deleteEntry(t.entryName)}))}r.splice(r.indexOf(t),1),delete s[e],l.totalEntries=r.length},getEntryChildren:function(e){if(c||g(),e&&e.isDirectory){const t=[],n=e.entryName,o=n.length;return r.forEach((function(e){e.entryName.substr(0,o)===n&&t.push(e)})),t}return[]},compressToBuffer:function(){c||g(),p();const e=[],t=[];let o=0,i=0;l.size=0,l.offset=0;for(const a of r){const r=a.getCompressedData();a.header.offset=i;const s=a.header.dataHeaderToBinary(),u=a.rawEntryName.length,c=n.alloc(u+a.extra.length);a.rawEntryName.copy(c,0),c.copy(a.extra,u);const f=s.length+c.length+r.length;i+=f,e.push(s),e.push(c),e.push(r);const d=a.packHeader();t.push(d),l.size+=d.length,o+=f+d.length}o+=l.mainHeaderSize,l.offset=i,i=0;const s=n.alloc(o);for(const t of e)t.copy(s,i),i+=t.length;for(const e of t)e.copy(s,i),i+=e.length;const f=l.toBinary();return u&&u.copy(f,a.Constants.ENDHDR),f.copy(s,i),s},toAsyncBuffer:function(e,t,o,i){try{c||g(),p();const t=[],s=[];let f=0,d=0;l.size=0,l.offset=0;const h=function(r){if(r.length){const e=r.pop(),a=e.entryName+e.extra.toString();o&&o(a),e.getCompressedDataAsync((function(o){i&&i(a),e.header.offset=d;const u=e.header.dataHeaderToBinary(),c=n.alloc(a.length,a),g=u.length+c.length+o.length;d+=g,t.push(u),t.push(c),t.push(o);const p=e.packHeader();s.push(p),l.size+=p.length,f+=g+p.length,h(r)}))}else{f+=l.mainHeaderSize,l.offset=d,d=0;const r=n.alloc(f);t.forEach((function(e){e.copy(r,d),d+=e.length})),s.forEach((function(e){e.copy(r,d),d+=e.length}));const o=l.toBinary();u&&u.copy(o,a.Constants.ENDHDR),o.copy(r,d),e(r)}};h(r)}catch(e){t(e)}}}}},9380:(e,t,r)=>{"use strict";var n=r(593)("ArrayBuffer.prototype.byteLength",!0),o=r(752);e.exports=function(e){return o(e)?n?n(e):e.byteLength:NaN}},4475:(e,t,r)=>{"use strict";var n=r(9142);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},o(e)}var i,a,s=r(4583).codes,u=s.ERR_AMBIGUOUS_ARGUMENT,l=s.ERR_INVALID_ARG_TYPE,c=s.ERR_INVALID_ARG_VALUE,f=s.ERR_INVALID_RETURN_VALUE,d=s.ERR_MISSING_ARGS,g=r(4541),p=r(5058).inspect,h=r(5058).types,y=h.isPromise,m=h.isRegExp,b=Object.assign?Object.assign:r(4093).assign,_=Object.is?Object.is:r(731);function w(){var e=r(523);i=e.isDeepEqual,a=e.isDeepStrictEqual}new Map;var E=!1,v=e.exports=A,S={};function T(e){if(e.message instanceof Error)throw e.message;throw new g(e)}function O(e,t,r,n){if(!r){var o=!1;if(0===t)o=!0,n="No value argument passed to `assert.ok()`";else if(n instanceof Error)throw n;var i=new g({actual:r,expected:!0,message:n,operator:"==",stackStartFn:e});throw i.generatedMessage=o,i}}function A(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];O.apply(void 0,[A,t.length].concat(t))}v.fail=function e(t,r,o,i,a){var s,u=arguments.length;if(0===u?s="Failed":1===u?(o=t,t=void 0):(!1===E&&(E=!0,(n.emitWarning?n.emitWarning:console.warn.bind(console))("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")),2===u&&(i="!=")),o instanceof Error)throw o;var l={actual:t,expected:r,operator:void 0===i?"fail":i,stackStartFn:a||e};void 0!==o&&(l.message=o);var c=new g(l);throw s&&(c.message=s,c.generatedMessage=!0),c},v.AssertionError=g,v.ok=A,v.equal=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");t!=r&&T({actual:t,expected:r,message:n,operator:"==",stackStartFn:e})},v.notEqual=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");t==r&&T({actual:t,expected:r,message:n,operator:"!=",stackStartFn:e})},v.deepEqual=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");void 0===i&&w(),i(t,r)||T({actual:t,expected:r,message:n,operator:"deepEqual",stackStartFn:e})},v.notDeepEqual=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");void 0===i&&w(),i(t,r)&&T({actual:t,expected:r,message:n,operator:"notDeepEqual",stackStartFn:e})},v.deepStrictEqual=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");void 0===i&&w(),a(t,r)||T({actual:t,expected:r,message:n,operator:"deepStrictEqual",stackStartFn:e})},v.notDeepStrictEqual=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");void 0===i&&w(),a(t,r)&&T({actual:t,expected:r,message:n,operator:"notDeepStrictEqual",stackStartFn:e})},v.strictEqual=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");_(t,r)||T({actual:t,expected:r,message:n,operator:"strictEqual",stackStartFn:e})},v.notStrictEqual=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");_(t,r)&&T({actual:t,expected:r,message:n,operator:"notStrictEqual",stackStartFn:e})};var I=function e(t,r,n){var o=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),r.forEach((function(e){e in t&&(void 0!==n&&"string"==typeof n[e]&&m(t[e])&&t[e].test(n[e])?o[e]=n[e]:o[e]=t[e])}))};function R(e,t,r,n){if("function"!=typeof t){if(m(t))return t.test(e);if(2===arguments.length)throw new l("expected",["Function","RegExp"],t);if("object"!==o(e)||null===e){var s=new g({actual:e,expected:t,message:r,operator:"deepStrictEqual",stackStartFn:n});throw s.operator=n.name,s}var u=Object.keys(t);if(t instanceof Error)u.push("name","message");else if(0===u.length)throw new c("error",t,"may not be an empty object");return void 0===i&&w(),u.forEach((function(o){"string"==typeof e[o]&&m(t[o])&&t[o].test(e[o])||function(e,t,r,n,o,i){if(!(r in e)||!a(e[r],t[r])){if(!n){var s=new I(e,o),u=new I(t,o,e),l=new g({actual:s,expected:u,operator:"deepStrictEqual",stackStartFn:i});throw l.actual=e,l.expected=t,l.operator=i.name,l}T({actual:e,expected:t,message:n,operator:i.name,stackStartFn:i})}}(e,t,o,r,u,n)})),!0}return void 0!==t.prototype&&e instanceof t||!Error.isPrototypeOf(t)&&!0===t.call({},e)}function N(e){if("function"!=typeof e)throw new l("fn","Function",e);try{e()}catch(e){return e}return S}function D(e){return y(e)||null!==e&&"object"===o(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function j(e){return Promise.resolve().then((function(){var t;if("function"==typeof e){if(!D(t=e()))throw new f("instance of Promise","promiseFn",t)}else{if(!D(e))throw new l("promiseFn",["Function","Promise"],e);t=e}return Promise.resolve().then((function(){return t})).then((function(){return S})).catch((function(e){return e}))}))}function k(e,t,r,n){if("string"==typeof r){if(4===arguments.length)throw new l("error",["Object","Error","Function","RegExp"],r);if("object"===o(t)&&null!==t){if(t.message===r)throw new u("error/message",'The error message "'.concat(t.message,'" is identical to the message.'))}else if(t===r)throw new u("error/message",'The error "'.concat(t,'" is identical to the message.'));n=r,r=void 0}else if(null!=r&&"object"!==o(r)&&"function"!=typeof r)throw new l("error",["Object","Error","Function","RegExp"],r);if(t===S){var i="";r&&r.name&&(i+=" (".concat(r.name,")")),i+=n?": ".concat(n):".";var a="rejects"===e.name?"rejection":"exception";T({actual:void 0,expected:r,operator:e.name,message:"Missing expected ".concat(a).concat(i),stackStartFn:e})}if(r&&!R(t,r,n,e))throw t}function C(e,t,r,n){if(t!==S){if("string"==typeof r&&(n=r,r=void 0),!r||R(t,r)){var o=n?": ".concat(n):".",i="doesNotReject"===e.name?"rejection":"exception";T({actual:t,expected:r,operator:e.name,message:"Got unwanted ".concat(i).concat(o,"\n")+'Actual message: "'.concat(t&&t.message,'"'),stackStartFn:e})}throw t}}function M(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];O.apply(void 0,[M,t.length].concat(t))}v.throws=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];k.apply(void 0,[e,N(t)].concat(n))},v.rejects=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return j(t).then((function(t){return k.apply(void 0,[e,t].concat(n))}))},v.doesNotThrow=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];C.apply(void 0,[e,N(t)].concat(n))},v.doesNotReject=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return j(t).then((function(t){return C.apply(void 0,[e,t].concat(n))}))},v.ifError=function e(t){if(null!=t){var r="ifError got unwanted exception: ";"object"===o(t)&&"string"==typeof t.message?0===t.message.length&&t.constructor?r+=t.constructor.name:r+=t.message:r+=p(t);var n=new g({actual:t,expected:null,operator:"ifError",message:r,stackStartFn:e}),i=t.stack;if("string"==typeof i){var a=i.split("\n");a.shift();for(var s=n.stack.split("\n"),u=0;u<a.length;u++){var l=s.indexOf(a[u]);if(-1!==l){s=s.slice(0,l);break}}n.stack="".concat(s.join("\n"),"\n").concat(a.join("\n"))}throw n}},v.strict=b(M,v,{equal:v.strictEqual,deepEqual:v.deepStrictEqual,notEqual:v.notStrictEqual,notDeepEqual:v.notDeepStrictEqual}),v.strict.strict=v.strict},4541:(e,t,r)=>{"use strict";var n=r(9142);function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function a(e,t){return!t||"object"!==d(t)&&"function"!=typeof t?s(e):t}function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u(e){var t="function"==typeof Map?new Map:void 0;return u=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return l(e,arguments,f(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),c(n,e)},u(e)}function l(e,t,r){return l=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&c(o,r.prototype),o},l.apply(null,arguments)}function c(e,t){return c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},c(e,t)}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function d(e){return d="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},d(e)}var g=r(5058).inspect,p=r(4583).codes.ERR_INVALID_ARG_TYPE;function h(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}var y="",m="",b="",_="",w={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function E(e){var t=Object.keys(e),r=Object.create(Object.getPrototypeOf(e));return t.forEach((function(t){r[t]=e[t]})),Object.defineProperty(r,"message",{value:e.message}),r}function v(e){return g(e,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}var S=function(e){function t(e){var r;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),"object"!==d(e)||null===e)throw new p("options","Object",e);var o=e.message,i=e.operator,u=e.stackStartFn,l=e.actual,c=e.expected,g=Error.stackTraceLimit;if(Error.stackTraceLimit=0,null!=o)r=a(this,f(t).call(this,String(o)));else if(n.stderr&&n.stderr.isTTY&&(n.stderr&&n.stderr.getColorDepth&&1!==n.stderr.getColorDepth()?(y="[34m",m="[32m",_="[39m",b="[31m"):(y="",m="",_="",b="")),"object"===d(l)&&null!==l&&"object"===d(c)&&null!==c&&"stack"in l&&l instanceof Error&&"stack"in c&&c instanceof Error&&(l=E(l),c=E(c)),"deepStrictEqual"===i||"strictEqual"===i)r=a(this,f(t).call(this,function(e,t,r){var o="",i="",a=0,s="",u=!1,l=v(e),c=l.split("\n"),f=v(t).split("\n"),g=0,p="";if("strictEqual"===r&&"object"===d(e)&&"object"===d(t)&&null!==e&&null!==t&&(r="strictEqualObject"),1===c.length&&1===f.length&&c[0]!==f[0]){var E=c[0].length+f[0].length;if(E<=10){if(!("object"===d(e)&&null!==e||"object"===d(t)&&null!==t||0===e&&0===t))return"".concat(w[r],"\n\n")+"".concat(c[0]," !== ").concat(f[0],"\n")}else if("strictEqualObject"!==r&&E<(n.stderr&&n.stderr.isTTY?n.stderr.columns:80)){for(;c[0][g]===f[0][g];)g++;g>2&&(p="\n ".concat(function(e,t){if(t=Math.floor(t),0==e.length||0==t)return"";var r=e.length*t;for(t=Math.floor(Math.log(t)/Math.log(2));t;)e+=e,t--;return e+e.substring(0,r-e.length)}(" ",g),"^"),g=0)}}for(var S=c[c.length-1],T=f[f.length-1];S===T&&(g++<2?s="\n ".concat(S).concat(s):o=S,c.pop(),f.pop(),0!==c.length&&0!==f.length);)S=c[c.length-1],T=f[f.length-1];var O=Math.max(c.length,f.length);if(0===O){var A=l.split("\n");if(A.length>30)for(A[26]="".concat(y,"...").concat(_);A.length>27;)A.pop();return"".concat(w.notIdentical,"\n\n").concat(A.join("\n"),"\n")}g>3&&(s="\n".concat(y,"...").concat(_).concat(s),u=!0),""!==o&&(s="\n ".concat(o).concat(s),o="");var I=0,R=w[r]+"\n".concat(m,"+ actual").concat(_," ").concat(b,"- expected").concat(_),N=" ".concat(y,"...").concat(_," Lines skipped");for(g=0;g<O;g++){var D=g-a;if(c.length<g+1)D>1&&g>2&&(D>4?(i+="\n".concat(y,"...").concat(_),u=!0):D>3&&(i+="\n ".concat(f[g-2]),I++),i+="\n ".concat(f[g-1]),I++),a=g,o+="\n".concat(b,"-").concat(_," ").concat(f[g]),I++;else if(f.length<g+1)D>1&&g>2&&(D>4?(i+="\n".concat(y,"...").concat(_),u=!0):D>3&&(i+="\n ".concat(c[g-2]),I++),i+="\n ".concat(c[g-1]),I++),a=g,i+="\n".concat(m,"+").concat(_," ").concat(c[g]),I++;else{var j=f[g],k=c[g],C=k!==j&&(!h(k,",")||k.slice(0,-1)!==j);C&&h(j,",")&&j.slice(0,-1)===k&&(C=!1,k+=","),C?(D>1&&g>2&&(D>4?(i+="\n".concat(y,"...").concat(_),u=!0):D>3&&(i+="\n ".concat(c[g-2]),I++),i+="\n ".concat(c[g-1]),I++),a=g,i+="\n".concat(m,"+").concat(_," ").concat(k),o+="\n".concat(b,"-").concat(_," ").concat(j),I+=2):(i+=o,o="",1!==D&&0!==g||(i+="\n ".concat(k),I++))}if(I>20&&g<O-2)return"".concat(R).concat(N,"\n").concat(i,"\n").concat(y,"...").concat(_).concat(o,"\n")+"".concat(y,"...").concat(_)}return"".concat(R).concat(u?N:"","\n").concat(i).concat(o).concat(s).concat(p)}(l,c,i)));else if("notDeepStrictEqual"===i||"notStrictEqual"===i){var S=w[i],T=v(l).split("\n");if("notStrictEqual"===i&&"object"===d(l)&&null!==l&&(S=w.notStrictEqualObject),T.length>30)for(T[26]="".concat(y,"...").concat(_);T.length>27;)T.pop();r=1===T.length?a(this,f(t).call(this,"".concat(S," ").concat(T[0]))):a(this,f(t).call(this,"".concat(S,"\n\n").concat(T.join("\n"),"\n")))}else{var O=v(l),A="",I=w[i];"notDeepEqual"===i||"notEqual"===i?(O="".concat(w[i],"\n\n").concat(O)).length>1024&&(O="".concat(O.slice(0,1021),"...")):(A="".concat(v(c)),O.length>512&&(O="".concat(O.slice(0,509),"...")),A.length>512&&(A="".concat(A.slice(0,509),"...")),"deepEqual"===i||"equal"===i?O="".concat(I,"\n\n").concat(O,"\n\nshould equal\n\n"):A=" ".concat(i," ").concat(A)),r=a(this,f(t).call(this,"".concat(O).concat(A)))}return Error.stackTraceLimit=g,r.generatedMessage=!o,Object.defineProperty(s(r),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),r.code="ERR_ASSERTION",r.actual=l,r.expected=c,r.operator=i,Error.captureStackTrace&&Error.captureStackTrace(s(r),u),r.stack,r.name="AssertionError",a(r)}var r,u;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&&c(e,t)}(t,e),r=t,u=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:g.custom,value:function(e,t){return g(this,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){o(e,t,r[t])}))}return e}({},t,{customInspect:!1,depth:0}))}}],u&&i(r.prototype,u),t}(u(Error));e.exports=S},4583:(e,t,r)=>{"use strict";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},n(e)}function o(e){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},o(e)}function i(e,t){return i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},i(e,t)}var a,s,u={};function l(e,t,r){r||(r=Error);var a=function(r){function a(r,i,s){var u;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),u=function(e,t){return!t||"object"!==n(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,o(a).call(this,function(e,r,n){return"string"==typeof t?t:t(e,r,n)}(r,i,s))),u.code=e,u}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)}(a,r),a}(r);u[e]=a}function c(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}l("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),l("ERR_INVALID_ARG_TYPE",(function(e,t,o){var i,s,u,l,f;if(void 0===a&&(a=r(4475)),a("string"==typeof e,"'name' must be a string"),"string"==typeof t&&(s="not ",t.substr(0,4)===s)?(i="must not be",t=t.replace(/^not /,"")):i="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-9,r)===t}(e," argument"))u="The ".concat(e," ").concat(i," ").concat(c(t,"type"));else{var d=("number"!=typeof f&&(f=0),f+1>(l=e).length||-1===l.indexOf(".",f)?"argument":"property");u='The "'.concat(e,'" ').concat(d," ").concat(i," ").concat(c(t,"type"))}return u+". Received type ".concat(n(o))}),TypeError),l("ERR_INVALID_ARG_VALUE",(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===s&&(s=r(5058));var o=s.inspect(t);return o.length>128&&(o="".concat(o.slice(0,128),"...")),"The argument '".concat(e,"' ").concat(n,". Received ").concat(o)}),TypeError,RangeError),l("ERR_INVALID_RETURN_VALUE",(function(e,t,r){var o;return o=r&&r.constructor&&r.constructor.name?"instance of ".concat(r.constructor.name):"type ".concat(n(r)),"Expected ".concat(e,' to be returned from the "').concat(t,'"')+" function but got ".concat(o,".")}),TypeError),l("ERR_MISSING_ARGS",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];void 0===a&&(a=r(4475)),a(t.length>0,"At least one arg needs to be specified");var o="The ",i=t.length;switch(t=t.map((function(e){return'"'.concat(e,'"')})),i){case 1:o+="".concat(t[0]," argument");break;case 2:o+="".concat(t[0]," and ").concat(t[1]," arguments");break;default:o+=t.slice(0,i-1).join(", "),o+=", and ".concat(t[i-1]," arguments")}return"".concat(o," must be specified")}),TypeError),e.exports.codes=u},523:(e,t,r)=>{"use strict";function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=[],n=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==s.return||s.return()}finally{if(o)throw i}}return r}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}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},o(e)}var i=void 0!==/a/g.flags,a=function(e){var t=[];return e.forEach((function(e){return t.push(e)})),t},s=function(e){var t=[];return e.forEach((function(e,r){return t.push([r,e])})),t},u=Object.is?Object.is:r(731),l=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},c=Number.isNaN?Number.isNaN:r(3054);function f(e){return e.call.bind(e)}var d=f(Object.prototype.hasOwnProperty),g=f(Object.prototype.propertyIsEnumerable),p=f(Object.prototype.toString),h=r(5058).types,y=h.isAnyArrayBuffer,m=h.isArrayBufferView,b=h.isDate,_=h.isMap,w=h.isRegExp,E=h.isSet,v=h.isNativeError,S=h.isBoxedPrimitive,T=h.isNumberObject,O=h.isStringObject,A=h.isBooleanObject,I=h.isBigIntObject,R=h.isSymbolObject,N=h.isFloat32Array,D=h.isFloat64Array;function j(e){if(0===e.length||e.length>10)return!0;for(var t=0;t<e.length;t++){var r=e.charCodeAt(t);if(r<48||r>57)return!0}return 10===e.length&&e>=Math.pow(2,32)}function k(e){return Object.keys(e).filter(j).concat(l(e).filter(Object.prototype.propertyIsEnumerable.bind(e)))}function C(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,o=0,i=Math.min(r,n);o<i;++o)if(e[o]!==t[o]){r=e[o],n=t[o];break}return r<n?-1:n<r?1:0}var M=0,L=1,x=2,B=3;function F(e,t,r,n){if(e===t)return 0!==e||!r||u(e,t);if(r){if("object"!==o(e))return"number"==typeof e&&c(e)&&c(t);if("object"!==o(t)||null===e||null===t)return!1;if(Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1}else{if(null===e||"object"!==o(e))return(null===t||"object"!==o(t))&&e==t;if(null===t||"object"!==o(t))return!1}var a,s,l,f,d=p(e);if(d!==p(t))return!1;if(Array.isArray(e)){if(e.length!==t.length)return!1;var g=k(e),h=k(t);return g.length===h.length&&P(e,t,r,n,L,g)}if("[object Object]"===d&&(!_(e)&&_(t)||!E(e)&&E(t)))return!1;if(b(e)){if(!b(t)||Date.prototype.getTime.call(e)!==Date.prototype.getTime.call(t))return!1}else if(w(e)){if(!w(t)||(l=e,f=t,!(i?l.source===f.source&&l.flags===f.flags:RegExp.prototype.toString.call(l)===RegExp.prototype.toString.call(f))))return!1}else if(v(e)||e instanceof Error){if(e.message!==t.message||e.name!==t.name)return!1}else{if(m(e)){if(r||!N(e)&&!D(e)){if(!function(e,t){return e.byteLength===t.byteLength&&0===C(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}(e,t))return!1}else if(!function(e,t){if(e.byteLength!==t.byteLength)return!1;for(var r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0}(e,t))return!1;var j=k(e),F=k(t);return j.length===F.length&&P(e,t,r,n,M,j)}if(E(e))return!(!E(t)||e.size!==t.size)&&P(e,t,r,n,x);if(_(e))return!(!_(t)||e.size!==t.size)&&P(e,t,r,n,B);if(y(e)){if(s=t,(a=e).byteLength!==s.byteLength||0!==C(new Uint8Array(a),new Uint8Array(s)))return!1}else if(S(e)&&!function(e,t){return T(e)?T(t)&&u(Number.prototype.valueOf.call(e),Number.prototype.valueOf.call(t)):O(e)?O(t)&&String.prototype.valueOf.call(e)===String.prototype.valueOf.call(t):A(e)?A(t)&&Boolean.prototype.valueOf.call(e)===Boolean.prototype.valueOf.call(t):I(e)?I(t)&&BigInt.prototype.valueOf.call(e)===BigInt.prototype.valueOf.call(t):R(t)&&Symbol.prototype.valueOf.call(e)===Symbol.prototype.valueOf.call(t)}(e,t))return!1}return P(e,t,r,n,M)}function U(e,t){return t.filter((function(t){return g(e,t)}))}function P(e,t,r,i,u,c){if(5===arguments.length){c=Object.keys(e);var f=Object.keys(t);if(c.length!==f.length)return!1}for(var p=0;p<c.length;p++)if(!d(t,c[p]))return!1;if(r&&5===arguments.length){var h=l(e);if(0!==h.length){var y=0;for(p=0;p<h.length;p++){var m=h[p];if(g(e,m)){if(!g(t,m))return!1;c.push(m),y++}else if(g(t,m))return!1}var b=l(t);if(h.length!==b.length&&U(t,b).length!==y)return!1}else{var _=l(t);if(0!==_.length&&0!==U(t,_).length)return!1}}if(0===c.length&&(u===M||u===L&&0===e.length||0===e.size))return!0;if(void 0===i)i={val1:new Map,val2:new Map,position:0};else{var w=i.val1.get(e);if(void 0!==w){var E=i.val2.get(t);if(void 0!==E)return w===E}i.position++}i.val1.set(e,i.position),i.val2.set(t,i.position);var v=function(e,t,r,i,u,l){var c=0;if(l===x){if(!function(e,t,r,n){for(var i=null,s=a(e),u=0;u<s.length;u++){var l=s[u];if("object"===o(l)&&null!==l)null===i&&(i=new Set),i.add(l);else if(!t.has(l)){if(r)return!1;if(!z(e,t,l))return!1;null===i&&(i=new Set),i.add(l)}}if(null!==i){for(var c=a(t),f=0;f<c.length;f++){var d=c[f];if("object"===o(d)&&null!==d){if(!W(i,d,r,n))return!1}else if(!r&&!e.has(d)&&!W(i,d,r,n))return!1}return 0===i.size}return!0}(e,t,r,u))return!1}else if(l===B){if(!function(e,t,r,i){for(var a=null,u=s(e),l=0;l<u.length;l++){var c=n(u[l],2),f=c[0],d=c[1];if("object"===o(f)&&null!==f)null===a&&(a=new Set),a.add(f);else{var g=t.get(f);if(void 0===g&&!t.has(f)||!F(d,g,r,i)){if(r)return!1;if(!V(e,t,f,d,i))return!1;null===a&&(a=new Set),a.add(f)}}}if(null!==a){for(var p=s(t),h=0;h<p.length;h++){var y=n(p[h],2),m=(f=y[0],y[1]);if("object"===o(f)&&null!==f){if(!$(a,e,f,m,r,i))return!1}else if(!(r||e.has(f)&&F(e.get(f),m,!1,i)||$(a,e,f,m,!1,i)))return!1}return 0===a.size}return!0}(e,t,r,u))return!1}else if(l===L)for(;c<e.length;c++){if(!d(e,c)){if(d(t,c))return!1;for(var f=Object.keys(e);c<f.length;c++){var g=f[c];if(!d(t,g)||!F(e[g],t[g],r,u))return!1}return f.length===Object.keys(t).length}if(!d(t,c)||!F(e[c],t[c],r,u))return!1}for(c=0;c<i.length;c++){var p=i[c];if(!F(e[p],t[p],r,u))return!1}return!0}(e,t,r,c,i,u);return i.val1.delete(e),i.val2.delete(t),v}function W(e,t,r,n){for(var o=a(e),i=0;i<o.length;i++){var s=o[i];if(F(t,s,r,n))return e.delete(s),!0}return!1}function H(e){switch(o(e)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":e=+e;case"number":if(c(e))return!1}return!0}function z(e,t,r){var n=H(r);return null!=n?n:t.has(n)&&!e.has(n)}function V(e,t,r,n,o){var i=H(r);if(null!=i)return i;var a=t.get(i);return!(void 0===a&&!t.has(i)||!F(n,a,!1,o))&&!e.has(i)&&F(n,a,!1,o)}function $(e,t,r,n,o,i){for(var s=a(e),u=0;u<s.length;u++){var l=s[u];if(F(r,l,o,i)&&F(n,t.get(l),o,i))return e.delete(l),!0}return!1}e.exports={isDeepEqual:function(e,t){return F(e,t,!1)},isDeepStrictEqual:function(e,t){return F(e,t,!0)}}},4919:(e,t)=>{"use strict";t.byteLength=function(e){var t=s(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,i=s(e),a=i[0],u=i[1],l=new o(function(e,t,r){return 3*(t+r)/4-r}(0,a,u)),c=0,f=u>0?a-4:a;for(r=0;r<f;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],l[c++]=t>>16&255,l[c++]=t>>8&255,l[c++]=255&t;return 2===u&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,l[c++]=255&t),1===u&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,l[c++]=t>>8&255,l[c++]=255&t),l},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],a=16383,s=0,l=n-o;s<l;s+=a)i.push(u(e,s,s+a>l?l:s+a));return 1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),i.join("")};for(var r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)r[a]=i[a],n[i.charCodeAt(a)]=a;function s(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function u(e,t,n){for(var o,i,a=[],s=t;s<n;s+=3)o=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),a.push(r[(i=o)>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},9626:(e,t,r)=>{"use strict";var n=r(9033).Buffer,o=r(9142),i=r(4475),a=r(7563),s=r(4151),u=r(3534),l=r(9806);for(var c in l)t[c]=l[c];function f(e){if("number"!=typeof e||e<t.DEFLATE||e>t.UNZIP)throw new TypeError("Bad argument");this.dictionary=null,this.err=0,this.flush=0,this.init_done=!1,this.level=0,this.memLevel=0,this.mode=e,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}t.NONE=0,t.DEFLATE=1,t.INFLATE=2,t.GZIP=3,t.GUNZIP=4,t.DEFLATERAW=5,t.INFLATERAW=6,t.UNZIP=7,f.prototype.close=function(){this.write_in_progress?this.pending_close=!0:(this.pending_close=!1,i(this.init_done,"close before init"),i(this.mode<=t.UNZIP),this.mode===t.DEFLATE||this.mode===t.GZIP||this.mode===t.DEFLATERAW?s.deflateEnd(this.strm):this.mode!==t.INFLATE&&this.mode!==t.GUNZIP&&this.mode!==t.INFLATERAW&&this.mode!==t.UNZIP||u.inflateEnd(this.strm),this.mode=t.NONE,this.dictionary=null)},f.prototype.write=function(e,t,r,n,o,i,a){return this._write(!0,e,t,r,n,o,i,a)},f.prototype.writeSync=function(e,t,r,n,o,i,a){return this._write(!1,e,t,r,n,o,i,a)},f.prototype._write=function(e,r,a,s,u,l,c,f){if(i.equal(arguments.length,8),i(this.init_done,"write before init"),i(this.mode!==t.NONE,"already finalized"),i.equal(!1,this.write_in_progress,"write already in progress"),i.equal(!1,this.pending_close,"close is pending"),this.write_in_progress=!0,i.equal(!1,void 0===r,"must provide flush value"),this.write_in_progress=!0,r!==t.Z_NO_FLUSH&&r!==t.Z_PARTIAL_FLUSH&&r!==t.Z_SYNC_FLUSH&&r!==t.Z_FULL_FLUSH&&r!==t.Z_FINISH&&r!==t.Z_BLOCK)throw new Error("Invalid flush value");if(null==a&&(a=n.alloc(0),u=0,s=0),this.strm.avail_in=u,this.strm.input=a,this.strm.next_in=s,this.strm.avail_out=f,this.strm.output=l,this.strm.next_out=c,this.flush=r,!e)return this._process(),this._checkError()?this._afterSync():void 0;var d=this;return o.nextTick((function(){d._process(),d._after()})),this},f.prototype._afterSync=function(){var e=this.strm.avail_out,t=this.strm.avail_in;return this.write_in_progress=!1,[t,e]},f.prototype._process=function(){var e=null;switch(this.mode){case t.DEFLATE:case t.GZIP:case t.DEFLATERAW:this.err=s.deflate(this.strm,this.flush);break;case t.UNZIP:switch(this.strm.avail_in>0&&(e=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(null===e)break;if(31!==this.strm.input[e]){this.mode=t.INFLATE;break}if(this.gzip_id_bytes_read=1,e++,1===this.strm.avail_in)break;case 1:if(null===e)break;139===this.strm.input[e]?(this.gzip_id_bytes_read=2,this.mode=t.GUNZIP):this.mode=t.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case t.INFLATE:case t.GUNZIP:case t.INFLATERAW:for(this.err=u.inflate(this.strm,this.flush),this.err===t.Z_NEED_DICT&&this.dictionary&&(this.err=u.inflateSetDictionary(this.strm,this.dictionary),this.err===t.Z_OK?this.err=u.inflate(this.strm,this.flush):this.err===t.Z_DATA_ERROR&&(this.err=t.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===t.GUNZIP&&this.err===t.Z_STREAM_END&&0!==this.strm.next_in[0];)this.reset(),this.err=u.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}},f.prototype._checkError=function(){switch(this.err){case t.Z_OK:case t.Z_BUF_ERROR:if(0!==this.strm.avail_out&&this.flush===t.Z_FINISH)return this._error("unexpected end of file"),!1;break;case t.Z_STREAM_END:break;case t.Z_NEED_DICT:return null==this.dictionary?this._error("Missing dictionary"):this._error("Bad dictionary"),!1;default:return this._error("Zlib error"),!1}return!0},f.prototype._after=function(){if(this._checkError()){var e=this.strm.avail_out,t=this.strm.avail_in;this.write_in_progress=!1,this.callback(t,e),this.pending_close&&this.close()}},f.prototype._error=function(e){this.strm.msg&&(e=this.strm.msg),this.onerror(e,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},f.prototype.init=function(e,r,n,o,a){i(4===arguments.length||5===arguments.length,"init(windowBits, level, memLevel, strategy, [dictionary])"),i(e>=8&&e<=15,"invalid windowBits"),i(r>=-1&&r<=9,"invalid compression level"),i(n>=1&&n<=9,"invalid memlevel"),i(o===t.Z_FILTERED||o===t.Z_HUFFMAN_ONLY||o===t.Z_RLE||o===t.Z_FIXED||o===t.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(r,e,n,o,a),this._setDictionary()},f.prototype.params=function(){throw new Error("deflateParams Not supported")},f.prototype.reset=function(){this._reset(),this._setDictionary()},f.prototype._init=function(e,r,n,o,i){switch(this.level=e,this.windowBits=r,this.memLevel=n,this.strategy=o,this.flush=t.Z_NO_FLUSH,this.err=t.Z_OK,this.mode!==t.GZIP&&this.mode!==t.GUNZIP||(this.windowBits+=16),this.mode===t.UNZIP&&(this.windowBits+=32),this.mode!==t.DEFLATERAW&&this.mode!==t.INFLATERAW||(this.windowBits=-1*this.windowBits),this.strm=new a,this.mode){case t.DEFLATE:case t.GZIP:case t.DEFLATERAW:this.err=s.deflateInit2(this.strm,this.level,t.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case t.INFLATE:case t.GUNZIP:case t.INFLATERAW:case t.UNZIP:this.err=u.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==t.Z_OK&&this._error("Init error"),this.dictionary=i,this.write_in_progress=!1,this.init_done=!0},f.prototype._setDictionary=function(){if(null!=this.dictionary){switch(this.err=t.Z_OK,this.mode){case t.DEFLATE:case t.DEFLATERAW:this.err=s.deflateSetDictionary(this.strm,this.dictionary)}this.err!==t.Z_OK&&this._error("Failed to set dictionary")}},f.prototype._reset=function(){switch(this.err=t.Z_OK,this.mode){case t.DEFLATE:case t.DEFLATERAW:case t.GZIP:this.err=s.deflateReset(this.strm);break;case t.INFLATE:case t.INFLATERAW:case t.GUNZIP:this.err=u.inflateReset(this.strm)}this.err!==t.Z_OK&&this._error("Failed to reset stream")},t.Zlib=f},7611:(e,t,r)=>{"use strict";var n=r(9142),o=r(9033).Buffer,i=r(7245).Transform,a=r(9626),s=r(5058),u=r(4475).ok,l=r(9033).kMaxLength,c="Cannot create final Buffer. It would be larger than 0x"+l.toString(16)+" bytes";a.Z_MIN_WINDOWBITS=8,a.Z_MAX_WINDOWBITS=15,a.Z_DEFAULT_WINDOWBITS=15,a.Z_MIN_CHUNK=64,a.Z_MAX_CHUNK=1/0,a.Z_DEFAULT_CHUNK=16384,a.Z_MIN_MEMLEVEL=1,a.Z_MAX_MEMLEVEL=9,a.Z_DEFAULT_MEMLEVEL=8,a.Z_MIN_LEVEL=-1,a.Z_MAX_LEVEL=9,a.Z_DEFAULT_LEVEL=a.Z_DEFAULT_COMPRESSION;for(var f=Object.keys(a),d=0;d<f.length;d++){var g=f[d];g.match(/^Z/)&&Object.defineProperty(t,g,{enumerable:!0,value:a[g],writable:!1})}for(var p={Z_OK:a.Z_OK,Z_STREAM_END:a.Z_STREAM_END,Z_NEED_DICT:a.Z_NEED_DICT,Z_ERRNO:a.Z_ERRNO,Z_STREAM_ERROR:a.Z_STREAM_ERROR,Z_DATA_ERROR:a.Z_DATA_ERROR,Z_MEM_ERROR:a.Z_MEM_ERROR,Z_BUF_ERROR:a.Z_BUF_ERROR,Z_VERSION_ERROR:a.Z_VERSION_ERROR},h=Object.keys(p),y=0;y<h.length;y++){var m=h[y];p[p[m]]=m}function b(e,t,r){var n=[],i=0;function a(){for(var t;null!==(t=e.read());)n.push(t),i+=t.length;e.once("readable",a)}function s(){var t,a=null;i>=l?a=new RangeError(c):t=o.concat(n,i),n=[],e.close(),r(a,t)}e.on("error",(function(t){e.removeListener("end",s),e.removeListener("readable",a),r(t)})),e.on("end",s),e.end(t),a()}function _(e,t){if("string"==typeof t&&(t=o.from(t)),!o.isBuffer(t))throw new TypeError("Not a string or buffer");var r=e._finishFlushFlag;return e._processChunk(t,r)}function w(e){if(!(this instanceof w))return new w(e);R.call(this,e,a.DEFLATE)}function E(e){if(!(this instanceof E))return new E(e);R.call(this,e,a.INFLATE)}function v(e){if(!(this instanceof v))return new v(e);R.call(this,e,a.GZIP)}function S(e){if(!(this instanceof S))return new S(e);R.call(this,e,a.GUNZIP)}function T(e){if(!(this instanceof T))return new T(e);R.call(this,e,a.DEFLATERAW)}function O(e){if(!(this instanceof O))return new O(e);R.call(this,e,a.INFLATERAW)}function A(e){if(!(this instanceof A))return new A(e);R.call(this,e,a.UNZIP)}function I(e){return e===a.Z_NO_FLUSH||e===a.Z_PARTIAL_FLUSH||e===a.Z_SYNC_FLUSH||e===a.Z_FULL_FLUSH||e===a.Z_FINISH||e===a.Z_BLOCK}function R(e,r){var n=this;if(this._opts=e=e||{},this._chunkSize=e.chunkSize||t.Z_DEFAULT_CHUNK,i.call(this,e),e.flush&&!I(e.flush))throw new Error("Invalid flush flag: "+e.flush);if(e.finishFlush&&!I(e.finishFlush))throw new Error("Invalid flush flag: "+e.finishFlush);if(this._flushFlag=e.flush||a.Z_NO_FLUSH,this._finishFlushFlag=void 0!==e.finishFlush?e.finishFlush:a.Z_FINISH,e.chunkSize&&(e.chunkSize<t.Z_MIN_CHUNK||e.chunkSize>t.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBits<t.Z_MIN_WINDOWBITS||e.windowBits>t.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.level<t.Z_MIN_LEVEL||e.level>t.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevel<t.Z_MIN_MEMLEVEL||e.memLevel>t.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=t.Z_FILTERED&&e.strategy!=t.Z_HUFFMAN_ONLY&&e.strategy!=t.Z_RLE&&e.strategy!=t.Z_FIXED&&e.strategy!=t.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!o.isBuffer(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new a.Zlib(r);var s=this;this._hadError=!1,this._handle.onerror=function(e,r){N(s),s._hadError=!0;var n=new Error(e);n.errno=r,n.code=t.codes[r],s.emit("error",n)};var u=t.Z_DEFAULT_COMPRESSION;"number"==typeof e.level&&(u=e.level);var l=t.Z_DEFAULT_STRATEGY;"number"==typeof e.strategy&&(l=e.strategy),this._handle.init(e.windowBits||t.Z_DEFAULT_WINDOWBITS,u,e.memLevel||t.Z_DEFAULT_MEMLEVEL,l,e.dictionary),this._buffer=o.allocUnsafe(this._chunkSize),this._offset=0,this._level=u,this._strategy=l,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!n._handle},configurable:!0,enumerable:!0})}function N(e,t){t&&n.nextTick(t),e._handle&&(e._handle.close(),e._handle=null)}function D(e){e.emit("close")}Object.defineProperty(t,"codes",{enumerable:!0,value:Object.freeze(p),writable:!1}),t.Deflate=w,t.Inflate=E,t.Gzip=v,t.Gunzip=S,t.DeflateRaw=T,t.InflateRaw=O,t.Unzip=A,t.createDeflate=function(e){return new w(e)},t.createInflate=function(e){return new E(e)},t.createDeflateRaw=function(e){return new T(e)},t.createInflateRaw=function(e){return new O(e)},t.createGzip=function(e){return new v(e)},t.createGunzip=function(e){return new S(e)},t.createUnzip=function(e){return new A(e)},t.deflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),b(new w(t),e,r)},t.deflateSync=function(e,t){return _(new w(t),e)},t.gzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),b(new v(t),e,r)},t.gzipSync=function(e,t){return _(new v(t),e)},t.deflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),b(new T(t),e,r)},t.deflateRawSync=function(e,t){return _(new T(t),e)},t.unzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),b(new A(t),e,r)},t.unzipSync=function(e,t){return _(new A(t),e)},t.inflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),b(new E(t),e,r)},t.inflateSync=function(e,t){return _(new E(t),e)},t.gunzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),b(new S(t),e,r)},t.gunzipSync=function(e,t){return _(new S(t),e)},t.inflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),b(new O(t),e,r)},t.inflateRawSync=function(e,t){return _(new O(t),e)},s.inherits(R,i),R.prototype.params=function(e,r,o){if(e<t.Z_MIN_LEVEL||e>t.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+e);if(r!=t.Z_FILTERED&&r!=t.Z_HUFFMAN_ONLY&&r!=t.Z_RLE&&r!=t.Z_FIXED&&r!=t.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+r);if(this._level!==e||this._strategy!==r){var i=this;this.flush(a.Z_SYNC_FLUSH,(function(){u(i._handle,"zlib binding closed"),i._handle.params(e,r),i._hadError||(i._level=e,i._strategy=r,o&&o())}))}else n.nextTick(o)},R.prototype.reset=function(){return u(this._handle,"zlib binding closed"),this._handle.reset()},R.prototype._flush=function(e){this._transform(o.alloc(0),"",e)},R.prototype.flush=function(e,t){var r=this,i=this._writableState;("function"==typeof e||void 0===e&&!t)&&(t=e,e=a.Z_FULL_FLUSH),i.ended?t&&n.nextTick(t):i.ending?t&&this.once("end",t):i.needDrain?t&&this.once("drain",(function(){return r.flush(e,t)})):(this._flushFlag=e,this.write(o.alloc(0),"",t))},R.prototype.close=function(e){N(this,e),n.nextTick(D,this)},R.prototype._transform=function(e,t,r){var n,i=this._writableState,s=(i.ending||i.ended)&&(!e||i.length===e.length);return null===e||o.isBuffer(e)?this._handle?(s?n=this._finishFlushFlag:(n=this._flushFlag,e.length>=i.length&&(this._flushFlag=this._opts.flush||a.Z_NO_FLUSH)),void this._processChunk(e,n,r)):r(new Error("zlib binding closed")):r(new Error("invalid input"))},R.prototype._processChunk=function(e,t,r){var n=e&&e.length,i=this._chunkSize-this._offset,a=0,s=this,f="function"==typeof r;if(!f){var d,g=[],p=0;this.on("error",(function(e){d=e})),u(this._handle,"zlib binding closed");do{var h=this._handle.writeSync(t,e,a,n,this._buffer,this._offset,i)}while(!this._hadError&&b(h[0],h[1]));if(this._hadError)throw d;if(p>=l)throw N(this),new RangeError(c);var y=o.concat(g,p);return N(this),y}u(this._handle,"zlib binding closed");var m=this._handle.write(t,e,a,n,this._buffer,this._offset,i);function b(l,c){if(this&&(this.buffer=null,this.callback=null),!s._hadError){var d=i-c;if(u(d>=0,"have should not go down"),d>0){var h=s._buffer.slice(s._offset,s._offset+d);s._offset+=d,f?s.push(h):(g.push(h),p+=h.length)}if((0===c||s._offset>=s._chunkSize)&&(i=s._chunkSize,s._offset=0,s._buffer=o.allocUnsafe(s._chunkSize)),0===c){if(a+=n-l,n=l,!f)return!0;var y=s._handle.write(t,e,a,n,s._buffer,s._offset,s._chunkSize);return y.callback=b,void(y.buffer=e)}if(!f)return!1;r()}}m.buffer=e,m.callback=b},s.inherits(w,R),s.inherits(E,R),s.inherits(v,R),s.inherits(S,R),s.inherits(T,R),s.inherits(O,R),s.inherits(A,R)},9033:(e,t,r)=>{"use strict";const n=r(4919),o=r(3226),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=u,t.SlowBuffer=function(e){return+e!=e&&(e=0),u.alloc(+e)},t.INSPECT_MAX_BYTES=50;const a=2147483647;function s(e){if(e>a)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return f(e)}return l(e,t,r)}function l(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|h(e,t);let n=s(r);const o=n.write(e,t);return o!==r&&(n=n.slice(0,o)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(Z(e,Uint8Array)){const t=new Uint8Array(e);return g(t.buffer,t.byteOffset,t.byteLength)}return d(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Z(e,ArrayBuffer)||e&&Z(e.buffer,ArrayBuffer))return g(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(Z(e,SharedArrayBuffer)||e&&Z(e.buffer,SharedArrayBuffer)))return g(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return u.from(n,t,r);const o=function(e){if(u.isBuffer(e)){const t=0|p(e.length),r=s(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||K(e.length)?s(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function f(e){return c(e),s(e<0?0:0|p(e))}function d(e){const t=e.length<0?0:0|p(e.length),r=s(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function g(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,u.prototype),n}function p(e){if(e>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function h(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Z(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let o=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return q(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return G(e).length;default:if(o)return n?-1:q(e).length;t=(""+t).toLowerCase(),o=!0}}function y(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return D(this,t,r);case"utf8":case"utf-8":return A(this,t,r);case"ascii":return R(this,t,r);case"latin1":case"binary":return N(this,t,r);case"base64":return O(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function m(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function b(e,t,r,n,o){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),K(r=+r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:_(e,t,r,n,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):_(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function _(e,t,r,n,o){let i,a=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,r/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){let n=-1;for(i=r;i<s;i++)if(l(e,i)===l(t,-1===n?0:i-n)){if(-1===n&&(n=i),i-n+1===u)return n*a}else-1!==n&&(i-=i-n),n=-1}else for(r+u>s&&(r=s-u),i=r;i>=0;i--){let r=!0;for(let n=0;n<u;n++)if(l(e,i+n)!==l(t,n)){r=!1;break}if(r)return i}return-1}function w(e,t,r,n){r=Number(r)||0;const o=e.length-r;n?(n=Number(n))>o&&(n=o):n=o;const i=t.length;let a;for(n>i/2&&(n=i/2),a=0;a<n;++a){const n=parseInt(t.substr(2*a,2),16);if(K(n))return a;e[r+a]=n}return a}function E(e,t,r,n){return Y(q(t,e.length-r),e,r,n)}function v(e,t,r,n){return Y(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function S(e,t,r,n){return Y(G(t),e,r,n)}function T(e,t,r,n){return Y(function(e,t){let r,n,o;const i=[];for(let a=0;a<e.length&&!((t-=2)<0);++a)r=e.charCodeAt(a),n=r>>8,o=r%256,i.push(o),i.push(n);return i}(t,e.length-r),e,r,n)}function O(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function A(e,t,r){r=Math.min(e.length,r);const n=[];let o=t;for(;o<r;){const t=e[o];let i=null,a=t>239?4:t>223?3:t>191?2:1;if(o+a<=r){let r,n,s,u;switch(a){case 1:t<128&&(i=t);break;case 2:r=e[o+1],128==(192&r)&&(u=(31&t)<<6|63&r,u>127&&(i=u));break;case 3:r=e[o+1],n=e[o+2],128==(192&r)&&128==(192&n)&&(u=(15&t)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(i=u));break;case 4:r=e[o+1],n=e[o+2],s=e[o+3],128==(192&r)&&128==(192&n)&&128==(192&s)&&(u=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&s,u>65535&&u<1114112&&(i=u))}}null===i?(i=65533,a=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|1023&i),n.push(i),o+=a}return function(e){const t=e.length;if(t<=I)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=I));return r}(n)}t.kMaxLength=a,u.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),u.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(e,t,r){return l(e,t,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(e,t,r){return function(e,t,r){return c(e),e<=0?s(e):void 0!==t?"string"==typeof r?s(e).fill(t,r):s(e).fill(t):s(e)}(e,t,r)},u.allocUnsafe=function(e){return f(e)},u.allocUnsafeSlow=function(e){return f(e)},u.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==u.prototype},u.compare=function(e,t){if(Z(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),Z(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let o=0,i=Math.min(r,n);o<i;++o)if(e[o]!==t[o]){r=e[o],n=t[o];break}return r<n?-1:n<r?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=u.allocUnsafe(t);let o=0;for(r=0;r<e.length;++r){let t=e[r];if(Z(t,Uint8Array))o+t.length>n.length?(u.isBuffer(t)||(t=u.from(t)),t.copy(n,o)):Uint8Array.prototype.set.call(n,t,o);else{if(!u.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,o)}o+=t.length}return n},u.byteLength=h,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)m(this,t,t+1);return this},u.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},u.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},u.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?A(this,0,e):y.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){let e="";const r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},i&&(u.prototype[i]=u.prototype.inspect),u.prototype.compare=function(e,t,r,n,o){if(Z(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),t<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=r)return 0;if(n>=o)return-1;if(t>=r)return 1;if(this===e)return 0;let i=(o>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0);const s=Math.min(i,a),l=this.slice(n,o),c=e.slice(t,r);for(let e=0;e<s;++e)if(l[e]!==c[e]){i=l[e],a=c[e];break}return i<a?-1:a<i?1:0},u.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},u.prototype.indexOf=function(e,t,r){return b(this,e,t,r,!0)},u.prototype.lastIndexOf=function(e,t,r){return b(this,e,t,r,!1)},u.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const o=this.length-t;if((void 0===r||r>o)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let i=!1;for(;;)switch(n){case"hex":return w(this,e,t,r);case"utf8":case"utf-8":return E(this,e,t,r);case"ascii":case"latin1":case"binary":return v(this,e,t,r);case"base64":return S(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const I=4096;function R(e,t,r){let n="";r=Math.min(e.length,r);for(let o=t;o<r;++o)n+=String.fromCharCode(127&e[o]);return n}function N(e,t,r){let n="";r=Math.min(e.length,r);for(let o=t;o<r;++o)n+=String.fromCharCode(e[o]);return n}function D(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let o="";for(let n=t;n<r;++n)o+=J[e[n]];return o}function j(e,t,r){const n=e.slice(t,r);let o="";for(let e=0;e<n.length-1;e+=2)o+=String.fromCharCode(n[e]+256*n[e+1]);return o}function k(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function C(e,t,r,n,o,i){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function M(e,t,r,n,o){H(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,r}function L(e,t,r,n,o){H(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r+7]=i,i>>=8,e[r+6]=i,i>>=8,e[r+5]=i,i>>=8,e[r+4]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=a,a>>=8,e[r+2]=a,a>>=8,e[r+1]=a,a>>=8,e[r]=a,r+8}function x(e,t,r,n,o,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function B(e,t,r,n,i){return t=+t,r>>>=0,i||x(e,0,r,4),o.write(e,t,r,n,23,4),r+4}function F(e,t,r,n,i){return t=+t,r>>>=0,i||x(e,0,r,8),o.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,u.prototype),n},u.prototype.readUintLE=u.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||k(e,t,this.length);let n=this[e],o=1,i=0;for(;++i<t&&(o*=256);)n+=this[e+i]*o;return n},u.prototype.readUintBE=u.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||k(e,t,this.length);let n=this[e+--t],o=1;for(;t>0&&(o*=256);)n+=this[e+--t]*o;return n},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||k(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||k(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||k(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||k(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||k(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readBigUInt64LE=X((function(e){z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,o=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(o)<<BigInt(32))})),u.prototype.readBigUInt64BE=X((function(e){z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],o=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(o)})),u.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||k(e,t,this.length);let n=this[e],o=1,i=0;for(;++i<t&&(o*=256);)n+=this[e+i]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||k(e,t,this.length);let n=t,o=1,i=this[e+--n];for(;n>0&&(o*=256);)i+=this[e+--n]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*t)),i},u.prototype.readInt8=function(e,t){return e>>>=0,t||k(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||k(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){e>>>=0,t||k(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||k(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||k(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readBigInt64LE=X((function(e){z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),u.prototype.readBigInt64BE=X((function(e){z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)})),u.prototype.readFloatLE=function(e,t){return e>>>=0,t||k(e,4,this.length),o.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||k(e,4,this.length),o.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||k(e,8,this.length),o.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||k(e,8,this.length),o.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||C(this,e,t,r,Math.pow(2,8*r)-1,0);let o=1,i=0;for(this[t]=255&e;++i<r&&(o*=256);)this[t+i]=e/o&255;return t+r},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||C(this,e,t,r,Math.pow(2,8*r)-1,0);let o=r-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigUInt64LE=X((function(e){return M(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=X((function(e){return L(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}let o=0,i=1,a=0;for(this[t]=255&e;++o<r&&(i*=256);)e<0&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/i>>0)-a&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}let o=r-1,i=1,a=0;for(this[t+o]=255&e;--o>=0&&(i*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/i>>0)-a&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigInt64LE=X((function(e){return M(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=X((function(e){return L(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(e,t,r){return B(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return B(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return F(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return F(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const o=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),o},u.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let o;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o<r;++o)this[o]=e;else{const i=u.isBuffer(e)?e:u.from(e,n),a=i.length;if(0===a)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<r-t;++o)this[o+t]=i[o%a]}return this};const U={};function P(e,t,r){U[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function W(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function H(e,t,r,n,o,i){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let o;throw o=i>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(i+1)}${n}`:`>= -(2${n} ** ${8*(i+1)-1}${n}) and < 2 ** ${8*(i+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new U.ERR_OUT_OF_RANGE("value",o,e)}!function(e,t,r){z(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||V(t,e.length-(r+1))}(n,o,i)}function z(e,t){if("number"!=typeof e)throw new U.ERR_INVALID_ARG_TYPE(t,"number",e)}function V(e,t,r){if(Math.floor(e)!==e)throw z(e,r),new U.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new U.ERR_BUFFER_OUT_OF_BOUNDS;throw new U.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}P("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),P("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),P("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,o=r;return Number.isInteger(r)&&Math.abs(r)>2**32?o=W(String(r)):"bigint"==typeof r&&(o=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(o=W(o)),o+="n"),n+=` It must be ${t}. Received ${o}`,n}),RangeError);const $=/[^+/0-9A-Za-z-_]/g;function q(e,t){let r;t=t||1/0;const n=e.length;let o=null;const i=[];for(let a=0;a<n;++a){if(r=e.charCodeAt(a),r>55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function G(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace($,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function Y(e,t,r,n){let o;for(o=0;o<n&&!(o+r>=t.length||o>=e.length);++o)t[o+r]=e[o];return o}function Z(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function K(e){return e!=e}const J=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let o=0;o<16;++o)t[n+o]=e[r]+e[o]}return t}();function X(e){return"undefined"==typeof BigInt?Q:e}function Q(){throw new Error("BigInt not supported")}},593:(e,t,r)=>{"use strict";var n=r(7701),o=r(4373),i=o(n("String.prototype.indexOf"));e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&i(e,".prototype.")>-1?o(r):r}},4373:(e,t,r)=>{"use strict";var n=r(3767),o=r(7701),i=o("%Function.prototype.apply%"),a=o("%Function.prototype.call%"),s=o("%Reflect.apply%",!0)||n.call(a,i),u=o("%Object.getOwnPropertyDescriptor%",!0),l=o("%Object.defineProperty%",!0),c=o("%Math.max%");if(l)try{l({},"a",{value:1})}catch(e){l=null}e.exports=function(e){var t=s(n,a,arguments);return u&&l&&u(t,"length").configurable&&l(t,"length",{value:1+c(0,e.length-(arguments.length-1))}),t};var f=function(){return s(n,i,arguments)};l?l(e.exports,"apply",{value:f}):e.exports.apply=f},4366:e=>{var t={utf8:{stringToBytes:function(e){return t.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(t.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var t=[],r=0;r<e.length;r++)t.push(255&e.charCodeAt(r));return t},bytesToString:function(e){for(var t=[],r=0;r<e.length;r++)t.push(String.fromCharCode(e[r]));return t.join("")}}};e.exports=t},2843:e=>{var t,r;t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r={rotl:function(e,t){return e<<t|e>>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&r.rotl(e,8)|4278255360&r.rotl(e,24);for(var t=0;t<e.length;t++)e[t]=r.endian(e[t]);return e},randomBytes:function(e){for(var t=[];e>0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],r=0,n=0;r<e.length;r++,n+=8)t[n>>>5]|=e[r]<<24-n%32;return t},wordsToBytes:function(e){for(var t=[],r=0;r<32*e.length;r+=8)t.push(e[r>>>5]>>>24-r%32&255);return t},bytesToHex:function(e){for(var t=[],r=0;r<e.length;r++)t.push((e[r]>>>4).toString(16)),t.push((15&e[r]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],r=0;r<e.length;r+=2)t.push(parseInt(e.substr(r,2),16));return t},bytesToBase64:function(e){for(var r=[],n=0;n<e.length;n+=3)for(var o=e[n]<<16|e[n+1]<<8|e[n+2],i=0;i<4;i++)8*n+6*i<=8*e.length?r.push(t.charAt(o>>>6*(3-i)&63)):r.push("=");return r.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var r=[],n=0,o=0;n<e.length;o=++n%4)0!=o&&r.push((t.indexOf(e.charAt(n-1))&Math.pow(2,-2*o+8)-1)<<2*o|t.indexOf(e.charAt(n))>>>6-2*o);return r}},e.exports=r},7647:(e,t,r)=>{var n=r(9033).Buffer;e.exports=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;this.size=e,this.length=0,this.buf=n.alloc(e)}prepend(e){if(n.isBuffer(e)){const t=this.length+e.length;if(t>=this.size&&(this.resize(),t>=this.size))throw Error("INVALID_BUFFER_STATE");const r=this.buf;this.buf=n.alloc(this.size),e.copy(this.buf,0),r.copy(this.buf,e.length),this.length+=e.length}else{const t=this.length++;t===this.size&&this.resize();const r=this.clone();this.buf[0]=e,r.copy(this.buf,1,0,t)}}append(e){const t=this.length++;t===this.size&&this.resize(),this.buf[t]=e}clone(){return n.from(this.buf.slice(0,this.length))}resize(){const e=this.length;this.size=2*this.size;const t=n.alloc(this.size);this.buf.copy(t,0,0,e),this.buf=t}toString(e){return e?this.buf.slice(0,this.length).toString(e):Uint8Array.prototype.slice.call(this.buf.slice(0,this.length))}toJSON(){return this.toString("utf8")}reset(){this.length=0}}},7182:(e,t,r)=>{var n=r(9033).Buffer;const{Transform:o}=r(7245),i=r(7647),a={utf8:n.from([239,187,191]),utf16le:n.from([255,254])};class s extends o{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super({readableObjectMode:!0,...e,encoding:null}),this.__originalOptions=e,this.__normalizeOptions(e)}__normalizeOptions(e){const t={};for(let r in e)t[c(r)]=e[r];if(void 0===t.encoding||!0===t.encoding)t.encoding="utf8";else if(null===t.encoding||!1===t.encoding)t.encoding=null;else if("string"!=typeof t.encoding&&null!==t.encoding)throw new l("CSV_INVALID_OPTION_ENCODING",["Invalid option encoding:","encoding must be a string or null to return a buffer,",`got ${JSON.stringify(t.encoding)}`],t);if(void 0===t.bom||null===t.bom||!1===t.bom)t.bom=!1;else if(!0!==t.bom)throw new l("CSV_INVALID_OPTION_BOM",["Invalid option bom:","bom must be true,",`got ${JSON.stringify(t.bom)}`],t);let r=null;if(void 0===t.cast||null===t.cast||!1===t.cast||""===t.cast)t.cast=void 0;else if("function"==typeof t.cast)r=t.cast,t.cast=!0;else if(!0!==t.cast)throw new l("CSV_INVALID_OPTION_CAST",["Invalid option cast:","cast must be true or a function,",`got ${JSON.stringify(t.cast)}`],t);if(void 0===t.cast_date||null===t.cast_date||!1===t.cast_date||""===t.cast_date)t.cast_date=!1;else{if(!0!==t.cast_date)throw new l("CSV_INVALID_OPTION_CAST_DATE",["Invalid option cast_date:","cast_date must be true or a function,",`got ${JSON.stringify(t.cast_date)}`],t);t.cast_date=function(e){const t=Date.parse(e);return isNaN(t)?e:new Date(t)}}let o=null;if(!0===t.columns)o=void 0;else if("function"==typeof t.columns)o=t.columns,t.columns=!0;else if(Array.isArray(t.columns))t.columns=g(t.columns);else{if(void 0!==t.columns&&null!==t.columns&&!1!==t.columns)throw new l("CSV_INVALID_OPTION_COLUMNS",["Invalid option columns:","expect an array, a function or true,",`got ${JSON.stringify(t.columns)}`],t);t.columns=!1}if(void 0===t.columns_duplicates_to_array||null===t.columns_duplicates_to_array||!1===t.columns_duplicates_to_array)t.columns_duplicates_to_array=!1;else{if(!0!==t.columns_duplicates_to_array)throw new l("CSV_INVALID_OPTION_COLUMNS_DUPLICATES_TO_ARRAY",["Invalid option columns_duplicates_to_array:","expect an boolean,",`got ${JSON.stringify(t.columns_duplicates_to_array)}`],t);if(!1===t.columns)throw new l("CSV_INVALID_OPTION_COLUMNS_DUPLICATES_TO_ARRAY",["Invalid option columns_duplicates_to_array:","the `columns` mode must be activated."],t)}if(void 0===t.comment||null===t.comment||!1===t.comment||""===t.comment)t.comment=null;else if("string"==typeof t.comment&&(t.comment=n.from(t.comment,t.encoding)),!n.isBuffer(t.comment))throw new l("CSV_INVALID_OPTION_COMMENT",["Invalid option comment:","comment must be a buffer or a string,",`got ${JSON.stringify(t.comment)}`],t);const a=JSON.stringify(t.delimiter);if(Array.isArray(t.delimiter)||(t.delimiter=[t.delimiter]),0===t.delimiter.length)throw new l("CSV_INVALID_OPTION_DELIMITER",["Invalid option delimiter:","delimiter must be a non empty string or buffer or array of string|buffer,",`got ${a}`],t);if(t.delimiter=t.delimiter.map((function(e){if(null==e||!1===e)return n.from(",",t.encoding);if("string"==typeof e&&(e=n.from(e,t.encoding)),!n.isBuffer(e)||0===e.length)throw new l("CSV_INVALID_OPTION_DELIMITER",["Invalid option delimiter:","delimiter must be a non empty string or buffer or array of string|buffer,",`got ${a}`],t);return e})),void 0===t.escape||!0===t.escape?t.escape=n.from('"',t.encoding):"string"==typeof t.escape?t.escape=n.from(t.escape,t.encoding):null!==t.escape&&!1!==t.escape||(t.escape=null),null!==t.escape&&!n.isBuffer(t.escape))throw new Error(`Invalid Option: escape must be a buffer, a string or a boolean, got ${JSON.stringify(t.escape)}`);if(void 0===t.from||null===t.from)t.from=1;else{if("string"==typeof t.from&&/\d+/.test(t.from)&&(t.from=parseInt(t.from)),!Number.isInteger(t.from))throw new Error(`Invalid Option: from must be an integer, got ${JSON.stringify(t.from)}`);if(t.from<0)throw new Error(`Invalid Option: from must be a positive integer, got ${JSON.stringify(e.from)}`)}if(void 0===t.from_line||null===t.from_line)t.from_line=1;else{if("string"==typeof t.from_line&&/\d+/.test(t.from_line)&&(t.from_line=parseInt(t.from_line)),!Number.isInteger(t.from_line))throw new Error(`Invalid Option: from_line must be an integer, got ${JSON.stringify(e.from_line)}`);if(t.from_line<=0)throw new Error(`Invalid Option: from_line must be a positive integer greater than 0, got ${JSON.stringify(e.from_line)}`)}if(void 0===t.ignore_last_delimiters||null===t.ignore_last_delimiters)t.ignore_last_delimiters=!1;else if("number"==typeof t.ignore_last_delimiters)t.ignore_last_delimiters=Math.floor(t.ignore_last_delimiters),0===t.ignore_last_delimiters&&(t.ignore_last_delimiters=!1);else if("boolean"!=typeof t.ignore_last_delimiters)throw new l("CSV_INVALID_OPTION_IGNORE_LAST_DELIMITERS",["Invalid option `ignore_last_delimiters`:","the value must be a boolean value or an integer,",`got ${JSON.stringify(t.ignore_last_delimiters)}`],t);if(!0===t.ignore_last_delimiters&&!1===t.columns)throw new l("CSV_IGNORE_LAST_DELIMITERS_REQUIRES_COLUMNS",["The option `ignore_last_delimiters`","requires the activation of the `columns` option"],t);if(void 0===t.info||null===t.info||!1===t.info)t.info=!1;else if(!0!==t.info)throw new Error(`Invalid Option: info must be true, got ${JSON.stringify(t.info)}`);if(void 0===t.max_record_size||null===t.max_record_size||!1===t.max_record_size)t.max_record_size=0;else if(Number.isInteger(t.max_record_size)&&t.max_record_size>=0);else{if("string"!=typeof t.max_record_size||!/\d+/.test(t.max_record_size))throw new Error(`Invalid Option: max_record_size must be a positive integer, got ${JSON.stringify(t.max_record_size)}`);t.max_record_size=parseInt(t.max_record_size)}if(void 0===t.objname||null===t.objname||!1===t.objname)t.objname=void 0;else if(n.isBuffer(t.objname)){if(0===t.objname.length)throw new Error("Invalid Option: objname must be a non empty buffer");null===t.encoding||(t.objname=t.objname.toString(t.encoding))}else{if("string"!=typeof t.objname)throw new Error(`Invalid Option: objname must be a string or a buffer, got ${t.objname}`);if(0===t.objname.length)throw new Error("Invalid Option: objname must be a non empty string")}if(void 0===t.on_record||null===t.on_record)t.on_record=void 0;else if("function"!=typeof t.on_record)throw new l("CSV_INVALID_OPTION_ON_RECORD",["Invalid option `on_record`:","expect a function,",`got ${JSON.stringify(t.on_record)}`],t);if(null===t.quote||!1===t.quote||""===t.quote)t.quote=null;else if(void 0===t.quote||!0===t.quote?t.quote=n.from('"',t.encoding):"string"==typeof t.quote&&(t.quote=n.from(t.quote,t.encoding)),!n.isBuffer(t.quote))throw new Error(`Invalid Option: quote must be a buffer or a string, got ${JSON.stringify(t.quote)}`);if(void 0===t.raw||null===t.raw||!1===t.raw)t.raw=!1;else if(!0!==t.raw)throw new Error(`Invalid Option: raw must be true, got ${JSON.stringify(t.raw)}`);if(t.record_delimiter?Array.isArray(t.record_delimiter)||(t.record_delimiter=[t.record_delimiter]):t.record_delimiter=[],t.record_delimiter=t.record_delimiter.map((function(e){return"string"==typeof e&&(e=n.from(e,t.encoding)),e})),"boolean"==typeof t.relax);else{if(void 0!==t.relax&&null!==t.relax)throw new Error(`Invalid Option: relax must be a boolean, got ${JSON.stringify(t.relax)}`);t.relax=!1}if("boolean"==typeof t.relax_column_count);else{if(void 0!==t.relax_column_count&&null!==t.relax_column_count)throw new Error(`Invalid Option: relax_column_count must be a boolean, got ${JSON.stringify(t.relax_column_count)}`);t.relax_column_count=!1}if("boolean"==typeof t.relax_column_count_less);else{if(void 0!==t.relax_column_count_less&&null!==t.relax_column_count_less)throw new Error(`Invalid Option: relax_column_count_less must be a boolean, got ${JSON.stringify(t.relax_column_count_less)}`);t.relax_column_count_less=!1}if("boolean"==typeof t.relax_column_count_more);else{if(void 0!==t.relax_column_count_more&&null!==t.relax_column_count_more)throw new Error(`Invalid Option: relax_column_count_more must be a boolean, got ${JSON.stringify(t.relax_column_count_more)}`);t.relax_column_count_more=!1}if("boolean"==typeof t.skip_empty_lines);else{if(void 0!==t.skip_empty_lines&&null!==t.skip_empty_lines)throw new Error(`Invalid Option: skip_empty_lines must be a boolean, got ${JSON.stringify(t.skip_empty_lines)}`);t.skip_empty_lines=!1}if("boolean"==typeof t.skip_lines_with_empty_values);else{if(void 0!==t.skip_lines_with_empty_values&&null!==t.skip_lines_with_empty_values)throw new Error(`Invalid Option: skip_lines_with_empty_values must be a boolean, got ${JSON.stringify(t.skip_lines_with_empty_values)}`);t.skip_lines_with_empty_values=!1}if("boolean"==typeof t.skip_lines_with_error);else{if(void 0!==t.skip_lines_with_error&&null!==t.skip_lines_with_error)throw new Error(`Invalid Option: skip_lines_with_error must be a boolean, got ${JSON.stringify(t.skip_lines_with_error)}`);t.skip_lines_with_error=!1}if(void 0===t.rtrim||null===t.rtrim||!1===t.rtrim)t.rtrim=!1;else if(!0!==t.rtrim)throw new Error(`Invalid Option: rtrim must be a boolean, got ${JSON.stringify(t.rtrim)}`);if(void 0===t.ltrim||null===t.ltrim||!1===t.ltrim)t.ltrim=!1;else if(!0!==t.ltrim)throw new Error(`Invalid Option: ltrim must be a boolean, got ${JSON.stringify(t.ltrim)}`);if(void 0===t.trim||null===t.trim||!1===t.trim)t.trim=!1;else if(!0!==t.trim)throw new Error(`Invalid Option: trim must be a boolean, got ${JSON.stringify(t.trim)}`);if(!0===t.trim&&!1!==e.ltrim?t.ltrim=!0:!0!==t.ltrim&&(t.ltrim=!1),!0===t.trim&&!1!==e.rtrim?t.rtrim=!0:!0!==t.rtrim&&(t.rtrim=!1),void 0===t.to||null===t.to)t.to=-1;else{if("string"==typeof t.to&&/\d+/.test(t.to)&&(t.to=parseInt(t.to)),!Number.isInteger(t.to))throw new Error(`Invalid Option: to must be an integer, got ${JSON.stringify(e.to)}`);if(t.to<=0)throw new Error(`Invalid Option: to must be a positive integer greater than 0, got ${JSON.stringify(e.to)}`)}if(void 0===t.to_line||null===t.to_line)t.to_line=-1;else{if("string"==typeof t.to_line&&/\d+/.test(t.to_line)&&(t.to_line=parseInt(t.to_line)),!Number.isInteger(t.to_line))throw new Error(`Invalid Option: to_line must be an integer, got ${JSON.stringify(e.to_line)}`);if(t.to_line<=0)throw new Error(`Invalid Option: to_line must be a positive integer greater than 0, got ${JSON.stringify(e.to_line)}`)}this.info={bytes:0,comment_lines:0,empty_lines:0,invalid_field_length:0,lines:1,records:0},this.options=t,this.state={bomSkipped:!1,bufBytesStart:0,castField:r,commenting:!1,error:void 0,enabled:1===t.from_line,escaping:!1,escapeIsQuote:n.isBuffer(t.escape)&&n.isBuffer(t.quote)&&0===n.compare(t.escape,t.quote),expectedRecordLength:Array.isArray(t.columns)?t.columns.length:void 0,field:new i(20),firstLineToHeaders:o,needMoreDataSize:Math.max(null!==t.comment?t.comment.length:0,...t.delimiter.map((e=>e.length)),null!==t.quote?t.quote.length:0),previousBuf:void 0,quoting:!1,stop:!1,rawBuffer:new i(100),record:[],recordHasError:!1,record_length:0,recordDelimiterMaxLength:0===t.record_delimiter.length?2:Math.max(...t.record_delimiter.map((e=>e.length))),trimChars:[n.from(" ",t.encoding)[0],n.from("\t",t.encoding)[0]],wasQuoting:!1,wasRowDelimiter:!1}}_transform(e,t,r){if(!0===this.state.stop)return;const n=this.__parse(e,!1);void 0!==n&&(this.state.stop=!0),r(n)}_flush(e){!0!==this.state.stop&&e(this.__parse(void 0,!0))}__parse(e,t){const{bom:r,comment:o,escape:i,from_line:s,ltrim:u,max_record_size:c,quote:f,raw:d,relax:g,rtrim:p,skip_empty_lines:h,to:y,to_line:m}=this.options;let{record_delimiter:b}=this.options;const{bomSkipped:_,previousBuf:w,rawBuffer:E,escapeIsQuote:v}=this.state;let S;if(void 0===w){if(void 0===e)return void this.push(null);S=e}else S=void 0!==w&&void 0===e?w:n.concat([w,e]);if(!1===_)if(!1===r)this.state.bomSkipped=!0;else if(S.length<3){if(!1===t)return void(this.state.previousBuf=S)}else{for(let e in a)if(0===a[e].compare(S,0,a[e].length)){let t=a[e].length;this.state.bufBytesStart+=t,S=S.slice(t),this.__normalizeOptions({...this.__originalOptions,encoding:e});break}this.state.bomSkipped=!0}const T=S.length;let O;for(O=0;O<T&&!this.__needMoreData(O,T,t);O++){if(!0===this.state.wasRowDelimiter&&(this.info.lines++,this.state.wasRowDelimiter=!1),-1!==m&&this.info.lines>m)return this.state.stop=!0,void this.push(null);!1===this.state.quoting&&0===b.length&&this.__autoDiscoverRecordDelimiter(S,O)&&(b=this.options.record_delimiter);const e=S[O];if(!0===d&&E.append(e),13!==e&&10!==e||!1!==this.state.wasRowDelimiter||(this.state.wasRowDelimiter=!0),!0===this.state.escaping)this.state.escaping=!1;else{if(null!==i&&!0===this.state.quoting&&this.__isEscape(S,O,e)&&O+i.length<T){if(!v){this.state.escaping=!0,O+=i.length-1;continue}if(this.__isQuote(S,O+i.length)){this.state.escaping=!0,O+=i.length-1;continue}}if(!1===this.state.commenting&&this.__isQuote(S,O))if(!0===this.state.quoting){const t=S[O+f.length],r=p&&this.__isCharTrimable(t),n=null!==o&&this.__compareBytes(o,S,O+f.length,t),a=this.__isDelimiter(S,O+f.length,t),s=0===b.length?this.__autoDiscoverRecordDelimiter(S,O+f.length):this.__isRecordDelimiter(t,S,O+f.length);if(null!==i&&this.__isEscape(S,O,e)&&this.__isQuote(S,O+i.length))O+=i.length-1;else{if(!t||a||s||n||r){this.state.quoting=!1,this.state.wasQuoting=!0,O+=f.length-1;continue}if(!1===g){const e=this.__error(new l("CSV_INVALID_CLOSING_QUOTE",["Invalid Closing Quote:",`got "${String.fromCharCode(t)}"`,`at line ${this.info.lines}`,"instead of delimiter, record delimiter, trimable character","(if activated) or comment"],this.options,this.__infoField()));if(void 0!==e)return e}else this.state.quoting=!1,this.state.wasQuoting=!0,this.state.field.prepend(f),O+=f.length-1}}else{if(0===this.state.field.length){this.state.quoting=!0,O+=f.length-1;continue}if(!1===g){const e=this.__error(new l("INVALID_OPENING_QUOTE",["Invalid Opening Quote:",`a quote is found inside a field at line ${this.info.lines}`],this.options,this.__infoField(),{field:this.state.field}));if(void 0!==e)return e}}if(!1===this.state.quoting){let t=this.__isRecordDelimiter(e,S,O);if(0!==t){if(this.state.commenting&&!1===this.state.wasQuoting&&0===this.state.record.length&&0===this.state.field.length)this.info.comment_lines++;else{if(!1===this.state.enabled&&this.info.lines+(!0===this.state.wasRowDelimiter?1:0)>=s){this.state.enabled=!0,this.__resetField(),this.__resetRecord(),O+=t-1;continue}if(!0===h&&!1===this.state.wasQuoting&&0===this.state.record.length&&0===this.state.field.length){this.info.empty_lines++,O+=t-1;continue}this.info.bytes=this.state.bufBytesStart+O;const e=this.__onField();if(void 0!==e)return e;this.info.bytes=this.state.bufBytesStart+O+t;const r=this.__onRecord();if(void 0!==r)return r;if(-1!==y&&this.info.records>=y)return this.state.stop=!0,void this.push(null)}this.state.commenting=!1,O+=t-1;continue}if(this.state.commenting)continue;if(0!==(null===o?0:this.__compareBytes(o,S,O,e))){this.state.commenting=!0;continue}let r=this.__isDelimiter(S,O,e);if(0!==r){this.info.bytes=this.state.bufBytesStart+O;const e=this.__onField();if(void 0!==e)return e;O+=r-1;continue}}}if(!1===this.state.commenting&&0!==c&&this.state.record_length+this.state.field.length>c){const e=this.__error(new l("CSV_MAX_RECORD_SIZE",["Max Record Size:","record exceed the maximum number of tolerated bytes",`of ${c}`,`at line ${this.info.lines}`],this.options,this.__infoField()));if(void 0!==e)return e}const t=!1===u||!0===this.state.quoting||0!==this.state.field.length||!this.__isCharTrimable(e),r=!1===p||!1===this.state.wasQuoting;if(!0===t&&!0===r)this.state.field.append(e);else if(!0===p&&!this.__isCharTrimable(e)){const e=this.__error(new l("CSV_NON_TRIMABLE_CHAR_AFTER_CLOSING_QUOTE",["Invalid Closing Quote:","found non trimable byte after quote",`at line ${this.info.lines}`],this.options,this.__infoField()));if(void 0!==e)return e}}if(!0===t)if(!0===this.state.quoting){const e=this.__error(new l("CSV_QUOTE_NOT_CLOSED",["Quote Not Closed:",`the parsing is finished with an opening quote at line ${this.info.lines}`],this.options,this.__infoField()));if(void 0!==e)return e}else if(!0===this.state.wasQuoting||0!==this.state.record.length||0!==this.state.field.length){this.info.bytes=this.state.bufBytesStart+O;const e=this.__onField();if(void 0!==e)return e;const t=this.__onRecord();if(void 0!==t)return t}else!0===this.state.wasRowDelimiter?this.info.empty_lines++:!0===this.state.commenting&&this.info.comment_lines++;else this.state.bufBytesStart+=O,this.state.previousBuf=S.slice(O);!0===this.state.wasRowDelimiter&&(this.info.lines++,this.state.wasRowDelimiter=!1)}__onRecord(){const{columns:e,columns_duplicates_to_array:t,encoding:r,info:n,from:o,relax_column_count:i,relax_column_count_less:a,relax_column_count_more:s,raw:u,skip_lines_with_empty_values:c}=this.options,{enabled:f,record:g}=this.state;if(!1===f)return this.__resetRecord();const p=g.length;if(!0===e)return!0===c&&d(g)?void this.__resetRecord():this.__firstLineToColumns(g);if(!1===e&&0===this.info.records&&(this.state.expectedRecordLength=p),p!==this.state.expectedRecordLength){const t=!1===e?new l("CSV_INCONSISTENT_RECORD_LENGTH",["Invalid Record Length:",`expect ${this.state.expectedRecordLength},`,`got ${p} on line ${this.info.lines}`],this.options,this.__infoField(),{record:g}):new l("CSV_RECORD_DONT_MATCH_COLUMNS_LENGTH",["Invalid Record Length:",`columns length is ${e.length},`,`got ${p} on line ${this.info.lines}`],this.options,this.__infoField(),{record:g});if(!0===i||!0===a&&p<this.state.expectedRecordLength||!0===s&&p>this.state.expectedRecordLength)this.info.invalid_field_length++,this.state.error=t;else{const e=this.__error(t);if(e)return e}}if(!0===c&&d(g))this.__resetRecord();else{if(!0===this.state.recordHasError)return this.__resetRecord(),void(this.state.recordHasError=!1);if(this.info.records++,1===o||this.info.records>=o)if(!1!==e){const o={};for(let r=0,n=g.length;r<n;r++)void 0===e[r]||e[r].disabled||(!0===t&&void 0!==o[e[r].name]?Array.isArray(o[e[r].name])?o[e[r].name]=o[e[r].name].concat(g[r]):o[e[r].name]=[o[e[r].name],g[r]]:o[e[r].name]=g[r]);const{objname:i}=this.options;if(void 0===i)if(!0===u||!0===n){const e=this.__push(Object.assign({record:o},!0===u?{raw:this.state.rawBuffer.toString(r)}:{},!0===n?{info:this.__infoRecord()}:{}));if(e)return e}else{const e=this.__push(o);if(e)return e}else if(!0===u||!0===n){const e=this.__push(Object.assign({record:[o[i],o]},!0===u?{raw:this.state.rawBuffer.toString(r)}:{},!0===n?{info:this.__infoRecord()}:{}));if(e)return e}else{const e=this.__push([o[i],o]);if(e)return e}}else if(!0===u||!0===n){const e=this.__push(Object.assign({record:g},!0===u?{raw:this.state.rawBuffer.toString(r)}:{},!0===n?{info:this.__infoRecord()}:{}));if(e)return e}else{const e=this.__push(g);if(e)return e}this.__resetRecord()}}__firstLineToColumns(e){const{firstLineToHeaders:t}=this.state;try{const r=void 0===t?e:t.call(null,e);if(!Array.isArray(r))return this.__error(new l("CSV_INVALID_COLUMN_MAPPING",["Invalid Column Mapping:","expect an array from column function,",`got ${JSON.stringify(r)}`],this.options,this.__infoField(),{headers:r}));const n=g(r);return this.state.expectedRecordLength=n.length,this.options.columns=n,void this.__resetRecord()}catch(e){return e}}__resetRecord(){!0===this.options.raw&&this.state.rawBuffer.reset(),this.state.error=void 0,this.state.record=[],this.state.record_length=0}__onField(){const{cast:e,encoding:t,rtrim:r,max_record_size:n}=this.options,{enabled:o,wasQuoting:i}=this.state;if(!1===o)return this.__resetField();let a=this.state.field.toString(t);if(!0===r&&!1===i&&(a=a.trimRight()),!0===e){const[e,t]=this.__cast(a);if(void 0!==e)return e;a=t}this.state.record.push(a),0!==n&&"string"==typeof a&&(this.state.record_length+=a.length),this.__resetField()}__resetField(){this.state.field.reset(),this.state.wasQuoting=!1}__push(e){const{on_record:t}=this.options;if(void 0!==t){const r=this.__infoRecord();try{e=t.call(null,e,r)}catch(e){return e}if(null==e)return}this.push(e)}__cast(e){const{columns:t,relax_column_count:r}=this.options;if(!0===Array.isArray(t)&&r&&this.options.columns.length<=this.state.record.length)return[void 0,void 0];if(null!==this.state.castField)try{const t=this.__infoField();return[void 0,this.state.castField.call(null,e,t)]}catch(e){return[e]}if(this.__isFloat(e))return[void 0,parseFloat(e)];if(!1!==this.options.cast_date){const t=this.__infoField();return[void 0,this.options.cast_date.call(null,e,t)]}return[void 0,e]}__isCharTrimable(e){return 32===e||9===e||13===e||10===e||12===e}__isFloat(e){return e-parseFloat(e)+1>=0}__compareBytes(e,t,r,n){if(e[0]!==n)return 0;const o=e.length;for(let n=1;n<o;n++)if(e[n]!==t[r+n])return 0;return o}__needMoreData(e,t,r){if(r)return!1;const{quote:n}=this.options,{quoting:o,needMoreDataSize:i,recordDelimiterMaxLength:a}=this.state;return t-e-1<Math.max(i,a,o?n.length+a:0)}__isDelimiter(e,t,r){const{delimiter:n,ignore_last_delimiters:o}=this.options;if(!0===o&&this.state.record.length===this.options.columns.length-1)return 0;if(!1!==o&&"number"==typeof o&&this.state.record.length===o-1)return 0;e:for(let o=0;o<n.length;o++){const i=n[o];if(i[0]===r){for(let r=1;r<i.length;r++)if(i[r]!==e[t+r])continue e;return i.length}}return 0}__isRecordDelimiter(e,t,r){const{record_delimiter:n}=this.options,o=n.length;e:for(let i=0;i<o;i++){const o=n[i],a=o.length;if(o[0]===e){for(let e=1;e<a;e++)if(o[e]!==t[r+e])continue e;return o.length}}return 0}__isEscape(e,t,r){const{escape:n}=this.options;if(null===n)return!1;const o=n.length;if(n[0]===r){for(let r=0;r<o;r++)if(n[r]!==e[t+r])return!1;return!0}return!1}__isQuote(e,t){const{quote:r}=this.options;if(null===r)return!1;const n=r.length;for(let o=0;o<n;o++)if(r[o]!==e[t+o])return!1;return!0}__autoDiscoverRecordDelimiter(e,t){const{encoding:r}=this.options,o=e[t];return 13===o?10===e[t+1]?(this.options.record_delimiter.push(n.from("\r\n",r)),this.state.recordDelimiterMaxLength=2,2):(this.options.record_delimiter.push(n.from("\r",r)),this.state.recordDelimiterMaxLength=1,1):10===o?(this.options.record_delimiter.push(n.from("\n",r)),this.state.recordDelimiterMaxLength=1,1):0}__error(e){const{skip_lines_with_error:t}=this.options,r="string"==typeof e?new Error(e):e;return t?(this.state.recordHasError=!0,void this.emit("skip",r)):r}__infoDataSet(){return{...this.info,columns:this.options.columns}}__infoRecord(){const{columns:e}=this.options;return{...this.__infoDataSet(),error:this.state.error,header:!0===e,index:this.state.record.length}}__infoField(){const{columns:e}=this.options,t=Array.isArray(e);return{...this.__infoRecord(),column:!0===t?e.length>this.state.record.length?e[this.state.record.length].name:null:this.state.record.length,quoting:this.state.wasQuoting}}}const u=function(){let e,t,r;for(let o in arguments){const i=arguments[o],a=typeof i;if(void 0!==e||"string"!=typeof i&&!n.isBuffer(i))if(void 0===t&&f(i))t=i;else{if(void 0!==r||"function"!==a)throw new l("CSV_INVALID_ARGUMENT",["Invalid argument:",`got ${JSON.stringify(i)} at index ${o}`],t||{});r=i}else e=i}const o=new s(t);if(r){const e=void 0===t||void 0===t.objname?[]:{};o.on("readable",(function(){let r;for(;null!==(r=this.read());)void 0===t||void 0===t.objname?e.push(r):e[r[0]]=r[1]})),o.on("error",(function(e){r(e,void 0,o.__infoDataSet())})),o.on("end",(function(){r(void 0,e,o.__infoDataSet())}))}return void 0!==e&&("function"==typeof setImmediate?setImmediate((function(){o.write(e),o.end()})):(o.write(e),o.end())),o};class l extends Error{constructor(e,t,r){Array.isArray(t)&&(t=t.join(" ")),super(t),void 0!==Error.captureStackTrace&&Error.captureStackTrace(this,l),this.code=e;for(var o=arguments.length,i=new Array(o>3?o-3:0),a=3;a<o;a++)i[a-3]=arguments[a];for(const e of i)for(const t in e){const o=e[t];this[t]=n.isBuffer(o)?o.toString(r.encoding):null==o?o:JSON.parse(JSON.stringify(o))}}}u.Parser=s,u.CsvError=l,e.exports=u;const c=function(e){return e.replace(/([A-Z])/g,(function(e,t){return"_"+t.toLowerCase()}))},f=function(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)},d=function(e){return e.every((e=>null==e||e.toString&&""===e.toString().trim()))},g=function(e){const t=[];for(let r=0,n=e.length;r<n;r++){const n=e[r];if(null==n||!1===n)t[r]={disabled:!0};else if("string"==typeof n)t[r]={name:n};else{if(!f(n))throw new l("CSV_INVALID_COLUMN_DEFINITION",["Invalid column definition:","expect a string or a literal object,",`got ${JSON.stringify(n)} at position ${r}`]);if("string"!=typeof n.name)throw new l("CSV_OPTION_COLUMNS_MISSING_NAME",["Option columns missing name:",`property "name" is required at position ${r}`,"when column is an object literal"]);t[r]=n}}return t}},2616:(e,t,r)=>{var n=r(9033).Buffer;const o=r(7182);e.exports=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"string"==typeof e&&(e=n.from(e));const r=t&&t.objname?{}:[],i=new o.Parser(t);i.push=function(e){null!==e&&(void 0===t.objname?r.push(e):r[e[0]]=e[1])};const a=i.__parse(e,!1);if(void 0!==a)throw a;const s=i.__parse(void 0,!0);if(void 0!==s)throw s;return r}},2193:(e,t,r)=>{var n=r(9033).Buffer;const{Transform:o}=r(7245),a=n.from([239,187,191]);class s extends o{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super({writableObjectMode:!0,...e});const t={};let r;for(let r in e)t[f(r)]=e[r];if(r=this.normalize(t))throw r;switch(t.record_delimiter){case"auto":t.record_delimiter=null;break;case"unix":t.record_delimiter="\n";break;case"mac":t.record_delimiter="\r";break;case"windows":t.record_delimiter="\r\n";break;case"ascii":t.record_delimiter="";break;case"unicode":t.record_delimiter="\u2028"}this.options=t,this.state={stop:!1},this.info={records:0}}normalize(e){if(void 0===e.bom||null===e.bom||!1===e.bom)e.bom=!1;else if(!0!==e.bom)return new l("CSV_OPTION_BOOLEAN_INVALID_TYPE",["option `bom` is optional and must be a boolean value,",`got ${JSON.stringify(e.bom)}`]);if(void 0===e.delimiter||null===e.delimiter)e.delimiter=",";else if(n.isBuffer(e.delimiter))e.delimiter=e.delimiter.toString();else if("string"!=typeof e.delimiter)return new l("CSV_OPTION_DELIMITER_INVALID_TYPE",["option `delimiter` must be a buffer or a string,",`got ${JSON.stringify(e.delimiter)}`]);if(void 0===e.quote||null===e.quote)e.quote='"';else if(!0===e.quote)e.quote='"';else if(!1===e.quote)e.quote="";else if(n.isBuffer(e.quote))e.quote=e.quote.toString();else if("string"!=typeof e.quote)return new l("CSV_OPTION_QUOTE_INVALID_TYPE",["option `quote` must be a boolean, a buffer or a string,",`got ${JSON.stringify(e.quote)}`]);if(void 0!==e.quoted&&null!==e.quoted||(e.quoted=!1),void 0!==e.quoted_empty&&null!==e.quoted_empty||(e.quoted_empty=void 0),void 0===e.quoted_match||null===e.quoted_match||!1===e.quoted_match?e.quoted_match=null:Array.isArray(e.quoted_match)||(e.quoted_match=[e.quoted_match]),e.quoted_match)for(let t of e.quoted_match){const e=t instanceof RegExp;if("string"!=typeof t&&!e)return Error(`Invalid Option: quoted_match must be a string or a regex, got ${JSON.stringify(t)}`)}if(void 0!==e.quoted_string&&null!==e.quoted_string||(e.quoted_string=!1),void 0!==e.eof&&null!==e.eof||(e.eof=!0),void 0===e.escape||null===e.escape)e.escape='"';else if(n.isBuffer(e.escape))e.escape=e.escape.toString();else if("string"!=typeof e.escape)return Error(`Invalid Option: escape must be a buffer or a string, got ${JSON.stringify(e.escape)}`);if(e.escape.length>1)return Error(`Invalid Option: escape must be one character, got ${e.escape.length} characters`);if(void 0!==e.header&&null!==e.header||(e.header=!1),e.columns=this.normalize_columns(e.columns),void 0!==e.quoted&&null!==e.quoted||(e.quoted=!1),void 0!==e.cast&&null!==e.cast||(e.cast={}),void 0!==e.cast.bigint&&null!==e.cast.bigint||(e.cast.bigint=e=>""+e),void 0!==e.cast.boolean&&null!==e.cast.boolean||(e.cast.boolean=e=>e?"1":""),void 0!==e.cast.date&&null!==e.cast.date||(e.cast.date=e=>""+e.getTime()),void 0!==e.cast.number&&null!==e.cast.number||(e.cast.number=e=>""+e),void 0!==e.cast.object&&null!==e.cast.object||(e.cast.object=e=>JSON.stringify(e)),void 0!==e.cast.string&&null!==e.cast.string||(e.cast.string=function(e){return e}),void 0===e.record_delimiter||null===e.record_delimiter)e.record_delimiter="\n";else if(n.isBuffer(e.record_delimiter))e.record_delimiter=e.record_delimiter.toString();else if("string"!=typeof e.record_delimiter)return Error(`Invalid Option: record_delimiter must be a buffer or a string, got ${JSON.stringify(e.record_delimiter)}`)}_transform(e,t,r){if(!0===this.state.stop)return;if(!Array.isArray(e)&&"object"!=typeof e)return this.state.stop=!0,r(Error(`Invalid Record: expect an array or an object, got ${JSON.stringify(e)}`));if(0===this.info.records)if(Array.isArray(e)){if(!0===this.options.header&&!this.options.columns)return this.state.stop=!0,r(Error("Undiscoverable Columns: header option requires column option or object records"))}else void 0!==this.options.columns&&null!==this.options.columns||(this.options.columns=this.normalize_columns(Object.keys(e)));0===this.info.records&&(this.bom(),this.headers());try{this.emit("record",e,this.info.records)}catch(e){return this.state.stop=!0,this.emit("error",e)}let n;if(this.options.eof){if(n=this.stringify(e),void 0===n)return;n+=this.options.record_delimiter}else{if(n=this.stringify(e),void 0===n)return;(this.options.header||this.info.records)&&(n=this.options.record_delimiter+n)}this.info.records++,this.push(n),r()}_flush(e){0===this.info.records&&(this.bom(),this.headers()),e()}stringify(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("object"!=typeof e)return e;const{columns:r,header:n}=this.options,o=[];if(Array.isArray(e)){r&&e.splice(r.length);for(let r=0;r<e.length;r++){const n=e[r],[i,a]=this.__cast(n,{index:r,column:r,records:this.info.records,header:t});if(i)return void this.emit("error",i);o[r]=[a,n]}}else if(r)for(let n=0;n<r.length;n++){const i=_(e,r[n].key),[a,s]=this.__cast(i,{index:n,column:r[n].key,records:this.info.records,header:t});if(a)return void this.emit("error",a);o[n]=[s,i]}else for(let n of e){const a=e[n],[s,u]=this.__cast(a,{index:i,column:r[i].key,records:this.info.records,header:t});if(s)return void this.emit("error",s);o.push([u,a])}let a="";for(let e=0;e<o.length;e++){let t,r,[n,i]=o[e];if("string"==typeof n)t=this.options;else if(c(n)){if(t=n,n=t.value,delete t.value,"string"!=typeof n&&null!=n)return void this.emit("error",Error(`Invalid Casting Value: returned value must return a string, null or undefined, got ${JSON.stringify(n)}`));if(t={...this.options,...t},r=this.normalize(t))return void this.emit("error",r)}else{if(null!=n)return void this.emit("error",Error(`Invalid Casting Value: returned value must return a string, an object, null or undefined, got ${JSON.stringify(n)}`));t=this.options}const{delimiter:s,escape:u,quote:l,quoted:f,quoted_empty:d,quoted_string:g,quoted_match:p,record_delimiter:h}=t;if(n){if("string"!=typeof n)return this.emit("error",Error(`Formatter must return a string, null or undefined, got ${JSON.stringify(n)}`)),null;const e=s.length&&n.indexOf(s)>=0,t=""!==l&&n.indexOf(l)>=0,r=n.indexOf(u)>=0&&u!==l,o=n.indexOf(h)>=0,c=g&&"string"==typeof i;let d=p&&p.filter((e=>"string"==typeof e?-1!==n.indexOf(e):e.test(n)));d=d&&d.length>0;const y=!0===t||e||o||f||c||d;if(!0===y&&!0===r){const e="\\"===u?new RegExp(u+u,"g"):new RegExp(u,"g");n=n.replace(e,u+u)}if(!0===t){const e=new RegExp(l,"g");n=n.replace(e,u+l)}!0===y&&(n=l+n+l),a+=n}else(!0===d||""===i&&!0===g&&!1!==d)&&(a+=l+l);e!==o.length-1&&(a+=s)}return a}bom(){!0===this.options.bom&&this.push(a)}headers(){if(!1===this.options.header)return;if(void 0===this.options.columns)return;let e=this.options.columns.map((e=>e.header));e=this.options.eof?this.stringify(e,!0)+this.options.record_delimiter:this.stringify(e),this.push(e)}__cast(e,t){const r=typeof e;try{return"string"===r?[void 0,this.options.cast.string(e,t)]:"bigint"===r?[void 0,this.options.cast.bigint(e,t)]:"number"===r?[void 0,this.options.cast.number(e,t)]:"boolean"===r?[void 0,this.options.cast.boolean(e,t)]:e instanceof Date?[void 0,this.options.cast.date(e,t)]:"object"===r&&null!==e?[void 0,this.options.cast.object(e,t)]:[void 0,e,e]}catch(e){return[e]}}normalize_columns(e){if(null!=e){if("object"!=typeof e)throw Error('Invalid option "columns": expect an array or an object');if(Array.isArray(e)){const t=[];for(let r of e)if("string"==typeof r)t.push({key:r,header:r});else{if("object"!=typeof r||void 0===r||Array.isArray(r))throw Error("Invalid column definition: expect a string or an object");if(!r.key)throw Error('Invalid column definition: property "key" is required');void 0===r.header&&(r.header=r.key),t.push(r)}e=t}else{const t=[];for(let r in e)t.push({key:r,header:e[r]});e=t}return e}}}const u=function(){let e,t,r;for(let n in arguments){const o=arguments[n],i=typeof o;if(void 0===e&&Array.isArray(o))e=o;else if(void 0===t&&c(o))t=o;else{if(void 0!==r||"function"!==i)throw new l("CSV_INVALID_ARGUMENT",["Invalid argument:",`got ${JSON.stringify(o)} at index ${n}`]);r=o}}const n=new s(t);if(r){const e=[];n.on("readable",(function(){let t;for(;null!==(t=this.read());)e.push(t)})),n.on("error",(function(e){r(e)})),n.on("end",(function(){r(void 0,e.join(""))}))}if(void 0!==e)if("function"==typeof setImmediate)setImmediate((function(){for(let t of e)n.write(t);n.end()}));else{for(let t of e)n.write(t);n.end()}return n};class l extends Error{constructor(e,t){Array.isArray(t)&&(t=t.join(" ")),super(t),void 0!==Error.captureStackTrace&&Error.captureStackTrace(this,l),this.code=e;for(var r=arguments.length,o=new Array(r>2?r-2:0),i=2;i<r;i++)o[i-2]=arguments[i];for(const e of o)for(const t in e){const r=e[t];this[t]=n.isBuffer(r)?r.toString():null==r?r:JSON.parse(JSON.stringify(r))}}}u.Stringifier=s,u.CsvError=l,e.exports=u;const c=function(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)},f=function(e){return e.replace(/([A-Z])/g,(function(e,t){return"_"+t.toLowerCase()}))},d=".".charCodeAt(0),g=/\\(\\)?/g,p=RegExp("[^.[\\]]+|\\[(?:([^\"'][^[]*)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))","g"),h=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,y=/^\w*$/,m=function(e){const t=typeof e;return"symbol"===t||"object"===t&&e&&"[object Symbol]"===function(e){return Object.prototype.toString.call(e)}(e)},b=function(e){if("string"==typeof e||m(e))return e;const t=`${e}`;return"0"==t&&1/e==-INFINITY?"-0":t},_=function(e,t){let r=0;const n=(t=function(e,t){return Array.isArray(e)?e:function(e,t){if(Array.isArray(e))return!1;const r=typeof e;return!("number"!==r&&"symbol"!==r&&"boolean"!==r&&e&&!m(e))||y.test(e)||!h.test(e)||null!=t&&e in Object(t)}(e,t)?[e]:function(e){const t=[];return e.charCodeAt(0)===d&&t.push(""),e.replace(p,(function(e,r,n,o){let i=e;n?i=o.replace(g,"$1"):r&&(i=r.trim()),t.push(i)})),t}(e)}(t,e)).length;for(;null!=e&&r<n;)e=e[b(t[r++])];return r&&r===n?e:void 0}},275:(e,t,r)=>{var n=r(9033).Buffer;const o=r(2193),{StringDecoder:i}=r(3462);e.exports=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=[];function a(e){e&&r.push(e.toString())}n.isBuffer(e)&&(e=(new i).write(e));let s=new o.Stringifier(t);s.on("data",a);for(let t of e)s.write(t);return s.end(),s.off("data",a),r.join("")}},6613:(e,t,r)=>{"use strict";var n=r(9519),o=r(593),i=r(5045),a=r(7701),s=r(2632),u=r(95),l=r(731),c=r(9446),f=r(9484),d=r(752),g=r(3258),p=r(4803),h=r(185),y=r(8204),m=r(1668),b=r(8230),_=r(2337),w=r(9380),E=o("SharedArrayBuffer.prototype.byteLength",!0),v=o("Date.prototype.getTime"),S=Object.getPrototypeOf,T=o("Object.prototype.toString"),O=a("%Set%",!0),A=o("Map.prototype.has",!0),I=o("Map.prototype.get",!0),R=o("Map.prototype.size",!0),N=o("Set.prototype.add",!0),D=o("Set.prototype.delete",!0),j=o("Set.prototype.has",!0),k=o("Set.prototype.size",!0);function C(e,t,r,n){for(var o,i=s(e);(o=i.next())&&!o.done;)if(F(t,o.value,r,n))return D(e,o.value),!0;return!1}function M(e){return void 0===e?null:"object"!=typeof e?"symbol"!=typeof e&&("string"!=typeof e&&"number"!=typeof e||+e==+e):void 0}function L(e,t,r,o,i,a){var s=M(r);if(null!=s)return s;var u=I(t,s),l=n({},i,{strict:!1});return!(void 0===u&&!A(t,s)||!F(o,u,l,a))&&!A(e,s)&&F(o,u,l,a)}function x(e,t,r){var n=M(r);return null!=n?n:j(t,n)&&!j(e,n)}function B(e,t,r,n,o,i){for(var a,u,l=s(e);(a=l.next())&&!a.done;)if(F(r,u=a.value,o,i)&&F(n,I(t,u),o,i))return D(e,u),!0;return!1}function F(e,t,r,o){var a=r||{};if(a.strict?l(e,t):e===t)return!0;if(m(e)!==m(t))return!1;if(!e||!t||"object"!=typeof e&&"object"!=typeof t)return a.strict?l(e,t):e==t;var u,D=o.has(e),M=o.has(t);if(D&&M){if(o.get(e)===o.get(t))return!0}else u={};return D||o.set(e,u),M||o.set(t,u),function(e,t,r,o){var a,u;if(typeof e!=typeof t)return!1;if(null==e||null==t)return!1;if(T(e)!==T(t))return!1;if(c(e)!==c(t))return!1;if(f(e)!==f(t))return!1;var l=e instanceof Error,m=t instanceof Error;if(l!==m)return!1;if((l||m)&&(e.name!==t.name||e.message!==t.message))return!1;var D=p(e),M=p(t);if(D!==M)return!1;if((D||M)&&(e.source!==t.source||i(e)!==i(t)))return!1;var P=g(e),W=g(t);if(P!==W)return!1;if((P||W)&&v(e)!==v(t))return!1;if(r.strict&&S&&S(e)!==S(t))return!1;var H=_(e),z=_(t);if((H||z)&&H!==z)return!1;var V=U(e),$=U(t);if(V!==$)return!1;if(V||$){if(e.length!==t.length)return!1;for(a=0;a<e.length;a++)if(e[a]!==t[a])return!1;return!0}var q=d(e),G=d(t);if(q!==G)return!1;if(q||G)return w(e)===w(t)&&"function"==typeof Uint8Array&&F(new Uint8Array(e),new Uint8Array(t),r,o);var Y=h(e),Z=h(t);if(Y!==Z)return!1;if(Y||Z)return E(e)===E(t)&&"function"==typeof Uint8Array&&F(new Uint8Array(e),new Uint8Array(t),r,o);if(typeof e!=typeof t)return!1;var K=y(e),J=y(t);if(K.length!==J.length)return!1;for(K.sort(),J.sort(),a=K.length-1;a>=0;a--)if(K[a]!=J[a])return!1;for(a=K.length-1;a>=0;a--)if(!F(e[u=K[a]],t[u],r,o))return!1;var X=b(e),Q=b(t);return X===Q&&("Set"===X||"Set"===Q?function(e,t,r,n){if(k(e)!==k(t))return!1;for(var o,i,a,u=s(e),l=s(t);(o=u.next())&&!o.done;)if(o.value&&"object"==typeof o.value)a||(a=new O),N(a,o.value);else if(!j(t,o.value)){if(r.strict)return!1;if(!x(e,t,o.value))return!1;a||(a=new O),N(a,o.value)}if(a){for(;(i=l.next())&&!i.done;)if(i.value&&"object"==typeof i.value){if(!C(a,i.value,r.strict,n))return!1}else if(!r.strict&&!j(e,i.value)&&!C(a,i.value,r.strict,n))return!1;return 0===k(a)}return!0}(e,t,r,o):"Map"!==X||function(e,t,r,o){if(R(e)!==R(t))return!1;for(var i,a,u,l,c,f,d=s(e),g=s(t);(i=d.next())&&!i.done;)if(l=i.value[0],c=i.value[1],l&&"object"==typeof l)u||(u=new O),N(u,l);else if(void 0===(f=I(t,l))&&!A(t,l)||!F(c,f,r,o)){if(r.strict)return!1;if(!L(e,t,l,c,r,o))return!1;u||(u=new O),N(u,l)}if(u){for(;(a=g.next())&&!a.done;)if(l=a.value[0],f=a.value[1],l&&"object"==typeof l){if(!B(u,e,l,f,r,o))return!1}else if(!(r.strict||e.has(l)&&F(I(e,l),f,r,o)||B(u,e,l,f,n({},r,{strict:!1}),o)))return!1;return 0===k(u)}return!0}(e,t,r,o))}(e,t,a,o)}function U(e){return!(!e||"object"!=typeof e||"number"!=typeof e.length||"function"!=typeof e.copy||"function"!=typeof e.slice||e.length>0&&"number"!=typeof e[0]||!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e)))}e.exports=function(e,t,r){return F(e,t,r,u())}},4347:(e,t,r)=>{"use strict";var n=r(8204),o="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),i=Object.prototype.toString,a=Array.prototype.concat,s=Object.defineProperty,u=r(1020)(),l=s&&u,c=function(e,t,r,n){if(t in e)if(!0===n){if(e[t]===r)return}else if("function"!=typeof(o=n)||"[object Function]"!==i.call(o)||!n())return;var o;l?s(e,t,{configurable:!0,enumerable:!1,value:r,writable:!0}):e[t]=r},f=function(e,t){var r=arguments.length>2?arguments[2]:{},i=n(t);o&&(i=a.call(i,Object.getOwnPropertySymbols(t)));for(var s=0;s<i.length;s+=1)c(e,i[s],t[i[s]],r[i[s]])};f.supportsDescriptors=!!l,e.exports=f},4093:e=>{"use strict";function t(e,t){if(null==e)throw new TypeError("Cannot convert first argument to object");for(var r=Object(e),n=1;n<arguments.length;n++){var o=arguments[n];if(null!=o)for(var i=Object.keys(Object(o)),a=0,s=i.length;a<s;a++){var u=i[a],l=Object.getOwnPropertyDescriptor(o,u);void 0!==l&&l.enumerable&&(r[u]=o[u])}}return r}e.exports={assign:t,polyfill:function(){Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:t})}}},8291:e=>{"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function i(){i.init.call(this)}e.exports=i,e.exports.once=function(e,t){return new Promise((function(r,n){function o(r){e.removeListener(t,i),n(r)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",o),r([].slice.call(arguments))}h(e,t,i,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&h(e,"error",t,{once:!0})}(e,o)}))},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var a=10;function s(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?i.defaultMaxListeners:e._maxListeners}function l(e,t,r,n){var o,i,a,l;if(s(r),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),i=e._events),a=i[t]),void 0===a)a=i[t]=r,++e._eventsCount;else if("function"==typeof a?a=i[t]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(o=u(e))>0&&a.length>o&&!a.warned){a.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=a.length,l=c,console&&console.warn&&console.warn(l)}return e}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},o=c.bind(n);return o.listener=r,n.wrapFn=o,o}function d(e,t,r){var n=e._events;if(void 0===n)return[];var o=n[t];return void 0===o?[]:"function"==typeof o?r?[o.listener||o]:[o]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(o):p(o,o.length)}function g(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function p(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function h(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function o(i){n.once&&e.removeEventListener(t,o),r(i)}))}}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),i.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},i.prototype.getMaxListeners=function(){return u(this)},i.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var o="error"===e,i=this._events;if(void 0!==i)o=o&&void 0===i.error;else if(!o)return!1;if(o){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var u=i[e];if(void 0===u)return!1;if("function"==typeof u)n(u,this,t);else{var l=u.length,c=p(u,l);for(r=0;r<l;++r)n(c[r],this,t)}return!0},i.prototype.addListener=function(e,t){return l(this,e,t,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(e,t){return l(this,e,t,!0)},i.prototype.once=function(e,t){return s(t),this.on(e,f(this,e,t)),this},i.prototype.prependOnceListener=function(e,t){return s(t),this.prependListener(e,f(this,e,t)),this},i.prototype.removeListener=function(e,t){var r,n,o,i,a;if(s(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(o=-1,i=r.length-1;i>=0;i--)if(r[i]===t||r[i].listener===t){a=r[i].listener,o=i;break}if(o<0)return this;0===o?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,o),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,a||t)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var o,i=Object.keys(r);for(n=0;n<i.length;++n)"removeListener"!==(o=i[n])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},i.prototype.listeners=function(e){return d(this,e,!0)},i.prototype.rawListeners=function(e){return d(this,e,!1)},i.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):g.call(e,t)},i.prototype.listenerCount=g,i.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},8184:(e,t,r)=>{"use strict";var n=r(1493),o=Object.prototype.toString,i=Object.prototype.hasOwnProperty;e.exports=function(e,t,r){if(!n(t))throw new TypeError("iterator must be a function");var a;arguments.length>=3&&(a=r),"[object Array]"===o.call(e)?function(e,t,r){for(var n=0,o=e.length;n<o;n++)i.call(e,n)&&(null==r?t(e[n],n,e):t.call(r,e[n],n,e))}(e,t,a):"string"==typeof e?function(e,t,r){for(var n=0,o=e.length;n<o;n++)null==r?t(e.charAt(n),n,e):t.call(r,e.charAt(n),n,e)}(e,t,a):function(e,t,r){for(var n in e)i.call(e,n)&&(null==r?t(e[n],n,e):t.call(r,e[n],n,e))}(e,t,a)}},3161:e=>{"use strict";var t=Array.prototype.slice,r=Object.prototype.toString;e.exports=function(e){var n=this;if("function"!=typeof n||"[object Function]"!==r.call(n))throw new TypeError("Function.prototype.bind called on incompatible "+n);for(var o,i=t.call(arguments,1),a=Math.max(0,n.length-i.length),s=[],u=0;u<a;u++)s.push("$"+u);if(o=Function("binder","return function ("+s.join(",")+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof o){var r=n.apply(this,i.concat(t.call(arguments)));return Object(r)===r?r:this}return n.apply(e,i.concat(t.call(arguments)))})),n.prototype){var l=function(){};l.prototype=n.prototype,o.prototype=new l,l.prototype=null}return o}},3767:(e,t,r)=>{"use strict";var n=r(3161);e.exports=Function.prototype.bind||n},3067:e=>{"use strict";var t=function(){return"string"==typeof function(){}.name},r=Object.getOwnPropertyDescriptor;if(r)try{r([],"length")}catch(e){r=null}t.functionsHaveConfigurableNames=function(){if(!t()||!r)return!1;var e=r((function(){}),"name");return!!e&&!!e.configurable};var n=Function.prototype.bind;t.boundFunctionsHaveNames=function(){return t()&&"function"==typeof n&&""!==function(){}.bind().name},e.exports=t},7701:(e,t,r)=>{"use strict";var n,o=SyntaxError,i=Function,a=TypeError,s=function(e){try{return i('"use strict"; return ('+e+").constructor;")()}catch(e){}},u=Object.getOwnPropertyDescriptor;if(u)try{u({},"")}catch(e){u=null}var l=function(){throw new a},c=u?function(){try{return l}catch(e){try{return u(arguments,"callee").get}catch(e){return l}}}():l,f=r(8489)(),d=Object.getPrototypeOf||function(e){return e.__proto__},g={},p="undefined"==typeof Uint8Array?n:d(Uint8Array),h={"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":f?d([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":g,"%AsyncGenerator%":g,"%AsyncGeneratorFunction%":g,"%AsyncIteratorPrototype%":g,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":i,"%GeneratorFunction%":g,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":f?d(d([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&f?d((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&f?d((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":f?d(""[Symbol.iterator]()):n,"%Symbol%":f?Symbol:n,"%SyntaxError%":o,"%ThrowTypeError%":c,"%TypedArray%":p,"%TypeError%":a,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet};try{null.error}catch(e){var y=d(d(e));h["%Error.prototype%"]=y}var m=function e(t){var r;if("%AsyncFunction%"===t)r=s("async function () {}");else if("%GeneratorFunction%"===t)r=s("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=s("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var o=e("%AsyncGenerator%");o&&(r=d(o.prototype))}return h[t]=r,r},b={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},_=r(3767),w=r(1888),E=_.call(Function.call,Array.prototype.concat),v=_.call(Function.apply,Array.prototype.splice),S=_.call(Function.call,String.prototype.replace),T=_.call(Function.call,String.prototype.slice),O=_.call(Function.call,RegExp.prototype.exec),A=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,I=/\\(\\)?/g,R=function(e,t){var r,n=e;if(w(b,n)&&(n="%"+(r=b[n])[0]+"%"),w(h,n)){var i=h[n];if(i===g&&(i=m(n)),void 0===i&&!t)throw new a("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:i}}throw new o("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new a('"allowMissing" argument must be a boolean');if(null===O(/^%?[^%]*%?$/,e))throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(e){var t=T(e,0,1),r=T(e,-1);if("%"===t&&"%"!==r)throw new o("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new o("invalid intrinsic syntax, expected opening `%`");var n=[];return S(e,A,(function(e,t,r,o){n[n.length]=r?S(o,I,"$1"):t||e})),n}(e),n=r.length>0?r[0]:"",i=R("%"+n+"%",t),s=i.name,l=i.value,c=!1,f=i.alias;f&&(n=f[0],v(r,E([0,1],f)));for(var d=1,g=!0;d<r.length;d+=1){var p=r[d],y=T(p,0,1),m=T(p,-1);if(('"'===y||"'"===y||"`"===y||'"'===m||"'"===m||"`"===m)&&y!==m)throw new o("property names with quotes must have matching quotes");if("constructor"!==p&&g||(c=!0),w(h,s="%"+(n+="."+p)+"%"))l=h[s];else if(null!=l){if(!(p in l)){if(!t)throw new a("base intrinsic for "+e+" exists, but the property is not available.");return}if(u&&d+1>=r.length){var b=u(l,p);l=(g=!!b)&&"get"in b&&!("originalValue"in b.get)?b.get:l[p]}else g=w(l,p),l=l[p];g&&!c&&(h[s]=l)}}return l}},469:function(__unused_webpack_module,exports,__webpack_require__){var $jscomp=$jscomp||{};$jscomp.scope={},$jscomp.findInternal=function(e,t,r){e instanceof String&&(e=String(e));for(var n=e.length,o=0;o<n;o++){var i=e[o];if(t.call(r,i,o,e))return{i:o,v:i}}return{i:-1,v:void 0}},$jscomp.ASSUME_ES5=!1,$jscomp.ASSUME_NO_NATIVE_MAP=!1,$jscomp.ASSUME_NO_NATIVE_SET=!1,$jscomp.SIMPLE_FROUND_POLYFILL=!1,$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,r){e!=Array.prototype&&e!=Object.prototype&&(e[t]=r.value)},$jscomp.getGlobal=function(e){return"undefined"!=typeof window&&window===e?e:void 0!==__webpack_require__.g&&null!=__webpack_require__.g?__webpack_require__.g:e},$jscomp.global=$jscomp.getGlobal(this),$jscomp.polyfill=function(e,t,r,n){if(t){for(r=$jscomp.global,e=e.split("."),n=0;n<e.length-1;n++){var o=e[n];o in r||(r[o]={}),r=r[o]}(t=t(n=r[e=e[e.length-1]]))!=n&&null!=t&&$jscomp.defineProperty(r,e,{configurable:!0,writable:!0,value:t})}},$jscomp.polyfill("Array.prototype.findIndex",(function(e){return e||function(e,t){return $jscomp.findInternal(this,e,t).i}}),"es6","es3"),$jscomp.checkStringArgs=function(e,t,r){if(null==e)throw new TypeError("The 'this' value for String.prototype."+r+" must not be null or undefined");if(t instanceof RegExp)throw new TypeError("First argument to String.prototype."+r+" must not be a regular expression");return e+""},$jscomp.polyfill("String.prototype.endsWith",(function(e){return e||function(e,t){var r=$jscomp.checkStringArgs(this,e,"endsWith");e+="",void 0===t&&(t=r.length),t=Math.max(0,Math.min(0|t,r.length));for(var n=e.length;0<n&&0<t;)if(r[--t]!=e[--n])return!1;return 0>=n}}),"es6","es3"),$jscomp.polyfill("Array.prototype.find",(function(e){return e||function(e,t){return $jscomp.findInternal(this,e,t).v}}),"es6","es3"),$jscomp.polyfill("String.prototype.startsWith",(function(e){return e||function(e,t){var r=$jscomp.checkStringArgs(this,e,"startsWith");e+="";var n=r.length,o=e.length;t=Math.max(0,Math.min(0|t,r.length));for(var i=0;i<o&&t<n;)if(r[t++]!=e[i++])return!1;return i>=o}}),"es6","es3"),$jscomp.polyfill("String.prototype.repeat",(function(e){return e||function(e){var t=$jscomp.checkStringArgs(this,null,"repeat");if(0>e||1342177279<e)throw new RangeError("Invalid count value");e|=0;for(var r="";e;)1&e&&(r+=t),(e>>>=1)&&(t+=t);return r}}),"es6","es3");var COMPILED=!0,goog=goog||{};goog.global=this||self,goog.exportPath_=function(e,t,r){e=e.split("."),r=r||goog.global,e[0]in r||void 0===r.execScript||r.execScript("var "+e[0]);for(var n;e.length&&(n=e.shift());)e.length||void 0===t?r=r[n]&&r[n]!==Object.prototype[n]?r[n]:r[n]={}:r[n]=t},goog.define=function(e,t){if(!COMPILED){var r=goog.global.CLOSURE_UNCOMPILED_DEFINES,n=goog.global.CLOSURE_DEFINES;r&&void 0===r.nodeType&&Object.prototype.hasOwnProperty.call(r,e)?t=r[e]:n&&void 0===n.nodeType&&Object.prototype.hasOwnProperty.call(n,e)&&(t=n[e])}return t},goog.FEATURESET_YEAR=2012,goog.DEBUG=!0,goog.LOCALE="en",goog.TRUSTED_SITE=!0,goog.STRICT_MODE_COMPATIBLE=!1,goog.DISALLOW_TEST_ONLY_CODE=COMPILED&&!goog.DEBUG,goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING=!1,goog.provide=function(e){if(goog.isInModuleLoader_())throw Error("goog.provide cannot be used within a module.");if(!COMPILED&&goog.isProvided_(e))throw Error('Namespace "'+e+'" already declared.');goog.constructNamespace_(e)},goog.constructNamespace_=function(e,t){if(!COMPILED){delete goog.implicitNamespaces_[e];for(var r=e;(r=r.substring(0,r.lastIndexOf(".")))&&!goog.getObjectByName(r);)goog.implicitNamespaces_[r]=!0}goog.exportPath_(e,t)},goog.getScriptNonce=function(e){return e&&e!=goog.global?goog.getScriptNonce_(e.document):(null===goog.cspNonce_&&(goog.cspNonce_=goog.getScriptNonce_(goog.global.document)),goog.cspNonce_)},goog.NONCE_PATTERN_=/^[\w+/_-]+[=]{0,2}$/,goog.cspNonce_=null,goog.getScriptNonce_=function(e){return(e=e.querySelector&&e.querySelector("script[nonce]"))&&(e=e.nonce||e.getAttribute("nonce"))&&goog.NONCE_PATTERN_.test(e)?e:""},goog.VALID_MODULE_RE_=/^[a-zA-Z_$][a-zA-Z0-9._$]*$/,goog.module=function(e){if("string"!=typeof e||!e||-1==e.search(goog.VALID_MODULE_RE_))throw Error("Invalid module identifier");if(!goog.isInGoogModuleLoader_())throw Error("Module "+e+" has been loaded incorrectly. Note, modules cannot be loaded as normal scripts. They require some kind of pre-processing step. You're likely trying to load a module via a script tag or as a part of a concatenated bundle without rewriting the module. For more info see: https://github.com/google/closure-library/wiki/goog.module:-an-ES6-module-like-alternative-to-goog.provide.");if(goog.moduleLoaderState_.moduleName)throw Error("goog.module may only be called once per module.");if(goog.moduleLoaderState_.moduleName=e,!COMPILED){if(goog.isProvided_(e))throw Error('Namespace "'+e+'" already declared.');delete goog.implicitNamespaces_[e]}},goog.module.get=function(e){return goog.module.getInternal_(e)},goog.module.getInternal_=function(e){if(!COMPILED){if(e in goog.loadedModules_)return goog.loadedModules_[e].exports;if(!goog.implicitNamespaces_[e])return null!=(e=goog.getObjectByName(e))?e:null}return null},goog.ModuleType={ES6:"es6",GOOG:"goog"},goog.moduleLoaderState_=null,goog.isInModuleLoader_=function(){return goog.isInGoogModuleLoader_()||goog.isInEs6ModuleLoader_()},goog.isInGoogModuleLoader_=function(){return!!goog.moduleLoaderState_&&goog.moduleLoaderState_.type==goog.ModuleType.GOOG},goog.isInEs6ModuleLoader_=function(){if(goog.moduleLoaderState_&&goog.moduleLoaderState_.type==goog.ModuleType.ES6)return!0;var e=goog.global.$jscomp;return!!e&&"function"==typeof e.getCurrentModulePath&&!!e.getCurrentModulePath()},goog.module.declareLegacyNamespace=function(){if(!COMPILED&&!goog.isInGoogModuleLoader_())throw Error("goog.module.declareLegacyNamespace must be called from within a goog.module");if(!COMPILED&&!goog.moduleLoaderState_.moduleName)throw Error("goog.module must be called prior to goog.module.declareLegacyNamespace.");goog.moduleLoaderState_.declareLegacyNamespace=!0},goog.declareModuleId=function(e){if(!COMPILED){if(!goog.isInEs6ModuleLoader_())throw Error("goog.declareModuleId may only be called from within an ES6 module");if(goog.moduleLoaderState_&&goog.moduleLoaderState_.moduleName)throw Error("goog.declareModuleId may only be called once per module.");if(e in goog.loadedModules_)throw Error('Module with namespace "'+e+'" already exists.')}if(goog.moduleLoaderState_)goog.moduleLoaderState_.moduleName=e;else{var t=goog.global.$jscomp;if(!t||"function"!=typeof t.getCurrentModulePath)throw Error('Module with namespace "'+e+'" has been loaded incorrectly.');t=t.require(t.getCurrentModulePath()),goog.loadedModules_[e]={exports:t,type:goog.ModuleType.ES6,moduleId:e}}},goog.setTestOnly=function(e){if(goog.DISALLOW_TEST_ONLY_CODE)throw e=e||"",Error("Importing test-only code into non-debug environment"+(e?": "+e:"."))},goog.forwardDeclare=function(e){},COMPILED||(goog.isProvided_=function(e){return e in goog.loadedModules_||!goog.implicitNamespaces_[e]&&null!=goog.getObjectByName(e)},goog.implicitNamespaces_={"goog.module":!0}),goog.getObjectByName=function(e,t){e=e.split("."),t=t||goog.global;for(var r=0;r<e.length;r++)if(null==(t=t[e[r]]))return null;return t},goog.globalize=function(e,t){for(var r in t=t||goog.global,e)t[r]=e[r]},goog.addDependency=function(e,t,r,n){!COMPILED&&goog.DEPENDENCIES_ENABLED&&goog.debugLoader_.addDependency(e,t,r,n)},goog.ENABLE_DEBUG_LOADER=!0,goog.logToConsole_=function(e){goog.global.console&&goog.global.console.error(e)},goog.require=function(e){if(!COMPILED){if(goog.ENABLE_DEBUG_LOADER&&goog.debugLoader_.requested(e),goog.isProvided_(e)){if(goog.isInModuleLoader_())return goog.module.getInternal_(e)}else if(goog.ENABLE_DEBUG_LOADER){var t=goog.moduleLoaderState_;goog.moduleLoaderState_=null;try{goog.debugLoader_.load_(e)}finally{goog.moduleLoaderState_=t}}return null}},goog.requireType=function(e){return{}},goog.basePath="",goog.nullFunction=function(){},goog.abstractMethod=function(){throw Error("unimplemented abstract method")},goog.addSingletonGetter=function(e){e.instance_=void 0,e.getInstance=function(){return e.instance_?e.instance_:(goog.DEBUG&&(goog.instantiatedSingletons_[goog.instantiatedSingletons_.length]=e),e.instance_=new e)}},goog.instantiatedSingletons_=[],goog.LOAD_MODULE_USING_EVAL=!0,goog.SEAL_MODULE_EXPORTS=goog.DEBUG,goog.loadedModules_={},goog.DEPENDENCIES_ENABLED=!COMPILED&&goog.ENABLE_DEBUG_LOADER,goog.TRANSPILE="detect",goog.ASSUME_ES_MODULES_TRANSPILED=!1,goog.TRANSPILE_TO_LANGUAGE="",goog.TRANSPILER="transpile.js",goog.hasBadLetScoping=null,goog.useSafari10Workaround=function(){if(null==goog.hasBadLetScoping){try{var a=!eval('"use strict";let x = 1; function f() { return typeof x; };f() == "number";')}catch(e){a=!1}goog.hasBadLetScoping=a}return goog.hasBadLetScoping},goog.workaroundSafari10EvalBug=function(e){return"(function(){"+e+"\n;})();\n"},goog.loadModule=function(e){var t=goog.moduleLoaderState_;try{if(goog.moduleLoaderState_={moduleName:"",declareLegacyNamespace:!1,type:goog.ModuleType.GOOG},goog.isFunction(e))var r=e.call(void 0,{});else{if("string"!=typeof e)throw Error("Invalid module definition");goog.useSafari10Workaround()&&(e=goog.workaroundSafari10EvalBug(e)),r=goog.loadModuleFromSource_.call(void 0,e)}var n=goog.moduleLoaderState_.moduleName;if("string"!=typeof n||!n)throw Error('Invalid module name "'+n+'"');goog.moduleLoaderState_.declareLegacyNamespace?goog.constructNamespace_(n,r):goog.SEAL_MODULE_EXPORTS&&Object.seal&&"object"==typeof r&&null!=r&&Object.seal(r),goog.loadedModules_[n]={exports:r,type:goog.ModuleType.GOOG,moduleId:goog.moduleLoaderState_.moduleName}}finally{goog.moduleLoaderState_=t}},goog.loadModuleFromSource_=function(a){return eval(a),{}},goog.normalizePath_=function(e){e=e.split("/");for(var t=0;t<e.length;)"."==e[t]?e.splice(t,1):t&&".."==e[t]&&e[t-1]&&".."!=e[t-1]?e.splice(--t,2):t++;return e.join("/")},goog.loadFileSync_=function(e){if(goog.global.CLOSURE_LOAD_FILE_SYNC)return goog.global.CLOSURE_LOAD_FILE_SYNC(e);try{var t=new goog.global.XMLHttpRequest;return t.open("get",e,!1),t.send(),0==t.status||200==t.status?t.responseText:null}catch(e){return null}},goog.transpile_=function(e,t,r){var n=goog.global.$jscomp;n||(goog.global.$jscomp=n={});var o=n.transpile;if(!o){var i=goog.basePath+goog.TRANSPILER,a=goog.loadFileSync_(i);if(a){if(function(){(0,eval)(a+"\n//# sourceURL="+i)}.call(goog.global),goog.global.$gwtExport&&goog.global.$gwtExport.$jscomp&&!goog.global.$gwtExport.$jscomp.transpile)throw Error('The transpiler did not properly export the "transpile" method. $gwtExport: '+JSON.stringify(goog.global.$gwtExport));goog.global.$jscomp.transpile=goog.global.$gwtExport.$jscomp.transpile,o=(n=goog.global.$jscomp).transpile}}return o||(o=n.transpile=function(e,t){return goog.logToConsole_(t+" requires transpilation but no transpiler was found."),e}),o(e,t,r)},goog.typeOf=function(e){var t=typeof e;if("object"==t){if(!e)return"null";if(e instanceof Array)return"array";if(e instanceof Object)return t;var r=Object.prototype.toString.call(e);if("[object Window]"==r)return"object";if("[object Array]"==r||"number"==typeof e.length&&void 0!==e.splice&&void 0!==e.propertyIsEnumerable&&!e.propertyIsEnumerable("splice"))return"array";if("[object Function]"==r||void 0!==e.call&&void 0!==e.propertyIsEnumerable&&!e.propertyIsEnumerable("call"))return"function"}else if("function"==t&&void 0===e.call)return"object";return t},goog.isArray=function(e){return"array"==goog.typeOf(e)},goog.isArrayLike=function(e){var t=goog.typeOf(e);return"array"==t||"object"==t&&"number"==typeof e.length},goog.isDateLike=function(e){return goog.isObject(e)&&"function"==typeof e.getFullYear},goog.isFunction=function(e){return"function"==goog.typeOf(e)},goog.isObject=function(e){var t=typeof e;return"object"==t&&null!=e||"function"==t},goog.getUid=function(e){return Object.prototype.hasOwnProperty.call(e,goog.UID_PROPERTY_)&&e[goog.UID_PROPERTY_]||(e[goog.UID_PROPERTY_]=++goog.uidCounter_)},goog.hasUid=function(e){return!!e[goog.UID_PROPERTY_]},goog.removeUid=function(e){null!==e&&"removeAttribute"in e&&e.removeAttribute(goog.UID_PROPERTY_);try{delete e[goog.UID_PROPERTY_]}catch(e){}},goog.UID_PROPERTY_="closure_uid_"+(1e9*Math.random()>>>0),goog.uidCounter_=0,goog.getHashCode=goog.getUid,goog.removeHashCode=goog.removeUid,goog.cloneObject=function(e){var t=goog.typeOf(e);if("object"==t||"array"==t){if("function"==typeof e.clone)return e.clone();for(var r in t="array"==t?[]:{},e)t[r]=goog.cloneObject(e[r]);return t}return e},goog.bindNative_=function(e,t,r){return e.call.apply(e.bind,arguments)},goog.bindJs_=function(e,t,r){if(!e)throw Error();if(2<arguments.length){var n=Array.prototype.slice.call(arguments,2);return function(){var r=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(r,n),e.apply(t,r)}}return function(){return e.apply(t,arguments)}},goog.bind=function(e,t,r){return Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?goog.bind=goog.bindNative_:goog.bind=goog.bindJs_,goog.bind.apply(null,arguments)},goog.partial=function(e,t){var r=Array.prototype.slice.call(arguments,1);return function(){var t=r.slice();return t.push.apply(t,arguments),e.apply(this,t)}},goog.mixin=function(e,t){for(var r in t)e[r]=t[r]},goog.now=goog.TRUSTED_SITE&&Date.now||function(){return+new Date},goog.globalEval=function(e){if(goog.global.execScript)goog.global.execScript(e,"JavaScript");else{if(!goog.global.eval)throw Error("goog.globalEval not available");if(null==goog.evalWorksForGlobals_){try{goog.global.eval("var _evalTest_ = 1;")}catch(e){}if(void 0!==goog.global._evalTest_){try{delete goog.global._evalTest_}catch(e){}goog.evalWorksForGlobals_=!0}else goog.evalWorksForGlobals_=!1}if(goog.evalWorksForGlobals_)goog.global.eval(e);else{var t=goog.global.document,r=t.createElement("script");r.type="text/javascript",r.defer=!1,r.appendChild(t.createTextNode(e)),t.head.appendChild(r),t.head.removeChild(r)}}},goog.evalWorksForGlobals_=null,goog.getCssName=function(e,t){if("."==String(e).charAt(0))throw Error('className passed in goog.getCssName must not start with ".". You passed: '+e);var r=function(e){return goog.cssNameMapping_[e]||e},n=function(e){e=e.split("-");for(var t=[],n=0;n<e.length;n++)t.push(r(e[n]));return t.join("-")};return n=goog.cssNameMapping_?"BY_WHOLE"==goog.cssNameMappingStyle_?r:n:function(e){return e},e=t?e+"-"+n(t):n(e),goog.global.CLOSURE_CSS_NAME_MAP_FN?goog.global.CLOSURE_CSS_NAME_MAP_FN(e):e},goog.setCssNameMapping=function(e,t){goog.cssNameMapping_=e,goog.cssNameMappingStyle_=t},!COMPILED&&goog.global.CLOSURE_CSS_NAME_MAPPING&&(goog.cssNameMapping_=goog.global.CLOSURE_CSS_NAME_MAPPING),goog.getMsg=function(e,t,r){return r&&r.html&&(e=e.replace(/</g,"<")),t&&(e=e.replace(/\{\$([^}]+)}/g,(function(e,r){return null!=t&&r in t?t[r]:e}))),e},goog.getMsgWithFallback=function(e,t){return e},goog.exportSymbol=function(e,t,r){goog.exportPath_(e,t,r)},goog.exportProperty=function(e,t,r){e[t]=r},goog.inherits=function(e,t){function r(){}r.prototype=t.prototype,e.superClass_=t.prototype,e.prototype=new r,e.prototype.constructor=e,e.base=function(e,r,n){for(var o=Array(arguments.length-2),i=2;i<arguments.length;i++)o[i-2]=arguments[i];return t.prototype[r].apply(e,o)}},goog.scope=function(e){if(goog.isInModuleLoader_())throw Error("goog.scope is not supported within a module.");e.call(goog.global)},COMPILED||(goog.global.COMPILED=COMPILED),goog.defineClass=function(e,t){var r=t.constructor,n=t.statics;return r&&r!=Object.prototype.constructor||(r=function(){throw Error("cannot instantiate an interface (no constructor defined).")}),r=goog.defineClass.createSealingConstructor_(r,e),e&&goog.inherits(r,e),delete t.constructor,delete t.statics,goog.defineClass.applyProperties_(r.prototype,t),null!=n&&(n instanceof Function?n(r):goog.defineClass.applyProperties_(r,n)),r},goog.defineClass.SEAL_CLASS_INSTANCES=goog.DEBUG,goog.defineClass.createSealingConstructor_=function(e,t){if(!goog.defineClass.SEAL_CLASS_INSTANCES)return e;var r=!goog.defineClass.isUnsealable_(t),n=function(){var t=e.apply(this,arguments)||this;return t[goog.UID_PROPERTY_]=t[goog.UID_PROPERTY_],this.constructor===n&&r&&Object.seal instanceof Function&&Object.seal(t),t};return n},goog.defineClass.isUnsealable_=function(e){return e&&e.prototype&&e.prototype[goog.UNSEALABLE_CONSTRUCTOR_PROPERTY_]},goog.defineClass.OBJECT_PROTOTYPE_FIELDS_="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),goog.defineClass.applyProperties_=function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);for(var n=0;n<goog.defineClass.OBJECT_PROTOTYPE_FIELDS_.length;n++)r=goog.defineClass.OBJECT_PROTOTYPE_FIELDS_[n],Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},goog.tagUnsealableClass=function(e){!COMPILED&&goog.defineClass.SEAL_CLASS_INSTANCES&&(e.prototype[goog.UNSEALABLE_CONSTRUCTOR_PROPERTY_]=!0)},goog.UNSEALABLE_CONSTRUCTOR_PROPERTY_="goog_defineClass_legacy_unsealable",!COMPILED&&goog.DEPENDENCIES_ENABLED&&(goog.inHtmlDocument_=function(){var e=goog.global.document;return null!=e&&"write"in e},goog.isDocumentLoading_=function(){var e=goog.global.document;return e.attachEvent?"complete"!=e.readyState:"loading"==e.readyState},goog.findBasePath_=function(){if(null!=goog.global.CLOSURE_BASE_PATH&&"string"==typeof goog.global.CLOSURE_BASE_PATH)goog.basePath=goog.global.CLOSURE_BASE_PATH;else if(goog.inHtmlDocument_()){var e=goog.global.document,t=e.currentScript;for(t=(e=t?[t]:e.getElementsByTagName("SCRIPT")).length-1;0<=t;--t){var r=e[t].src,n=r.lastIndexOf("?");if(n=-1==n?r.length:n,"base.js"==r.substr(n-7,7)){goog.basePath=r.substr(0,n-7);break}}}},goog.findBasePath_(),goog.Transpiler=function(){this.requiresTranspilation_=null,this.transpilationTarget_=goog.TRANSPILE_TO_LANGUAGE},goog.Transpiler.prototype.createRequiresTranspilation_=function(){function a(t,r){e?d[t]=!0:r()?(c=t,d[t]=!1):e=d[t]=!0}function b(a){try{return!!eval(a)}catch(e){return!1}}var c="es3",d={es3:!1},e=!1,f=goog.global.navigator&&goog.global.navigator.userAgent?goog.global.navigator.userAgent:"";return a("es5",(function(){return b("[1,].length==1")})),a("es6",(function(){return!f.match(/Edge\/(\d+)(\.\d)*/i)&&b('(()=>{"use strict";class X{constructor(){if(new.target!=String)throw 1;this.x=42}}let q=Reflect.construct(X,[],String);if(q.x!=42||!(q instanceof String))throw 1;for(const a of[2,3]){if(a==2)continue;function f(z={a}){let a=0;return z.a}{function f(){return 0;}}return f()==3}})()')})),a("es7",(function(){return b("2 ** 2 == 4")})),a("es8",(function(){return b("async () => 1, true")})),a("es9",(function(){return b("({...rest} = {}), true")})),a("es_next",(function(){return!1})),{target:c,map:d}},goog.Transpiler.prototype.needsTranspile=function(e,t){if("always"==goog.TRANSPILE)return!0;if("never"==goog.TRANSPILE)return!1;if(!this.requiresTranspilation_){var r=this.createRequiresTranspilation_();this.requiresTranspilation_=r.map,this.transpilationTarget_=this.transpilationTarget_||r.target}if(e in this.requiresTranspilation_)return!!this.requiresTranspilation_[e]||!(!goog.inHtmlDocument_()||"es6"!=t||"noModule"in goog.global.document.createElement("script"));throw Error("Unknown language mode: "+e)},goog.Transpiler.prototype.transpile=function(e,t){return goog.transpile_(e,t,this.transpilationTarget_)},goog.transpiler_=new goog.Transpiler,goog.protectScriptTag_=function(e){return e.replace(/<\/(SCRIPT)/gi,"\\x3c/$1")},goog.DebugLoader_=function(){this.dependencies_={},this.idToPath_={},this.written_={},this.loadingDeps_=[],this.depsToLoad_=[],this.paused_=!1,this.factory_=new goog.DependencyFactory(goog.transpiler_),this.deferredCallbacks_={},this.deferredQueue_=[]},goog.DebugLoader_.prototype.bootstrap=function(e,t){function r(){n&&(goog.global.setTimeout(n,0),n=null)}var n=t;if(e.length){t=[];for(var o=0;o<e.length;o++){var i=this.getPathFromDeps_(e[o]);if(!i)throw Error("Unregonized namespace: "+e[o]);t.push(this.dependencies_[i])}i=goog.require;var a=0;for(o=0;o<e.length;o++)i(e[o]),t[o].onLoad((function(){++a==e.length&&r()}))}else r()},goog.DebugLoader_.prototype.loadClosureDeps=function(){this.depsToLoad_.push(this.factory_.createDependency(goog.normalizePath_(goog.basePath+"deps.js"),"deps.js",[],[],{},!1)),this.loadDeps_()},goog.DebugLoader_.prototype.requested=function(e,t){(e=this.getPathFromDeps_(e))&&(t||this.areDepsLoaded_(this.dependencies_[e].requires))&&(t=this.deferredCallbacks_[e])&&(delete this.deferredCallbacks_[e],t())},goog.DebugLoader_.prototype.setDependencyFactory=function(e){this.factory_=e},goog.DebugLoader_.prototype.load_=function(e){if(!this.getPathFromDeps_(e))throw e="goog.require could not find: "+e,goog.logToConsole_(e),Error(e);var t=this,r=[],n=function(e){var o=t.getPathFromDeps_(e);if(!o)throw Error("Bad dependency path or symbol: "+e);if(!t.written_[o]){for(t.written_[o]=!0,e=t.dependencies_[o],o=0;o<e.requires.length;o++)goog.isProvided_(e.requires[o])||n(e.requires[o]);r.push(e)}};n(e),e=!!this.depsToLoad_.length,this.depsToLoad_=this.depsToLoad_.concat(r),this.paused_||e||this.loadDeps_()},goog.DebugLoader_.prototype.loadDeps_=function(){for(var e=this,t=this.paused_;this.depsToLoad_.length&&!t;)!function(){var r=!1,n=e.depsToLoad_.shift(),o=!1;e.loading_(n);var i={pause:function(){if(r)throw Error("Cannot call pause after the call to load.");t=!0},resume:function(){r?e.resume_():t=!1},loaded:function(){if(o)throw Error("Double call to loaded.");o=!0,e.loaded_(n)},pending:function(){for(var t=[],r=0;r<e.loadingDeps_.length;r++)t.push(e.loadingDeps_[r]);return t},setModuleState:function(e){goog.moduleLoaderState_={type:e,moduleName:"",declareLegacyNamespace:!1}},registerEs6ModuleExports:function(e,t,r){r&&(goog.loadedModules_[r]={exports:t,type:goog.ModuleType.ES6,moduleId:r||""})},registerGoogModuleExports:function(e,t){goog.loadedModules_[e]={exports:t,type:goog.ModuleType.GOOG,moduleId:e}},clearModuleState:function(){goog.moduleLoaderState_=null},defer:function(t){if(r)throw Error("Cannot register with defer after the call to load.");e.defer_(n,t)},areDepsLoaded:function(){return e.areDepsLoaded_(n.requires)}};try{n.load(i)}finally{r=!0}}();t&&this.pause_()},goog.DebugLoader_.prototype.pause_=function(){this.paused_=!0},goog.DebugLoader_.prototype.resume_=function(){this.paused_&&(this.paused_=!1,this.loadDeps_())},goog.DebugLoader_.prototype.loading_=function(e){this.loadingDeps_.push(e)},goog.DebugLoader_.prototype.loaded_=function(e){for(var t=0;t<this.loadingDeps_.length;t++)if(this.loadingDeps_[t]==e){this.loadingDeps_.splice(t,1);break}for(t=0;t<this.deferredQueue_.length;t++)if(this.deferredQueue_[t]==e.path){this.deferredQueue_.splice(t,1);break}if(this.loadingDeps_.length==this.deferredQueue_.length&&!this.depsToLoad_.length)for(;this.deferredQueue_.length;)this.requested(this.deferredQueue_.shift(),!0);e.loaded()},goog.DebugLoader_.prototype.areDepsLoaded_=function(e){for(var t=0;t<e.length;t++){var r=this.getPathFromDeps_(e[t]);if(!r||!(r in this.deferredCallbacks_)&&!goog.isProvided_(e[t]))return!1}return!0},goog.DebugLoader_.prototype.getPathFromDeps_=function(e){return e in this.idToPath_?this.idToPath_[e]:e in this.dependencies_?e:null},goog.DebugLoader_.prototype.defer_=function(e,t){this.deferredCallbacks_[e.path]=t,this.deferredQueue_.push(e.path)},goog.LoadController=function(){},goog.LoadController.prototype.pause=function(){},goog.LoadController.prototype.resume=function(){},goog.LoadController.prototype.loaded=function(){},goog.LoadController.prototype.pending=function(){},goog.LoadController.prototype.registerEs6ModuleExports=function(e,t,r){},goog.LoadController.prototype.setModuleState=function(e){},goog.LoadController.prototype.clearModuleState=function(){},goog.LoadController.prototype.defer=function(e){},goog.LoadController.prototype.areDepsLoaded=function(){},goog.Dependency=function(e,t,r,n,o){this.path=e,this.relativePath=t,this.provides=r,this.requires=n,this.loadFlags=o,this.loaded_=!1,this.loadCallbacks_=[]},goog.Dependency.prototype.getPathName=function(){var e=this.path,t=e.indexOf("://");return 0<=t&&0<=(t=(e=e.substring(t+3)).indexOf("/"))&&(e=e.substring(t+1)),e},goog.Dependency.prototype.onLoad=function(e){this.loaded_?e():this.loadCallbacks_.push(e)},goog.Dependency.prototype.loaded=function(){this.loaded_=!0;var e=this.loadCallbacks_;this.loadCallbacks_=[];for(var t=0;t<e.length;t++)e[t]()},goog.Dependency.defer_=!1,goog.Dependency.callbackMap_={},goog.Dependency.registerCallback_=function(e){var t=Math.random().toString(32);return goog.Dependency.callbackMap_[t]=e,t},goog.Dependency.unregisterCallback_=function(e){delete goog.Dependency.callbackMap_[e]},goog.Dependency.callback_=function(e,t){if(!(e in goog.Dependency.callbackMap_))throw Error("Callback key "+e+" does not exist (was base.js loaded more than once?).");for(var r=goog.Dependency.callbackMap_[e],n=[],o=1;o<arguments.length;o++)n.push(arguments[o]);r.apply(void 0,n)},goog.Dependency.prototype.load=function(e){if(goog.global.CLOSURE_IMPORT_SCRIPT)goog.global.CLOSURE_IMPORT_SCRIPT(this.path)?e.loaded():e.pause();else if(goog.inHtmlDocument_()){var t=goog.global.document;if("complete"==t.readyState&&!goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING){if(/\bdeps.js$/.test(this.path))return void e.loaded();throw Error('Cannot write "'+this.path+'" after document load')}if(!goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING&&goog.isDocumentLoading_()){var r=goog.Dependency.registerCallback_((function(t){goog.DebugLoader_.IS_OLD_IE_&&"complete"!=t.readyState||(goog.Dependency.unregisterCallback_(r),e.loaded())})),n=!goog.DebugLoader_.IS_OLD_IE_&&goog.getScriptNonce()?' nonce="'+goog.getScriptNonce()+'"':"";n='<script src="'+this.path+'" '+(goog.DebugLoader_.IS_OLD_IE_?"onreadystatechange":"onload")+"=\"goog.Dependency.callback_('"+r+'\', this)" type="text/javascript" '+(goog.Dependency.defer_?"defer":"")+n+"><\/script>",t.write(goog.TRUSTED_TYPES_POLICY_?goog.TRUSTED_TYPES_POLICY_.createHTML(n):n)}else{var o=t.createElement("script");o.defer=goog.Dependency.defer_,o.async=!1,o.type="text/javascript",(n=goog.getScriptNonce())&&o.setAttribute("nonce",n),goog.DebugLoader_.IS_OLD_IE_?(e.pause(),o.onreadystatechange=function(){"loaded"!=o.readyState&&"complete"!=o.readyState||(e.loaded(),e.resume())}):o.onload=function(){o.onload=null,e.loaded()},o.src=goog.TRUSTED_TYPES_POLICY_?goog.TRUSTED_TYPES_POLICY_.createScriptURL(this.path):this.path,t.head.appendChild(o)}}else goog.logToConsole_("Cannot use default debug loader outside of HTML documents."),"deps.js"==this.relativePath?(goog.logToConsole_("Consider setting CLOSURE_IMPORT_SCRIPT before loading base.js, or setting CLOSURE_NO_DEPS to true."),e.loaded()):e.pause()},goog.Es6ModuleDependency=function(e,t,r,n,o){goog.Dependency.call(this,e,t,r,n,o)},goog.inherits(goog.Es6ModuleDependency,goog.Dependency),goog.Es6ModuleDependency.prototype.load=function(e){if(goog.global.CLOSURE_IMPORT_SCRIPT)goog.global.CLOSURE_IMPORT_SCRIPT(this.path)?e.loaded():e.pause();else if(goog.inHtmlDocument_()){var t=goog.global.document,r=this;if(goog.isDocumentLoading_()){var n=function(e,r){e=r?'<script type="module" crossorigin>'+r+"<\/script>":'<script type="module" crossorigin src="'+e+'"><\/script>',t.write(goog.TRUSTED_TYPES_POLICY_?goog.TRUSTED_TYPES_POLICY_.createHTML(e):e)};goog.Dependency.defer_=!0}else n=function(e,r){var n=t.createElement("script");n.defer=!0,n.async=!1,n.type="module",n.setAttribute("crossorigin",!0);var o=goog.getScriptNonce();o&&n.setAttribute("nonce",o),r?n.textContent=goog.TRUSTED_TYPES_POLICY_?goog.TRUSTED_TYPES_POLICY_.createScript(r):r:n.src=goog.TRUSTED_TYPES_POLICY_?goog.TRUSTED_TYPES_POLICY_.createScriptURL(e):e,t.head.appendChild(n)};var o=goog.Dependency.registerCallback_((function(){goog.Dependency.unregisterCallback_(o),e.setModuleState(goog.ModuleType.ES6)}));n(void 0,'goog.Dependency.callback_("'+o+'")'),n(this.path,void 0);var i=goog.Dependency.registerCallback_((function(t){goog.Dependency.unregisterCallback_(i),e.registerEs6ModuleExports(r.path,t,goog.moduleLoaderState_.moduleName)}));n(void 0,'import * as m from "'+this.path+'"; goog.Dependency.callback_("'+i+'", m)');var a=goog.Dependency.registerCallback_((function(){goog.Dependency.unregisterCallback_(a),e.clearModuleState(),e.loaded()}));n(void 0,'goog.Dependency.callback_("'+a+'")')}else goog.logToConsole_("Cannot use default debug loader outside of HTML documents."),e.pause()},goog.TransformedDependency=function(e,t,r,n,o){goog.Dependency.call(this,e,t,r,n,o),this.contents_=null,this.lazyFetch_=!goog.inHtmlDocument_()||!("noModule"in goog.global.document.createElement("script"))},goog.inherits(goog.TransformedDependency,goog.Dependency),goog.TransformedDependency.prototype.load=function(e){function t(){n.contents_=goog.loadFileSync_(n.path),n.contents_&&(n.contents_=n.transform(n.contents_),n.contents_&&(n.contents_+="\n//# sourceURL="+n.path))}function r(){if(n.lazyFetch_&&t(),n.contents_){o&&e.setModuleState(goog.ModuleType.ES6);try{var r=n.contents_;if(n.contents_=null,goog.globalEval(r),o)var i=goog.moduleLoaderState_.moduleName}finally{o&&e.clearModuleState()}o&&goog.global.$jscomp.require.ensure([n.getPathName()],(function(){e.registerEs6ModuleExports(n.path,goog.global.$jscomp.require(n.getPathName()),i)})),e.loaded()}}var n=this;if(goog.global.CLOSURE_IMPORT_SCRIPT)t(),this.contents_&&goog.global.CLOSURE_IMPORT_SCRIPT("",this.contents_)?(this.contents_=null,e.loaded()):e.pause();else{var o=this.loadFlags.module==goog.ModuleType.ES6;this.lazyFetch_||t();var i=1<e.pending().length,a=i&&goog.DebugLoader_.IS_OLD_IE_;if(i=goog.Dependency.defer_&&(i||goog.isDocumentLoading_()),a||i)e.defer((function(){r()}));else{var s=goog.global.document;if(a=goog.inHtmlDocument_()&&"ActiveXObject"in goog.global,o&&goog.inHtmlDocument_()&&goog.isDocumentLoading_()&&!a){goog.Dependency.defer_=!0,e.pause();var u=s.onreadystatechange;s.onreadystatechange=function(){"interactive"==s.readyState&&(s.onreadystatechange=u,r(),e.resume()),goog.isFunction(u)&&u.apply(void 0,arguments)}}else!goog.DebugLoader_.IS_OLD_IE_&&goog.inHtmlDocument_()&&goog.isDocumentLoading_()?function(){var e=goog.global.document,t=goog.Dependency.registerCallback_((function(){goog.Dependency.unregisterCallback_(t),r()})),n='<script type="text/javascript">'+goog.protectScriptTag_('goog.Dependency.callback_("'+t+'");')+"<\/script>";e.write(goog.TRUSTED_TYPES_POLICY_?goog.TRUSTED_TYPES_POLICY_.createHTML(n):n)}():r()}}},goog.TransformedDependency.prototype.transform=function(e){},goog.TranspiledDependency=function(e,t,r,n,o,i){goog.TransformedDependency.call(this,e,t,r,n,o),this.transpiler=i},goog.inherits(goog.TranspiledDependency,goog.TransformedDependency),goog.TranspiledDependency.prototype.transform=function(e){return this.transpiler.transpile(e,this.getPathName())},goog.PreTranspiledEs6ModuleDependency=function(e,t,r,n,o){goog.TransformedDependency.call(this,e,t,r,n,o)},goog.inherits(goog.PreTranspiledEs6ModuleDependency,goog.TransformedDependency),goog.PreTranspiledEs6ModuleDependency.prototype.transform=function(e){return e},goog.GoogModuleDependency=function(e,t,r,n,o,i,a){goog.TransformedDependency.call(this,e,t,r,n,o),this.needsTranspile_=i,this.transpiler_=a},goog.inherits(goog.GoogModuleDependency,goog.TransformedDependency),goog.GoogModuleDependency.prototype.transform=function(e){return this.needsTranspile_&&(e=this.transpiler_.transpile(e,this.getPathName())),goog.LOAD_MODULE_USING_EVAL&&void 0!==goog.global.JSON?"goog.loadModule("+goog.global.JSON.stringify(e+"\n//# sourceURL="+this.path+"\n")+");":'goog.loadModule(function(exports) {"use strict";'+e+"\n;return exports});\n//# sourceURL="+this.path+"\n"},goog.DebugLoader_.IS_OLD_IE_=!(goog.global.atob||!goog.global.document||!goog.global.document.all),goog.DebugLoader_.prototype.addDependency=function(e,t,r,n){t=t||[],e=e.replace(/\\/g,"/");var o=goog.normalizePath_(goog.basePath+e);for(n&&"boolean"!=typeof n||(n=n?{module:goog.ModuleType.GOOG}:{}),r=this.factory_.createDependency(o,e,t,r,n,goog.transpiler_.needsTranspile(n.lang||"es3",n.module)),this.dependencies_[o]=r,r=0;r<t.length;r++)this.idToPath_[t[r]]=o;this.idToPath_[e]=o},goog.DependencyFactory=function(e){this.transpiler=e},goog.DependencyFactory.prototype.createDependency=function(e,t,r,n,o,i){return o.module==goog.ModuleType.GOOG?new goog.GoogModuleDependency(e,t,r,n,o,i,this.transpiler):i?new goog.TranspiledDependency(e,t,r,n,o,this.transpiler):o.module==goog.ModuleType.ES6?"never"==goog.TRANSPILE&&goog.ASSUME_ES_MODULES_TRANSPILED?new goog.PreTranspiledEs6ModuleDependency(e,t,r,n,o):new goog.Es6ModuleDependency(e,t,r,n,o):new goog.Dependency(e,t,r,n,o)},goog.debugLoader_=new goog.DebugLoader_,goog.loadClosureDeps=function(){goog.debugLoader_.loadClosureDeps()},goog.setDependencyFactory=function(e){goog.debugLoader_.setDependencyFactory(e)},goog.global.CLOSURE_NO_DEPS||goog.debugLoader_.loadClosureDeps(),goog.bootstrap=function(e,t){goog.debugLoader_.bootstrap(e,t)}),goog.TRUSTED_TYPES_POLICY_NAME="",goog.identity_=function(e){return e},goog.createTrustedTypesPolicy=function(e){var t=null,r=goog.global.trustedTypes||goog.global.TrustedTypes;if(!r||!r.createPolicy)return t;try{t=r.createPolicy(e,{createHTML:goog.identity_,createScript:goog.identity_,createScriptURL:goog.identity_,createURL:goog.identity_})}catch(e){goog.logToConsole_(e.message)}return t},goog.TRUSTED_TYPES_POLICY_=goog.TRUSTED_TYPES_POLICY_NAME?goog.createTrustedTypesPolicy(goog.TRUSTED_TYPES_POLICY_NAME+"#base"):null,goog.object={},goog.object.is=function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t},goog.object.forEach=function(e,t,r){for(var n in e)t.call(r,e[n],n,e)},goog.object.filter=function(e,t,r){var n,o={};for(n in e)t.call(r,e[n],n,e)&&(o[n]=e[n]);return o},goog.object.map=function(e,t,r){var n,o={};for(n in e)o[n]=t.call(r,e[n],n,e);return o},goog.object.some=function(e,t,r){for(var n in e)if(t.call(r,e[n],n,e))return!0;return!1},goog.object.every=function(e,t,r){for(var n in e)if(!t.call(r,e[n],n,e))return!1;return!0},goog.object.getCount=function(e){var t,r=0;for(t in e)r++;return r},goog.object.getAnyKey=function(e){for(var t in e)return t},goog.object.getAnyValue=function(e){for(var t in e)return e[t]},goog.object.contains=function(e,t){return goog.object.containsValue(e,t)},goog.object.getValues=function(e){var t,r=[],n=0;for(t in e)r[n++]=e[t];return r},goog.object.getKeys=function(e){var t,r=[],n=0;for(t in e)r[n++]=t;return r},goog.object.getValueByKeys=function(e,t){var r=goog.isArrayLike(t),n=r?t:arguments;for(r=r?0:1;r<n.length;r++){if(null==e)return;e=e[n[r]]}return e},goog.object.containsKey=function(e,t){return null!==e&&t in e},goog.object.containsValue=function(e,t){for(var r in e)if(e[r]==t)return!0;return!1},goog.object.findKey=function(e,t,r){for(var n in e)if(t.call(r,e[n],n,e))return n},goog.object.findValue=function(e,t,r){return(t=goog.object.findKey(e,t,r))&&e[t]},goog.object.isEmpty=function(e){for(var t in e)return!1;return!0},goog.object.clear=function(e){for(var t in e)delete e[t]},goog.object.remove=function(e,t){var r;return(r=t in e)&&delete e[t],r},goog.object.add=function(e,t,r){if(null!==e&&t in e)throw Error('The object already contains the key "'+t+'"');goog.object.set(e,t,r)},goog.object.get=function(e,t,r){return null!==e&&t in e?e[t]:r},goog.object.set=function(e,t,r){e[t]=r},goog.object.setIfUndefined=function(e,t,r){return t in e?e[t]:e[t]=r},goog.object.setWithReturnValueIfNotSet=function(e,t,r){return t in e?e[t]:(r=r(),e[t]=r)},goog.object.equals=function(e,t){for(var r in e)if(!(r in t)||e[r]!==t[r])return!1;for(var n in t)if(!(n in e))return!1;return!0},goog.object.clone=function(e){var t,r={};for(t in e)r[t]=e[t];return r},goog.object.unsafeClone=function(e){var t=goog.typeOf(e);if("object"==t||"array"==t){if(goog.isFunction(e.clone))return e.clone();for(var r in t="array"==t?[]:{},e)t[r]=goog.object.unsafeClone(e[r]);return t}return e},goog.object.transpose=function(e){var t,r={};for(t in e)r[e[t]]=t;return r},goog.object.PROTOTYPE_FIELDS_="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),goog.object.extend=function(e,t){for(var r,n,o=1;o<arguments.length;o++){for(r in n=arguments[o])e[r]=n[r];for(var i=0;i<goog.object.PROTOTYPE_FIELDS_.length;i++)r=goog.object.PROTOTYPE_FIELDS_[i],Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}},goog.object.create=function(e){var t=arguments.length;if(1==t&&Array.isArray(arguments[0]))return goog.object.create.apply(null,arguments[0]);if(t%2)throw Error("Uneven number of arguments");for(var r={},n=0;n<t;n+=2)r[arguments[n]]=arguments[n+1];return r},goog.object.createSet=function(e){var t=arguments.length;if(1==t&&Array.isArray(arguments[0]))return goog.object.createSet.apply(null,arguments[0]);for(var r={},n=0;n<t;n++)r[arguments[n]]=!0;return r},goog.object.createImmutableView=function(e){var t=e;return Object.isFrozen&&!Object.isFrozen(e)&&(t=Object.create(e),Object.freeze(t)),t},goog.object.isImmutableView=function(e){return!!Object.isFrozen&&Object.isFrozen(e)},goog.object.getAllPropertyNames=function(e,t,r){if(!e)return[];if(!Object.getOwnPropertyNames||!Object.getPrototypeOf)return goog.object.getKeys(e);for(var n={};e&&(e!==Object.prototype||t)&&(e!==Function.prototype||r);){for(var o=Object.getOwnPropertyNames(e),i=0;i<o.length;i++)n[o[i]]=!0;e=Object.getPrototypeOf(e)}return goog.object.getKeys(n)},goog.object.getSuperClass=function(e){return(e=Object.getPrototypeOf(e.prototype))&&e.constructor};var jspb={asserts:{}};jspb.asserts.doAssertFailure=function(e,t,r,n){var o="Assertion failed";if(r){o+=": "+r;var i=n}else e&&(o+=": "+e,i=t);throw Error(""+o,i||[])},jspb.asserts.assert=function(e,t,r){for(var n=[],o=2;o<arguments.length;++o)n[o-2]=arguments[o];return e||jspb.asserts.doAssertFailure("",null,t,n),e},jspb.asserts.assertString=function(e,t,r){for(var n=[],o=2;o<arguments.length;++o)n[o-2]=arguments[o];return"string"!=typeof e&&jspb.asserts.doAssertFailure("Expected string but got %s: %s.",[goog.typeOf(e),e],t,n),e},jspb.asserts.assertArray=function(e,t,r){for(var n=[],o=2;o<arguments.length;++o)n[o-2]=arguments[o];return Array.isArray(e)||jspb.asserts.doAssertFailure("Expected array but got %s: %s.",[goog.typeOf(e),e],t,n),e},jspb.asserts.fail=function(e,t){for(var r=[],n=1;n<arguments.length;++n)r[n-1]=arguments[n];throw Error("Failure"+(e?": "+e:""),r)},jspb.asserts.assertInstanceof=function(e,t,r,n){for(var o=[],i=3;i<arguments.length;++i)o[i-3]=arguments[i];return e instanceof t||jspb.asserts.doAssertFailure("Expected instanceof %s but got %s.",[jspb.asserts.getType(t),jspb.asserts.getType(e)],r,o),e},jspb.asserts.getType=function(e){return e instanceof Function?e.displayName||e.name||"unknown type name":e instanceof Object?e.constructor.displayName||e.constructor.name||Object.prototype.toString.call(e):null===e?"null":typeof e},jspb.BinaryConstants={},jspb.ConstBinaryMessage=function(){},jspb.BinaryMessage=function(){},jspb.BinaryConstants.FieldType={INVALID:-1,DOUBLE:1,FLOAT:2,INT64:3,UINT64:4,INT32:5,FIXED64:6,FIXED32:7,BOOL:8,STRING:9,GROUP:10,MESSAGE:11,BYTES:12,UINT32:13,ENUM:14,SFIXED32:15,SFIXED64:16,SINT32:17,SINT64:18,FHASH64:30,VHASH64:31},jspb.BinaryConstants.WireType={INVALID:-1,VARINT:0,FIXED64:1,DELIMITED:2,START_GROUP:3,END_GROUP:4,FIXED32:5},jspb.BinaryConstants.FieldTypeToWireType=function(e){var t=jspb.BinaryConstants.FieldType,r=jspb.BinaryConstants.WireType;switch(e){case t.INT32:case t.INT64:case t.UINT32:case t.UINT64:case t.SINT32:case t.SINT64:case t.BOOL:case t.ENUM:case t.VHASH64:return r.VARINT;case t.DOUBLE:case t.FIXED64:case t.SFIXED64:case t.FHASH64:return r.FIXED64;case t.STRING:case t.MESSAGE:case t.BYTES:return r.DELIMITED;case t.FLOAT:case t.FIXED32:case t.SFIXED32:return r.FIXED32;default:return r.INVALID}},jspb.BinaryConstants.INVALID_FIELD_NUMBER=-1,jspb.BinaryConstants.FLOAT32_EPS=1401298464324817e-60,jspb.BinaryConstants.FLOAT32_MIN=11754943508222875e-54,jspb.BinaryConstants.FLOAT32_MAX=34028234663852886e22,jspb.BinaryConstants.FLOAT64_EPS=5e-324,jspb.BinaryConstants.FLOAT64_MIN=22250738585072014e-324,jspb.BinaryConstants.FLOAT64_MAX=17976931348623157e292,jspb.BinaryConstants.TWO_TO_20=1048576,jspb.BinaryConstants.TWO_TO_23=8388608,jspb.BinaryConstants.TWO_TO_31=2147483648,jspb.BinaryConstants.TWO_TO_32=4294967296,jspb.BinaryConstants.TWO_TO_52=4503599627370496,jspb.BinaryConstants.TWO_TO_63=0x8000000000000000,jspb.BinaryConstants.TWO_TO_64=0x10000000000000000,jspb.BinaryConstants.ZERO_HASH="\0\0\0\0\0\0\0\0",goog.debug={},goog.debug.Error=function(e){if(Error.captureStackTrace)Error.captureStackTrace(this,goog.debug.Error);else{var t=Error().stack;t&&(this.stack=t)}e&&(this.message=String(e)),this.reportErrorToServer=!0},goog.inherits(goog.debug.Error,Error),goog.debug.Error.prototype.name="CustomError",goog.dom={},goog.dom.NodeType={ELEMENT:1,ATTRIBUTE:2,TEXT:3,CDATA_SECTION:4,ENTITY_REFERENCE:5,ENTITY:6,PROCESSING_INSTRUCTION:7,COMMENT:8,DOCUMENT:9,DOCUMENT_TYPE:10,DOCUMENT_FRAGMENT:11,NOTATION:12},goog.asserts={},goog.asserts.ENABLE_ASSERTS=goog.DEBUG,goog.asserts.AssertionError=function(e,t){goog.debug.Error.call(this,goog.asserts.subs_(e,t)),this.messagePattern=e},goog.inherits(goog.asserts.AssertionError,goog.debug.Error),goog.asserts.AssertionError.prototype.name="AssertionError",goog.asserts.DEFAULT_ERROR_HANDLER=function(e){throw e},goog.asserts.errorHandler_=goog.asserts.DEFAULT_ERROR_HANDLER,goog.asserts.subs_=function(e,t){for(var r="",n=(e=e.split("%s")).length-1,o=0;o<n;o++)r+=e[o]+(o<t.length?t[o]:"%s");return r+e[n]},goog.asserts.doAssertFailure_=function(e,t,r,n){var o="Assertion failed";if(r){o+=": "+r;var i=n}else e&&(o+=": "+e,i=t);e=new goog.asserts.AssertionError(""+o,i||[]),goog.asserts.errorHandler_(e)},goog.asserts.setErrorHandler=function(e){goog.asserts.ENABLE_ASSERTS&&(goog.asserts.errorHandler_=e)},goog.asserts.assert=function(e,t,r){return goog.asserts.ENABLE_ASSERTS&&!e&&goog.asserts.doAssertFailure_("",null,t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertExists=function(e,t,r){return goog.asserts.ENABLE_ASSERTS&&null==e&&goog.asserts.doAssertFailure_("Expected to exist: %s.",[e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.fail=function(e,t){goog.asserts.ENABLE_ASSERTS&&goog.asserts.errorHandler_(new goog.asserts.AssertionError("Failure"+(e?": "+e:""),Array.prototype.slice.call(arguments,1)))},goog.asserts.assertNumber=function(e,t,r){return goog.asserts.ENABLE_ASSERTS&&"number"!=typeof e&&goog.asserts.doAssertFailure_("Expected number but got %s: %s.",[goog.typeOf(e),e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertString=function(e,t,r){return goog.asserts.ENABLE_ASSERTS&&"string"!=typeof e&&goog.asserts.doAssertFailure_("Expected string but got %s: %s.",[goog.typeOf(e),e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertFunction=function(e,t,r){return goog.asserts.ENABLE_ASSERTS&&!goog.isFunction(e)&&goog.asserts.doAssertFailure_("Expected function but got %s: %s.",[goog.typeOf(e),e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertObject=function(e,t,r){return goog.asserts.ENABLE_ASSERTS&&!goog.isObject(e)&&goog.asserts.doAssertFailure_("Expected object but got %s: %s.",[goog.typeOf(e),e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertArray=function(e,t,r){return goog.asserts.ENABLE_ASSERTS&&!Array.isArray(e)&&goog.asserts.doAssertFailure_("Expected array but got %s: %s.",[goog.typeOf(e),e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertBoolean=function(e,t,r){return goog.asserts.ENABLE_ASSERTS&&"boolean"!=typeof e&&goog.asserts.doAssertFailure_("Expected boolean but got %s: %s.",[goog.typeOf(e),e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertElement=function(e,t,r){return!goog.asserts.ENABLE_ASSERTS||goog.isObject(e)&&e.nodeType==goog.dom.NodeType.ELEMENT||goog.asserts.doAssertFailure_("Expected Element but got %s: %s.",[goog.typeOf(e),e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertInstanceof=function(e,t,r,n){return!goog.asserts.ENABLE_ASSERTS||e instanceof t||goog.asserts.doAssertFailure_("Expected instanceof %s but got %s.",[goog.asserts.getType_(t),goog.asserts.getType_(e)],r,Array.prototype.slice.call(arguments,3)),e},goog.asserts.assertFinite=function(e,t,r){return!goog.asserts.ENABLE_ASSERTS||"number"==typeof e&&isFinite(e)||goog.asserts.doAssertFailure_("Expected %s to be a finite number but it is not.",[e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertObjectPrototypeIsIntact=function(){for(var e in Object.prototype)goog.asserts.fail(e+" should not be enumerable in Object.prototype.")},goog.asserts.getType_=function(e){return e instanceof Function?e.displayName||e.name||"unknown type name":e instanceof Object?e.constructor.displayName||e.constructor.name||Object.prototype.toString.call(e):null===e?"null":typeof e},goog.array={},goog.NATIVE_ARRAY_PROTOTYPES=goog.TRUSTED_SITE,goog.array.ASSUME_NATIVE_FUNCTIONS=2012<goog.FEATURESET_YEAR,goog.array.peek=function(e){return e[e.length-1]},goog.array.last=goog.array.peek,goog.array.indexOf=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.indexOf)?function(e,t,r){return goog.asserts.assert(null!=e.length),Array.prototype.indexOf.call(e,t,r)}:function(e,t,r){if(r=null==r?0:0>r?Math.max(0,e.length+r):r,"string"==typeof e)return"string"!=typeof t||1!=t.length?-1:e.indexOf(t,r);for(;r<e.length;r++)if(r in e&&e[r]===t)return r;return-1},goog.array.lastIndexOf=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.lastIndexOf)?function(e,t,r){return goog.asserts.assert(null!=e.length),Array.prototype.lastIndexOf.call(e,t,null==r?e.length-1:r)}:function(e,t,r){if(0>(r=null==r?e.length-1:r)&&(r=Math.max(0,e.length+r)),"string"==typeof e)return"string"!=typeof t||1!=t.length?-1:e.lastIndexOf(t,r);for(;0<=r;r--)if(r in e&&e[r]===t)return r;return-1},goog.array.forEach=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.forEach)?function(e,t,r){goog.asserts.assert(null!=e.length),Array.prototype.forEach.call(e,t,r)}:function(e,t,r){for(var n=e.length,o="string"==typeof e?e.split(""):e,i=0;i<n;i++)i in o&&t.call(r,o[i],i,e)},goog.array.forEachRight=function(e,t,r){var n=e.length,o="string"==typeof e?e.split(""):e;for(--n;0<=n;--n)n in o&&t.call(r,o[n],n,e)},goog.array.filter=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.filter)?function(e,t,r){return goog.asserts.assert(null!=e.length),Array.prototype.filter.call(e,t,r)}:function(e,t,r){for(var n=e.length,o=[],i=0,a="string"==typeof e?e.split(""):e,s=0;s<n;s++)if(s in a){var u=a[s];t.call(r,u,s,e)&&(o[i++]=u)}return o},goog.array.map=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.map)?function(e,t,r){return goog.asserts.assert(null!=e.length),Array.prototype.map.call(e,t,r)}:function(e,t,r){for(var n=e.length,o=Array(n),i="string"==typeof e?e.split(""):e,a=0;a<n;a++)a in i&&(o[a]=t.call(r,i[a],a,e));return o},goog.array.reduce=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.reduce)?function(e,t,r,n){return goog.asserts.assert(null!=e.length),n&&(t=goog.bind(t,n)),Array.prototype.reduce.call(e,t,r)}:function(e,t,r,n){var o=r;return goog.array.forEach(e,(function(r,i){o=t.call(n,o,r,i,e)})),o},goog.array.reduceRight=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.reduceRight)?function(e,t,r,n){return goog.asserts.assert(null!=e.length),goog.asserts.assert(null!=t),n&&(t=goog.bind(t,n)),Array.prototype.reduceRight.call(e,t,r)}:function(e,t,r,n){var o=r;return goog.array.forEachRight(e,(function(r,i){o=t.call(n,o,r,i,e)})),o},goog.array.some=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.some)?function(e,t,r){return goog.asserts.assert(null!=e.length),Array.prototype.some.call(e,t,r)}:function(e,t,r){for(var n=e.length,o="string"==typeof e?e.split(""):e,i=0;i<n;i++)if(i in o&&t.call(r,o[i],i,e))return!0;return!1},goog.array.every=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.every)?function(e,t,r){return goog.asserts.assert(null!=e.length),Array.prototype.every.call(e,t,r)}:function(e,t,r){for(var n=e.length,o="string"==typeof e?e.split(""):e,i=0;i<n;i++)if(i in o&&!t.call(r,o[i],i,e))return!1;return!0},goog.array.count=function(e,t,r){var n=0;return goog.array.forEach(e,(function(e,o,i){t.call(r,e,o,i)&&++n}),r),n},goog.array.find=function(e,t,r){return 0>(t=goog.array.findIndex(e,t,r))?null:"string"==typeof e?e.charAt(t):e[t]},goog.array.findIndex=function(e,t,r){for(var n=e.length,o="string"==typeof e?e.split(""):e,i=0;i<n;i++)if(i in o&&t.call(r,o[i],i,e))return i;return-1},goog.array.findRight=function(e,t,r){return 0>(t=goog.array.findIndexRight(e,t,r))?null:"string"==typeof e?e.charAt(t):e[t]},goog.array.findIndexRight=function(e,t,r){var n=e.length,o="string"==typeof e?e.split(""):e;for(--n;0<=n;n--)if(n in o&&t.call(r,o[n],n,e))return n;return-1},goog.array.contains=function(e,t){return 0<=goog.array.indexOf(e,t)},goog.array.isEmpty=function(e){return 0==e.length},goog.array.clear=function(e){if(!Array.isArray(e))for(var t=e.length-1;0<=t;t--)delete e[t];e.length=0},goog.array.insert=function(e,t){goog.array.contains(e,t)||e.push(t)},goog.array.insertAt=function(e,t,r){goog.array.splice(e,r,0,t)},goog.array.insertArrayAt=function(e,t,r){goog.partial(goog.array.splice,e,r,0).apply(null,t)},goog.array.insertBefore=function(e,t,r){var n;2==arguments.length||0>(n=goog.array.indexOf(e,r))?e.push(t):goog.array.insertAt(e,t,n)},goog.array.remove=function(e,t){var r;return(r=0<=(t=goog.array.indexOf(e,t)))&&goog.array.removeAt(e,t),r},goog.array.removeLast=function(e,t){return 0<=(t=goog.array.lastIndexOf(e,t))&&(goog.array.removeAt(e,t),!0)},goog.array.removeAt=function(e,t){return goog.asserts.assert(null!=e.length),1==Array.prototype.splice.call(e,t,1).length},goog.array.removeIf=function(e,t,r){return 0<=(t=goog.array.findIndex(e,t,r))&&(goog.array.removeAt(e,t),!0)},goog.array.removeAllIf=function(e,t,r){var n=0;return goog.array.forEachRight(e,(function(o,i){t.call(r,o,i,e)&&goog.array.removeAt(e,i)&&n++})),n},goog.array.concat=function(e){return Array.prototype.concat.apply([],arguments)},goog.array.join=function(e){return Array.prototype.concat.apply([],arguments)},goog.array.toArray=function(e){var t=e.length;if(0<t){for(var r=Array(t),n=0;n<t;n++)r[n]=e[n];return r}return[]},goog.array.clone=goog.array.toArray,goog.array.extend=function(e,t){for(var r=1;r<arguments.length;r++){var n=arguments[r];if(goog.isArrayLike(n)){var o=e.length||0,i=n.length||0;e.length=o+i;for(var a=0;a<i;a++)e[o+a]=n[a]}else e.push(n)}},goog.array.splice=function(e,t,r,n){return goog.asserts.assert(null!=e.length),Array.prototype.splice.apply(e,goog.array.slice(arguments,1))},goog.array.slice=function(e,t,r){return goog.asserts.assert(null!=e.length),2>=arguments.length?Array.prototype.slice.call(e,t):Array.prototype.slice.call(e,t,r)},goog.array.removeDuplicates=function(e,t,r){t=t||e;var n=function(e){return goog.isObject(e)?"o"+goog.getUid(e):(typeof e).charAt(0)+e};r=r||n,n={};for(var o=0,i=0;i<e.length;){var a=e[i++],s=r(a);Object.prototype.hasOwnProperty.call(n,s)||(n[s]=!0,t[o++]=a)}t.length=o},goog.array.binarySearch=function(e,t,r){return goog.array.binarySearch_(e,r||goog.array.defaultCompare,!1,t)},goog.array.binarySelect=function(e,t,r){return goog.array.binarySearch_(e,t,!0,void 0,r)},goog.array.binarySearch_=function(e,t,r,n,o){for(var i,a=0,s=e.length;a<s;){var u=a+(s-a>>>1),l=r?t.call(o,e[u],u,e):t(n,e[u]);0<l?a=u+1:(s=u,i=!l)}return i?a:-a-1},goog.array.sort=function(e,t){e.sort(t||goog.array.defaultCompare)},goog.array.stableSort=function(e,t){for(var r=Array(e.length),n=0;n<e.length;n++)r[n]={index:n,value:e[n]};var o=t||goog.array.defaultCompare;for(goog.array.sort(r,(function(e,t){return o(e.value,t.value)||e.index-t.index})),n=0;n<e.length;n++)e[n]=r[n].value},goog.array.sortByKey=function(e,t,r){var n=r||goog.array.defaultCompare;goog.array.sort(e,(function(e,r){return n(t(e),t(r))}))},goog.array.sortObjectsByKey=function(e,t,r){goog.array.sortByKey(e,(function(e){return e[t]}),r)},goog.array.isSorted=function(e,t,r){t=t||goog.array.defaultCompare;for(var n=1;n<e.length;n++){var o=t(e[n-1],e[n]);if(0<o||0==o&&r)return!1}return!0},goog.array.equals=function(e,t,r){if(!goog.isArrayLike(e)||!goog.isArrayLike(t)||e.length!=t.length)return!1;var n=e.length;r=r||goog.array.defaultCompareEquality;for(var o=0;o<n;o++)if(!r(e[o],t[o]))return!1;return!0},goog.array.compare3=function(e,t,r){r=r||goog.array.defaultCompare;for(var n=Math.min(e.length,t.length),o=0;o<n;o++){var i=r(e[o],t[o]);if(0!=i)return i}return goog.array.defaultCompare(e.length,t.length)},goog.array.defaultCompare=function(e,t){return e>t?1:e<t?-1:0},goog.array.inverseDefaultCompare=function(e,t){return-goog.array.defaultCompare(e,t)},goog.array.defaultCompareEquality=function(e,t){return e===t},goog.array.binaryInsert=function(e,t,r){return 0>(r=goog.array.binarySearch(e,t,r))&&(goog.array.insertAt(e,t,-(r+1)),!0)},goog.array.binaryRemove=function(e,t,r){return 0<=(t=goog.array.binarySearch(e,t,r))&&goog.array.removeAt(e,t)},goog.array.bucket=function(e,t,r){for(var n={},o=0;o<e.length;o++){var i=e[o],a=t.call(r,i,o,e);void 0!==a&&(n[a]||(n[a]=[])).push(i)}return n},goog.array.toObject=function(e,t,r){var n={};return goog.array.forEach(e,(function(o,i){n[t.call(r,o,i,e)]=o})),n},goog.array.range=function(e,t,r){var n=[],o=0,i=e;if(void 0!==t&&(o=e,i=t),0>(r=r||1)*(i-o))return[];if(0<r)for(e=o;e<i;e+=r)n.push(e);else for(e=o;e>i;e+=r)n.push(e);return n},goog.array.repeat=function(e,t){for(var r=[],n=0;n<t;n++)r[n]=e;return r},goog.array.flatten=function(e){for(var t=[],r=0;r<arguments.length;r++){var n=arguments[r];if(Array.isArray(n))for(var o=0;o<n.length;o+=8192){var i=goog.array.slice(n,o,o+8192);i=goog.array.flatten.apply(null,i);for(var a=0;a<i.length;a++)t.push(i[a])}else t.push(n)}return t},goog.array.rotate=function(e,t){return goog.asserts.assert(null!=e.length),e.length&&(0<(t%=e.length)?Array.prototype.unshift.apply(e,e.splice(-t,t)):0>t&&Array.prototype.push.apply(e,e.splice(0,-t))),e},goog.array.moveItem=function(e,t,r){goog.asserts.assert(0<=t&&t<e.length),goog.asserts.assert(0<=r&&r<e.length),t=Array.prototype.splice.call(e,t,1),Array.prototype.splice.call(e,r,0,t[0])},goog.array.zip=function(e){if(!arguments.length)return[];for(var t=[],r=arguments[0].length,n=1;n<arguments.length;n++)arguments[n].length<r&&(r=arguments[n].length);for(n=0;n<r;n++){for(var o=[],i=0;i<arguments.length;i++)o.push(arguments[i][n]);t.push(o)}return t},goog.array.shuffle=function(e,t){t=t||Math.random;for(var r=e.length-1;0<r;r--){var n=Math.floor(t()*(r+1)),o=e[r];e[r]=e[n],e[n]=o}},goog.array.copyByIndex=function(e,t){var r=[];return goog.array.forEach(t,(function(t){r.push(e[t])})),r},goog.array.concatMap=function(e,t,r){return goog.array.concat.apply([],goog.array.map(e,t,r))},goog.crypt={},goog.crypt.stringToByteArray=function(e){for(var t=[],r=0,n=0;n<e.length;n++){var o=e.charCodeAt(n);255<o&&(t[r++]=255&o,o>>=8),t[r++]=o}return t},goog.crypt.byteArrayToString=function(e){if(8192>=e.length)return String.fromCharCode.apply(null,e);for(var t="",r=0;r<e.length;r+=8192){var n=goog.array.slice(e,r,r+8192);t+=String.fromCharCode.apply(null,n)}return t},goog.crypt.byteArrayToHex=function(e,t){return goog.array.map(e,(function(e){return 1<(e=e.toString(16)).length?e:"0"+e})).join(t||"")},goog.crypt.hexToByteArray=function(e){goog.asserts.assert(0==e.length%2,"Key string length must be multiple of 2");for(var t=[],r=0;r<e.length;r+=2)t.push(parseInt(e.substring(r,r+2),16));return t},goog.crypt.stringToUtf8ByteArray=function(e){for(var t=[],r=0,n=0;n<e.length;n++){var o=e.charCodeAt(n);128>o?t[r++]=o:(2048>o?t[r++]=o>>6|192:(55296==(64512&o)&&n+1<e.length&&56320==(64512&e.charCodeAt(n+1))?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++n)),t[r++]=o>>18|240,t[r++]=o>>12&63|128):t[r++]=o>>12|224,t[r++]=o>>6&63|128),t[r++]=63&o|128)}return t},goog.crypt.utf8ByteArrayToString=function(e){for(var t=[],r=0,n=0;r<e.length;){var o=e[r++];if(128>o)t[n++]=String.fromCharCode(o);else if(191<o&&224>o){var i=e[r++];t[n++]=String.fromCharCode((31&o)<<6|63&i)}else if(239<o&&365>o){i=e[r++];var a=e[r++];o=((7&o)<<18|(63&i)<<12|(63&a)<<6|63&e[r++])-65536,t[n++]=String.fromCharCode(55296+(o>>10)),t[n++]=String.fromCharCode(56320+(1023&o))}else i=e[r++],a=e[r++],t[n++]=String.fromCharCode((15&o)<<12|(63&i)<<6|63&a)}return t.join("")},goog.crypt.xorByteArray=function(e,t){goog.asserts.assert(e.length==t.length,"XOR array lengths must match");for(var r=[],n=0;n<e.length;n++)r.push(e[n]^t[n]);return r},goog.dom.asserts={},goog.dom.asserts.assertIsLocation=function(e){if(goog.asserts.ENABLE_ASSERTS){var t=goog.dom.asserts.getWindow_(e);t&&(!e||!(e instanceof t.Location)&&e instanceof t.Element)&&goog.asserts.fail("Argument is not a Location (or a non-Element mock); got: %s",goog.dom.asserts.debugStringForType_(e))}return e},goog.dom.asserts.assertIsElementType_=function(e,t){if(goog.asserts.ENABLE_ASSERTS){var r=goog.dom.asserts.getWindow_(e);r&&void 0!==r[t]&&(e&&(e instanceof r[t]||!(e instanceof r.Location||e instanceof r.Element))||goog.asserts.fail("Argument is not a %s (or a non-Element, non-Location mock); got: %s",t,goog.dom.asserts.debugStringForType_(e)))}return e},goog.dom.asserts.assertIsHTMLAnchorElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLAnchorElement")},goog.dom.asserts.assertIsHTMLButtonElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLButtonElement")},goog.dom.asserts.assertIsHTMLLinkElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLLinkElement")},goog.dom.asserts.assertIsHTMLImageElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLImageElement")},goog.dom.asserts.assertIsHTMLAudioElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLAudioElement")},goog.dom.asserts.assertIsHTMLVideoElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLVideoElement")},goog.dom.asserts.assertIsHTMLInputElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLInputElement")},goog.dom.asserts.assertIsHTMLTextAreaElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLTextAreaElement")},goog.dom.asserts.assertIsHTMLCanvasElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLCanvasElement")},goog.dom.asserts.assertIsHTMLEmbedElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLEmbedElement")},goog.dom.asserts.assertIsHTMLFormElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLFormElement")},goog.dom.asserts.assertIsHTMLFrameElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLFrameElement")},goog.dom.asserts.assertIsHTMLIFrameElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLIFrameElement")},goog.dom.asserts.assertIsHTMLObjectElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLObjectElement")},goog.dom.asserts.assertIsHTMLScriptElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLScriptElement")},goog.dom.asserts.debugStringForType_=function(e){if(!goog.isObject(e))return void 0===e?"undefined":null===e?"null":typeof e;try{return e.constructor.displayName||e.constructor.name||Object.prototype.toString.call(e)}catch(e){return"<object could not be stringified>"}},goog.dom.asserts.getWindow_=function(e){try{var t=e&&e.ownerDocument,r=t&&(t.defaultView||t.parentWindow);if((r=r||goog.global).Element&&r.Location)return r}catch(e){}return null},goog.functions={},goog.functions.constant=function(e){return function(){return e}},goog.functions.FALSE=function(){return!1},goog.functions.TRUE=function(){return!0},goog.functions.NULL=function(){return null},goog.functions.identity=function(e,t){return e},goog.functions.error=function(e){return function(){throw Error(e)}},goog.functions.fail=function(e){return function(){throw e}},goog.functions.lock=function(e,t){return t=t||0,function(){return e.apply(this,Array.prototype.slice.call(arguments,0,t))}},goog.functions.nth=function(e){return function(){return arguments[e]}},goog.functions.partialRight=function(e,t){var r=Array.prototype.slice.call(arguments,1);return function(){var t=Array.prototype.slice.call(arguments);return t.push.apply(t,r),e.apply(this,t)}},goog.functions.withReturnValue=function(e,t){return goog.functions.sequence(e,goog.functions.constant(t))},goog.functions.equalTo=function(e,t){return function(r){return t?e==r:e===r}},goog.functions.compose=function(e,t){var r=arguments,n=r.length;return function(){var e;n&&(e=r[n-1].apply(this,arguments));for(var t=n-2;0<=t;t--)e=r[t].call(this,e);return e}},goog.functions.sequence=function(e){var t=arguments,r=t.length;return function(){for(var e,n=0;n<r;n++)e=t[n].apply(this,arguments);return e}},goog.functions.and=function(e){var t=arguments,r=t.length;return function(){for(var e=0;e<r;e++)if(!t[e].apply(this,arguments))return!1;return!0}},goog.functions.or=function(e){var t=arguments,r=t.length;return function(){for(var e=0;e<r;e++)if(t[e].apply(this,arguments))return!0;return!1}},goog.functions.not=function(e){return function(){return!e.apply(this,arguments)}},goog.functions.create=function(e,t){var r=function(){};return r.prototype=e.prototype,r=new r,e.apply(r,Array.prototype.slice.call(arguments,1)),r},goog.functions.CACHE_RETURN_VALUE=!0,goog.functions.cacheReturnValue=function(e){var t,r=!1;return function(){return goog.functions.CACHE_RETURN_VALUE?(r||(t=e(),r=!0),t):e()}},goog.functions.once=function(e){var t=e;return function(){if(t){var e=t;t=null,e()}}},goog.functions.debounce=function(e,t,r){var n=0;return function(o){goog.global.clearTimeout(n);var i=arguments;n=goog.global.setTimeout((function(){e.apply(r,i)}),t)}},goog.functions.throttle=function(e,t,r){var n=0,o=!1,i=[],a=function(){n=0,o&&(o=!1,s())},s=function(){n=goog.global.setTimeout(a,t),e.apply(r,i)};return function(e){i=arguments,n?o=!0:s()}},goog.functions.rateLimit=function(e,t,r){var n=0,o=function(){n=0};return function(i){n||(n=goog.global.setTimeout(o,t),e.apply(r,arguments))}},goog.dom.HtmlElement=function(){},goog.dom.TagName=function(e){this.tagName_=e},goog.dom.TagName.prototype.toString=function(){return this.tagName_},goog.dom.TagName.A=new goog.dom.TagName("A"),goog.dom.TagName.ABBR=new goog.dom.TagName("ABBR"),goog.dom.TagName.ACRONYM=new goog.dom.TagName("ACRONYM"),goog.dom.TagName.ADDRESS=new goog.dom.TagName("ADDRESS"),goog.dom.TagName.APPLET=new goog.dom.TagName("APPLET"),goog.dom.TagName.AREA=new goog.dom.TagName("AREA"),goog.dom.TagName.ARTICLE=new goog.dom.TagName("ARTICLE"),goog.dom.TagName.ASIDE=new goog.dom.TagName("ASIDE"),goog.dom.TagName.AUDIO=new goog.dom.TagName("AUDIO"),goog.dom.TagName.B=new goog.dom.TagName("B"),goog.dom.TagName.BASE=new goog.dom.TagName("BASE"),goog.dom.TagName.BASEFONT=new goog.dom.TagName("BASEFONT"),goog.dom.TagName.BDI=new goog.dom.TagName("BDI"),goog.dom.TagName.BDO=new goog.dom.TagName("BDO"),goog.dom.TagName.BIG=new goog.dom.TagName("BIG"),goog.dom.TagName.BLOCKQUOTE=new goog.dom.TagName("BLOCKQUOTE"),goog.dom.TagName.BODY=new goog.dom.TagName("BODY"),goog.dom.TagName.BR=new goog.dom.TagName("BR"),goog.dom.TagName.BUTTON=new goog.dom.TagName("BUTTON"),goog.dom.TagName.CANVAS=new goog.dom.TagName("CANVAS"),goog.dom.TagName.CAPTION=new goog.dom.TagName("CAPTION"),goog.dom.TagName.CENTER=new goog.dom.TagName("CENTER"),goog.dom.TagName.CITE=new goog.dom.TagName("CITE"),goog.dom.TagName.CODE=new goog.dom.TagName("CODE"),goog.dom.TagName.COL=new goog.dom.TagName("COL"),goog.dom.TagName.COLGROUP=new goog.dom.TagName("COLGROUP"),goog.dom.TagName.COMMAND=new goog.dom.TagName("COMMAND"),goog.dom.TagName.DATA=new goog.dom.TagName("DATA"),goog.dom.TagName.DATALIST=new goog.dom.TagName("DATALIST"),goog.dom.TagName.DD=new goog.dom.TagName("DD"),goog.dom.TagName.DEL=new goog.dom.TagName("DEL"),goog.dom.TagName.DETAILS=new goog.dom.TagName("DETAILS"),goog.dom.TagName.DFN=new goog.dom.TagName("DFN"),goog.dom.TagName.DIALOG=new goog.dom.TagName("DIALOG"),goog.dom.TagName.DIR=new goog.dom.TagName("DIR"),goog.dom.TagName.DIV=new goog.dom.TagName("DIV"),goog.dom.TagName.DL=new goog.dom.TagName("DL"),goog.dom.TagName.DT=new goog.dom.TagName("DT"),goog.dom.TagName.EM=new goog.dom.TagName("EM"),goog.dom.TagName.EMBED=new goog.dom.TagName("EMBED"),goog.dom.TagName.FIELDSET=new goog.dom.TagName("FIELDSET"),goog.dom.TagName.FIGCAPTION=new goog.dom.TagName("FIGCAPTION"),goog.dom.TagName.FIGURE=new goog.dom.TagName("FIGURE"),goog.dom.TagName.FONT=new goog.dom.TagName("FONT"),goog.dom.TagName.FOOTER=new goog.dom.TagName("FOOTER"),goog.dom.TagName.FORM=new goog.dom.TagName("FORM"),goog.dom.TagName.FRAME=new goog.dom.TagName("FRAME"),goog.dom.TagName.FRAMESET=new goog.dom.TagName("FRAMESET"),goog.dom.TagName.H1=new goog.dom.TagName("H1"),goog.dom.TagName.H2=new goog.dom.TagName("H2"),goog.dom.TagName.H3=new goog.dom.TagName("H3"),goog.dom.TagName.H4=new goog.dom.TagName("H4"),goog.dom.TagName.H5=new goog.dom.TagName("H5"),goog.dom.TagName.H6=new goog.dom.TagName("H6"),goog.dom.TagName.HEAD=new goog.dom.TagName("HEAD"),goog.dom.TagName.HEADER=new goog.dom.TagName("HEADER"),goog.dom.TagName.HGROUP=new goog.dom.TagName("HGROUP"),goog.dom.TagName.HR=new goog.dom.TagName("HR"),goog.dom.TagName.HTML=new goog.dom.TagName("HTML"),goog.dom.TagName.I=new goog.dom.TagName("I"),goog.dom.TagName.IFRAME=new goog.dom.TagName("IFRAME"),goog.dom.TagName.IMG=new goog.dom.TagName("IMG"),goog.dom.TagName.INPUT=new goog.dom.TagName("INPUT"),goog.dom.TagName.INS=new goog.dom.TagName("INS"),goog.dom.TagName.ISINDEX=new goog.dom.TagName("ISINDEX"),goog.dom.TagName.KBD=new goog.dom.TagName("KBD"),goog.dom.TagName.KEYGEN=new goog.dom.TagName("KEYGEN"),goog.dom.TagName.LABEL=new goog.dom.TagName("LABEL"),goog.dom.TagName.LEGEND=new goog.dom.TagName("LEGEND"),goog.dom.TagName.LI=new goog.dom.TagName("LI"),goog.dom.TagName.LINK=new goog.dom.TagName("LINK"),goog.dom.TagName.MAIN=new goog.dom.TagName("MAIN"),goog.dom.TagName.MAP=new goog.dom.TagName("MAP"),goog.dom.TagName.MARK=new goog.dom.TagName("MARK"),goog.dom.TagName.MATH=new goog.dom.TagName("MATH"),goog.dom.TagName.MENU=new goog.dom.TagName("MENU"),goog.dom.TagName.MENUITEM=new goog.dom.TagName("MENUITEM"),goog.dom.TagName.META=new goog.dom.TagName("META"),goog.dom.TagName.METER=new goog.dom.TagName("METER"),goog.dom.TagName.NAV=new goog.dom.TagName("NAV"),goog.dom.TagName.NOFRAMES=new goog.dom.TagName("NOFRAMES"),goog.dom.TagName.NOSCRIPT=new goog.dom.TagName("NOSCRIPT"),goog.dom.TagName.OBJECT=new goog.dom.TagName("OBJECT"),goog.dom.TagName.OL=new goog.dom.TagName("OL"),goog.dom.TagName.OPTGROUP=new goog.dom.TagName("OPTGROUP"),goog.dom.TagName.OPTION=new goog.dom.TagName("OPTION"),goog.dom.TagName.OUTPUT=new goog.dom.TagName("OUTPUT"),goog.dom.TagName.P=new goog.dom.TagName("P"),goog.dom.TagName.PARAM=new goog.dom.TagName("PARAM"),goog.dom.TagName.PICTURE=new goog.dom.TagName("PICTURE"),goog.dom.TagName.PRE=new goog.dom.TagName("PRE"),goog.dom.TagName.PROGRESS=new goog.dom.TagName("PROGRESS"),goog.dom.TagName.Q=new goog.dom.TagName("Q"),goog.dom.TagName.RP=new goog.dom.TagName("RP"),goog.dom.TagName.RT=new goog.dom.TagName("RT"),goog.dom.TagName.RTC=new goog.dom.TagName("RTC"),goog.dom.TagName.RUBY=new goog.dom.TagName("RUBY"),goog.dom.TagName.S=new goog.dom.TagName("S"),goog.dom.TagName.SAMP=new goog.dom.TagName("SAMP"),goog.dom.TagName.SCRIPT=new goog.dom.TagName("SCRIPT"),goog.dom.TagName.SECTION=new goog.dom.TagName("SECTION"),goog.dom.TagName.SELECT=new goog.dom.TagName("SELECT"),goog.dom.TagName.SMALL=new goog.dom.TagName("SMALL"),goog.dom.TagName.SOURCE=new goog.dom.TagName("SOURCE"),goog.dom.TagName.SPAN=new goog.dom.TagName("SPAN"),goog.dom.TagName.STRIKE=new goog.dom.TagName("STRIKE"),goog.dom.TagName.STRONG=new goog.dom.TagName("STRONG"),goog.dom.TagName.STYLE=new goog.dom.TagName("STYLE"),goog.dom.TagName.SUB=new goog.dom.TagName("SUB"),goog.dom.TagName.SUMMARY=new goog.dom.TagName("SUMMARY"),goog.dom.TagName.SUP=new goog.dom.TagName("SUP"),goog.dom.TagName.SVG=new goog.dom.TagName("SVG"),goog.dom.TagName.TABLE=new goog.dom.TagName("TABLE"),goog.dom.TagName.TBODY=new goog.dom.TagName("TBODY"),goog.dom.TagName.TD=new goog.dom.TagName("TD"),goog.dom.TagName.TEMPLATE=new goog.dom.TagName("TEMPLATE"),goog.dom.TagName.TEXTAREA=new goog.dom.TagName("TEXTAREA"),goog.dom.TagName.TFOOT=new goog.dom.TagName("TFOOT"),goog.dom.TagName.TH=new goog.dom.TagName("TH"),goog.dom.TagName.THEAD=new goog.dom.TagName("THEAD"),goog.dom.TagName.TIME=new goog.dom.TagName("TIME"),goog.dom.TagName.TITLE=new goog.dom.TagName("TITLE"),goog.dom.TagName.TR=new goog.dom.TagName("TR"),goog.dom.TagName.TRACK=new goog.dom.TagName("TRACK"),goog.dom.TagName.TT=new goog.dom.TagName("TT"),goog.dom.TagName.U=new goog.dom.TagName("U"),goog.dom.TagName.UL=new goog.dom.TagName("UL"),goog.dom.TagName.VAR=new goog.dom.TagName("VAR"),goog.dom.TagName.VIDEO=new goog.dom.TagName("VIDEO"),goog.dom.TagName.WBR=new goog.dom.TagName("WBR"),goog.dom.tags={},goog.dom.tags.VOID_TAGS_={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},goog.dom.tags.isVoidTag=function(e){return!0===goog.dom.tags.VOID_TAGS_[e]},goog.html={},goog.html.trustedtypes={},goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY=goog.TRUSTED_TYPES_POLICY_NAME?goog.createTrustedTypesPolicy(goog.TRUSTED_TYPES_POLICY_NAME+"#html"):null,goog.string={},goog.string.TypedString=function(){},goog.string.Const=function(e,t){this.stringConstValueWithSecurityContract__googStringSecurityPrivate_=e===goog.string.Const.GOOG_STRING_CONSTRUCTOR_TOKEN_PRIVATE_&&t||"",this.STRING_CONST_TYPE_MARKER__GOOG_STRING_SECURITY_PRIVATE_=goog.string.Const.TYPE_MARKER_},goog.string.Const.prototype.implementsGoogStringTypedString=!0,goog.string.Const.prototype.getTypedStringValue=function(){return this.stringConstValueWithSecurityContract__googStringSecurityPrivate_},goog.DEBUG&&(goog.string.Const.prototype.toString=function(){return"Const{"+this.stringConstValueWithSecurityContract__googStringSecurityPrivate_+"}"}),goog.string.Const.unwrap=function(e){return e instanceof goog.string.Const&&e.constructor===goog.string.Const&&e.STRING_CONST_TYPE_MARKER__GOOG_STRING_SECURITY_PRIVATE_===goog.string.Const.TYPE_MARKER_?e.stringConstValueWithSecurityContract__googStringSecurityPrivate_:(goog.asserts.fail("expected object of type Const, got '"+e+"'"),"type_error:Const")},goog.string.Const.from=function(e){return new goog.string.Const(goog.string.Const.GOOG_STRING_CONSTRUCTOR_TOKEN_PRIVATE_,e)},goog.string.Const.TYPE_MARKER_={},goog.string.Const.GOOG_STRING_CONSTRUCTOR_TOKEN_PRIVATE_={},goog.string.Const.EMPTY=goog.string.Const.from(""),goog.html.SafeScript=function(){this.privateDoNotAccessOrElseSafeScriptWrappedValue_="",this.SAFE_SCRIPT_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_=goog.html.SafeScript.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_},goog.html.SafeScript.prototype.implementsGoogStringTypedString=!0,goog.html.SafeScript.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_={},goog.html.SafeScript.fromConstant=function(e){return 0===(e=goog.string.Const.unwrap(e)).length?goog.html.SafeScript.EMPTY:goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse(e)},goog.html.SafeScript.fromConstantAndArgs=function(e,t){for(var r=[],n=1;n<arguments.length;n++)r.push(goog.html.SafeScript.stringify_(arguments[n]));return goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse("("+goog.string.Const.unwrap(e)+")("+r.join(", ")+");")},goog.html.SafeScript.fromJson=function(e){return goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse(goog.html.SafeScript.stringify_(e))},goog.html.SafeScript.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseSafeScriptWrappedValue_.toString()},goog.DEBUG&&(goog.html.SafeScript.prototype.toString=function(){return"SafeScript{"+this.privateDoNotAccessOrElseSafeScriptWrappedValue_+"}"}),goog.html.SafeScript.unwrap=function(e){return goog.html.SafeScript.unwrapTrustedScript(e).toString()},goog.html.SafeScript.unwrapTrustedScript=function(e){return e instanceof goog.html.SafeScript&&e.constructor===goog.html.SafeScript&&e.SAFE_SCRIPT_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_===goog.html.SafeScript.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_?e.privateDoNotAccessOrElseSafeScriptWrappedValue_:(goog.asserts.fail("expected object of type SafeScript, got '"+e+"' of type "+goog.typeOf(e)),"type_error:SafeScript")},goog.html.SafeScript.stringify_=function(e){return JSON.stringify(e).replace(/</g,"\\x3c")},goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse=function(e){return(new goog.html.SafeScript).initSecurityPrivateDoNotAccessOrElse_(e)},goog.html.SafeScript.prototype.initSecurityPrivateDoNotAccessOrElse_=function(e){return this.privateDoNotAccessOrElseSafeScriptWrappedValue_=goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY?goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY.createScript(e):e,this},goog.html.SafeScript.EMPTY=goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse(""),goog.fs={},goog.fs.url={},goog.fs.url.createObjectUrl=function(e){return goog.fs.url.getUrlObject_().createObjectURL(e)},goog.fs.url.revokeObjectUrl=function(e){goog.fs.url.getUrlObject_().revokeObjectURL(e)},goog.fs.url.UrlObject_=function(){},goog.fs.url.UrlObject_.prototype.createObjectURL=function(e){},goog.fs.url.UrlObject_.prototype.revokeObjectURL=function(e){},goog.fs.url.getUrlObject_=function(){var e=goog.fs.url.findUrlObject_();if(null!=e)return e;throw Error("This browser doesn't seem to support blob URLs")},goog.fs.url.findUrlObject_=function(){return void 0!==goog.global.URL&&void 0!==goog.global.URL.createObjectURL?goog.global.URL:void 0!==goog.global.webkitURL&&void 0!==goog.global.webkitURL.createObjectURL?goog.global.webkitURL:void 0!==goog.global.createObjectURL?goog.global:null},goog.fs.url.browserSupportsObjectUrls=function(){return null!=goog.fs.url.findUrlObject_()},goog.fs.blob={},goog.fs.blob.getBlob=function(e){var t=goog.global.BlobBuilder||goog.global.WebKitBlobBuilder;if(void 0!==t){t=new t;for(var r=0;r<arguments.length;r++)t.append(arguments[r]);return t.getBlob()}return goog.fs.blob.getBlobWithProperties(goog.array.toArray(arguments))},goog.fs.blob.getBlobWithProperties=function(e,t,r){var n=goog.global.BlobBuilder||goog.global.WebKitBlobBuilder;if(void 0!==n){n=new n;for(var o=0;o<e.length;o++)n.append(e[o],r);return n.getBlob(t)}if(void 0!==goog.global.Blob)return n={},t&&(n.type=t),r&&(n.endings=r),new Blob(e,n);throw Error("This browser doesn't seem to support creating Blobs")},goog.i18n={},goog.i18n.bidi={},goog.i18n.bidi.FORCE_RTL=!1,goog.i18n.bidi.IS_RTL=goog.i18n.bidi.FORCE_RTL||("ar"==goog.LOCALE.substring(0,2).toLowerCase()||"fa"==goog.LOCALE.substring(0,2).toLowerCase()||"he"==goog.LOCALE.substring(0,2).toLowerCase()||"iw"==goog.LOCALE.substring(0,2).toLowerCase()||"ps"==goog.LOCALE.substring(0,2).toLowerCase()||"sd"==goog.LOCALE.substring(0,2).toLowerCase()||"ug"==goog.LOCALE.substring(0,2).toLowerCase()||"ur"==goog.LOCALE.substring(0,2).toLowerCase()||"yi"==goog.LOCALE.substring(0,2).toLowerCase())&&(2==goog.LOCALE.length||"-"==goog.LOCALE.substring(2,3)||"_"==goog.LOCALE.substring(2,3))||3<=goog.LOCALE.length&&"ckb"==goog.LOCALE.substring(0,3).toLowerCase()&&(3==goog.LOCALE.length||"-"==goog.LOCALE.substring(3,4)||"_"==goog.LOCALE.substring(3,4))||7<=goog.LOCALE.length&&("-"==goog.LOCALE.substring(2,3)||"_"==goog.LOCALE.substring(2,3))&&("adlm"==goog.LOCALE.substring(3,7).toLowerCase()||"arab"==goog.LOCALE.substring(3,7).toLowerCase()||"hebr"==goog.LOCALE.substring(3,7).toLowerCase()||"nkoo"==goog.LOCALE.substring(3,7).toLowerCase()||"rohg"==goog.LOCALE.substring(3,7).toLowerCase()||"thaa"==goog.LOCALE.substring(3,7).toLowerCase())||8<=goog.LOCALE.length&&("-"==goog.LOCALE.substring(3,4)||"_"==goog.LOCALE.substring(3,4))&&("adlm"==goog.LOCALE.substring(4,8).toLowerCase()||"arab"==goog.LOCALE.substring(4,8).toLowerCase()||"hebr"==goog.LOCALE.substring(4,8).toLowerCase()||"nkoo"==goog.LOCALE.substring(4,8).toLowerCase()||"rohg"==goog.LOCALE.substring(4,8).toLowerCase()||"thaa"==goog.LOCALE.substring(4,8).toLowerCase()),goog.i18n.bidi.Format={LRE:"",RLE:"",PDF:"",LRM:"",RLM:""},goog.i18n.bidi.Dir={LTR:1,RTL:-1,NEUTRAL:0},goog.i18n.bidi.RIGHT="right",goog.i18n.bidi.LEFT="left",goog.i18n.bidi.I18N_RIGHT=goog.i18n.bidi.IS_RTL?goog.i18n.bidi.LEFT:goog.i18n.bidi.RIGHT,goog.i18n.bidi.I18N_LEFT=goog.i18n.bidi.IS_RTL?goog.i18n.bidi.RIGHT:goog.i18n.bidi.LEFT,goog.i18n.bidi.toDir=function(e,t){return"number"==typeof e?0<e?goog.i18n.bidi.Dir.LTR:0>e?goog.i18n.bidi.Dir.RTL:t?null:goog.i18n.bidi.Dir.NEUTRAL:null==e?null:e?goog.i18n.bidi.Dir.RTL:goog.i18n.bidi.Dir.LTR},goog.i18n.bidi.ltrChars_="A-Za-zÀ-ÖØ-öø-ʸ̀-ऀ-Ⰰ-\ud801\ud804-\ud839\ud83c-\udbff豈-︀--",goog.i18n.bidi.rtlChars_="֑-ۯۺ-ࣿ\ud802-\ud803\ud83a-\ud83bיִ-﷿ﹰ-ﻼ",goog.i18n.bidi.htmlSkipReg_=/<[^>]*>|&[^;]+;/g,goog.i18n.bidi.stripHtmlIfNeeded_=function(e,t){return t?e.replace(goog.i18n.bidi.htmlSkipReg_,""):e},goog.i18n.bidi.rtlCharReg_=new RegExp("["+goog.i18n.bidi.rtlChars_+"]"),goog.i18n.bidi.ltrCharReg_=new RegExp("["+goog.i18n.bidi.ltrChars_+"]"),goog.i18n.bidi.hasAnyRtl=function(e,t){return goog.i18n.bidi.rtlCharReg_.test(goog.i18n.bidi.stripHtmlIfNeeded_(e,t))},goog.i18n.bidi.hasRtlChar=goog.i18n.bidi.hasAnyRtl,goog.i18n.bidi.hasAnyLtr=function(e,t){return goog.i18n.bidi.ltrCharReg_.test(goog.i18n.bidi.stripHtmlIfNeeded_(e,t))},goog.i18n.bidi.ltrRe_=new RegExp("^["+goog.i18n.bidi.ltrChars_+"]"),goog.i18n.bidi.rtlRe_=new RegExp("^["+goog.i18n.bidi.rtlChars_+"]"),goog.i18n.bidi.isRtlChar=function(e){return goog.i18n.bidi.rtlRe_.test(e)},goog.i18n.bidi.isLtrChar=function(e){return goog.i18n.bidi.ltrRe_.test(e)},goog.i18n.bidi.isNeutralChar=function(e){return!goog.i18n.bidi.isLtrChar(e)&&!goog.i18n.bidi.isRtlChar(e)},goog.i18n.bidi.ltrDirCheckRe_=new RegExp("^[^"+goog.i18n.bidi.rtlChars_+"]*["+goog.i18n.bidi.ltrChars_+"]"),goog.i18n.bidi.rtlDirCheckRe_=new RegExp("^[^"+goog.i18n.bidi.ltrChars_+"]*["+goog.i18n.bidi.rtlChars_+"]"),goog.i18n.bidi.startsWithRtl=function(e,t){return goog.i18n.bidi.rtlDirCheckRe_.test(goog.i18n.bidi.stripHtmlIfNeeded_(e,t))},goog.i18n.bidi.isRtlText=goog.i18n.bidi.startsWithRtl,goog.i18n.bidi.startsWithLtr=function(e,t){return goog.i18n.bidi.ltrDirCheckRe_.test(goog.i18n.bidi.stripHtmlIfNeeded_(e,t))},goog.i18n.bidi.isLtrText=goog.i18n.bidi.startsWithLtr,goog.i18n.bidi.isRequiredLtrRe_=/^http:\/\/.*/,goog.i18n.bidi.isNeutralText=function(e,t){return e=goog.i18n.bidi.stripHtmlIfNeeded_(e,t),goog.i18n.bidi.isRequiredLtrRe_.test(e)||!goog.i18n.bidi.hasAnyLtr(e)&&!goog.i18n.bidi.hasAnyRtl(e)},goog.i18n.bidi.ltrExitDirCheckRe_=new RegExp("["+goog.i18n.bidi.ltrChars_+"][^"+goog.i18n.bidi.rtlChars_+"]*$"),goog.i18n.bidi.rtlExitDirCheckRe_=new RegExp("["+goog.i18n.bidi.rtlChars_+"][^"+goog.i18n.bidi.ltrChars_+"]*$"),goog.i18n.bidi.endsWithLtr=function(e,t){return goog.i18n.bidi.ltrExitDirCheckRe_.test(goog.i18n.bidi.stripHtmlIfNeeded_(e,t))},goog.i18n.bidi.isLtrExitText=goog.i18n.bidi.endsWithLtr,goog.i18n.bidi.endsWithRtl=function(e,t){return goog.i18n.bidi.rtlExitDirCheckRe_.test(goog.i18n.bidi.stripHtmlIfNeeded_(e,t))},goog.i18n.bidi.isRtlExitText=goog.i18n.bidi.endsWithRtl,goog.i18n.bidi.rtlLocalesRe_=/^(ar|ckb|dv|he|iw|fa|nqo|ps|sd|ug|ur|yi|.*[-_](Adlm|Arab|Hebr|Nkoo|Rohg|Thaa))(?!.*[-_](Latn|Cyrl)($|-|_))($|-|_)/i,goog.i18n.bidi.isRtlLanguage=function(e){return goog.i18n.bidi.rtlLocalesRe_.test(e)},goog.i18n.bidi.bracketGuardTextRe_=/(\(.*?\)+)|(\[.*?\]+)|(\{.*?\}+)|(<.*?>+)/g,goog.i18n.bidi.guardBracketInText=function(e,t){return t=(void 0===t?goog.i18n.bidi.hasAnyRtl(e):t)?goog.i18n.bidi.Format.RLM:goog.i18n.bidi.Format.LRM,e.replace(goog.i18n.bidi.bracketGuardTextRe_,t+"$&"+t)},goog.i18n.bidi.enforceRtlInHtml=function(e){return"<"==e.charAt(0)?e.replace(/<\w+/,"$& dir=rtl"):"\n<span dir=rtl>"+e+"</span>"},goog.i18n.bidi.enforceRtlInText=function(e){return goog.i18n.bidi.Format.RLE+e+goog.i18n.bidi.Format.PDF},goog.i18n.bidi.enforceLtrInHtml=function(e){return"<"==e.charAt(0)?e.replace(/<\w+/,"$& dir=ltr"):"\n<span dir=ltr>"+e+"</span>"},goog.i18n.bidi.enforceLtrInText=function(e){return goog.i18n.bidi.Format.LRE+e+goog.i18n.bidi.Format.PDF},goog.i18n.bidi.dimensionsRe_=/:\s*([.\d][.\w]*)\s+([.\d][.\w]*)\s+([.\d][.\w]*)\s+([.\d][.\w]*)/g,goog.i18n.bidi.leftRe_=/left/gi,goog.i18n.bidi.rightRe_=/right/gi,goog.i18n.bidi.tempRe_=/%%%%/g,goog.i18n.bidi.mirrorCSS=function(e){return e.replace(goog.i18n.bidi.dimensionsRe_,":$1 $4 $3 $2").replace(goog.i18n.bidi.leftRe_,"%%%%").replace(goog.i18n.bidi.rightRe_,goog.i18n.bidi.LEFT).replace(goog.i18n.bidi.tempRe_,goog.i18n.bidi.RIGHT)},goog.i18n.bidi.doubleQuoteSubstituteRe_=/([\u0591-\u05f2])"/g,goog.i18n.bidi.singleQuoteSubstituteRe_=/([\u0591-\u05f2])'/g,goog.i18n.bidi.normalizeHebrewQuote=function(e){return e.replace(goog.i18n.bidi.doubleQuoteSubstituteRe_,"$1״").replace(goog.i18n.bidi.singleQuoteSubstituteRe_,"$1׳")},goog.i18n.bidi.wordSeparatorRe_=/\s+/,goog.i18n.bidi.hasNumeralsRe_=/[\d\u06f0-\u06f9]/,goog.i18n.bidi.rtlDetectionThreshold_=.4,goog.i18n.bidi.estimateDirection=function(e,t){var r=0,n=0,o=!1;for(e=goog.i18n.bidi.stripHtmlIfNeeded_(e,t).split(goog.i18n.bidi.wordSeparatorRe_),t=0;t<e.length;t++){var i=e[t];goog.i18n.bidi.startsWithRtl(i)?(r++,n++):goog.i18n.bidi.isRequiredLtrRe_.test(i)?o=!0:goog.i18n.bidi.hasAnyLtr(i)?n++:goog.i18n.bidi.hasNumeralsRe_.test(i)&&(o=!0)}return 0==n?o?goog.i18n.bidi.Dir.LTR:goog.i18n.bidi.Dir.NEUTRAL:r/n>goog.i18n.bidi.rtlDetectionThreshold_?goog.i18n.bidi.Dir.RTL:goog.i18n.bidi.Dir.LTR},goog.i18n.bidi.detectRtlDirectionality=function(e,t){return goog.i18n.bidi.estimateDirection(e,t)==goog.i18n.bidi.Dir.RTL},goog.i18n.bidi.setElementDirAndAlign=function(e,t){e&&(t=goog.i18n.bidi.toDir(t))&&(e.style.textAlign=t==goog.i18n.bidi.Dir.RTL?goog.i18n.bidi.RIGHT:goog.i18n.bidi.LEFT,e.dir=t==goog.i18n.bidi.Dir.RTL?"rtl":"ltr")},goog.i18n.bidi.setElementDirByTextDirectionality=function(e,t){switch(goog.i18n.bidi.estimateDirection(t)){case goog.i18n.bidi.Dir.LTR:e.dir="ltr";break;case goog.i18n.bidi.Dir.RTL:e.dir="rtl";break;default:e.removeAttribute("dir")}},goog.i18n.bidi.DirectionalString=function(){},goog.html.TrustedResourceUrl=function(e,t){this.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_=e===goog.html.TrustedResourceUrl.CONSTRUCTOR_TOKEN_PRIVATE_&&t||"",this.TRUSTED_RESOURCE_URL_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_=goog.html.TrustedResourceUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_},goog.html.TrustedResourceUrl.prototype.implementsGoogStringTypedString=!0,goog.html.TrustedResourceUrl.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_.toString()},goog.html.TrustedResourceUrl.prototype.implementsGoogI18nBidiDirectionalString=!0,goog.html.TrustedResourceUrl.prototype.getDirection=function(){return goog.i18n.bidi.Dir.LTR},goog.html.TrustedResourceUrl.prototype.cloneWithParams=function(e,t){var r=goog.html.TrustedResourceUrl.unwrap(this),n=(r=goog.html.TrustedResourceUrl.URL_PARAM_PARSER_.exec(r))[3]||"";return goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(r[1]+goog.html.TrustedResourceUrl.stringifyParams_("?",r[2]||"",e)+goog.html.TrustedResourceUrl.stringifyParams_("#",n,t))},goog.DEBUG&&(goog.html.TrustedResourceUrl.prototype.toString=function(){return"TrustedResourceUrl{"+this.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_+"}"}),goog.html.TrustedResourceUrl.unwrap=function(e){return goog.html.TrustedResourceUrl.unwrapTrustedScriptURL(e).toString()},goog.html.TrustedResourceUrl.unwrapTrustedScriptURL=function(e){return e instanceof goog.html.TrustedResourceUrl&&e.constructor===goog.html.TrustedResourceUrl&&e.TRUSTED_RESOURCE_URL_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_===goog.html.TrustedResourceUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_?e.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_:(goog.asserts.fail("expected object of type TrustedResourceUrl, got '"+e+"' of type "+goog.typeOf(e)),"type_error:TrustedResourceUrl")},goog.html.TrustedResourceUrl.format=function(e,t){var r=goog.string.Const.unwrap(e);if(!goog.html.TrustedResourceUrl.BASE_URL_.test(r))throw Error("Invalid TrustedResourceUrl format: "+r);return e=r.replace(goog.html.TrustedResourceUrl.FORMAT_MARKER_,(function(e,n){if(!Object.prototype.hasOwnProperty.call(t,n))throw Error('Found marker, "'+n+'", in format string, "'+r+'", but no valid label mapping found in args: '+JSON.stringify(t));return(e=t[n])instanceof goog.string.Const?goog.string.Const.unwrap(e):encodeURIComponent(String(e))})),goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.TrustedResourceUrl.FORMAT_MARKER_=/%{(\w+)}/g,goog.html.TrustedResourceUrl.BASE_URL_=/^((https:)?\/\/[0-9a-z.:[\]-]+\/|\/[^/\\]|[^:/\\%]+\/|[^:/\\%]*[?#]|about:blank#)/i,goog.html.TrustedResourceUrl.URL_PARAM_PARSER_=/^([^?#]*)(\?[^#]*)?(#[\s\S]*)?/,goog.html.TrustedResourceUrl.formatWithParams=function(e,t,r,n){return goog.html.TrustedResourceUrl.format(e,t).cloneWithParams(r,n)},goog.html.TrustedResourceUrl.fromConstant=function(e){return goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(goog.string.Const.unwrap(e))},goog.html.TrustedResourceUrl.fromConstants=function(e){for(var t="",r=0;r<e.length;r++)t+=goog.string.Const.unwrap(e[r]);return goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(t)},goog.html.TrustedResourceUrl.fromSafeScript=function(e){return e=goog.fs.blob.getBlobWithProperties([goog.html.SafeScript.unwrap(e)],"text/javascript"),e=goog.fs.url.createObjectUrl(e),goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.TrustedResourceUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_={},goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse=function(e){return e=goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY?goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY.createScriptURL(e):e,new goog.html.TrustedResourceUrl(goog.html.TrustedResourceUrl.CONSTRUCTOR_TOKEN_PRIVATE_,e)},goog.html.TrustedResourceUrl.stringifyParams_=function(e,t,r){if(null==r)return t;if("string"==typeof r)return r?e+encodeURIComponent(r):"";for(var n in r){var o=r[n];o=Array.isArray(o)?o:[o];for(var i=0;i<o.length;i++){var a=o[i];null!=a&&(t||(t=e),t+=(t.length>e.length?"&":"")+encodeURIComponent(n)+"="+encodeURIComponent(String(a)))}}return t},goog.html.TrustedResourceUrl.CONSTRUCTOR_TOKEN_PRIVATE_={},goog.string.internal={},goog.string.internal.startsWith=function(e,t){return 0==e.lastIndexOf(t,0)},goog.string.internal.endsWith=function(e,t){var r=e.length-t.length;return 0<=r&&e.indexOf(t,r)==r},goog.string.internal.caseInsensitiveStartsWith=function(e,t){return 0==goog.string.internal.caseInsensitiveCompare(t,e.substr(0,t.length))},goog.string.internal.caseInsensitiveEndsWith=function(e,t){return 0==goog.string.internal.caseInsensitiveCompare(t,e.substr(e.length-t.length,t.length))},goog.string.internal.caseInsensitiveEquals=function(e,t){return e.toLowerCase()==t.toLowerCase()},goog.string.internal.isEmptyOrWhitespace=function(e){return/^[\s\xa0]*$/.test(e)},goog.string.internal.trim=goog.TRUSTED_SITE&&String.prototype.trim?function(e){return e.trim()}:function(e){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(e)[1]},goog.string.internal.caseInsensitiveCompare=function(e,t){return(e=String(e).toLowerCase())<(t=String(t).toLowerCase())?-1:e==t?0:1},goog.string.internal.newLineToBr=function(e,t){return e.replace(/(\r\n|\r|\n)/g,t?"<br />":"<br>")},goog.string.internal.htmlEscape=function(e,t){if(t)e=e.replace(goog.string.internal.AMP_RE_,"&").replace(goog.string.internal.LT_RE_,"<").replace(goog.string.internal.GT_RE_,">").replace(goog.string.internal.QUOT_RE_,""").replace(goog.string.internal.SINGLE_QUOTE_RE_,"'").replace(goog.string.internal.NULL_RE_,"�");else{if(!goog.string.internal.ALL_RE_.test(e))return e;-1!=e.indexOf("&")&&(e=e.replace(goog.string.internal.AMP_RE_,"&")),-1!=e.indexOf("<")&&(e=e.replace(goog.string.internal.LT_RE_,"<")),-1!=e.indexOf(">")&&(e=e.replace(goog.string.internal.GT_RE_,">")),-1!=e.indexOf('"')&&(e=e.replace(goog.string.internal.QUOT_RE_,""")),-1!=e.indexOf("'")&&(e=e.replace(goog.string.internal.SINGLE_QUOTE_RE_,"'")),-1!=e.indexOf("\0")&&(e=e.replace(goog.string.internal.NULL_RE_,"�"))}return e},goog.string.internal.AMP_RE_=/&/g,goog.string.internal.LT_RE_=/</g,goog.string.internal.GT_RE_=/>/g,goog.string.internal.QUOT_RE_=/"/g,goog.string.internal.SINGLE_QUOTE_RE_=/'/g,goog.string.internal.NULL_RE_=/\x00/g,goog.string.internal.ALL_RE_=/[\x00&<>"']/,goog.string.internal.whitespaceEscape=function(e,t){return goog.string.internal.newLineToBr(e.replace(/ /g,"  "),t)},goog.string.internal.contains=function(e,t){return-1!=e.indexOf(t)},goog.string.internal.caseInsensitiveContains=function(e,t){return goog.string.internal.contains(e.toLowerCase(),t.toLowerCase())},goog.string.internal.compareVersions=function(e,t){var r=0;e=goog.string.internal.trim(String(e)).split("."),t=goog.string.internal.trim(String(t)).split(".");for(var n=Math.max(e.length,t.length),o=0;0==r&&o<n;o++){var i=e[o]||"",a=t[o]||"";do{if(i=/(\d*)(\D*)(.*)/.exec(i)||["","","",""],a=/(\d*)(\D*)(.*)/.exec(a)||["","","",""],0==i[0].length&&0==a[0].length)break;r=0==i[1].length?0:parseInt(i[1],10);var s=0==a[1].length?0:parseInt(a[1],10);r=goog.string.internal.compareElements_(r,s)||goog.string.internal.compareElements_(0==i[2].length,0==a[2].length)||goog.string.internal.compareElements_(i[2],a[2]),i=i[3],a=a[3]}while(0==r)}return r},goog.string.internal.compareElements_=function(e,t){return e<t?-1:e>t?1:0},goog.html.SafeUrl=function(e,t){this.privateDoNotAccessOrElseSafeUrlWrappedValue_=e===goog.html.SafeUrl.CONSTRUCTOR_TOKEN_PRIVATE_&&t||"",this.SAFE_URL_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_=goog.html.SafeUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_},goog.html.SafeUrl.INNOCUOUS_STRING="about:invalid#zClosurez",goog.html.SafeUrl.prototype.implementsGoogStringTypedString=!0,goog.html.SafeUrl.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseSafeUrlWrappedValue_.toString()},goog.html.SafeUrl.prototype.implementsGoogI18nBidiDirectionalString=!0,goog.html.SafeUrl.prototype.getDirection=function(){return goog.i18n.bidi.Dir.LTR},goog.DEBUG&&(goog.html.SafeUrl.prototype.toString=function(){return"SafeUrl{"+this.privateDoNotAccessOrElseSafeUrlWrappedValue_+"}"}),goog.html.SafeUrl.unwrap=function(e){return e instanceof goog.html.SafeUrl&&e.constructor===goog.html.SafeUrl&&e.SAFE_URL_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_===goog.html.SafeUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_?e.privateDoNotAccessOrElseSafeUrlWrappedValue_:(goog.asserts.fail("expected object of type SafeUrl, got '"+e+"' of type "+goog.typeOf(e)),"type_error:SafeUrl")},goog.html.SafeUrl.fromConstant=function(e){return goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(goog.string.Const.unwrap(e))},goog.html.SAFE_MIME_TYPE_PATTERN_=/^(?:audio\/(?:3gpp2|3gpp|aac|L16|midi|mp3|mp4|mpeg|oga|ogg|opus|x-m4a|x-matroska|x-wav|wav|webm)|image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp|x-icon)|text\/csv|video\/(?:mpeg|mp4|ogg|webm|quicktime|x-matroska))(?:;\w+=(?:\w+|"[\w;,= ]+"))*$/i,goog.html.SafeUrl.isSafeMimeType=function(e){return goog.html.SAFE_MIME_TYPE_PATTERN_.test(e)},goog.html.SafeUrl.fromBlob=function(e){return e=goog.html.SafeUrl.isSafeMimeType(e.type)?goog.fs.url.createObjectUrl(e):goog.html.SafeUrl.INNOCUOUS_STRING,goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.SafeUrl.fromMediaSource=function(e){return goog.asserts.assert("MediaSource"in goog.global,"No support for MediaSource"),e=e instanceof MediaSource?goog.fs.url.createObjectUrl(e):goog.html.SafeUrl.INNOCUOUS_STRING,goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.DATA_URL_PATTERN_=/^data:(.*);base64,[a-z0-9+\/]+=*$/i,goog.html.SafeUrl.fromDataUrl=function(e){var t=(e=e.replace(/(%0A|%0D)/g,"")).match(goog.html.DATA_URL_PATTERN_);return t=t&&goog.html.SafeUrl.isSafeMimeType(t[1]),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(t?e:goog.html.SafeUrl.INNOCUOUS_STRING)},goog.html.SafeUrl.fromTelUrl=function(e){return goog.string.internal.caseInsensitiveStartsWith(e,"tel:")||(e=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.SIP_URL_PATTERN_=/^sip[s]?:[+a-z0-9_.!$%&'*\/=^`{|}~-]+@([a-z0-9-]+\.)+[a-z0-9]{2,63}$/i,goog.html.SafeUrl.fromSipUrl=function(e){return goog.html.SIP_URL_PATTERN_.test(decodeURIComponent(e))||(e=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.SafeUrl.fromFacebookMessengerUrl=function(e){return goog.string.internal.caseInsensitiveStartsWith(e,"fb-messenger://share")||(e=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.SafeUrl.fromWhatsAppUrl=function(e){return goog.string.internal.caseInsensitiveStartsWith(e,"whatsapp://send")||(e=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.SafeUrl.fromSmsUrl=function(e){return goog.string.internal.caseInsensitiveStartsWith(e,"sms:")&&goog.html.SafeUrl.isSmsUrlBodyValid_(e)||(e=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.SafeUrl.isSmsUrlBodyValid_=function(e){var t=e.indexOf("#");if(0<t&&(e=e.substring(0,t)),!(t=e.match(/[?&]body=/gi)))return!0;if(1<t.length)return!1;if(!(e=e.match(/[?&]body=([^&]*)/)[1]))return!0;try{decodeURIComponent(e)}catch(e){return!1}return/^(?:[a-z0-9\-_.~]|%[0-9a-f]{2})+$/i.test(e)},goog.html.SafeUrl.fromSshUrl=function(e){return goog.string.internal.caseInsensitiveStartsWith(e,"ssh://")||(e=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.SafeUrl.sanitizeChromeExtensionUrl=function(e,t){return goog.html.SafeUrl.sanitizeExtensionUrl_(/^chrome-extension:\/\/([^\/]+)\//,e,t)},goog.html.SafeUrl.sanitizeFirefoxExtensionUrl=function(e,t){return goog.html.SafeUrl.sanitizeExtensionUrl_(/^moz-extension:\/\/([^\/]+)\//,e,t)},goog.html.SafeUrl.sanitizeEdgeExtensionUrl=function(e,t){return goog.html.SafeUrl.sanitizeExtensionUrl_(/^ms-browser-extension:\/\/([^\/]+)\//,e,t)},goog.html.SafeUrl.sanitizeExtensionUrl_=function(e,t,r){return(e=e.exec(t))?(e=e[1],-1==(r instanceof goog.string.Const?[goog.string.Const.unwrap(r)]:r.map((function(e){return goog.string.Const.unwrap(e)}))).indexOf(e)&&(t=goog.html.SafeUrl.INNOCUOUS_STRING)):t=goog.html.SafeUrl.INNOCUOUS_STRING,goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(t)},goog.html.SafeUrl.fromTrustedResourceUrl=function(e){return goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(goog.html.TrustedResourceUrl.unwrap(e))},goog.html.SAFE_URL_PATTERN_=/^(?:(?:https?|mailto|ftp):|[^:/?#]*(?:[/?#]|$))/i,goog.html.SafeUrl.SAFE_URL_PATTERN=goog.html.SAFE_URL_PATTERN_,goog.html.SafeUrl.sanitize=function(e){return e instanceof goog.html.SafeUrl?e:(e="object"==typeof e&&e.implementsGoogStringTypedString?e.getTypedStringValue():String(e),goog.html.SAFE_URL_PATTERN_.test(e)||(e=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e))},goog.html.SafeUrl.sanitizeAssertUnchanged=function(e,t){return e instanceof goog.html.SafeUrl?e:(e="object"==typeof e&&e.implementsGoogStringTypedString?e.getTypedStringValue():String(e),t&&/^data:/i.test(e)&&(t=goog.html.SafeUrl.fromDataUrl(e)).getTypedStringValue()==e?t:(goog.asserts.assert(goog.html.SAFE_URL_PATTERN_.test(e),"%s does not match the safe URL pattern",e)||(e=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)))},goog.html.SafeUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_={},goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse=function(e){return new goog.html.SafeUrl(goog.html.SafeUrl.CONSTRUCTOR_TOKEN_PRIVATE_,e)},goog.html.SafeUrl.ABOUT_BLANK=goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse("about:blank"),goog.html.SafeUrl.CONSTRUCTOR_TOKEN_PRIVATE_={},goog.html.SafeStyle=function(){this.privateDoNotAccessOrElseSafeStyleWrappedValue_="",this.SAFE_STYLE_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_=goog.html.SafeStyle.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_},goog.html.SafeStyle.prototype.implementsGoogStringTypedString=!0,goog.html.SafeStyle.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_={},goog.html.SafeStyle.fromConstant=function(e){return 0===(e=goog.string.Const.unwrap(e)).length?goog.html.SafeStyle.EMPTY:(goog.asserts.assert(goog.string.internal.endsWith(e,";"),"Last character of style string is not ';': "+e),goog.asserts.assert(goog.string.internal.contains(e,":"),"Style string must contain at least one ':', to specify a \"name: value\" pair: "+e),goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse(e))},goog.html.SafeStyle.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseSafeStyleWrappedValue_},goog.DEBUG&&(goog.html.SafeStyle.prototype.toString=function(){return"SafeStyle{"+this.privateDoNotAccessOrElseSafeStyleWrappedValue_+"}"}),goog.html.SafeStyle.unwrap=function(e){return e instanceof goog.html.SafeStyle&&e.constructor===goog.html.SafeStyle&&e.SAFE_STYLE_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_===goog.html.SafeStyle.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_?e.privateDoNotAccessOrElseSafeStyleWrappedValue_:(goog.asserts.fail("expected object of type SafeStyle, got '"+e+"' of type "+goog.typeOf(e)),"type_error:SafeStyle")},goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse=function(e){return(new goog.html.SafeStyle).initSecurityPrivateDoNotAccessOrElse_(e)},goog.html.SafeStyle.prototype.initSecurityPrivateDoNotAccessOrElse_=function(e){return this.privateDoNotAccessOrElseSafeStyleWrappedValue_=e,this},goog.html.SafeStyle.EMPTY=goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse(""),goog.html.SafeStyle.INNOCUOUS_STRING="zClosurez",goog.html.SafeStyle.create=function(e){var t,r="";for(t in e){if(!/^[-_a-zA-Z0-9]+$/.test(t))throw Error("Name allows only [-_a-zA-Z0-9], got: "+t);var n=e[t];null!=n&&(r+=t+":"+(n=Array.isArray(n)?goog.array.map(n,goog.html.SafeStyle.sanitizePropertyValue_).join(" "):goog.html.SafeStyle.sanitizePropertyValue_(n))+";")}return r?goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse(r):goog.html.SafeStyle.EMPTY},goog.html.SafeStyle.sanitizePropertyValue_=function(e){if(e instanceof goog.html.SafeUrl)return'url("'+goog.html.SafeUrl.unwrap(e).replace(/</g,"%3c").replace(/[\\"]/g,"\\$&")+'")';if(e=e instanceof goog.string.Const?goog.string.Const.unwrap(e):goog.html.SafeStyle.sanitizePropertyValueString_(String(e)),/[{;}]/.test(e))throw new goog.asserts.AssertionError("Value does not allow [{;}], got: %s.",[e]);return e},goog.html.SafeStyle.sanitizePropertyValueString_=function(e){var t=e.replace(goog.html.SafeStyle.FUNCTIONS_RE_,"$1").replace(goog.html.SafeStyle.FUNCTIONS_RE_,"$1").replace(goog.html.SafeStyle.URL_RE_,"url");return goog.html.SafeStyle.VALUE_RE_.test(t)?goog.html.SafeStyle.COMMENT_RE_.test(e)?(goog.asserts.fail("String value disallows comments, got: "+e),goog.html.SafeStyle.INNOCUOUS_STRING):goog.html.SafeStyle.hasBalancedQuotes_(e)?goog.html.SafeStyle.hasBalancedSquareBrackets_(e)?goog.html.SafeStyle.sanitizeUrl_(e):(goog.asserts.fail("String value requires balanced square brackets and one identifier per pair of brackets, got: "+e),goog.html.SafeStyle.INNOCUOUS_STRING):(goog.asserts.fail("String value requires balanced quotes, got: "+e),goog.html.SafeStyle.INNOCUOUS_STRING):(goog.asserts.fail("String value allows only "+goog.html.SafeStyle.VALUE_ALLOWED_CHARS_+" and simple functions, got: "+e),goog.html.SafeStyle.INNOCUOUS_STRING)},goog.html.SafeStyle.hasBalancedQuotes_=function(e){for(var t=!0,r=!0,n=0;n<e.length;n++){var o=e.charAt(n);"'"==o&&r?t=!t:'"'==o&&t&&(r=!r)}return t&&r},goog.html.SafeStyle.hasBalancedSquareBrackets_=function(e){for(var t=!0,r=/^[-_a-zA-Z0-9]$/,n=0;n<e.length;n++){var o=e.charAt(n);if("]"==o){if(t)return!1;t=!0}else if("["==o){if(!t)return!1;t=!1}else if(!t&&!r.test(o))return!1}return t},goog.html.SafeStyle.VALUE_ALLOWED_CHARS_="[-,.\"'%_!# a-zA-Z0-9\\[\\]]",goog.html.SafeStyle.VALUE_RE_=new RegExp("^"+goog.html.SafeStyle.VALUE_ALLOWED_CHARS_+"+$"),goog.html.SafeStyle.URL_RE_=/\b(url\([ \t\n]*)('[ -&(-\[\]-~]*'|"[ !#-\[\]-~]*"|[!#-&*-\[\]-~]*)([ \t\n]*\))/g,goog.html.SafeStyle.ALLOWED_FUNCTIONS_="calc cubic-bezier fit-content hsl hsla linear-gradient matrix minmax repeat rgb rgba (rotate|scale|translate)(X|Y|Z|3d)?".split(" "),goog.html.SafeStyle.FUNCTIONS_RE_=new RegExp("\\b("+goog.html.SafeStyle.ALLOWED_FUNCTIONS_.join("|")+")\\([-+*/0-9a-z.%\\[\\], ]+\\)","g"),goog.html.SafeStyle.COMMENT_RE_=/\/\*/,goog.html.SafeStyle.sanitizeUrl_=function(e){return e.replace(goog.html.SafeStyle.URL_RE_,(function(e,t,r,n){var o="";return r=r.replace(/^(['"])(.*)\1$/,(function(e,t,r){return o=t,r})),e=goog.html.SafeUrl.sanitize(r).getTypedStringValue(),t+o+e+o+n}))},goog.html.SafeStyle.concat=function(e){var t="",r=function(e){Array.isArray(e)?goog.array.forEach(e,r):t+=goog.html.SafeStyle.unwrap(e)};return goog.array.forEach(arguments,r),t?goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse(t):goog.html.SafeStyle.EMPTY},goog.html.SafeStyleSheet=function(){this.privateDoNotAccessOrElseSafeStyleSheetWrappedValue_="",this.SAFE_STYLE_SHEET_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_=goog.html.SafeStyleSheet.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_},goog.html.SafeStyleSheet.prototype.implementsGoogStringTypedString=!0,goog.html.SafeStyleSheet.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_={},goog.html.SafeStyleSheet.createRule=function(e,t){if(goog.string.internal.contains(e,"<"))throw Error("Selector does not allow '<', got: "+e);var r=e.replace(/('|")((?!\1)[^\r\n\f\\]|\\[\s\S])*\1/g,"");if(!/^[-_a-zA-Z0-9#.:* ,>+~[\]()=^$|]+$/.test(r))throw Error("Selector allows only [-_a-zA-Z0-9#.:* ,>+~[\\]()=^$|] and strings, got: "+e);if(!goog.html.SafeStyleSheet.hasBalancedBrackets_(r))throw Error("() and [] in selector must be balanced, got: "+e);return t instanceof goog.html.SafeStyle||(t=goog.html.SafeStyle.create(t)),e=e+"{"+goog.html.SafeStyle.unwrap(t).replace(/</g,"\\3C ")+"}",goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse(e)},goog.html.SafeStyleSheet.hasBalancedBrackets_=function(e){for(var t={"(":")","[":"]"},r=[],n=0;n<e.length;n++){var o=e[n];if(t[o])r.push(t[o]);else if(goog.object.contains(t,o)&&r.pop()!=o)return!1}return 0==r.length},goog.html.SafeStyleSheet.concat=function(e){var t="",r=function(e){Array.isArray(e)?goog.array.forEach(e,r):t+=goog.html.SafeStyleSheet.unwrap(e)};return goog.array.forEach(arguments,r),goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse(t)},goog.html.SafeStyleSheet.fromConstant=function(e){return 0===(e=goog.string.Const.unwrap(e)).length?goog.html.SafeStyleSheet.EMPTY:(goog.asserts.assert(!goog.string.internal.contains(e,"<"),"Forbidden '<' character in style sheet string: "+e),goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse(e))},goog.html.SafeStyleSheet.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseSafeStyleSheetWrappedValue_},goog.DEBUG&&(goog.html.SafeStyleSheet.prototype.toString=function(){return"SafeStyleSheet{"+this.privateDoNotAccessOrElseSafeStyleSheetWrappedValue_+"}"}),goog.html.SafeStyleSheet.unwrap=function(e){return e instanceof goog.html.SafeStyleSheet&&e.constructor===goog.html.SafeStyleSheet&&e.SAFE_STYLE_SHEET_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_===goog.html.SafeStyleSheet.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_?e.privateDoNotAccessOrElseSafeStyleSheetWrappedValue_:(goog.asserts.fail("expected object of type SafeStyleSheet, got '"+e+"' of type "+goog.typeOf(e)),"type_error:SafeStyleSheet")},goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse=function(e){return(new goog.html.SafeStyleSheet).initSecurityPrivateDoNotAccessOrElse_(e)},goog.html.SafeStyleSheet.prototype.initSecurityPrivateDoNotAccessOrElse_=function(e){return this.privateDoNotAccessOrElseSafeStyleSheetWrappedValue_=e,this},goog.html.SafeStyleSheet.EMPTY=goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse(""),goog.labs={},goog.labs.userAgent={},goog.labs.userAgent.util={},goog.labs.userAgent.util.getNativeUserAgentString_=function(){var e=goog.labs.userAgent.util.getNavigator_();return e&&(e=e.userAgent)?e:""},goog.labs.userAgent.util.getNavigator_=function(){return goog.global.navigator},goog.labs.userAgent.util.userAgent_=goog.labs.userAgent.util.getNativeUserAgentString_(),goog.labs.userAgent.util.setUserAgent=function(e){goog.labs.userAgent.util.userAgent_=e||goog.labs.userAgent.util.getNativeUserAgentString_()},goog.labs.userAgent.util.getUserAgent=function(){return goog.labs.userAgent.util.userAgent_},goog.labs.userAgent.util.matchUserAgent=function(e){var t=goog.labs.userAgent.util.getUserAgent();return goog.string.internal.contains(t,e)},goog.labs.userAgent.util.matchUserAgentIgnoreCase=function(e){var t=goog.labs.userAgent.util.getUserAgent();return goog.string.internal.caseInsensitiveContains(t,e)},goog.labs.userAgent.util.extractVersionTuples=function(e){for(var t,r=/(\w[\w ]+)\/([^\s]+)\s*(?:\((.*?)\))?/g,n=[];t=r.exec(e);)n.push([t[1],t[2],t[3]||void 0]);return n},goog.labs.userAgent.browser={},goog.labs.userAgent.browser.matchOpera_=function(){return goog.labs.userAgent.util.matchUserAgent("Opera")},goog.labs.userAgent.browser.matchIE_=function(){return goog.labs.userAgent.util.matchUserAgent("Trident")||goog.labs.userAgent.util.matchUserAgent("MSIE")},goog.labs.userAgent.browser.matchEdgeHtml_=function(){return goog.labs.userAgent.util.matchUserAgent("Edge")},goog.labs.userAgent.browser.matchEdgeChromium_=function(){return goog.labs.userAgent.util.matchUserAgent("Edg/")},goog.labs.userAgent.browser.matchOperaChromium_=function(){return goog.labs.userAgent.util.matchUserAgent("OPR")},goog.labs.userAgent.browser.matchFirefox_=function(){return goog.labs.userAgent.util.matchUserAgent("Firefox")||goog.labs.userAgent.util.matchUserAgent("FxiOS")},goog.labs.userAgent.browser.matchSafari_=function(){return goog.labs.userAgent.util.matchUserAgent("Safari")&&!(goog.labs.userAgent.browser.matchChrome_()||goog.labs.userAgent.browser.matchCoast_()||goog.labs.userAgent.browser.matchOpera_()||goog.labs.userAgent.browser.matchEdgeHtml_()||goog.labs.userAgent.browser.matchEdgeChromium_()||goog.labs.userAgent.browser.matchOperaChromium_()||goog.labs.userAgent.browser.matchFirefox_()||goog.labs.userAgent.browser.isSilk()||goog.labs.userAgent.util.matchUserAgent("Android"))},goog.labs.userAgent.browser.matchCoast_=function(){return goog.labs.userAgent.util.matchUserAgent("Coast")},goog.labs.userAgent.browser.matchIosWebview_=function(){return(goog.labs.userAgent.util.matchUserAgent("iPad")||goog.labs.userAgent.util.matchUserAgent("iPhone"))&&!goog.labs.userAgent.browser.matchSafari_()&&!goog.labs.userAgent.browser.matchChrome_()&&!goog.labs.userAgent.browser.matchCoast_()&&!goog.labs.userAgent.browser.matchFirefox_()&&goog.labs.userAgent.util.matchUserAgent("AppleWebKit")},goog.labs.userAgent.browser.matchChrome_=function(){return(goog.labs.userAgent.util.matchUserAgent("Chrome")||goog.labs.userAgent.util.matchUserAgent("CriOS"))&&!goog.labs.userAgent.browser.matchEdgeHtml_()},goog.labs.userAgent.browser.matchAndroidBrowser_=function(){return goog.labs.userAgent.util.matchUserAgent("Android")&&!(goog.labs.userAgent.browser.isChrome()||goog.labs.userAgent.browser.isFirefox()||goog.labs.userAgent.browser.isOpera()||goog.labs.userAgent.browser.isSilk())},goog.labs.userAgent.browser.isOpera=goog.labs.userAgent.browser.matchOpera_,goog.labs.userAgent.browser.isIE=goog.labs.userAgent.browser.matchIE_,goog.labs.userAgent.browser.isEdge=goog.labs.userAgent.browser.matchEdgeHtml_,goog.labs.userAgent.browser.isEdgeChromium=goog.labs.userAgent.browser.matchEdgeChromium_,goog.labs.userAgent.browser.isOperaChromium=goog.labs.userAgent.browser.matchOperaChromium_,goog.labs.userAgent.browser.isFirefox=goog.labs.userAgent.browser.matchFirefox_,goog.labs.userAgent.browser.isSafari=goog.labs.userAgent.browser.matchSafari_,goog.labs.userAgent.browser.isCoast=goog.labs.userAgent.browser.matchCoast_,goog.labs.userAgent.browser.isIosWebview=goog.labs.userAgent.browser.matchIosWebview_,goog.labs.userAgent.browser.isChrome=goog.labs.userAgent.browser.matchChrome_,goog.labs.userAgent.browser.isAndroidBrowser=goog.labs.userAgent.browser.matchAndroidBrowser_,goog.labs.userAgent.browser.isSilk=function(){return goog.labs.userAgent.util.matchUserAgent("Silk")},goog.labs.userAgent.browser.getVersion=function(){function e(e){return e=goog.array.find(e,n),r[e]||""}var t=goog.labs.userAgent.util.getUserAgent();if(goog.labs.userAgent.browser.isIE())return goog.labs.userAgent.browser.getIEVersion_(t);t=goog.labs.userAgent.util.extractVersionTuples(t);var r={};goog.array.forEach(t,(function(e){r[e[0]]=e[1]}));var n=goog.partial(goog.object.containsKey,r);return goog.labs.userAgent.browser.isOpera()?e(["Version","Opera"]):goog.labs.userAgent.browser.isEdge()?e(["Edge"]):goog.labs.userAgent.browser.isEdgeChromium()?e(["Edg"]):goog.labs.userAgent.browser.isChrome()?e(["Chrome","CriOS","HeadlessChrome"]):(t=t[2])&&t[1]||""},goog.labs.userAgent.browser.isVersionOrHigher=function(e){return 0<=goog.string.internal.compareVersions(goog.labs.userAgent.browser.getVersion(),e)},goog.labs.userAgent.browser.getIEVersion_=function(e){var t=/rv: *([\d\.]*)/.exec(e);if(t&&t[1])return t[1];t="";var r=/MSIE +([\d\.]+)/.exec(e);if(r&&r[1])if(e=/Trident\/(\d.\d)/.exec(e),"7.0"==r[1])if(e&&e[1])switch(e[1]){case"4.0":t="8.0";break;case"5.0":t="9.0";break;case"6.0":t="10.0";break;case"7.0":t="11.0"}else t="7.0";else t=r[1];return t},goog.html.SafeHtml=function(){this.privateDoNotAccessOrElseSafeHtmlWrappedValue_="",this.SAFE_HTML_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_=goog.html.SafeHtml.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_,this.dir_=null},goog.html.SafeHtml.ENABLE_ERROR_MESSAGES=goog.DEBUG,goog.html.SafeHtml.SUPPORT_STYLE_ATTRIBUTE=!0,goog.html.SafeHtml.prototype.implementsGoogI18nBidiDirectionalString=!0,goog.html.SafeHtml.prototype.getDirection=function(){return this.dir_},goog.html.SafeHtml.prototype.implementsGoogStringTypedString=!0,goog.html.SafeHtml.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseSafeHtmlWrappedValue_.toString()},goog.DEBUG&&(goog.html.SafeHtml.prototype.toString=function(){return"SafeHtml{"+this.privateDoNotAccessOrElseSafeHtmlWrappedValue_+"}"}),goog.html.SafeHtml.unwrap=function(e){return goog.html.SafeHtml.unwrapTrustedHTML(e).toString()},goog.html.SafeHtml.unwrapTrustedHTML=function(e){return e instanceof goog.html.SafeHtml&&e.constructor===goog.html.SafeHtml&&e.SAFE_HTML_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_===goog.html.SafeHtml.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_?e.privateDoNotAccessOrElseSafeHtmlWrappedValue_:(goog.asserts.fail("expected object of type SafeHtml, got '"+e+"' of type "+goog.typeOf(e)),"type_error:SafeHtml")},goog.html.SafeHtml.htmlEscape=function(e){if(e instanceof goog.html.SafeHtml)return e;var t="object"==typeof e,r=null;return t&&e.implementsGoogI18nBidiDirectionalString&&(r=e.getDirection()),e=t&&e.implementsGoogStringTypedString?e.getTypedStringValue():String(e),goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(goog.string.internal.htmlEscape(e),r)},goog.html.SafeHtml.htmlEscapePreservingNewlines=function(e){return e instanceof goog.html.SafeHtml?e:(e=goog.html.SafeHtml.htmlEscape(e),goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(goog.string.internal.newLineToBr(goog.html.SafeHtml.unwrap(e)),e.getDirection()))},goog.html.SafeHtml.htmlEscapePreservingNewlinesAndSpaces=function(e){return e instanceof goog.html.SafeHtml?e:(e=goog.html.SafeHtml.htmlEscape(e),goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(goog.string.internal.whitespaceEscape(goog.html.SafeHtml.unwrap(e)),e.getDirection()))},goog.html.SafeHtml.from=goog.html.SafeHtml.htmlEscape,goog.html.SafeHtml.comment=function(e){return goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse("\x3c!--"+goog.string.internal.htmlEscape(e)+"--\x3e",null)},goog.html.SafeHtml.VALID_NAMES_IN_TAG_=/^[a-zA-Z0-9-]+$/,goog.html.SafeHtml.URL_ATTRIBUTES_={action:!0,cite:!0,data:!0,formaction:!0,href:!0,manifest:!0,poster:!0,src:!0},goog.html.SafeHtml.NOT_ALLOWED_TAG_NAMES_={APPLET:!0,BASE:!0,EMBED:!0,IFRAME:!0,LINK:!0,MATH:!0,META:!0,OBJECT:!0,SCRIPT:!0,STYLE:!0,SVG:!0,TEMPLATE:!0},goog.html.SafeHtml.create=function(e,t,r){return goog.html.SafeHtml.verifyTagName(String(e)),goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse(String(e),t,r)},goog.html.SafeHtml.verifyTagName=function(e){if(!goog.html.SafeHtml.VALID_NAMES_IN_TAG_.test(e))throw Error(goog.html.SafeHtml.ENABLE_ERROR_MESSAGES?"Invalid tag name <"+e+">.":"");if(e.toUpperCase()in goog.html.SafeHtml.NOT_ALLOWED_TAG_NAMES_)throw Error(goog.html.SafeHtml.ENABLE_ERROR_MESSAGES?"Tag name <"+e+"> is not allowed for SafeHtml.":"")},goog.html.SafeHtml.createIframe=function(e,t,r,n){e&&goog.html.TrustedResourceUrl.unwrap(e);var o={};return o.src=e||null,o.srcdoc=t&&goog.html.SafeHtml.unwrap(t),e=goog.html.SafeHtml.combineAttributes(o,{sandbox:""},r),goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse("iframe",e,n)},goog.html.SafeHtml.createSandboxIframe=function(e,t,r,n){if(!goog.html.SafeHtml.canUseSandboxIframe())throw Error(goog.html.SafeHtml.ENABLE_ERROR_MESSAGES?"The browser does not support sandboxed iframes.":"");var o={};return o.src=e?goog.html.SafeUrl.unwrap(goog.html.SafeUrl.sanitize(e)):null,o.srcdoc=t||null,o.sandbox="",e=goog.html.SafeHtml.combineAttributes(o,{},r),goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse("iframe",e,n)},goog.html.SafeHtml.canUseSandboxIframe=function(){return goog.global.HTMLIFrameElement&&"sandbox"in goog.global.HTMLIFrameElement.prototype},goog.html.SafeHtml.createScriptSrc=function(e,t){return goog.html.TrustedResourceUrl.unwrap(e),e=goog.html.SafeHtml.combineAttributes({src:e},{},t),goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse("script",e)},goog.html.SafeHtml.createScript=function(e,t){for(var r in t){var n=r.toLowerCase();if("language"==n||"src"==n||"text"==n||"type"==n)throw Error(goog.html.SafeHtml.ENABLE_ERROR_MESSAGES?'Cannot set "'+n+'" attribute':"")}for(r="",e=goog.array.concat(e),n=0;n<e.length;n++)r+=goog.html.SafeScript.unwrap(e[n]);return e=goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(r,goog.i18n.bidi.Dir.NEUTRAL),goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse("script",t,e)},goog.html.SafeHtml.createStyle=function(e,t){t=goog.html.SafeHtml.combineAttributes({type:"text/css"},{},t);var r="";e=goog.array.concat(e);for(var n=0;n<e.length;n++)r+=goog.html.SafeStyleSheet.unwrap(e[n]);return e=goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(r,goog.i18n.bidi.Dir.NEUTRAL),goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse("style",t,e)},goog.html.SafeHtml.createMetaRefresh=function(e,t){return e=goog.html.SafeUrl.unwrap(goog.html.SafeUrl.sanitize(e)),(goog.labs.userAgent.browser.isIE()||goog.labs.userAgent.browser.isEdge())&&goog.string.internal.contains(e,";")&&(e="'"+e.replace(/'/g,"%27")+"'"),goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse("meta",{"http-equiv":"refresh",content:(t||0)+"; url="+e})},goog.html.SafeHtml.getAttrNameAndValue_=function(e,t,r){if(r instanceof goog.string.Const)r=goog.string.Const.unwrap(r);else if("style"==t.toLowerCase()){if(!goog.html.SafeHtml.SUPPORT_STYLE_ATTRIBUTE)throw Error(goog.html.SafeHtml.ENABLE_ERROR_MESSAGES?'Attribute "style" not supported.':"");r=goog.html.SafeHtml.getStyleValue_(r)}else{if(/^on/i.test(t))throw Error(goog.html.SafeHtml.ENABLE_ERROR_MESSAGES?'Attribute "'+t+'" requires goog.string.Const value, "'+r+'" given.':"");if(t.toLowerCase()in goog.html.SafeHtml.URL_ATTRIBUTES_)if(r instanceof goog.html.TrustedResourceUrl)r=goog.html.TrustedResourceUrl.unwrap(r);else if(r instanceof goog.html.SafeUrl)r=goog.html.SafeUrl.unwrap(r);else{if("string"!=typeof r)throw Error(goog.html.SafeHtml.ENABLE_ERROR_MESSAGES?'Attribute "'+t+'" on tag "'+e+'" requires goog.html.SafeUrl, goog.string.Const, or string, value "'+r+'" given.':"");r=goog.html.SafeUrl.sanitize(r).getTypedStringValue()}}return r.implementsGoogStringTypedString&&(r=r.getTypedStringValue()),goog.asserts.assert("string"==typeof r||"number"==typeof r,"String or number value expected, got "+typeof r+" with value: "+r),t+'="'+goog.string.internal.htmlEscape(String(r))+'"'},goog.html.SafeHtml.getStyleValue_=function(e){if(!goog.isObject(e))throw Error(goog.html.SafeHtml.ENABLE_ERROR_MESSAGES?'The "style" attribute requires goog.html.SafeStyle or map of style properties, '+typeof e+" given: "+e:"");return e instanceof goog.html.SafeStyle||(e=goog.html.SafeStyle.create(e)),goog.html.SafeStyle.unwrap(e)},goog.html.SafeHtml.createWithDir=function(e,t,r,n){return(t=goog.html.SafeHtml.create(t,r,n)).dir_=e,t},goog.html.SafeHtml.join=function(e,t){var r=(e=goog.html.SafeHtml.htmlEscape(e)).getDirection(),n=[],o=function(e){Array.isArray(e)?goog.array.forEach(e,o):(e=goog.html.SafeHtml.htmlEscape(e),n.push(goog.html.SafeHtml.unwrap(e)),e=e.getDirection(),r==goog.i18n.bidi.Dir.NEUTRAL?r=e:e!=goog.i18n.bidi.Dir.NEUTRAL&&r!=e&&(r=null))};return goog.array.forEach(t,o),goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(n.join(goog.html.SafeHtml.unwrap(e)),r)},goog.html.SafeHtml.concat=function(e){return goog.html.SafeHtml.join(goog.html.SafeHtml.EMPTY,Array.prototype.slice.call(arguments))},goog.html.SafeHtml.concatWithDir=function(e,t){var r=goog.html.SafeHtml.concat(goog.array.slice(arguments,1));return r.dir_=e,r},goog.html.SafeHtml.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_={},goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse=function(e,t){return(new goog.html.SafeHtml).initSecurityPrivateDoNotAccessOrElse_(e,t)},goog.html.SafeHtml.prototype.initSecurityPrivateDoNotAccessOrElse_=function(e,t){return this.privateDoNotAccessOrElseSafeHtmlWrappedValue_=goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY?goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY.createHTML(e):e,this.dir_=t,this},goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse=function(e,t,r){var n=null,o="<"+e+goog.html.SafeHtml.stringifyAttributes(e,t);return null==r?r=[]:Array.isArray(r)||(r=[r]),goog.dom.tags.isVoidTag(e.toLowerCase())?(goog.asserts.assert(!r.length,"Void tag <"+e+"> does not allow content."),o+=">"):(n=goog.html.SafeHtml.concat(r),o+=">"+goog.html.SafeHtml.unwrap(n)+"</"+e+">",n=n.getDirection()),(e=t&&t.dir)&&(n=/^(ltr|rtl|auto)$/i.test(e)?goog.i18n.bidi.Dir.NEUTRAL:null),goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(o,n)},goog.html.SafeHtml.stringifyAttributes=function(e,t){var r="";if(t)for(var n in t){if(!goog.html.SafeHtml.VALID_NAMES_IN_TAG_.test(n))throw Error(goog.html.SafeHtml.ENABLE_ERROR_MESSAGES?'Invalid attribute name "'+n+'".':"");var o=t[n];null!=o&&(r+=" "+goog.html.SafeHtml.getAttrNameAndValue_(e,n,o))}return r},goog.html.SafeHtml.combineAttributes=function(e,t,r){var n,o={};for(n in e)goog.asserts.assert(n.toLowerCase()==n,"Must be lower case"),o[n]=e[n];for(n in t)goog.asserts.assert(n.toLowerCase()==n,"Must be lower case"),o[n]=t[n];if(r)for(n in r){var i=n.toLowerCase();if(i in e)throw Error(goog.html.SafeHtml.ENABLE_ERROR_MESSAGES?'Cannot override "'+i+'" attribute, got "'+n+'" with value "'+r[n]+'"':"");i in t&&delete o[i],o[n]=r[n]}return o},goog.html.SafeHtml.DOCTYPE_HTML=goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse("<!DOCTYPE html>",goog.i18n.bidi.Dir.NEUTRAL),goog.html.SafeHtml.EMPTY=goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse("",goog.i18n.bidi.Dir.NEUTRAL),goog.html.SafeHtml.BR=goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse("<br>",goog.i18n.bidi.Dir.NEUTRAL),goog.html.uncheckedconversions={},goog.html.uncheckedconversions.safeHtmlFromStringKnownToSatisfyTypeContract=function(e,t,r){return goog.asserts.assertString(goog.string.Const.unwrap(e),"must provide justification"),goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap(e)),"must provide non-empty justification"),goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(t,r||null)},goog.html.uncheckedconversions.safeScriptFromStringKnownToSatisfyTypeContract=function(e,t){return goog.asserts.assertString(goog.string.Const.unwrap(e),"must provide justification"),goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap(e)),"must provide non-empty justification"),goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse(t)},goog.html.uncheckedconversions.safeStyleFromStringKnownToSatisfyTypeContract=function(e,t){return goog.asserts.assertString(goog.string.Const.unwrap(e),"must provide justification"),goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap(e)),"must provide non-empty justification"),goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse(t)},goog.html.uncheckedconversions.safeStyleSheetFromStringKnownToSatisfyTypeContract=function(e,t){return goog.asserts.assertString(goog.string.Const.unwrap(e),"must provide justification"),goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap(e)),"must provide non-empty justification"),goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse(t)},goog.html.uncheckedconversions.safeUrlFromStringKnownToSatisfyTypeContract=function(e,t){return goog.asserts.assertString(goog.string.Const.unwrap(e),"must provide justification"),goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap(e)),"must provide non-empty justification"),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(t)},goog.html.uncheckedconversions.trustedResourceUrlFromStringKnownToSatisfyTypeContract=function(e,t){return goog.asserts.assertString(goog.string.Const.unwrap(e),"must provide justification"),goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap(e)),"must provide non-empty justification"),goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(t)},goog.dom.safe={},goog.dom.safe.InsertAdjacentHtmlPosition={AFTERBEGIN:"afterbegin",AFTEREND:"afterend",BEFOREBEGIN:"beforebegin",BEFOREEND:"beforeend"},goog.dom.safe.insertAdjacentHtml=function(e,t,r){e.insertAdjacentHTML(t,goog.html.SafeHtml.unwrapTrustedHTML(r))},goog.dom.safe.SET_INNER_HTML_DISALLOWED_TAGS_={MATH:!0,SCRIPT:!0,STYLE:!0,SVG:!0,TEMPLATE:!0},goog.dom.safe.isInnerHtmlCleanupRecursive_=goog.functions.cacheReturnValue((function(){if(goog.DEBUG&&"undefined"==typeof document)return!1;var e=document.createElement("div"),t=document.createElement("div");return t.appendChild(document.createElement("div")),e.appendChild(t),!(goog.DEBUG&&!e.firstChild||(t=e.firstChild.firstChild,e.innerHTML=goog.html.SafeHtml.unwrapTrustedHTML(goog.html.SafeHtml.EMPTY),t.parentElement))})),goog.dom.safe.unsafeSetInnerHtmlDoNotUseOrElse=function(e,t){if(goog.dom.safe.isInnerHtmlCleanupRecursive_())for(;e.lastChild;)e.removeChild(e.lastChild);e.innerHTML=goog.html.SafeHtml.unwrapTrustedHTML(t)},goog.dom.safe.setInnerHtml=function(e,t){if(goog.asserts.ENABLE_ASSERTS){var r=e.tagName.toUpperCase();if(goog.dom.safe.SET_INNER_HTML_DISALLOWED_TAGS_[r])throw Error("goog.dom.safe.setInnerHtml cannot be used to set content of "+e.tagName+".")}goog.dom.safe.unsafeSetInnerHtmlDoNotUseOrElse(e,t)},goog.dom.safe.setOuterHtml=function(e,t){e.outerHTML=goog.html.SafeHtml.unwrapTrustedHTML(t)},goog.dom.safe.setFormElementAction=function(e,t){t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),goog.dom.asserts.assertIsHTMLFormElement(e).action=goog.html.SafeUrl.unwrap(t)},goog.dom.safe.setButtonFormAction=function(e,t){t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),goog.dom.asserts.assertIsHTMLButtonElement(e).formAction=goog.html.SafeUrl.unwrap(t)},goog.dom.safe.setInputFormAction=function(e,t){t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),goog.dom.asserts.assertIsHTMLInputElement(e).formAction=goog.html.SafeUrl.unwrap(t)},goog.dom.safe.setStyle=function(e,t){e.style.cssText=goog.html.SafeStyle.unwrap(t)},goog.dom.safe.documentWrite=function(e,t){e.write(goog.html.SafeHtml.unwrapTrustedHTML(t))},goog.dom.safe.setAnchorHref=function(e,t){goog.dom.asserts.assertIsHTMLAnchorElement(e),t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),e.href=goog.html.SafeUrl.unwrap(t)},goog.dom.safe.setImageSrc=function(e,t){if(goog.dom.asserts.assertIsHTMLImageElement(e),!(t instanceof goog.html.SafeUrl)){var r=/^data:image\//i.test(t);t=goog.html.SafeUrl.sanitizeAssertUnchanged(t,r)}e.src=goog.html.SafeUrl.unwrap(t)},goog.dom.safe.setAudioSrc=function(e,t){if(goog.dom.asserts.assertIsHTMLAudioElement(e),!(t instanceof goog.html.SafeUrl)){var r=/^data:audio\//i.test(t);t=goog.html.SafeUrl.sanitizeAssertUnchanged(t,r)}e.src=goog.html.SafeUrl.unwrap(t)},goog.dom.safe.setVideoSrc=function(e,t){if(goog.dom.asserts.assertIsHTMLVideoElement(e),!(t instanceof goog.html.SafeUrl)){var r=/^data:video\//i.test(t);t=goog.html.SafeUrl.sanitizeAssertUnchanged(t,r)}e.src=goog.html.SafeUrl.unwrap(t)},goog.dom.safe.setEmbedSrc=function(e,t){goog.dom.asserts.assertIsHTMLEmbedElement(e),e.src=goog.html.TrustedResourceUrl.unwrapTrustedScriptURL(t)},goog.dom.safe.setFrameSrc=function(e,t){goog.dom.asserts.assertIsHTMLFrameElement(e),e.src=goog.html.TrustedResourceUrl.unwrap(t)},goog.dom.safe.setIframeSrc=function(e,t){goog.dom.asserts.assertIsHTMLIFrameElement(e),e.src=goog.html.TrustedResourceUrl.unwrap(t)},goog.dom.safe.setIframeSrcdoc=function(e,t){goog.dom.asserts.assertIsHTMLIFrameElement(e),e.srcdoc=goog.html.SafeHtml.unwrapTrustedHTML(t)},goog.dom.safe.setLinkHrefAndRel=function(e,t,r){goog.dom.asserts.assertIsHTMLLinkElement(e),e.rel=r,goog.string.internal.caseInsensitiveContains(r,"stylesheet")?(goog.asserts.assert(t instanceof goog.html.TrustedResourceUrl,'URL must be TrustedResourceUrl because "rel" contains "stylesheet"'),e.href=goog.html.TrustedResourceUrl.unwrap(t)):e.href=t instanceof goog.html.TrustedResourceUrl?goog.html.TrustedResourceUrl.unwrap(t):t instanceof goog.html.SafeUrl?goog.html.SafeUrl.unwrap(t):goog.html.SafeUrl.unwrap(goog.html.SafeUrl.sanitizeAssertUnchanged(t))},goog.dom.safe.setObjectData=function(e,t){goog.dom.asserts.assertIsHTMLObjectElement(e),e.data=goog.html.TrustedResourceUrl.unwrapTrustedScriptURL(t)},goog.dom.safe.setScriptSrc=function(e,t){goog.dom.asserts.assertIsHTMLScriptElement(e),e.src=goog.html.TrustedResourceUrl.unwrapTrustedScriptURL(t),(t=goog.getScriptNonce())&&e.setAttribute("nonce",t)},goog.dom.safe.setScriptContent=function(e,t){goog.dom.asserts.assertIsHTMLScriptElement(e),e.text=goog.html.SafeScript.unwrapTrustedScript(t),(t=goog.getScriptNonce())&&e.setAttribute("nonce",t)},goog.dom.safe.setLocationHref=function(e,t){goog.dom.asserts.assertIsLocation(e),t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),e.href=goog.html.SafeUrl.unwrap(t)},goog.dom.safe.assignLocation=function(e,t){goog.dom.asserts.assertIsLocation(e),t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),e.assign(goog.html.SafeUrl.unwrap(t))},goog.dom.safe.replaceLocation=function(e,t){t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),e.replace(goog.html.SafeUrl.unwrap(t))},goog.dom.safe.openInWindow=function(e,t,r,n,o){return e=e instanceof goog.html.SafeUrl?e:goog.html.SafeUrl.sanitizeAssertUnchanged(e),t=t||goog.global,r=r instanceof goog.string.Const?goog.string.Const.unwrap(r):r||"",t.open(goog.html.SafeUrl.unwrap(e),r,n,o)},goog.dom.safe.parseFromStringHtml=function(e,t){return goog.dom.safe.parseFromString(e,t,"text/html")},goog.dom.safe.parseFromString=function(e,t,r){return e.parseFromString(goog.html.SafeHtml.unwrapTrustedHTML(t),r)},goog.dom.safe.createImageFromBlob=function(e){if(!/^image\/.*/g.test(e.type))throw Error("goog.dom.safe.createImageFromBlob only accepts MIME type image/.*.");var t=goog.global.URL.createObjectURL(e);return(e=new goog.global.Image).onload=function(){goog.global.URL.revokeObjectURL(t)},goog.dom.safe.setImageSrc(e,goog.html.uncheckedconversions.safeUrlFromStringKnownToSatisfyTypeContract(goog.string.Const.from("Image blob URL."),t)),e},goog.string.DETECT_DOUBLE_ESCAPING=!1,goog.string.FORCE_NON_DOM_HTML_UNESCAPING=!1,goog.string.Unicode={NBSP:" "},goog.string.startsWith=goog.string.internal.startsWith,goog.string.endsWith=goog.string.internal.endsWith,goog.string.caseInsensitiveStartsWith=goog.string.internal.caseInsensitiveStartsWith,goog.string.caseInsensitiveEndsWith=goog.string.internal.caseInsensitiveEndsWith,goog.string.caseInsensitiveEquals=goog.string.internal.caseInsensitiveEquals,goog.string.subs=function(e,t){for(var r=e.split("%s"),n="",o=Array.prototype.slice.call(arguments,1);o.length&&1<r.length;)n+=r.shift()+o.shift();return n+r.join("%s")},goog.string.collapseWhitespace=function(e){return e.replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")},goog.string.isEmptyOrWhitespace=goog.string.internal.isEmptyOrWhitespace,goog.string.isEmptyString=function(e){return 0==e.length},goog.string.isEmpty=goog.string.isEmptyOrWhitespace,goog.string.isEmptyOrWhitespaceSafe=function(e){return goog.string.isEmptyOrWhitespace(goog.string.makeSafe(e))},goog.string.isEmptySafe=goog.string.isEmptyOrWhitespaceSafe,goog.string.isBreakingWhitespace=function(e){return!/[^\t\n\r ]/.test(e)},goog.string.isAlpha=function(e){return!/[^a-zA-Z]/.test(e)},goog.string.isNumeric=function(e){return!/[^0-9]/.test(e)},goog.string.isAlphaNumeric=function(e){return!/[^a-zA-Z0-9]/.test(e)},goog.string.isSpace=function(e){return" "==e},goog.string.isUnicodeChar=function(e){return 1==e.length&&" "<=e&&"~">=e||""<=e&&"�">=e},goog.string.stripNewlines=function(e){return e.replace(/(\r\n|\r|\n)+/g," ")},goog.string.canonicalizeNewlines=function(e){return e.replace(/(\r\n|\r|\n)/g,"\n")},goog.string.normalizeWhitespace=function(e){return e.replace(/\xa0|\s/g," ")},goog.string.normalizeSpaces=function(e){return e.replace(/\xa0|[ \t]+/g," ")},goog.string.collapseBreakingSpaces=function(e){return e.replace(/[\t\r\n ]+/g," ").replace(/^[\t\r\n ]+|[\t\r\n ]+$/g,"")},goog.string.trim=goog.string.internal.trim,goog.string.trimLeft=function(e){return e.replace(/^[\s\xa0]+/,"")},goog.string.trimRight=function(e){return e.replace(/[\s\xa0]+$/,"")},goog.string.caseInsensitiveCompare=goog.string.internal.caseInsensitiveCompare,goog.string.numberAwareCompare_=function(e,t,r){if(e==t)return 0;if(!e)return-1;if(!t)return 1;for(var n=e.toLowerCase().match(r),o=t.toLowerCase().match(r),i=Math.min(n.length,o.length),a=0;a<i;a++){r=n[a];var s=o[a];if(r!=s)return e=parseInt(r,10),!isNaN(e)&&(t=parseInt(s,10),!isNaN(t)&&e-t)?e-t:r<s?-1:1}return n.length!=o.length?n.length-o.length:e<t?-1:1},goog.string.intAwareCompare=function(e,t){return goog.string.numberAwareCompare_(e,t,/\d+|\D+/g)},goog.string.floatAwareCompare=function(e,t){return goog.string.numberAwareCompare_(e,t,/\d+|\.\d+|\D+/g)},goog.string.numerateCompare=goog.string.floatAwareCompare,goog.string.urlEncode=function(e){return encodeURIComponent(String(e))},goog.string.urlDecode=function(e){return decodeURIComponent(e.replace(/\+/g," "))},goog.string.newLineToBr=goog.string.internal.newLineToBr,goog.string.htmlEscape=function(e,t){return e=goog.string.internal.htmlEscape(e,t),goog.string.DETECT_DOUBLE_ESCAPING&&(e=e.replace(goog.string.E_RE_,"e")),e},goog.string.E_RE_=/e/g,goog.string.unescapeEntities=function(e){return goog.string.contains(e,"&")?!goog.string.FORCE_NON_DOM_HTML_UNESCAPING&&"document"in goog.global?goog.string.unescapeEntitiesUsingDom_(e):goog.string.unescapePureXmlEntities_(e):e},goog.string.unescapeEntitiesWithDocument=function(e,t){return goog.string.contains(e,"&")?goog.string.unescapeEntitiesUsingDom_(e,t):e},goog.string.unescapeEntitiesUsingDom_=function(e,t){var r={"&":"&","<":"<",">":">",""":'"'},n=t?t.createElement("div"):goog.global.document.createElement("div");return e.replace(goog.string.HTML_ENTITY_PATTERN_,(function(e,t){var o=r[e];return o||("#"==t.charAt(0)&&(t=Number("0"+t.substr(1)),isNaN(t)||(o=String.fromCharCode(t))),o||(goog.dom.safe.setInnerHtml(n,goog.html.uncheckedconversions.safeHtmlFromStringKnownToSatisfyTypeContract(goog.string.Const.from("Single HTML entity."),e+" ")),o=n.firstChild.nodeValue.slice(0,-1)),r[e]=o)}))},goog.string.unescapePureXmlEntities_=function(e){return e.replace(/&([^;]+);/g,(function(e,t){switch(t){case"amp":return"&";case"lt":return"<";case"gt":return">";case"quot":return'"';default:return"#"!=t.charAt(0)||(t=Number("0"+t.substr(1)),isNaN(t))?e:String.fromCharCode(t)}}))},goog.string.HTML_ENTITY_PATTERN_=/&([^;\s<&]+);?/g,goog.string.whitespaceEscape=function(e,t){return goog.string.newLineToBr(e.replace(/ /g,"  "),t)},goog.string.preserveSpaces=function(e){return e.replace(/(^|[\n ]) /g,"$1"+goog.string.Unicode.NBSP)},goog.string.stripQuotes=function(e,t){for(var r=t.length,n=0;n<r;n++){var o=1==r?t:t.charAt(n);if(e.charAt(0)==o&&e.charAt(e.length-1)==o)return e.substring(1,e.length-1)}return e},goog.string.truncate=function(e,t,r){return r&&(e=goog.string.unescapeEntities(e)),e.length>t&&(e=e.substring(0,t-3)+"..."),r&&(e=goog.string.htmlEscape(e)),e},goog.string.truncateMiddle=function(e,t,r,n){if(r&&(e=goog.string.unescapeEntities(e)),n&&e.length>t){n>t&&(n=t);var o=e.length-n;e=e.substring(0,t-n)+"..."+e.substring(o)}else e.length>t&&(n=Math.floor(t/2),o=e.length-n,e=e.substring(0,n+t%2)+"..."+e.substring(o));return r&&(e=goog.string.htmlEscape(e)),e},goog.string.specialEscapeChars_={"\0":"\\0","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\x0B",'"':'\\"',"\\":"\\\\","<":"\\u003C"},goog.string.jsEscapeCache_={"'":"\\'"},goog.string.quote=function(e){e=String(e);for(var t=['"'],r=0;r<e.length;r++){var n=e.charAt(r),o=n.charCodeAt(0);t[r+1]=goog.string.specialEscapeChars_[n]||(31<o&&127>o?n:goog.string.escapeChar(n))}return t.push('"'),t.join("")},goog.string.escapeString=function(e){for(var t=[],r=0;r<e.length;r++)t[r]=goog.string.escapeChar(e.charAt(r));return t.join("")},goog.string.escapeChar=function(e){if(e in goog.string.jsEscapeCache_)return goog.string.jsEscapeCache_[e];if(e in goog.string.specialEscapeChars_)return goog.string.jsEscapeCache_[e]=goog.string.specialEscapeChars_[e];var t=e.charCodeAt(0);if(31<t&&127>t)var r=e;else 256>t?(r="\\x",(16>t||256<t)&&(r+="0")):(r="\\u",4096>t&&(r+="0")),r+=t.toString(16).toUpperCase();return goog.string.jsEscapeCache_[e]=r},goog.string.contains=goog.string.internal.contains,goog.string.caseInsensitiveContains=goog.string.internal.caseInsensitiveContains,goog.string.countOf=function(e,t){return e&&t?e.split(t).length-1:0},goog.string.removeAt=function(e,t,r){var n=e;return 0<=t&&t<e.length&&0<r&&(n=e.substr(0,t)+e.substr(t+r,e.length-t-r)),n},goog.string.remove=function(e,t){return e.replace(t,"")},goog.string.removeAll=function(e,t){return t=new RegExp(goog.string.regExpEscape(t),"g"),e.replace(t,"")},goog.string.replaceAll=function(e,t,r){return t=new RegExp(goog.string.regExpEscape(t),"g"),e.replace(t,r.replace(/\$/g,"$$$$"))},goog.string.regExpEscape=function(e){return String(e).replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1").replace(/\x08/g,"\\x08")},goog.string.repeat=String.prototype.repeat?function(e,t){return e.repeat(t)}:function(e,t){return Array(t+1).join(e)},goog.string.padNumber=function(e,t,r){return-1==(r=(e=void 0!==r?e.toFixed(r):String(e)).indexOf("."))&&(r=e.length),goog.string.repeat("0",Math.max(0,t-r))+e},goog.string.makeSafe=function(e){return null==e?"":String(e)},goog.string.buildString=function(e){return Array.prototype.join.call(arguments,"")},goog.string.getRandomString=function(){return Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^goog.now()).toString(36)},goog.string.compareVersions=goog.string.internal.compareVersions,goog.string.hashCode=function(e){for(var t=0,r=0;r<e.length;++r)t=31*t+e.charCodeAt(r)>>>0;return t},goog.string.uniqueStringCounter_=2147483648*Math.random()|0,goog.string.createUniqueString=function(){return"goog_"+goog.string.uniqueStringCounter_++},goog.string.toNumber=function(e){var t=Number(e);return 0==t&&goog.string.isEmptyOrWhitespace(e)?NaN:t},goog.string.isLowerCamelCase=function(e){return/^[a-z]+([A-Z][a-z]*)*$/.test(e)},goog.string.isUpperCamelCase=function(e){return/^([A-Z][a-z]*)+$/.test(e)},goog.string.toCamelCase=function(e){return String(e).replace(/\-([a-z])/g,(function(e,t){return t.toUpperCase()}))},goog.string.toSelectorCase=function(e){return String(e).replace(/([A-Z])/g,"-$1").toLowerCase()},goog.string.toTitleCase=function(e,t){return t="string"==typeof t?goog.string.regExpEscape(t):"\\s",e.replace(new RegExp("(^"+(t?"|["+t+"]+":"")+")([a-z])","g"),(function(e,t,r){return t+r.toUpperCase()}))},goog.string.capitalize=function(e){return String(e.charAt(0)).toUpperCase()+String(e.substr(1)).toLowerCase()},goog.string.parseInt=function(e){return isFinite(e)&&(e=String(e)),"string"==typeof e?/^\s*-?0x/i.test(e)?parseInt(e,16):parseInt(e,10):NaN},goog.string.splitLimit=function(e,t,r){e=e.split(t);for(var n=[];0<r&&e.length;)n.push(e.shift()),r--;return e.length&&n.push(e.join(t)),n},goog.string.lastComponent=function(e,t){if(!t)return e;"string"==typeof t&&(t=[t]);for(var r=-1,n=0;n<t.length;n++)if(""!=t[n]){var o=e.lastIndexOf(t[n]);o>r&&(r=o)}return-1==r?e:e.slice(r+1)},goog.string.editDistance=function(e,t){var r=[],n=[];if(e==t)return 0;if(!e.length||!t.length)return Math.max(e.length,t.length);for(var o=0;o<t.length+1;o++)r[o]=o;for(o=0;o<e.length;o++){n[0]=o+1;for(var i=0;i<t.length;i++)n[i+1]=Math.min(n[i]+1,r[i+1]+1,r[i]+Number(e[o]!=t[i]));for(i=0;i<r.length;i++)r[i]=n[i]}return n[t.length]},goog.labs.userAgent.engine={},goog.labs.userAgent.engine.isPresto=function(){return goog.labs.userAgent.util.matchUserAgent("Presto")},goog.labs.userAgent.engine.isTrident=function(){return goog.labs.userAgent.util.matchUserAgent("Trident")||goog.labs.userAgent.util.matchUserAgent("MSIE")},goog.labs.userAgent.engine.isEdge=function(){return goog.labs.userAgent.util.matchUserAgent("Edge")},goog.labs.userAgent.engine.isWebKit=function(){return goog.labs.userAgent.util.matchUserAgentIgnoreCase("WebKit")&&!goog.labs.userAgent.engine.isEdge()},goog.labs.userAgent.engine.isGecko=function(){return goog.labs.userAgent.util.matchUserAgent("Gecko")&&!goog.labs.userAgent.engine.isWebKit()&&!goog.labs.userAgent.engine.isTrident()&&!goog.labs.userAgent.engine.isEdge()},goog.labs.userAgent.engine.getVersion=function(){var e=goog.labs.userAgent.util.getUserAgent();if(e){e=goog.labs.userAgent.util.extractVersionTuples(e);var t,r=goog.labs.userAgent.engine.getEngineTuple_(e);if(r)return"Gecko"==r[0]?goog.labs.userAgent.engine.getVersionForKey_(e,"Firefox"):r[1];if((e=e[0])&&(t=e[2])&&(t=/Trident\/([^\s;]+)/.exec(t)))return t[1]}return""},goog.labs.userAgent.engine.getEngineTuple_=function(e){if(!goog.labs.userAgent.engine.isEdge())return e[1];for(var t=0;t<e.length;t++){var r=e[t];if("Edge"==r[0])return r}},goog.labs.userAgent.engine.isVersionOrHigher=function(e){return 0<=goog.string.compareVersions(goog.labs.userAgent.engine.getVersion(),e)},goog.labs.userAgent.engine.getVersionForKey_=function(e,t){return(e=goog.array.find(e,(function(e){return t==e[0]})))&&e[1]||""},goog.labs.userAgent.platform={},goog.labs.userAgent.platform.isAndroid=function(){return goog.labs.userAgent.util.matchUserAgent("Android")},goog.labs.userAgent.platform.isIpod=function(){return goog.labs.userAgent.util.matchUserAgent("iPod")},goog.labs.userAgent.platform.isIphone=function(){return goog.labs.userAgent.util.matchUserAgent("iPhone")&&!goog.labs.userAgent.util.matchUserAgent("iPod")&&!goog.labs.userAgent.util.matchUserAgent("iPad")},goog.labs.userAgent.platform.isIpad=function(){return goog.labs.userAgent.util.matchUserAgent("iPad")},goog.labs.userAgent.platform.isIos=function(){return goog.labs.userAgent.platform.isIphone()||goog.labs.userAgent.platform.isIpad()||goog.labs.userAgent.platform.isIpod()},goog.labs.userAgent.platform.isMacintosh=function(){return goog.labs.userAgent.util.matchUserAgent("Macintosh")},goog.labs.userAgent.platform.isLinux=function(){return goog.labs.userAgent.util.matchUserAgent("Linux")},goog.labs.userAgent.platform.isWindows=function(){return goog.labs.userAgent.util.matchUserAgent("Windows")},goog.labs.userAgent.platform.isChromeOS=function(){return goog.labs.userAgent.util.matchUserAgent("CrOS")},goog.labs.userAgent.platform.isChromecast=function(){return goog.labs.userAgent.util.matchUserAgent("CrKey")},goog.labs.userAgent.platform.isKaiOS=function(){return goog.labs.userAgent.util.matchUserAgentIgnoreCase("KaiOS")},goog.labs.userAgent.platform.getVersion=function(){var e=goog.labs.userAgent.util.getUserAgent(),t="";return goog.labs.userAgent.platform.isWindows()?t=(e=(t=/Windows (?:NT|Phone) ([0-9.]+)/).exec(e))?e[1]:"0.0":goog.labs.userAgent.platform.isIos()?t=(e=(t=/(?:iPhone|iPod|iPad|CPU)\s+OS\s+(\S+)/).exec(e))&&e[1].replace(/_/g,"."):goog.labs.userAgent.platform.isMacintosh()?t=(e=(t=/Mac OS X ([0-9_.]+)/).exec(e))?e[1].replace(/_/g,"."):"10":goog.labs.userAgent.platform.isKaiOS()?t=(e=(t=/(?:KaiOS)\/(\S+)/i).exec(e))&&e[1]:goog.labs.userAgent.platform.isAndroid()?t=(e=(t=/Android\s+([^\);]+)(\)|;)/).exec(e))&&e[1]:goog.labs.userAgent.platform.isChromeOS()&&(t=(e=(t=/(?:CrOS\s+(?:i686|x86_64)\s+([0-9.]+))/).exec(e))&&e[1]),t||""},goog.labs.userAgent.platform.isVersionOrHigher=function(e){return 0<=goog.string.compareVersions(goog.labs.userAgent.platform.getVersion(),e)},goog.reflect={},goog.reflect.object=function(e,t){return t},goog.reflect.objectProperty=function(e,t){return e},goog.reflect.sinkValue=function(e){return goog.reflect.sinkValue[" "](e),e},goog.reflect.sinkValue[" "]=goog.nullFunction,goog.reflect.canAccessProperty=function(e,t){try{return goog.reflect.sinkValue(e[t]),!0}catch(e){}return!1},goog.reflect.cache=function(e,t,r,n){return n=n?n(t):t,Object.prototype.hasOwnProperty.call(e,n)?e[n]:e[n]=r(t)},goog.userAgent={},goog.userAgent.ASSUME_IE=!1,goog.userAgent.ASSUME_EDGE=!1,goog.userAgent.ASSUME_GECKO=!1,goog.userAgent.ASSUME_WEBKIT=!1,goog.userAgent.ASSUME_MOBILE_WEBKIT=!1,goog.userAgent.ASSUME_OPERA=!1,goog.userAgent.ASSUME_ANY_VERSION=!1,goog.userAgent.BROWSER_KNOWN_=goog.userAgent.ASSUME_IE||goog.userAgent.ASSUME_EDGE||goog.userAgent.ASSUME_GECKO||goog.userAgent.ASSUME_MOBILE_WEBKIT||goog.userAgent.ASSUME_WEBKIT||goog.userAgent.ASSUME_OPERA,goog.userAgent.getUserAgentString=function(){return goog.labs.userAgent.util.getUserAgent()},goog.userAgent.getNavigatorTyped=function(){return goog.global.navigator||null},goog.userAgent.getNavigator=function(){return goog.userAgent.getNavigatorTyped()},goog.userAgent.OPERA=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_OPERA:goog.labs.userAgent.browser.isOpera(),goog.userAgent.IE=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_IE:goog.labs.userAgent.browser.isIE(),goog.userAgent.EDGE=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_EDGE:goog.labs.userAgent.engine.isEdge(),goog.userAgent.EDGE_OR_IE=goog.userAgent.EDGE||goog.userAgent.IE,goog.userAgent.GECKO=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_GECKO:goog.labs.userAgent.engine.isGecko(),goog.userAgent.WEBKIT=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_WEBKIT||goog.userAgent.ASSUME_MOBILE_WEBKIT:goog.labs.userAgent.engine.isWebKit(),goog.userAgent.isMobile_=function(){return goog.userAgent.WEBKIT&&goog.labs.userAgent.util.matchUserAgent("Mobile")},goog.userAgent.MOBILE=goog.userAgent.ASSUME_MOBILE_WEBKIT||goog.userAgent.isMobile_(),goog.userAgent.SAFARI=goog.userAgent.WEBKIT,goog.userAgent.determinePlatform_=function(){var e=goog.userAgent.getNavigatorTyped();return e&&e.platform||""},goog.userAgent.PLATFORM=goog.userAgent.determinePlatform_(),goog.userAgent.ASSUME_MAC=!1,goog.userAgent.ASSUME_WINDOWS=!1,goog.userAgent.ASSUME_LINUX=!1,goog.userAgent.ASSUME_X11=!1,goog.userAgent.ASSUME_ANDROID=!1,goog.userAgent.ASSUME_IPHONE=!1,goog.userAgent.ASSUME_IPAD=!1,goog.userAgent.ASSUME_IPOD=!1,goog.userAgent.ASSUME_KAIOS=!1,goog.userAgent.PLATFORM_KNOWN_=goog.userAgent.ASSUME_MAC||goog.userAgent.ASSUME_WINDOWS||goog.userAgent.ASSUME_LINUX||goog.userAgent.ASSUME_X11||goog.userAgent.ASSUME_ANDROID||goog.userAgent.ASSUME_IPHONE||goog.userAgent.ASSUME_IPAD||goog.userAgent.ASSUME_IPOD,goog.userAgent.MAC=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_MAC:goog.labs.userAgent.platform.isMacintosh();goog.userAgent.WINDOWS=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_WINDOWS:goog.labs.userAgent.platform.isWindows(),goog.userAgent.isLegacyLinux_=function(){return goog.labs.userAgent.platform.isLinux()||goog.labs.userAgent.platform.isChromeOS()},goog.userAgent.LINUX=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_LINUX:goog.userAgent.isLegacyLinux_(),goog.userAgent.isX11_=function(){var e=goog.userAgent.getNavigatorTyped();return!!e&&goog.string.contains(e.appVersion||"","X11")},goog.userAgent.X11=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_X11:goog.userAgent.isX11_(),goog.userAgent.ANDROID=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_ANDROID:goog.labs.userAgent.platform.isAndroid(),goog.userAgent.IPHONE=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_IPHONE:goog.labs.userAgent.platform.isIphone(),goog.userAgent.IPAD=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_IPAD:goog.labs.userAgent.platform.isIpad(),goog.userAgent.IPOD=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_IPOD:goog.labs.userAgent.platform.isIpod(),goog.userAgent.IOS=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_IPHONE||goog.userAgent.ASSUME_IPAD||goog.userAgent.ASSUME_IPOD:goog.labs.userAgent.platform.isIos(),goog.userAgent.KAIOS=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_KAIOS:goog.labs.userAgent.platform.isKaiOS(),goog.userAgent.determineVersion_=function(){var e="",t=goog.userAgent.getVersionRegexResult_();return t&&(e=t?t[1]:""),goog.userAgent.IE&&null!=(t=goog.userAgent.getDocumentMode_())&&t>parseFloat(e)?String(t):e},goog.userAgent.getVersionRegexResult_=function(){var e=goog.userAgent.getUserAgentString();return goog.userAgent.GECKO?/rv:([^\);]+)(\)|;)/.exec(e):goog.userAgent.EDGE?/Edge\/([\d\.]+)/.exec(e):goog.userAgent.IE?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(e):goog.userAgent.WEBKIT?/WebKit\/(\S+)/.exec(e):goog.userAgent.OPERA?/(?:Version)[ \/]?(\S+)/.exec(e):void 0},goog.userAgent.getDocumentMode_=function(){var e=goog.global.document;return e?e.documentMode:void 0},goog.userAgent.VERSION=goog.userAgent.determineVersion_(),goog.userAgent.compare=function(e,t){return goog.string.compareVersions(e,t)},goog.userAgent.isVersionOrHigherCache_={},goog.userAgent.isVersionOrHigher=function(e){return goog.userAgent.ASSUME_ANY_VERSION||goog.reflect.cache(goog.userAgent.isVersionOrHigherCache_,e,(function(){return 0<=goog.string.compareVersions(goog.userAgent.VERSION,e)}))},goog.userAgent.isVersion=goog.userAgent.isVersionOrHigher,goog.userAgent.isDocumentModeOrHigher=function(e){return Number(goog.userAgent.DOCUMENT_MODE)>=e},goog.userAgent.isDocumentMode=goog.userAgent.isDocumentModeOrHigher,goog.userAgent.DOCUMENT_MODE=function(){if(goog.global.document&&goog.userAgent.IE)return goog.userAgent.getDocumentMode_()||parseInt(goog.userAgent.VERSION,10)||void 0}(),goog.userAgent.product={},goog.userAgent.product.ASSUME_FIREFOX=!1,goog.userAgent.product.ASSUME_IPHONE=!1,goog.userAgent.product.ASSUME_IPAD=!1,goog.userAgent.product.ASSUME_ANDROID=!1,goog.userAgent.product.ASSUME_CHROME=!1,goog.userAgent.product.ASSUME_SAFARI=!1,goog.userAgent.product.PRODUCT_KNOWN_=goog.userAgent.ASSUME_IE||goog.userAgent.ASSUME_EDGE||goog.userAgent.ASSUME_OPERA||goog.userAgent.product.ASSUME_FIREFOX||goog.userAgent.product.ASSUME_IPHONE||goog.userAgent.product.ASSUME_IPAD||goog.userAgent.product.ASSUME_ANDROID||goog.userAgent.product.ASSUME_CHROME||goog.userAgent.product.ASSUME_SAFARI,goog.userAgent.product.OPERA=goog.userAgent.OPERA,goog.userAgent.product.IE=goog.userAgent.IE,goog.userAgent.product.EDGE=goog.userAgent.EDGE,goog.userAgent.product.FIREFOX=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_FIREFOX:goog.labs.userAgent.browser.isFirefox(),goog.userAgent.product.isIphoneOrIpod_=function(){return goog.labs.userAgent.platform.isIphone()||goog.labs.userAgent.platform.isIpod()},goog.userAgent.product.IPHONE=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_IPHONE:goog.userAgent.product.isIphoneOrIpod_(),goog.userAgent.product.IPAD=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_IPAD:goog.labs.userAgent.platform.isIpad(),goog.userAgent.product.ANDROID=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_ANDROID:goog.labs.userAgent.browser.isAndroidBrowser(),goog.userAgent.product.CHROME=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_CHROME:goog.labs.userAgent.browser.isChrome(),goog.userAgent.product.isSafariDesktop_=function(){return goog.labs.userAgent.browser.isSafari()&&!goog.labs.userAgent.platform.isIos()},goog.userAgent.product.SAFARI=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_SAFARI:goog.userAgent.product.isSafariDesktop_(),goog.crypt.base64={},goog.crypt.base64.DEFAULT_ALPHABET_COMMON_="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",goog.crypt.base64.ENCODED_VALS=goog.crypt.base64.DEFAULT_ALPHABET_COMMON_+"+/=",goog.crypt.base64.ENCODED_VALS_WEBSAFE=goog.crypt.base64.DEFAULT_ALPHABET_COMMON_+"-_.",goog.crypt.base64.Alphabet={DEFAULT:0,NO_PADDING:1,WEBSAFE:2,WEBSAFE_DOT_PADDING:3,WEBSAFE_NO_PADDING:4},goog.crypt.base64.paddingChars_="=.",goog.crypt.base64.isPadding_=function(e){return goog.string.contains(goog.crypt.base64.paddingChars_,e)},goog.crypt.base64.byteToCharMaps_={},goog.crypt.base64.charToByteMap_=null,goog.crypt.base64.ASSUME_NATIVE_SUPPORT_=goog.userAgent.GECKO||goog.userAgent.WEBKIT&&!goog.userAgent.product.SAFARI||goog.userAgent.OPERA,goog.crypt.base64.HAS_NATIVE_ENCODE_=goog.crypt.base64.ASSUME_NATIVE_SUPPORT_||"function"==typeof goog.global.btoa,goog.crypt.base64.HAS_NATIVE_DECODE_=goog.crypt.base64.ASSUME_NATIVE_SUPPORT_||!goog.userAgent.product.SAFARI&&!goog.userAgent.IE&&"function"==typeof goog.global.atob,goog.crypt.base64.encodeByteArray=function(e,t){goog.asserts.assert(goog.isArrayLike(e),"encodeByteArray takes an array as a parameter"),void 0===t&&(t=goog.crypt.base64.Alphabet.DEFAULT),goog.crypt.base64.init_(),t=goog.crypt.base64.byteToCharMaps_[t];for(var r=[],n=0;n<e.length;n+=3){var o=e[n],i=n+1<e.length,a=i?e[n+1]:0,s=n+2<e.length,u=s?e[n+2]:0,l=o>>2;o=(3&o)<<4|a>>4,a=(15&a)<<2|u>>6,u&=63,s||(u=64,i||(a=64)),r.push(t[l],t[o],t[a]||"",t[u]||"")}return r.join("")},goog.crypt.base64.encodeString=function(e,t){return goog.crypt.base64.HAS_NATIVE_ENCODE_&&!t?goog.global.btoa(e):goog.crypt.base64.encodeByteArray(goog.crypt.stringToByteArray(e),t)},goog.crypt.base64.decodeString=function(e,t){if(goog.crypt.base64.HAS_NATIVE_DECODE_&&!t)return goog.global.atob(e);var r="";return goog.crypt.base64.decodeStringInternal_(e,(function(e){r+=String.fromCharCode(e)})),r},goog.crypt.base64.decodeStringToByteArray=function(e,t){var r=[];return goog.crypt.base64.decodeStringInternal_(e,(function(e){r.push(e)})),r},goog.crypt.base64.decodeStringToUint8Array=function(e){goog.asserts.assert(!goog.userAgent.IE||goog.userAgent.isVersionOrHigher("10"),"Browser does not support typed arrays");var t=e.length,r=3*t/4;r%3?r=Math.floor(r):goog.crypt.base64.isPadding_(e[t-1])&&(r=goog.crypt.base64.isPadding_(e[t-2])?r-2:r-1);var n=new Uint8Array(r),o=0;return goog.crypt.base64.decodeStringInternal_(e,(function(e){n[o++]=e})),n.subarray(0,o)},goog.crypt.base64.decodeStringInternal_=function(e,t){function r(t){for(;n<e.length;){var r=e.charAt(n++),o=goog.crypt.base64.charToByteMap_[r];if(null!=o)return o;if(!goog.string.isEmptyOrWhitespace(r))throw Error("Unknown base64 encoding at char: "+r)}return t}goog.crypt.base64.init_();for(var n=0;;){var o=r(-1),i=r(0),a=r(64),s=r(64);if(64===s&&-1===o)break;t(o<<2|i>>4),64!=a&&(t(i<<4&240|a>>2),64!=s&&t(a<<6&192|s))}},goog.crypt.base64.init_=function(){if(!goog.crypt.base64.charToByteMap_){goog.crypt.base64.charToByteMap_={};for(var e=goog.crypt.base64.DEFAULT_ALPHABET_COMMON_.split(""),t=["+/=","+/","-_=","-_.","-_"],r=0;5>r;r++){var n=e.concat(t[r].split(""));goog.crypt.base64.byteToCharMaps_[r]=n;for(var o=0;o<n.length;o++){var i=n[o],a=goog.crypt.base64.charToByteMap_[i];void 0===a?goog.crypt.base64.charToByteMap_[i]=o:goog.asserts.assert(a===o)}}}},jspb.utils={},jspb.utils.split64Low=0,jspb.utils.split64High=0,jspb.utils.splitUint64=function(e){var t=e>>>0;e=Math.floor((e-t)/jspb.BinaryConstants.TWO_TO_32)>>>0,jspb.utils.split64Low=t,jspb.utils.split64High=e},jspb.utils.splitInt64=function(e){var t=0>e,r=(e=Math.abs(e))>>>0;e=Math.floor((e-r)/jspb.BinaryConstants.TWO_TO_32),e>>>=0,t&&(e=~e>>>0,4294967295<(r=1+(~r>>>0))&&(r=0,4294967295<++e&&(e=0))),jspb.utils.split64Low=r,jspb.utils.split64High=e},jspb.utils.splitZigzag64=function(e){var t=0>e;e=2*Math.abs(e),jspb.utils.splitUint64(e),e=jspb.utils.split64Low;var r=jspb.utils.split64High;t&&(0==e?0==r?r=e=4294967295:(r--,e=4294967295):e--),jspb.utils.split64Low=e,jspb.utils.split64High=r},jspb.utils.splitFloat32=function(e){var t=0>e?1:0;if(0===(e=t?-e:e))0<1/e?(jspb.utils.split64High=0,jspb.utils.split64Low=0):(jspb.utils.split64High=0,jspb.utils.split64Low=2147483648);else if(isNaN(e))jspb.utils.split64High=0,jspb.utils.split64Low=2147483647;else if(e>jspb.BinaryConstants.FLOAT32_MAX)jspb.utils.split64High=0,jspb.utils.split64Low=(t<<31|2139095040)>>>0;else if(e<jspb.BinaryConstants.FLOAT32_MIN)e=Math.round(e/Math.pow(2,-149)),jspb.utils.split64High=0,jspb.utils.split64Low=(t<<31|e)>>>0;else{var r=Math.floor(Math.log(e)/Math.LN2);e*=Math.pow(2,-r),16777216<=(e=Math.round(e*jspb.BinaryConstants.TWO_TO_23))&&++r,jspb.utils.split64High=0,jspb.utils.split64Low=(t<<31|r+127<<23|8388607&e)>>>0}},jspb.utils.splitFloat64=function(e){var t=0>e?1:0;if(0===(e=t?-e:e))jspb.utils.split64High=0<1/e?0:2147483648,jspb.utils.split64Low=0;else if(isNaN(e))jspb.utils.split64High=2147483647,jspb.utils.split64Low=4294967295;else if(e>jspb.BinaryConstants.FLOAT64_MAX)jspb.utils.split64High=(t<<31|2146435072)>>>0,jspb.utils.split64Low=0;else if(e<jspb.BinaryConstants.FLOAT64_MIN){var r=e/Math.pow(2,-1074);e=r/jspb.BinaryConstants.TWO_TO_32,jspb.utils.split64High=(t<<31|e)>>>0,jspb.utils.split64Low=r>>>0}else{var n=0;if(2<=(r=e))for(;2<=r&&1023>n;)n++,r/=2;else for(;1>r&&-1022<n;)r*=2,n--;e=(r=e*Math.pow(2,-n))*jspb.BinaryConstants.TWO_TO_20&1048575,r=r*jspb.BinaryConstants.TWO_TO_52>>>0,jspb.utils.split64High=(t<<31|n+1023<<20|e)>>>0,jspb.utils.split64Low=r}},jspb.utils.splitHash64=function(e){var t=e.charCodeAt(0),r=e.charCodeAt(1),n=e.charCodeAt(2),o=e.charCodeAt(3),i=e.charCodeAt(4),a=e.charCodeAt(5),s=e.charCodeAt(6);e=e.charCodeAt(7),jspb.utils.split64Low=t+(r<<8)+(n<<16)+(o<<24)>>>0,jspb.utils.split64High=i+(a<<8)+(s<<16)+(e<<24)>>>0},jspb.utils.joinUint64=function(e,t){return t*jspb.BinaryConstants.TWO_TO_32+(e>>>0)},jspb.utils.joinInt64=function(e,t){var r=2147483648&t;return r&&(t=~t>>>0,0==(e=1+~e>>>0)&&(t=t+1>>>0)),e=jspb.utils.joinUint64(e,t),r?-e:e},jspb.utils.toZigzag64=function(e,t,r){var n=t>>31;return r(e<<1^n,(t<<1|e>>>31)^n)},jspb.utils.joinZigzag64=function(e,t){return jspb.utils.fromZigzag64(e,t,jspb.utils.joinInt64)},jspb.utils.fromZigzag64=function(e,t,r){var n=-(1&e);return r((e>>>1|t<<31)^n,t>>>1^n)},jspb.utils.joinFloat32=function(e,t){t=2*(e>>31)+1;var r=e>>>23&255;return e&=8388607,255==r?e?NaN:1/0*t:0==r?t*Math.pow(2,-149)*e:t*Math.pow(2,r-150)*(e+Math.pow(2,23))},jspb.utils.joinFloat64=function(e,t){var r=2*(t>>31)+1,n=t>>>20&2047;return e=jspb.BinaryConstants.TWO_TO_32*(1048575&t)+e,2047==n?e?NaN:1/0*r:0==n?r*Math.pow(2,-1074)*e:r*Math.pow(2,n-1075)*(e+jspb.BinaryConstants.TWO_TO_52)},jspb.utils.joinHash64=function(e,t){return String.fromCharCode(e>>>0&255,e>>>8&255,e>>>16&255,e>>>24&255,t>>>0&255,t>>>8&255,t>>>16&255,t>>>24&255)},jspb.utils.DIGITS="0123456789abcdef".split(""),jspb.utils.ZERO_CHAR_CODE_=48,jspb.utils.A_CHAR_CODE_=97,jspb.utils.joinUnsignedDecimalString=function(e,t){function r(e,t){return e=e?String(e):"",t?"0000000".slice(e.length)+e:e}if(2097151>=t)return""+jspb.utils.joinUint64(e,t);var n=(e>>>24|t<<8)>>>0&16777215;return e=(16777215&e)+6777216*n+6710656*(t=t>>16&65535),n+=8147497*t,t*=2,1e7<=e&&(n+=Math.floor(e/1e7),e%=1e7),1e7<=n&&(t+=Math.floor(n/1e7),n%=1e7),r(t,0)+r(n,t)+r(e,1)},jspb.utils.joinSignedDecimalString=function(e,t){var r=2147483648&t;return r&&(t=~t+(0==(e=1+~e>>>0)?1:0)>>>0),e=jspb.utils.joinUnsignedDecimalString(e,t),r?"-"+e:e},jspb.utils.hash64ToDecimalString=function(e,t){jspb.utils.splitHash64(e),e=jspb.utils.split64Low;var r=jspb.utils.split64High;return t?jspb.utils.joinSignedDecimalString(e,r):jspb.utils.joinUnsignedDecimalString(e,r)},jspb.utils.hash64ArrayToDecimalStrings=function(e,t){for(var r=Array(e.length),n=0;n<e.length;n++)r[n]=jspb.utils.hash64ToDecimalString(e[n],t);return r},jspb.utils.decimalStringToHash64=function(e){function t(e,t){for(var r=0;8>r&&(1!==e||0<t);r++)t=e*n[r]+t,n[r]=255&t,t>>>=8}jspb.asserts.assert(0<e.length);var r=!1;"-"===e[0]&&(r=!0,e=e.slice(1));for(var n=[0,0,0,0,0,0,0,0],o=0;o<e.length;o++)t(10,e.charCodeAt(o)-jspb.utils.ZERO_CHAR_CODE_);return r&&(function(){for(var e=0;8>e;e++)n[e]=255&~n[e]}(),t(1,1)),goog.crypt.byteArrayToString(n)},jspb.utils.splitDecimalString=function(e){jspb.utils.splitHash64(jspb.utils.decimalStringToHash64(e))},jspb.utils.toHexDigit_=function(e){return String.fromCharCode(10>e?jspb.utils.ZERO_CHAR_CODE_+e:jspb.utils.A_CHAR_CODE_-10+e)},jspb.utils.fromHexCharCode_=function(e){return e>=jspb.utils.A_CHAR_CODE_?e-jspb.utils.A_CHAR_CODE_+10:e-jspb.utils.ZERO_CHAR_CODE_},jspb.utils.hash64ToHexString=function(e){var t=Array(18);t[0]="0",t[1]="x";for(var r=0;8>r;r++){var n=e.charCodeAt(7-r);t[2*r+2]=jspb.utils.toHexDigit_(n>>4),t[2*r+3]=jspb.utils.toHexDigit_(15&n)}return t.join("")},jspb.utils.hexStringToHash64=function(e){e=e.toLowerCase(),jspb.asserts.assert(18==e.length),jspb.asserts.assert("0"==e[0]),jspb.asserts.assert("x"==e[1]);for(var t="",r=0;8>r;r++){var n=jspb.utils.fromHexCharCode_(e.charCodeAt(2*r+2)),o=jspb.utils.fromHexCharCode_(e.charCodeAt(2*r+3));t=String.fromCharCode(16*n+o)+t}return t},jspb.utils.hash64ToNumber=function(e,t){jspb.utils.splitHash64(e),e=jspb.utils.split64Low;var r=jspb.utils.split64High;return t?jspb.utils.joinInt64(e,r):jspb.utils.joinUint64(e,r)},jspb.utils.numberToHash64=function(e){return jspb.utils.splitInt64(e),jspb.utils.joinHash64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.utils.countVarints=function(e,t,r){for(var n=0,o=t;o<r;o++)n+=e[o]>>7;return r-t-n},jspb.utils.countVarintFields=function(e,t,r,n){var o=0;if(128>(n=8*n+jspb.BinaryConstants.WireType.VARINT))for(;t<r&&e[t++]==n;)for(o++;;){var i=e[t++];if(0==(128&i))break}else for(;t<r;){for(i=n;128<i;){if(e[t]!=(127&i|128))return o;t++,i>>=7}if(e[t++]!=i)break;for(o++;0!=(128&(i=e[t++])););}return o},jspb.utils.countFixedFields_=function(e,t,r,n,o){var i=0;if(128>n)for(;t<r&&e[t++]==n;)i++,t+=o;else for(;t<r;){for(var a=n;128<a;){if(e[t++]!=(127&a|128))return i;a>>=7}if(e[t++]!=a)break;i++,t+=o}return i},jspb.utils.countFixed32Fields=function(e,t,r,n){return jspb.utils.countFixedFields_(e,t,r,8*n+jspb.BinaryConstants.WireType.FIXED32,4)},jspb.utils.countFixed64Fields=function(e,t,r,n){return jspb.utils.countFixedFields_(e,t,r,8*n+jspb.BinaryConstants.WireType.FIXED64,8)},jspb.utils.countDelimitedFields=function(e,t,r,n){var o=0;for(n=8*n+jspb.BinaryConstants.WireType.DELIMITED;t<r;){for(var i=n;128<i;){if(e[t++]!=(127&i|128))return o;i>>=7}if(e[t++]!=i)break;o++;for(var a=0,s=1;a+=(127&(i=e[t++]))*s,s*=128,0!=(128&i););t+=a}return o},jspb.utils.debugBytesToTextFormat=function(e){var t='"';if(e){e=jspb.utils.byteSourceToUint8Array(e);for(var r=0;r<e.length;r++)t+="\\x",16>e[r]&&(t+="0"),t+=e[r].toString(16)}return t+'"'},jspb.utils.debugScalarToTextFormat=function(e){return"string"==typeof e?goog.string.quote(e):e.toString()},jspb.utils.stringToByteArray=function(e){for(var t=new Uint8Array(e.length),r=0;r<e.length;r++){var n=e.charCodeAt(r);if(255<n)throw Error("Conversion error: string contains codepoint outside of byte range");t[r]=n}return t},jspb.utils.byteSourceToUint8Array=function(e){return e.constructor===Uint8Array?e:e.constructor===ArrayBuffer||e.constructor===Array?new Uint8Array(e):e.constructor===String?goog.crypt.base64.decodeStringToUint8Array(e):e instanceof Uint8Array?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):(jspb.asserts.fail("Type not convertible to Uint8Array."),new Uint8Array(0))},jspb.BinaryDecoder=function(e,t,r){this.bytes_=null,this.cursor_=this.end_=this.start_=0,this.error_=!1,e&&this.setBlock(e,t,r)},jspb.BinaryDecoder.instanceCache_=[],jspb.BinaryDecoder.alloc=function(e,t,r){if(jspb.BinaryDecoder.instanceCache_.length){var n=jspb.BinaryDecoder.instanceCache_.pop();return e&&n.setBlock(e,t,r),n}return new jspb.BinaryDecoder(e,t,r)},jspb.BinaryDecoder.prototype.free=function(){this.clear(),100>jspb.BinaryDecoder.instanceCache_.length&&jspb.BinaryDecoder.instanceCache_.push(this)},jspb.BinaryDecoder.prototype.clone=function(){return jspb.BinaryDecoder.alloc(this.bytes_,this.start_,this.end_-this.start_)},jspb.BinaryDecoder.prototype.clear=function(){this.bytes_=null,this.cursor_=this.end_=this.start_=0,this.error_=!1},jspb.BinaryDecoder.prototype.getBuffer=function(){return this.bytes_},jspb.BinaryDecoder.prototype.setBlock=function(e,t,r){this.bytes_=jspb.utils.byteSourceToUint8Array(e),this.start_=void 0!==t?t:0,this.end_=void 0!==r?this.start_+r:this.bytes_.length,this.cursor_=this.start_},jspb.BinaryDecoder.prototype.getEnd=function(){return this.end_},jspb.BinaryDecoder.prototype.setEnd=function(e){this.end_=e},jspb.BinaryDecoder.prototype.reset=function(){this.cursor_=this.start_},jspb.BinaryDecoder.prototype.getCursor=function(){return this.cursor_},jspb.BinaryDecoder.prototype.setCursor=function(e){this.cursor_=e},jspb.BinaryDecoder.prototype.advance=function(e){this.cursor_+=e,jspb.asserts.assert(this.cursor_<=this.end_)},jspb.BinaryDecoder.prototype.atEnd=function(){return this.cursor_==this.end_},jspb.BinaryDecoder.prototype.pastEnd=function(){return this.cursor_>this.end_},jspb.BinaryDecoder.prototype.getError=function(){return this.error_||0>this.cursor_||this.cursor_>this.end_},jspb.BinaryDecoder.prototype.readSplitVarint64=function(e){for(var t=128,r=0,n=0,o=0;4>o&&128<=t;o++)r|=(127&(t=this.bytes_[this.cursor_++]))<<7*o;if(128<=t&&(r|=(127&(t=this.bytes_[this.cursor_++]))<<28,n|=(127&t)>>4),128<=t)for(o=0;5>o&&128<=t;o++)n|=(127&(t=this.bytes_[this.cursor_++]))<<7*o+3;if(128>t)return e(r>>>0,n>>>0);jspb.asserts.fail("Failed to read varint, encoding is invalid."),this.error_=!0},jspb.BinaryDecoder.prototype.readSplitZigzagVarint64=function(e){return this.readSplitVarint64((function(t,r){return jspb.utils.fromZigzag64(t,r,e)}))},jspb.BinaryDecoder.prototype.readSplitFixed64=function(e){var t=this.bytes_,r=this.cursor_;this.cursor_+=8;for(var n=0,o=0,i=r+7;i>=r;i--)n=n<<8|t[i],o=o<<8|t[i+4];return e(n,o)},jspb.BinaryDecoder.prototype.skipVarint=function(){for(;128&this.bytes_[this.cursor_];)this.cursor_++;this.cursor_++},jspb.BinaryDecoder.prototype.unskipVarint=function(e){for(;128<e;)this.cursor_--,e>>>=7;this.cursor_--},jspb.BinaryDecoder.prototype.readUnsignedVarint32=function(){var e=this.bytes_,t=e[this.cursor_+0],r=127&t;return 128>t?(this.cursor_+=1,jspb.asserts.assert(this.cursor_<=this.end_),r):(r|=(127&(t=e[this.cursor_+1]))<<7,128>t?(this.cursor_+=2,jspb.asserts.assert(this.cursor_<=this.end_),r):(r|=(127&(t=e[this.cursor_+2]))<<14,128>t?(this.cursor_+=3,jspb.asserts.assert(this.cursor_<=this.end_),r):(r|=(127&(t=e[this.cursor_+3]))<<21,128>t?(this.cursor_+=4,jspb.asserts.assert(this.cursor_<=this.end_),r):(r|=(15&(t=e[this.cursor_+4]))<<28,128>t?(this.cursor_+=5,jspb.asserts.assert(this.cursor_<=this.end_),r>>>0):(this.cursor_+=5,128<=e[this.cursor_++]&&128<=e[this.cursor_++]&&128<=e[this.cursor_++]&&128<=e[this.cursor_++]&&128<=e[this.cursor_++]&&jspb.asserts.assert(!1),jspb.asserts.assert(this.cursor_<=this.end_),r)))))},jspb.BinaryDecoder.prototype.readSignedVarint32=function(){return~~this.readUnsignedVarint32()},jspb.BinaryDecoder.prototype.readUnsignedVarint32String=function(){return this.readUnsignedVarint32().toString()},jspb.BinaryDecoder.prototype.readSignedVarint32String=function(){return this.readSignedVarint32().toString()},jspb.BinaryDecoder.prototype.readZigzagVarint32=function(){var e=this.readUnsignedVarint32();return e>>>1^-(1&e)},jspb.BinaryDecoder.prototype.readUnsignedVarint64=function(){return this.readSplitVarint64(jspb.utils.joinUint64)},jspb.BinaryDecoder.prototype.readUnsignedVarint64String=function(){return this.readSplitVarint64(jspb.utils.joinUnsignedDecimalString)},jspb.BinaryDecoder.prototype.readSignedVarint64=function(){return this.readSplitVarint64(jspb.utils.joinInt64)},jspb.BinaryDecoder.prototype.readSignedVarint64String=function(){return this.readSplitVarint64(jspb.utils.joinSignedDecimalString)},jspb.BinaryDecoder.prototype.readZigzagVarint64=function(){return this.readSplitVarint64(jspb.utils.joinZigzag64)},jspb.BinaryDecoder.prototype.readZigzagVarintHash64=function(){return this.readSplitZigzagVarint64(jspb.utils.joinHash64)},jspb.BinaryDecoder.prototype.readZigzagVarint64String=function(){return this.readSplitZigzagVarint64(jspb.utils.joinSignedDecimalString)},jspb.BinaryDecoder.prototype.readUint8=function(){var e=this.bytes_[this.cursor_+0];return this.cursor_+=1,jspb.asserts.assert(this.cursor_<=this.end_),e},jspb.BinaryDecoder.prototype.readUint16=function(){var e=this.bytes_[this.cursor_+0],t=this.bytes_[this.cursor_+1];return this.cursor_+=2,jspb.asserts.assert(this.cursor_<=this.end_),e<<0|t<<8},jspb.BinaryDecoder.prototype.readUint32=function(){var e=this.bytes_[this.cursor_+0],t=this.bytes_[this.cursor_+1],r=this.bytes_[this.cursor_+2],n=this.bytes_[this.cursor_+3];return this.cursor_+=4,jspb.asserts.assert(this.cursor_<=this.end_),(e<<0|t<<8|r<<16|n<<24)>>>0},jspb.BinaryDecoder.prototype.readUint64=function(){var e=this.readUint32(),t=this.readUint32();return jspb.utils.joinUint64(e,t)},jspb.BinaryDecoder.prototype.readUint64String=function(){var e=this.readUint32(),t=this.readUint32();return jspb.utils.joinUnsignedDecimalString(e,t)},jspb.BinaryDecoder.prototype.readInt8=function(){var e=this.bytes_[this.cursor_+0];return this.cursor_+=1,jspb.asserts.assert(this.cursor_<=this.end_),e<<24>>24},jspb.BinaryDecoder.prototype.readInt16=function(){var e=this.bytes_[this.cursor_+0],t=this.bytes_[this.cursor_+1];return this.cursor_+=2,jspb.asserts.assert(this.cursor_<=this.end_),(e<<0|t<<8)<<16>>16},jspb.BinaryDecoder.prototype.readInt32=function(){var e=this.bytes_[this.cursor_+0],t=this.bytes_[this.cursor_+1],r=this.bytes_[this.cursor_+2],n=this.bytes_[this.cursor_+3];return this.cursor_+=4,jspb.asserts.assert(this.cursor_<=this.end_),e<<0|t<<8|r<<16|n<<24},jspb.BinaryDecoder.prototype.readInt64=function(){var e=this.readUint32(),t=this.readUint32();return jspb.utils.joinInt64(e,t)},jspb.BinaryDecoder.prototype.readInt64String=function(){var e=this.readUint32(),t=this.readUint32();return jspb.utils.joinSignedDecimalString(e,t)},jspb.BinaryDecoder.prototype.readFloat=function(){var e=this.readUint32();return jspb.utils.joinFloat32(e,0)},jspb.BinaryDecoder.prototype.readDouble=function(){var e=this.readUint32(),t=this.readUint32();return jspb.utils.joinFloat64(e,t)},jspb.BinaryDecoder.prototype.readBool=function(){return!!this.bytes_[this.cursor_++]},jspb.BinaryDecoder.prototype.readEnum=function(){return this.readSignedVarint32()},jspb.BinaryDecoder.prototype.readString=function(e){var t=this.bytes_,r=this.cursor_;e=r+e;for(var n=[],o="";r<e;){var i=t[r++];if(128>i)n.push(i);else{if(192>i)continue;if(224>i){var a=t[r++];n.push((31&i)<<6|63&a)}else if(240>i){a=t[r++];var s=t[r++];n.push((15&i)<<12|(63&a)<<6|63&s)}else 248>i&&(i=(7&i)<<18|(63&(a=t[r++]))<<12|(63&(s=t[r++]))<<6|63&t[r++],i-=65536,n.push(55296+(i>>10&1023),56320+(1023&i)))}8192<=n.length&&(o+=String.fromCharCode.apply(null,n),n.length=0)}return o+=goog.crypt.byteArrayToString(n),this.cursor_=r,o},jspb.BinaryDecoder.prototype.readStringWithLength=function(){var e=this.readUnsignedVarint32();return this.readString(e)},jspb.BinaryDecoder.prototype.readBytes=function(e){if(0>e||this.cursor_+e>this.bytes_.length)return this.error_=!0,jspb.asserts.fail("Invalid byte length!"),new Uint8Array(0);var t=this.bytes_.subarray(this.cursor_,this.cursor_+e);return this.cursor_+=e,jspb.asserts.assert(this.cursor_<=this.end_),t},jspb.BinaryDecoder.prototype.readVarintHash64=function(){return this.readSplitVarint64(jspb.utils.joinHash64)},jspb.BinaryDecoder.prototype.readFixedHash64=function(){var e=this.bytes_,t=this.cursor_,r=e[t+0],n=e[t+1],o=e[t+2],i=e[t+3],a=e[t+4],s=e[t+5],u=e[t+6];return e=e[t+7],this.cursor_+=8,String.fromCharCode(r,n,o,i,a,s,u,e)},jspb.BinaryReader=function(e,t,r){this.decoder_=jspb.BinaryDecoder.alloc(e,t,r),this.fieldCursor_=this.decoder_.getCursor(),this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER,this.nextWireType_=jspb.BinaryConstants.WireType.INVALID,this.error_=!1,this.readCallbacks_=null},jspb.BinaryReader.instanceCache_=[],jspb.BinaryReader.alloc=function(e,t,r){if(jspb.BinaryReader.instanceCache_.length){var n=jspb.BinaryReader.instanceCache_.pop();return e&&n.decoder_.setBlock(e,t,r),n}return new jspb.BinaryReader(e,t,r)},jspb.BinaryReader.prototype.alloc=jspb.BinaryReader.alloc,jspb.BinaryReader.prototype.free=function(){this.decoder_.clear(),this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER,this.nextWireType_=jspb.BinaryConstants.WireType.INVALID,this.error_=!1,this.readCallbacks_=null,100>jspb.BinaryReader.instanceCache_.length&&jspb.BinaryReader.instanceCache_.push(this)},jspb.BinaryReader.prototype.getFieldCursor=function(){return this.fieldCursor_},jspb.BinaryReader.prototype.getCursor=function(){return this.decoder_.getCursor()},jspb.BinaryReader.prototype.getBuffer=function(){return this.decoder_.getBuffer()},jspb.BinaryReader.prototype.getFieldNumber=function(){return this.nextField_},goog.exportProperty(jspb.BinaryReader.prototype,"getFieldNumber",jspb.BinaryReader.prototype.getFieldNumber),jspb.BinaryReader.prototype.getWireType=function(){return this.nextWireType_},jspb.BinaryReader.prototype.isDelimited=function(){return this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED},goog.exportProperty(jspb.BinaryReader.prototype,"isDelimited",jspb.BinaryReader.prototype.isDelimited),jspb.BinaryReader.prototype.isEndGroup=function(){return this.nextWireType_==jspb.BinaryConstants.WireType.END_GROUP},goog.exportProperty(jspb.BinaryReader.prototype,"isEndGroup",jspb.BinaryReader.prototype.isEndGroup),jspb.BinaryReader.prototype.getError=function(){return this.error_||this.decoder_.getError()},jspb.BinaryReader.prototype.setBlock=function(e,t,r){this.decoder_.setBlock(e,t,r),this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER,this.nextWireType_=jspb.BinaryConstants.WireType.INVALID},jspb.BinaryReader.prototype.reset=function(){this.decoder_.reset(),this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER,this.nextWireType_=jspb.BinaryConstants.WireType.INVALID},jspb.BinaryReader.prototype.advance=function(e){this.decoder_.advance(e)},jspb.BinaryReader.prototype.nextField=function(){if(this.decoder_.atEnd())return!1;if(this.getError())return jspb.asserts.fail("Decoder hit an error"),!1;this.fieldCursor_=this.decoder_.getCursor();var e=this.decoder_.readUnsignedVarint32(),t=e>>>3;return(e&=7)!=jspb.BinaryConstants.WireType.VARINT&&e!=jspb.BinaryConstants.WireType.FIXED32&&e!=jspb.BinaryConstants.WireType.FIXED64&&e!=jspb.BinaryConstants.WireType.DELIMITED&&e!=jspb.BinaryConstants.WireType.START_GROUP&&e!=jspb.BinaryConstants.WireType.END_GROUP?(jspb.asserts.fail("Invalid wire type: %s (at position %s)",e,this.fieldCursor_),this.error_=!0,!1):(this.nextField_=t,this.nextWireType_=e,!0)},goog.exportProperty(jspb.BinaryReader.prototype,"nextField",jspb.BinaryReader.prototype.nextField),jspb.BinaryReader.prototype.unskipHeader=function(){this.decoder_.unskipVarint(this.nextField_<<3|this.nextWireType_)},jspb.BinaryReader.prototype.skipMatchingFields=function(){var e=this.nextField_;for(this.unskipHeader();this.nextField()&&this.getFieldNumber()==e;)this.skipField();this.decoder_.atEnd()||this.unskipHeader()},jspb.BinaryReader.prototype.skipVarintField=function(){this.nextWireType_!=jspb.BinaryConstants.WireType.VARINT?(jspb.asserts.fail("Invalid wire type for skipVarintField"),this.skipField()):this.decoder_.skipVarint()},jspb.BinaryReader.prototype.skipDelimitedField=function(){if(this.nextWireType_!=jspb.BinaryConstants.WireType.DELIMITED)jspb.asserts.fail("Invalid wire type for skipDelimitedField"),this.skipField();else{var e=this.decoder_.readUnsignedVarint32();this.decoder_.advance(e)}},jspb.BinaryReader.prototype.skipFixed32Field=function(){this.nextWireType_!=jspb.BinaryConstants.WireType.FIXED32?(jspb.asserts.fail("Invalid wire type for skipFixed32Field"),this.skipField()):this.decoder_.advance(4)},jspb.BinaryReader.prototype.skipFixed64Field=function(){this.nextWireType_!=jspb.BinaryConstants.WireType.FIXED64?(jspb.asserts.fail("Invalid wire type for skipFixed64Field"),this.skipField()):this.decoder_.advance(8)},jspb.BinaryReader.prototype.skipGroup=function(){for(var e=this.nextField_;;){if(!this.nextField()){jspb.asserts.fail("Unmatched start-group tag: stream EOF"),this.error_=!0;break}if(this.nextWireType_==jspb.BinaryConstants.WireType.END_GROUP){this.nextField_!=e&&(jspb.asserts.fail("Unmatched end-group tag"),this.error_=!0);break}this.skipField()}},jspb.BinaryReader.prototype.skipField=function(){switch(this.nextWireType_){case jspb.BinaryConstants.WireType.VARINT:this.skipVarintField();break;case jspb.BinaryConstants.WireType.FIXED64:this.skipFixed64Field();break;case jspb.BinaryConstants.WireType.DELIMITED:this.skipDelimitedField();break;case jspb.BinaryConstants.WireType.FIXED32:this.skipFixed32Field();break;case jspb.BinaryConstants.WireType.START_GROUP:this.skipGroup();break;default:jspb.asserts.fail("Invalid wire encoding for field.")}},jspb.BinaryReader.prototype.registerReadCallback=function(e,t){null===this.readCallbacks_&&(this.readCallbacks_={}),jspb.asserts.assert(!this.readCallbacks_[e]),this.readCallbacks_[e]=t},jspb.BinaryReader.prototype.runReadCallback=function(e){return jspb.asserts.assert(null!==this.readCallbacks_),e=this.readCallbacks_[e],jspb.asserts.assert(e),e(this)},jspb.BinaryReader.prototype.readAny=function(e){this.nextWireType_=jspb.BinaryConstants.FieldTypeToWireType(e);var t=jspb.BinaryConstants.FieldType;switch(e){case t.DOUBLE:return this.readDouble();case t.FLOAT:return this.readFloat();case t.INT64:return this.readInt64();case t.UINT64:return this.readUint64();case t.INT32:return this.readInt32();case t.FIXED64:return this.readFixed64();case t.FIXED32:return this.readFixed32();case t.BOOL:return this.readBool();case t.STRING:return this.readString();case t.GROUP:jspb.asserts.fail("Group field type not supported in readAny()");case t.MESSAGE:jspb.asserts.fail("Message field type not supported in readAny()");case t.BYTES:return this.readBytes();case t.UINT32:return this.readUint32();case t.ENUM:return this.readEnum();case t.SFIXED32:return this.readSfixed32();case t.SFIXED64:return this.readSfixed64();case t.SINT32:return this.readSint32();case t.SINT64:return this.readSint64();case t.FHASH64:return this.readFixedHash64();case t.VHASH64:return this.readVarintHash64();default:jspb.asserts.fail("Invalid field type in readAny()")}return 0},jspb.BinaryReader.prototype.readMessage=function(e,t){jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var r=this.decoder_.getEnd(),n=this.decoder_.readUnsignedVarint32();n=this.decoder_.getCursor()+n,this.decoder_.setEnd(n),t(e,this),this.decoder_.setCursor(n),this.decoder_.setEnd(r)},goog.exportProperty(jspb.BinaryReader.prototype,"readMessage",jspb.BinaryReader.prototype.readMessage),jspb.BinaryReader.prototype.readGroup=function(e,t,r){jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.START_GROUP),jspb.asserts.assert(this.nextField_==e),r(t,this),this.error_||this.nextWireType_==jspb.BinaryConstants.WireType.END_GROUP||(jspb.asserts.fail("Group submessage did not end with an END_GROUP tag"),this.error_=!0)},goog.exportProperty(jspb.BinaryReader.prototype,"readGroup",jspb.BinaryReader.prototype.readGroup),jspb.BinaryReader.prototype.getFieldDecoder=function(){jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var e=this.decoder_.readUnsignedVarint32(),t=this.decoder_.getCursor(),r=t+e;return e=jspb.BinaryDecoder.alloc(this.decoder_.getBuffer(),t,e),this.decoder_.setCursor(r),e},jspb.BinaryReader.prototype.readInt32=function(){return jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint32()},goog.exportProperty(jspb.BinaryReader.prototype,"readInt32",jspb.BinaryReader.prototype.readInt32),jspb.BinaryReader.prototype.readInt32String=function(){return jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint32String()},jspb.BinaryReader.prototype.readInt64=function(){return jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint64()},goog.exportProperty(jspb.BinaryReader.prototype,"readInt64",jspb.BinaryReader.prototype.readInt64),jspb.BinaryReader.prototype.readInt64String=function(){return jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint64String()},jspb.BinaryReader.prototype.readUint32=function(){return jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readUnsignedVarint32()},goog.exportProperty(jspb.BinaryReader.prototype,"readUint32",jspb.BinaryReader.prototype.readUint32),jspb.BinaryReader.prototype.readUint32String=function(){return jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readUnsignedVarint32String()},jspb.BinaryReader.prototype.readUint64=function(){return jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readUnsignedVarint64()},goog.exportProperty(jspb.BinaryReader.prototype,"readUint64",jspb.BinaryReader.prototype.readUint64),jspb.BinaryReader.prototype.readUint64String=function(){return jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readUnsignedVarint64String()},jspb.BinaryReader.prototype.readSint32=function(){return jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readZigzagVarint32()},goog.exportProperty(jspb.BinaryReader.prototype,"readSint32",jspb.BinaryReader.prototype.readSint32),jspb.BinaryReader.prototype.readSint64=function(){return jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readZigzagVarint64()},goog.exportProperty(jspb.BinaryReader.prototype,"readSint64",jspb.BinaryReader.prototype.readSint64),jspb.BinaryReader.prototype.readSint64String=function(){return jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readZigzagVarint64String()},jspb.BinaryReader.prototype.readFixed32=function(){return jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32),this.decoder_.readUint32()},goog.exportProperty(jspb.BinaryReader.prototype,"readFixed32",jspb.BinaryReader.prototype.readFixed32),jspb.BinaryReader.prototype.readFixed64=function(){return jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readUint64()},goog.exportProperty(jspb.BinaryReader.prototype,"readFixed64",jspb.BinaryReader.prototype.readFixed64),jspb.BinaryReader.prototype.readFixed64String=function(){return jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readUint64String()},jspb.BinaryReader.prototype.readSfixed32=function(){return jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32),this.decoder_.readInt32()},goog.exportProperty(jspb.BinaryReader.prototype,"readSfixed32",jspb.BinaryReader.prototype.readSfixed32),jspb.BinaryReader.prototype.readSfixed32String=function(){return jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32),this.decoder_.readInt32().toString()},jspb.BinaryReader.prototype.readSfixed64=function(){return jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readInt64()},goog.exportProperty(jspb.BinaryReader.prototype,"readSfixed64",jspb.BinaryReader.prototype.readSfixed64),jspb.BinaryReader.prototype.readSfixed64String=function(){return jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readInt64String()},jspb.BinaryReader.prototype.readFloat=function(){return jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32),this.decoder_.readFloat()},goog.exportProperty(jspb.BinaryReader.prototype,"readFloat",jspb.BinaryReader.prototype.readFloat),jspb.BinaryReader.prototype.readDouble=function(){return jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readDouble()},goog.exportProperty(jspb.BinaryReader.prototype,"readDouble",jspb.BinaryReader.prototype.readDouble),jspb.BinaryReader.prototype.readBool=function(){return jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),!!this.decoder_.readUnsignedVarint32()},goog.exportProperty(jspb.BinaryReader.prototype,"readBool",jspb.BinaryReader.prototype.readBool),jspb.BinaryReader.prototype.readEnum=function(){return jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint64()},goog.exportProperty(jspb.BinaryReader.prototype,"readEnum",jspb.BinaryReader.prototype.readEnum),jspb.BinaryReader.prototype.readString=function(){jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var e=this.decoder_.readUnsignedVarint32();return this.decoder_.readString(e)},goog.exportProperty(jspb.BinaryReader.prototype,"readString",jspb.BinaryReader.prototype.readString),jspb.BinaryReader.prototype.readBytes=function(){jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var e=this.decoder_.readUnsignedVarint32();return this.decoder_.readBytes(e)},goog.exportProperty(jspb.BinaryReader.prototype,"readBytes",jspb.BinaryReader.prototype.readBytes),jspb.BinaryReader.prototype.readVarintHash64=function(){return jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readVarintHash64()},jspb.BinaryReader.prototype.readSintHash64=function(){return jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readZigzagVarintHash64()},jspb.BinaryReader.prototype.readSplitVarint64=function(e){return jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSplitVarint64(e)},jspb.BinaryReader.prototype.readSplitZigzagVarint64=function(e){return jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSplitVarint64((function(t,r){return jspb.utils.fromZigzag64(t,r,e)}))},jspb.BinaryReader.prototype.readFixedHash64=function(){return jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readFixedHash64()},jspb.BinaryReader.prototype.readSplitFixed64=function(e){return jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readSplitFixed64(e)},jspb.BinaryReader.prototype.readPackedField_=function(e){jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var t=this.decoder_.readUnsignedVarint32();t=this.decoder_.getCursor()+t;for(var r=[];this.decoder_.getCursor()<t;)r.push(e.call(this.decoder_));return r},jspb.BinaryReader.prototype.readPackedInt32=function(){return this.readPackedField_(this.decoder_.readSignedVarint32)},goog.exportProperty(jspb.BinaryReader.prototype,"readPackedInt32",jspb.BinaryReader.prototype.readPackedInt32),jspb.BinaryReader.prototype.readPackedInt32String=function(){return this.readPackedField_(this.decoder_.readSignedVarint32String)},jspb.BinaryReader.prototype.readPackedInt64=function(){return this.readPackedField_(this.decoder_.readSignedVarint64)},goog.exportProperty(jspb.BinaryReader.prototype,"readPackedInt64",jspb.BinaryReader.prototype.readPackedInt64),jspb.BinaryReader.prototype.readPackedInt64String=function(){return this.readPackedField_(this.decoder_.readSignedVarint64String)},jspb.BinaryReader.prototype.readPackedUint32=function(){return this.readPackedField_(this.decoder_.readUnsignedVarint32)},goog.exportProperty(jspb.BinaryReader.prototype,"readPackedUint32",jspb.BinaryReader.prototype.readPackedUint32),jspb.BinaryReader.prototype.readPackedUint32String=function(){return this.readPackedField_(this.decoder_.readUnsignedVarint32String)},jspb.BinaryReader.prototype.readPackedUint64=function(){return this.readPackedField_(this.decoder_.readUnsignedVarint64)},goog.exportProperty(jspb.BinaryReader.prototype,"readPackedUint64",jspb.BinaryReader.prototype.readPackedUint64),jspb.BinaryReader.prototype.readPackedUint64String=function(){return this.readPackedField_(this.decoder_.readUnsignedVarint64String)},jspb.BinaryReader.prototype.readPackedSint32=function(){return this.readPackedField_(this.decoder_.readZigzagVarint32)},goog.exportProperty(jspb.BinaryReader.prototype,"readPackedSint32",jspb.BinaryReader.prototype.readPackedSint32),jspb.BinaryReader.prototype.readPackedSint64=function(){return this.readPackedField_(this.decoder_.readZigzagVarint64)},goog.exportProperty(jspb.BinaryReader.prototype,"readPackedSint64",jspb.BinaryReader.prototype.readPackedSint64),jspb.BinaryReader.prototype.readPackedSint64String=function(){return this.readPackedField_(this.decoder_.readZigzagVarint64String)},jspb.BinaryReader.prototype.readPackedFixed32=function(){return this.readPackedField_(this.decoder_.readUint32)},goog.exportProperty(jspb.BinaryReader.prototype,"readPackedFixed32",jspb.BinaryReader.prototype.readPackedFixed32),jspb.BinaryReader.prototype.readPackedFixed64=function(){return this.readPackedField_(this.decoder_.readUint64)},goog.exportProperty(jspb.BinaryReader.prototype,"readPackedFixed64",jspb.BinaryReader.prototype.readPackedFixed64),jspb.BinaryReader.prototype.readPackedFixed64String=function(){return this.readPackedField_(this.decoder_.readUint64String)},jspb.BinaryReader.prototype.readPackedSfixed32=function(){return this.readPackedField_(this.decoder_.readInt32)},goog.exportProperty(jspb.BinaryReader.prototype,"readPackedSfixed32",jspb.BinaryReader.prototype.readPackedSfixed32),jspb.BinaryReader.prototype.readPackedSfixed64=function(){return this.readPackedField_(this.decoder_.readInt64)},goog.exportProperty(jspb.BinaryReader.prototype,"readPackedSfixed64",jspb.BinaryReader.prototype.readPackedSfixed64),jspb.BinaryReader.prototype.readPackedSfixed64String=function(){return this.readPackedField_(this.decoder_.readInt64String)},jspb.BinaryReader.prototype.readPackedFloat=function(){return this.readPackedField_(this.decoder_.readFloat)},goog.exportProperty(jspb.BinaryReader.prototype,"readPackedFloat",jspb.BinaryReader.prototype.readPackedFloat),jspb.BinaryReader.prototype.readPackedDouble=function(){return this.readPackedField_(this.decoder_.readDouble)},goog.exportProperty(jspb.BinaryReader.prototype,"readPackedDouble",jspb.BinaryReader.prototype.readPackedDouble),jspb.BinaryReader.prototype.readPackedBool=function(){return this.readPackedField_(this.decoder_.readBool)},goog.exportProperty(jspb.BinaryReader.prototype,"readPackedBool",jspb.BinaryReader.prototype.readPackedBool),jspb.BinaryReader.prototype.readPackedEnum=function(){return this.readPackedField_(this.decoder_.readEnum)},goog.exportProperty(jspb.BinaryReader.prototype,"readPackedEnum",jspb.BinaryReader.prototype.readPackedEnum),jspb.BinaryReader.prototype.readPackedVarintHash64=function(){return this.readPackedField_(this.decoder_.readVarintHash64)},jspb.BinaryReader.prototype.readPackedFixedHash64=function(){return this.readPackedField_(this.decoder_.readFixedHash64)},jspb.BinaryEncoder=function(){this.buffer_=[]},jspb.BinaryEncoder.prototype.length=function(){return this.buffer_.length},jspb.BinaryEncoder.prototype.end=function(){var e=this.buffer_;return this.buffer_=[],e},jspb.BinaryEncoder.prototype.writeSplitVarint64=function(e,t){for(jspb.asserts.assert(e==Math.floor(e)),jspb.asserts.assert(t==Math.floor(t)),jspb.asserts.assert(0<=e&&e<jspb.BinaryConstants.TWO_TO_32),jspb.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_32);0<t||127<e;)this.buffer_.push(127&e|128),e=(e>>>7|t<<25)>>>0,t>>>=7;this.buffer_.push(e)},jspb.BinaryEncoder.prototype.writeSplitFixed64=function(e,t){jspb.asserts.assert(e==Math.floor(e)),jspb.asserts.assert(t==Math.floor(t)),jspb.asserts.assert(0<=e&&e<jspb.BinaryConstants.TWO_TO_32),jspb.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_32),this.writeUint32(e),this.writeUint32(t)},jspb.BinaryEncoder.prototype.writeUnsignedVarint32=function(e){for(jspb.asserts.assert(e==Math.floor(e)),jspb.asserts.assert(0<=e&&e<jspb.BinaryConstants.TWO_TO_32);127<e;)this.buffer_.push(127&e|128),e>>>=7;this.buffer_.push(e)},jspb.BinaryEncoder.prototype.writeSignedVarint32=function(e){if(jspb.asserts.assert(e==Math.floor(e)),jspb.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_31&&e<jspb.BinaryConstants.TWO_TO_31),0<=e)this.writeUnsignedVarint32(e);else{for(var t=0;9>t;t++)this.buffer_.push(127&e|128),e>>=7;this.buffer_.push(1)}},jspb.BinaryEncoder.prototype.writeUnsignedVarint64=function(e){jspb.asserts.assert(e==Math.floor(e)),jspb.asserts.assert(0<=e&&e<jspb.BinaryConstants.TWO_TO_64),jspb.utils.splitInt64(e),this.writeSplitVarint64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeSignedVarint64=function(e){jspb.asserts.assert(e==Math.floor(e)),jspb.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_63&&e<jspb.BinaryConstants.TWO_TO_63),jspb.utils.splitInt64(e),this.writeSplitVarint64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeZigzagVarint32=function(e){jspb.asserts.assert(e==Math.floor(e)),jspb.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_31&&e<jspb.BinaryConstants.TWO_TO_31),this.writeUnsignedVarint32((e<<1^e>>31)>>>0)},jspb.BinaryEncoder.prototype.writeZigzagVarint64=function(e){jspb.asserts.assert(e==Math.floor(e)),jspb.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_63&&e<jspb.BinaryConstants.TWO_TO_63),jspb.utils.splitZigzag64(e),this.writeSplitVarint64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeZigzagVarint64String=function(e){this.writeZigzagVarintHash64(jspb.utils.decimalStringToHash64(e))},jspb.BinaryEncoder.prototype.writeZigzagVarintHash64=function(e){var t=this;jspb.utils.splitHash64(e),jspb.utils.toZigzag64(jspb.utils.split64Low,jspb.utils.split64High,(function(e,r){t.writeSplitVarint64(e>>>0,r>>>0)}))},jspb.BinaryEncoder.prototype.writeUint8=function(e){jspb.asserts.assert(e==Math.floor(e)),jspb.asserts.assert(0<=e&&256>e),this.buffer_.push(e>>>0&255)},jspb.BinaryEncoder.prototype.writeUint16=function(e){jspb.asserts.assert(e==Math.floor(e)),jspb.asserts.assert(0<=e&&65536>e),this.buffer_.push(e>>>0&255),this.buffer_.push(e>>>8&255)},jspb.BinaryEncoder.prototype.writeUint32=function(e){jspb.asserts.assert(e==Math.floor(e)),jspb.asserts.assert(0<=e&&e<jspb.BinaryConstants.TWO_TO_32),this.buffer_.push(e>>>0&255),this.buffer_.push(e>>>8&255),this.buffer_.push(e>>>16&255),this.buffer_.push(e>>>24&255)},jspb.BinaryEncoder.prototype.writeUint64=function(e){jspb.asserts.assert(e==Math.floor(e)),jspb.asserts.assert(0<=e&&e<jspb.BinaryConstants.TWO_TO_64),jspb.utils.splitUint64(e),this.writeUint32(jspb.utils.split64Low),this.writeUint32(jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeInt8=function(e){jspb.asserts.assert(e==Math.floor(e)),jspb.asserts.assert(-128<=e&&128>e),this.buffer_.push(e>>>0&255)},jspb.BinaryEncoder.prototype.writeInt16=function(e){jspb.asserts.assert(e==Math.floor(e)),jspb.asserts.assert(-32768<=e&&32768>e),this.buffer_.push(e>>>0&255),this.buffer_.push(e>>>8&255)},jspb.BinaryEncoder.prototype.writeInt32=function(e){jspb.asserts.assert(e==Math.floor(e)),jspb.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_31&&e<jspb.BinaryConstants.TWO_TO_31),this.buffer_.push(e>>>0&255),this.buffer_.push(e>>>8&255),this.buffer_.push(e>>>16&255),this.buffer_.push(e>>>24&255)},jspb.BinaryEncoder.prototype.writeInt64=function(e){jspb.asserts.assert(e==Math.floor(e)),jspb.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_63&&e<jspb.BinaryConstants.TWO_TO_63),jspb.utils.splitInt64(e),this.writeSplitFixed64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeInt64String=function(e){jspb.asserts.assert(e==Math.floor(e)),jspb.asserts.assert(+e>=-jspb.BinaryConstants.TWO_TO_63&&+e<jspb.BinaryConstants.TWO_TO_63),jspb.utils.splitHash64(jspb.utils.decimalStringToHash64(e)),this.writeSplitFixed64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeFloat=function(e){jspb.asserts.assert(1/0===e||-1/0===e||isNaN(e)||e>=-jspb.BinaryConstants.FLOAT32_MAX&&e<=jspb.BinaryConstants.FLOAT32_MAX),jspb.utils.splitFloat32(e),this.writeUint32(jspb.utils.split64Low)},jspb.BinaryEncoder.prototype.writeDouble=function(e){jspb.asserts.assert(1/0===e||-1/0===e||isNaN(e)||e>=-jspb.BinaryConstants.FLOAT64_MAX&&e<=jspb.BinaryConstants.FLOAT64_MAX),jspb.utils.splitFloat64(e),this.writeUint32(jspb.utils.split64Low),this.writeUint32(jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeBool=function(e){jspb.asserts.assert("boolean"==typeof e||"number"==typeof e),this.buffer_.push(e?1:0)},jspb.BinaryEncoder.prototype.writeEnum=function(e){jspb.asserts.assert(e==Math.floor(e)),jspb.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_31&&e<jspb.BinaryConstants.TWO_TO_31),this.writeSignedVarint32(e)},jspb.BinaryEncoder.prototype.writeBytes=function(e){this.buffer_.push.apply(this.buffer_,e)},jspb.BinaryEncoder.prototype.writeVarintHash64=function(e){jspb.utils.splitHash64(e),this.writeSplitVarint64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeFixedHash64=function(e){jspb.utils.splitHash64(e),this.writeUint32(jspb.utils.split64Low),this.writeUint32(jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeString=function(e){var t=this.buffer_.length;jspb.asserts.assertString(e);for(var r=0;r<e.length;r++){var n=e.charCodeAt(r);if(128>n)this.buffer_.push(n);else if(2048>n)this.buffer_.push(n>>6|192),this.buffer_.push(63&n|128);else if(65536>n)if(55296<=n&&56319>=n&&r+1<e.length){var o=e.charCodeAt(r+1);56320<=o&&57343>=o&&(n=1024*(n-55296)+o-56320+65536,this.buffer_.push(n>>18|240),this.buffer_.push(n>>12&63|128),this.buffer_.push(n>>6&63|128),this.buffer_.push(63&n|128),r++)}else this.buffer_.push(n>>12|224),this.buffer_.push(n>>6&63|128),this.buffer_.push(63&n|128)}return this.buffer_.length-t},jspb.arith={},jspb.arith.UInt64=function(e,t){this.lo=e,this.hi=t},jspb.arith.UInt64.prototype.cmp=function(e){return this.hi<e.hi||this.hi==e.hi&&this.lo<e.lo?-1:this.hi==e.hi&&this.lo==e.lo?0:1},jspb.arith.UInt64.prototype.rightShift=function(){return new jspb.arith.UInt64((this.lo>>>1|(1&this.hi)<<31)>>>0,this.hi>>>1>>>0)},jspb.arith.UInt64.prototype.leftShift=function(){return new jspb.arith.UInt64(this.lo<<1>>>0,(this.hi<<1|this.lo>>>31)>>>0)},jspb.arith.UInt64.prototype.msb=function(){return!!(2147483648&this.hi)},jspb.arith.UInt64.prototype.lsb=function(){return!!(1&this.lo)},jspb.arith.UInt64.prototype.zero=function(){return 0==this.lo&&0==this.hi},jspb.arith.UInt64.prototype.add=function(e){return new jspb.arith.UInt64((this.lo+e.lo&4294967295)>>>0>>>0,((this.hi+e.hi&4294967295)>>>0)+(4294967296<=this.lo+e.lo?1:0)>>>0)},jspb.arith.UInt64.prototype.sub=function(e){return new jspb.arith.UInt64((this.lo-e.lo&4294967295)>>>0>>>0,((this.hi-e.hi&4294967295)>>>0)-(0>this.lo-e.lo?1:0)>>>0)},jspb.arith.UInt64.mul32x32=function(e,t){var r=65535&e,n=65535&t,o=t>>>16;for(t=r*n+65536*(r*o&65535)+65536*((e>>>=16)*n&65535),r=e*o+(r*o>>>16)+(e*n>>>16);4294967296<=t;)t-=4294967296,r+=1;return new jspb.arith.UInt64(t>>>0,r>>>0)},jspb.arith.UInt64.prototype.mul=function(e){var t=jspb.arith.UInt64.mul32x32(this.lo,e);return(e=jspb.arith.UInt64.mul32x32(this.hi,e)).hi=e.lo,e.lo=0,t.add(e)},jspb.arith.UInt64.prototype.div=function(e){if(0==e)return[];var t=new jspb.arith.UInt64(0,0),r=new jspb.arith.UInt64(this.lo,this.hi);e=new jspb.arith.UInt64(e,0);for(var n=new jspb.arith.UInt64(1,0);!e.msb();)e=e.leftShift(),n=n.leftShift();for(;!n.zero();)0>=e.cmp(r)&&(t=t.add(n),r=r.sub(e)),e=e.rightShift(),n=n.rightShift();return[t,r]},jspb.arith.UInt64.prototype.toString=function(){for(var e="",t=this;!t.zero();){var r=(t=t.div(10))[0];e=t[1].lo+e,t=r}return""==e&&(e="0"),e},jspb.arith.UInt64.fromString=function(e){for(var t=new jspb.arith.UInt64(0,0),r=new jspb.arith.UInt64(0,0),n=0;n<e.length;n++){if("0">e[n]||"9"<e[n])return null;var o=parseInt(e[n],10);r.lo=o,t=t.mul(10).add(r)}return t},jspb.arith.UInt64.prototype.clone=function(){return new jspb.arith.UInt64(this.lo,this.hi)},jspb.arith.Int64=function(e,t){this.lo=e,this.hi=t},jspb.arith.Int64.prototype.add=function(e){return new jspb.arith.Int64((this.lo+e.lo&4294967295)>>>0>>>0,((this.hi+e.hi&4294967295)>>>0)+(4294967296<=this.lo+e.lo?1:0)>>>0)},jspb.arith.Int64.prototype.sub=function(e){return new jspb.arith.Int64((this.lo-e.lo&4294967295)>>>0>>>0,((this.hi-e.hi&4294967295)>>>0)-(0>this.lo-e.lo?1:0)>>>0)},jspb.arith.Int64.prototype.clone=function(){return new jspb.arith.Int64(this.lo,this.hi)},jspb.arith.Int64.prototype.toString=function(){var e=0!=(2147483648&this.hi),t=new jspb.arith.UInt64(this.lo,this.hi);return e&&(t=new jspb.arith.UInt64(0,0).sub(t)),(e?"-":"")+t.toString()},jspb.arith.Int64.fromString=function(e){var t=0<e.length&&"-"==e[0];return t&&(e=e.substring(1)),null===(e=jspb.arith.UInt64.fromString(e))?null:(t&&(e=new jspb.arith.UInt64(0,0).sub(e)),new jspb.arith.Int64(e.lo,e.hi))},jspb.BinaryWriter=function(){this.blocks_=[],this.totalLength_=0,this.encoder_=new jspb.BinaryEncoder,this.bookmarks_=[]},jspb.BinaryWriter.prototype.appendUint8Array_=function(e){var t=this.encoder_.end();this.blocks_.push(t),this.blocks_.push(e),this.totalLength_+=t.length+e.length},jspb.BinaryWriter.prototype.beginDelimited_=function(e){return this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),e=this.encoder_.end(),this.blocks_.push(e),this.totalLength_+=e.length,e.push(this.totalLength_),e},jspb.BinaryWriter.prototype.endDelimited_=function(e){var t=e.pop();for(t=this.totalLength_+this.encoder_.length()-t,jspb.asserts.assert(0<=t);127<t;)e.push(127&t|128),t>>>=7,this.totalLength_++;e.push(t),this.totalLength_++},jspb.BinaryWriter.prototype.writeSerializedMessage=function(e,t,r){this.appendUint8Array_(e.subarray(t,r))},jspb.BinaryWriter.prototype.maybeWriteSerializedMessage=function(e,t,r){null!=e&&null!=t&&null!=r&&this.writeSerializedMessage(e,t,r)},jspb.BinaryWriter.prototype.reset=function(){this.blocks_=[],this.encoder_.end(),this.totalLength_=0,this.bookmarks_=[]},jspb.BinaryWriter.prototype.getResultBuffer=function(){jspb.asserts.assert(0==this.bookmarks_.length);for(var e=new Uint8Array(this.totalLength_+this.encoder_.length()),t=this.blocks_,r=t.length,n=0,o=0;o<r;o++){var i=t[o];e.set(i,n),n+=i.length}return t=this.encoder_.end(),e.set(t,n),n+=t.length,jspb.asserts.assert(n==e.length),this.blocks_=[e],e},goog.exportProperty(jspb.BinaryWriter.prototype,"getResultBuffer",jspb.BinaryWriter.prototype.getResultBuffer),jspb.BinaryWriter.prototype.getResultBase64String=function(e){return goog.crypt.base64.encodeByteArray(this.getResultBuffer(),e)},jspb.BinaryWriter.prototype.beginSubMessage=function(e){this.bookmarks_.push(this.beginDelimited_(e))},jspb.BinaryWriter.prototype.endSubMessage=function(){jspb.asserts.assert(0<=this.bookmarks_.length),this.endDelimited_(this.bookmarks_.pop())},jspb.BinaryWriter.prototype.writeFieldHeader_=function(e,t){jspb.asserts.assert(1<=e&&e==Math.floor(e)),this.encoder_.writeUnsignedVarint32(8*e+t)},jspb.BinaryWriter.prototype.writeAny=function(e,t,r){var n=jspb.BinaryConstants.FieldType;switch(e){case n.DOUBLE:this.writeDouble(t,r);break;case n.FLOAT:this.writeFloat(t,r);break;case n.INT64:this.writeInt64(t,r);break;case n.UINT64:this.writeUint64(t,r);break;case n.INT32:this.writeInt32(t,r);break;case n.FIXED64:this.writeFixed64(t,r);break;case n.FIXED32:this.writeFixed32(t,r);break;case n.BOOL:this.writeBool(t,r);break;case n.STRING:this.writeString(t,r);break;case n.GROUP:jspb.asserts.fail("Group field type not supported in writeAny()");break;case n.MESSAGE:jspb.asserts.fail("Message field type not supported in writeAny()");break;case n.BYTES:this.writeBytes(t,r);break;case n.UINT32:this.writeUint32(t,r);break;case n.ENUM:this.writeEnum(t,r);break;case n.SFIXED32:this.writeSfixed32(t,r);break;case n.SFIXED64:this.writeSfixed64(t,r);break;case n.SINT32:this.writeSint32(t,r);break;case n.SINT64:this.writeSint64(t,r);break;case n.FHASH64:this.writeFixedHash64(t,r);break;case n.VHASH64:this.writeVarintHash64(t,r);break;default:jspb.asserts.fail("Invalid field type in writeAny()")}},jspb.BinaryWriter.prototype.writeUnsignedVarint32_=function(e,t){null!=t&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeUnsignedVarint32(t))},jspb.BinaryWriter.prototype.writeSignedVarint32_=function(e,t){null!=t&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSignedVarint32(t))},jspb.BinaryWriter.prototype.writeUnsignedVarint64_=function(e,t){null!=t&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeUnsignedVarint64(t))},jspb.BinaryWriter.prototype.writeSignedVarint64_=function(e,t){null!=t&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSignedVarint64(t))},jspb.BinaryWriter.prototype.writeZigzagVarint32_=function(e,t){null!=t&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeZigzagVarint32(t))},jspb.BinaryWriter.prototype.writeZigzagVarint64_=function(e,t){null!=t&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeZigzagVarint64(t))},jspb.BinaryWriter.prototype.writeZigzagVarint64String_=function(e,t){null!=t&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeZigzagVarint64String(t))},jspb.BinaryWriter.prototype.writeZigzagVarintHash64_=function(e,t){null!=t&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeZigzagVarintHash64(t))},jspb.BinaryWriter.prototype.writeInt32=function(e,t){null!=t&&(jspb.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_31&&t<jspb.BinaryConstants.TWO_TO_31),this.writeSignedVarint32_(e,t))},goog.exportProperty(jspb.BinaryWriter.prototype,"writeInt32",jspb.BinaryWriter.prototype.writeInt32),jspb.BinaryWriter.prototype.writeInt32String=function(e,t){null!=t&&(t=parseInt(t,10),jspb.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_31&&t<jspb.BinaryConstants.TWO_TO_31),this.writeSignedVarint32_(e,t))},jspb.BinaryWriter.prototype.writeInt64=function(e,t){null!=t&&(jspb.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_63&&t<jspb.BinaryConstants.TWO_TO_63),this.writeSignedVarint64_(e,t))},goog.exportProperty(jspb.BinaryWriter.prototype,"writeInt64",jspb.BinaryWriter.prototype.writeInt64),jspb.BinaryWriter.prototype.writeInt64String=function(e,t){null!=t&&(t=jspb.arith.Int64.fromString(t),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSplitVarint64(t.lo,t.hi))},jspb.BinaryWriter.prototype.writeUint32=function(e,t){null!=t&&(jspb.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_32),this.writeUnsignedVarint32_(e,t))},goog.exportProperty(jspb.BinaryWriter.prototype,"writeUint32",jspb.BinaryWriter.prototype.writeUint32),jspb.BinaryWriter.prototype.writeUint32String=function(e,t){null!=t&&(t=parseInt(t,10),jspb.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_32),this.writeUnsignedVarint32_(e,t))},jspb.BinaryWriter.prototype.writeUint64=function(e,t){null!=t&&(jspb.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_64),this.writeUnsignedVarint64_(e,t))},goog.exportProperty(jspb.BinaryWriter.prototype,"writeUint64",jspb.BinaryWriter.prototype.writeUint64),jspb.BinaryWriter.prototype.writeUint64String=function(e,t){null!=t&&(t=jspb.arith.UInt64.fromString(t),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSplitVarint64(t.lo,t.hi))},jspb.BinaryWriter.prototype.writeSint32=function(e,t){null!=t&&(jspb.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_31&&t<jspb.BinaryConstants.TWO_TO_31),this.writeZigzagVarint32_(e,t))},goog.exportProperty(jspb.BinaryWriter.prototype,"writeSint32",jspb.BinaryWriter.prototype.writeSint32),jspb.BinaryWriter.prototype.writeSint64=function(e,t){null!=t&&(jspb.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_63&&t<jspb.BinaryConstants.TWO_TO_63),this.writeZigzagVarint64_(e,t))},goog.exportProperty(jspb.BinaryWriter.prototype,"writeSint64",jspb.BinaryWriter.prototype.writeSint64),jspb.BinaryWriter.prototype.writeSintHash64=function(e,t){null!=t&&this.writeZigzagVarintHash64_(e,t)},jspb.BinaryWriter.prototype.writeSint64String=function(e,t){null!=t&&this.writeZigzagVarint64String_(e,t)},jspb.BinaryWriter.prototype.writeFixed32=function(e,t){null!=t&&(jspb.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_32),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED32),this.encoder_.writeUint32(t))},goog.exportProperty(jspb.BinaryWriter.prototype,"writeFixed32",jspb.BinaryWriter.prototype.writeFixed32),jspb.BinaryWriter.prototype.writeFixed64=function(e,t){null!=t&&(jspb.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_64),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeUint64(t))},goog.exportProperty(jspb.BinaryWriter.prototype,"writeFixed64",jspb.BinaryWriter.prototype.writeFixed64),jspb.BinaryWriter.prototype.writeFixed64String=function(e,t){null!=t&&(t=jspb.arith.UInt64.fromString(t),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeSplitFixed64(t.lo,t.hi))},jspb.BinaryWriter.prototype.writeSfixed32=function(e,t){null!=t&&(jspb.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_31&&t<jspb.BinaryConstants.TWO_TO_31),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED32),this.encoder_.writeInt32(t))},goog.exportProperty(jspb.BinaryWriter.prototype,"writeSfixed32",jspb.BinaryWriter.prototype.writeSfixed32),jspb.BinaryWriter.prototype.writeSfixed64=function(e,t){null!=t&&(jspb.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_63&&t<jspb.BinaryConstants.TWO_TO_63),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeInt64(t))},goog.exportProperty(jspb.BinaryWriter.prototype,"writeSfixed64",jspb.BinaryWriter.prototype.writeSfixed64),jspb.BinaryWriter.prototype.writeSfixed64String=function(e,t){null!=t&&(t=jspb.arith.Int64.fromString(t),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeSplitFixed64(t.lo,t.hi))},jspb.BinaryWriter.prototype.writeFloat=function(e,t){null!=t&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED32),this.encoder_.writeFloat(t))},goog.exportProperty(jspb.BinaryWriter.prototype,"writeFloat",jspb.BinaryWriter.prototype.writeFloat),jspb.BinaryWriter.prototype.writeDouble=function(e,t){null!=t&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeDouble(t))},goog.exportProperty(jspb.BinaryWriter.prototype,"writeDouble",jspb.BinaryWriter.prototype.writeDouble),jspb.BinaryWriter.prototype.writeBool=function(e,t){null!=t&&(jspb.asserts.assert("boolean"==typeof t||"number"==typeof t),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeBool(t))},goog.exportProperty(jspb.BinaryWriter.prototype,"writeBool",jspb.BinaryWriter.prototype.writeBool),jspb.BinaryWriter.prototype.writeEnum=function(e,t){null!=t&&(jspb.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_31&&t<jspb.BinaryConstants.TWO_TO_31),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSignedVarint32(t))},goog.exportProperty(jspb.BinaryWriter.prototype,"writeEnum",jspb.BinaryWriter.prototype.writeEnum),jspb.BinaryWriter.prototype.writeString=function(e,t){null!=t&&(e=this.beginDelimited_(e),this.encoder_.writeString(t),this.endDelimited_(e))},goog.exportProperty(jspb.BinaryWriter.prototype,"writeString",jspb.BinaryWriter.prototype.writeString),jspb.BinaryWriter.prototype.writeBytes=function(e,t){null!=t&&(t=jspb.utils.byteSourceToUint8Array(t),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(t.length),this.appendUint8Array_(t))},goog.exportProperty(jspb.BinaryWriter.prototype,"writeBytes",jspb.BinaryWriter.prototype.writeBytes),jspb.BinaryWriter.prototype.writeMessage=function(e,t,r){null!=t&&(e=this.beginDelimited_(e),r(t,this),this.endDelimited_(e))},goog.exportProperty(jspb.BinaryWriter.prototype,"writeMessage",jspb.BinaryWriter.prototype.writeMessage),jspb.BinaryWriter.prototype.writeMessageSet=function(e,t,r){null!=t&&(this.writeFieldHeader_(1,jspb.BinaryConstants.WireType.START_GROUP),this.writeFieldHeader_(2,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSignedVarint32(e),e=this.beginDelimited_(3),r(t,this),this.endDelimited_(e),this.writeFieldHeader_(1,jspb.BinaryConstants.WireType.END_GROUP))},jspb.BinaryWriter.prototype.writeGroup=function(e,t,r){null!=t&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.START_GROUP),r(t,this),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.END_GROUP))},goog.exportProperty(jspb.BinaryWriter.prototype,"writeGroup",jspb.BinaryWriter.prototype.writeGroup),jspb.BinaryWriter.prototype.writeFixedHash64=function(e,t){null!=t&&(jspb.asserts.assert(8==t.length),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeFixedHash64(t))},jspb.BinaryWriter.prototype.writeVarintHash64=function(e,t){null!=t&&(jspb.asserts.assert(8==t.length),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeVarintHash64(t))},jspb.BinaryWriter.prototype.writeSplitFixed64=function(e,t,r){this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeSplitFixed64(t,r)},jspb.BinaryWriter.prototype.writeSplitVarint64=function(e,t,r){this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSplitVarint64(t,r)},jspb.BinaryWriter.prototype.writeSplitZigzagVarint64=function(e,t,r){this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT);var n=this.encoder_;jspb.utils.toZigzag64(t,r,(function(e,t){n.writeSplitVarint64(e>>>0,t>>>0)}))},jspb.BinaryWriter.prototype.writeRepeatedInt32=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.writeSignedVarint32_(e,t[r])},goog.exportProperty(jspb.BinaryWriter.prototype,"writeRepeatedInt32",jspb.BinaryWriter.prototype.writeRepeatedInt32),jspb.BinaryWriter.prototype.writeRepeatedInt32String=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.writeInt32String(e,t[r])},jspb.BinaryWriter.prototype.writeRepeatedInt64=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.writeSignedVarint64_(e,t[r])},goog.exportProperty(jspb.BinaryWriter.prototype,"writeRepeatedInt64",jspb.BinaryWriter.prototype.writeRepeatedInt64),jspb.BinaryWriter.prototype.writeRepeatedSplitFixed64=function(e,t,r,n){if(null!=t)for(var o=0;o<t.length;o++)this.writeSplitFixed64(e,r(t[o]),n(t[o]))},jspb.BinaryWriter.prototype.writeRepeatedSplitVarint64=function(e,t,r,n){if(null!=t)for(var o=0;o<t.length;o++)this.writeSplitVarint64(e,r(t[o]),n(t[o]))},jspb.BinaryWriter.prototype.writeRepeatedSplitZigzagVarint64=function(e,t,r,n){if(null!=t)for(var o=0;o<t.length;o++)this.writeSplitZigzagVarint64(e,r(t[o]),n(t[o]))},jspb.BinaryWriter.prototype.writeRepeatedInt64String=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.writeInt64String(e,t[r])},jspb.BinaryWriter.prototype.writeRepeatedUint32=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.writeUnsignedVarint32_(e,t[r])},goog.exportProperty(jspb.BinaryWriter.prototype,"writeRepeatedUint32",jspb.BinaryWriter.prototype.writeRepeatedUint32),jspb.BinaryWriter.prototype.writeRepeatedUint32String=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.writeUint32String(e,t[r])},jspb.BinaryWriter.prototype.writeRepeatedUint64=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.writeUnsignedVarint64_(e,t[r])},goog.exportProperty(jspb.BinaryWriter.prototype,"writeRepeatedUint64",jspb.BinaryWriter.prototype.writeRepeatedUint64),jspb.BinaryWriter.prototype.writeRepeatedUint64String=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.writeUint64String(e,t[r])},jspb.BinaryWriter.prototype.writeRepeatedSint32=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.writeZigzagVarint32_(e,t[r])},goog.exportProperty(jspb.BinaryWriter.prototype,"writeRepeatedSint32",jspb.BinaryWriter.prototype.writeRepeatedSint32),jspb.BinaryWriter.prototype.writeRepeatedSint64=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.writeZigzagVarint64_(e,t[r])},goog.exportProperty(jspb.BinaryWriter.prototype,"writeRepeatedSint64",jspb.BinaryWriter.prototype.writeRepeatedSint64),jspb.BinaryWriter.prototype.writeRepeatedSint64String=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.writeZigzagVarint64String_(e,t[r])},jspb.BinaryWriter.prototype.writeRepeatedSintHash64=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.writeZigzagVarintHash64_(e,t[r])},jspb.BinaryWriter.prototype.writeRepeatedFixed32=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.writeFixed32(e,t[r])},goog.exportProperty(jspb.BinaryWriter.prototype,"writeRepeatedFixed32",jspb.BinaryWriter.prototype.writeRepeatedFixed32),jspb.BinaryWriter.prototype.writeRepeatedFixed64=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.writeFixed64(e,t[r])},goog.exportProperty(jspb.BinaryWriter.prototype,"writeRepeatedFixed64",jspb.BinaryWriter.prototype.writeRepeatedFixed64),jspb.BinaryWriter.prototype.writeRepeatedFixed64String=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.writeFixed64String(e,t[r])},goog.exportProperty(jspb.BinaryWriter.prototype,"writeRepeatedFixed64String",jspb.BinaryWriter.prototype.writeRepeatedFixed64String),jspb.BinaryWriter.prototype.writeRepeatedSfixed32=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.writeSfixed32(e,t[r])},goog.exportProperty(jspb.BinaryWriter.prototype,"writeRepeatedSfixed32",jspb.BinaryWriter.prototype.writeRepeatedSfixed32),jspb.BinaryWriter.prototype.writeRepeatedSfixed64=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.writeSfixed64(e,t[r])},goog.exportProperty(jspb.BinaryWriter.prototype,"writeRepeatedSfixed64",jspb.BinaryWriter.prototype.writeRepeatedSfixed64),jspb.BinaryWriter.prototype.writeRepeatedSfixed64String=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.writeSfixed64String(e,t[r])},jspb.BinaryWriter.prototype.writeRepeatedFloat=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.writeFloat(e,t[r])},goog.exportProperty(jspb.BinaryWriter.prototype,"writeRepeatedFloat",jspb.BinaryWriter.prototype.writeRepeatedFloat),jspb.BinaryWriter.prototype.writeRepeatedDouble=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.writeDouble(e,t[r])},goog.exportProperty(jspb.BinaryWriter.prototype,"writeRepeatedDouble",jspb.BinaryWriter.prototype.writeRepeatedDouble),jspb.BinaryWriter.prototype.writeRepeatedBool=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.writeBool(e,t[r])},goog.exportProperty(jspb.BinaryWriter.prototype,"writeRepeatedBool",jspb.BinaryWriter.prototype.writeRepeatedBool),jspb.BinaryWriter.prototype.writeRepeatedEnum=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.writeEnum(e,t[r])},goog.exportProperty(jspb.BinaryWriter.prototype,"writeRepeatedEnum",jspb.BinaryWriter.prototype.writeRepeatedEnum),jspb.BinaryWriter.prototype.writeRepeatedString=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.writeString(e,t[r])},goog.exportProperty(jspb.BinaryWriter.prototype,"writeRepeatedString",jspb.BinaryWriter.prototype.writeRepeatedString),jspb.BinaryWriter.prototype.writeRepeatedBytes=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.writeBytes(e,t[r])},goog.exportProperty(jspb.BinaryWriter.prototype,"writeRepeatedBytes",jspb.BinaryWriter.prototype.writeRepeatedBytes),jspb.BinaryWriter.prototype.writeRepeatedMessage=function(e,t,r){if(null!=t)for(var n=0;n<t.length;n++){var o=this.beginDelimited_(e);r(t[n],this),this.endDelimited_(o)}},goog.exportProperty(jspb.BinaryWriter.prototype,"writeRepeatedMessage",jspb.BinaryWriter.prototype.writeRepeatedMessage),jspb.BinaryWriter.prototype.writeRepeatedGroup=function(e,t,r){if(null!=t)for(var n=0;n<t.length;n++)this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.START_GROUP),r(t[n],this),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.END_GROUP)},goog.exportProperty(jspb.BinaryWriter.prototype,"writeRepeatedGroup",jspb.BinaryWriter.prototype.writeRepeatedGroup),jspb.BinaryWriter.prototype.writeRepeatedFixedHash64=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.writeFixedHash64(e,t[r])},jspb.BinaryWriter.prototype.writeRepeatedVarintHash64=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.writeVarintHash64(e,t[r])},jspb.BinaryWriter.prototype.writePackedInt32=function(e,t){if(null!=t&&t.length){e=this.beginDelimited_(e);for(var r=0;r<t.length;r++)this.encoder_.writeSignedVarint32(t[r]);this.endDelimited_(e)}},goog.exportProperty(jspb.BinaryWriter.prototype,"writePackedInt32",jspb.BinaryWriter.prototype.writePackedInt32),jspb.BinaryWriter.prototype.writePackedInt32String=function(e,t){if(null!=t&&t.length){e=this.beginDelimited_(e);for(var r=0;r<t.length;r++)this.encoder_.writeSignedVarint32(parseInt(t[r],10));this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedInt64=function(e,t){if(null!=t&&t.length){e=this.beginDelimited_(e);for(var r=0;r<t.length;r++)this.encoder_.writeSignedVarint64(t[r]);this.endDelimited_(e)}},goog.exportProperty(jspb.BinaryWriter.prototype,"writePackedInt64",jspb.BinaryWriter.prototype.writePackedInt64),jspb.BinaryWriter.prototype.writePackedSplitFixed64=function(e,t,r,n){if(null!=t){e=this.beginDelimited_(e);for(var o=0;o<t.length;o++)this.encoder_.writeSplitFixed64(r(t[o]),n(t[o]));this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedSplitVarint64=function(e,t,r,n){if(null!=t){e=this.beginDelimited_(e);for(var o=0;o<t.length;o++)this.encoder_.writeSplitVarint64(r(t[o]),n(t[o]));this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedSplitZigzagVarint64=function(e,t,r,n){if(null!=t){e=this.beginDelimited_(e);for(var o=this.encoder_,i=0;i<t.length;i++)jspb.utils.toZigzag64(r(t[i]),n(t[i]),(function(e,t){o.writeSplitVarint64(e>>>0,t>>>0)}));this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedInt64String=function(e,t){if(null!=t&&t.length){e=this.beginDelimited_(e);for(var r=0;r<t.length;r++){var n=jspb.arith.Int64.fromString(t[r]);this.encoder_.writeSplitVarint64(n.lo,n.hi)}this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedUint32=function(e,t){if(null!=t&&t.length){e=this.beginDelimited_(e);for(var r=0;r<t.length;r++)this.encoder_.writeUnsignedVarint32(t[r]);this.endDelimited_(e)}},goog.exportProperty(jspb.BinaryWriter.prototype,"writePackedUint32",jspb.BinaryWriter.prototype.writePackedUint32),jspb.BinaryWriter.prototype.writePackedUint32String=function(e,t){if(null!=t&&t.length){e=this.beginDelimited_(e);for(var r=0;r<t.length;r++)this.encoder_.writeUnsignedVarint32(parseInt(t[r],10));this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedUint64=function(e,t){if(null!=t&&t.length){e=this.beginDelimited_(e);for(var r=0;r<t.length;r++)this.encoder_.writeUnsignedVarint64(t[r]);this.endDelimited_(e)}},goog.exportProperty(jspb.BinaryWriter.prototype,"writePackedUint64",jspb.BinaryWriter.prototype.writePackedUint64),jspb.BinaryWriter.prototype.writePackedUint64String=function(e,t){if(null!=t&&t.length){e=this.beginDelimited_(e);for(var r=0;r<t.length;r++){var n=jspb.arith.UInt64.fromString(t[r]);this.encoder_.writeSplitVarint64(n.lo,n.hi)}this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedSint32=function(e,t){if(null!=t&&t.length){e=this.beginDelimited_(e);for(var r=0;r<t.length;r++)this.encoder_.writeZigzagVarint32(t[r]);this.endDelimited_(e)}},goog.exportProperty(jspb.BinaryWriter.prototype,"writePackedSint32",jspb.BinaryWriter.prototype.writePackedSint32),jspb.BinaryWriter.prototype.writePackedSint64=function(e,t){if(null!=t&&t.length){e=this.beginDelimited_(e);for(var r=0;r<t.length;r++)this.encoder_.writeZigzagVarint64(t[r]);this.endDelimited_(e)}},goog.exportProperty(jspb.BinaryWriter.prototype,"writePackedSint64",jspb.BinaryWriter.prototype.writePackedSint64),jspb.BinaryWriter.prototype.writePackedSint64String=function(e,t){if(null!=t&&t.length){e=this.beginDelimited_(e);for(var r=0;r<t.length;r++)this.encoder_.writeZigzagVarintHash64(jspb.utils.decimalStringToHash64(t[r]));this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedSintHash64=function(e,t){if(null!=t&&t.length){e=this.beginDelimited_(e);for(var r=0;r<t.length;r++)this.encoder_.writeZigzagVarintHash64(t[r]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedFixed32=function(e,t){if(null!=t&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(4*t.length),e=0;e<t.length;e++)this.encoder_.writeUint32(t[e])},goog.exportProperty(jspb.BinaryWriter.prototype,"writePackedFixed32",jspb.BinaryWriter.prototype.writePackedFixed32),jspb.BinaryWriter.prototype.writePackedFixed64=function(e,t){if(null!=t&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),e=0;e<t.length;e++)this.encoder_.writeUint64(t[e])},goog.exportProperty(jspb.BinaryWriter.prototype,"writePackedFixed64",jspb.BinaryWriter.prototype.writePackedFixed64),jspb.BinaryWriter.prototype.writePackedFixed64String=function(e,t){if(null!=t&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),e=0;e<t.length;e++){var r=jspb.arith.UInt64.fromString(t[e]);this.encoder_.writeSplitFixed64(r.lo,r.hi)}},jspb.BinaryWriter.prototype.writePackedSfixed32=function(e,t){if(null!=t&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(4*t.length),e=0;e<t.length;e++)this.encoder_.writeInt32(t[e])},goog.exportProperty(jspb.BinaryWriter.prototype,"writePackedSfixed32",jspb.BinaryWriter.prototype.writePackedSfixed32),jspb.BinaryWriter.prototype.writePackedSfixed64=function(e,t){if(null!=t&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),e=0;e<t.length;e++)this.encoder_.writeInt64(t[e])},goog.exportProperty(jspb.BinaryWriter.prototype,"writePackedSfixed64",jspb.BinaryWriter.prototype.writePackedSfixed64),jspb.BinaryWriter.prototype.writePackedSfixed64String=function(e,t){if(null!=t&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),e=0;e<t.length;e++)this.encoder_.writeInt64String(t[e])},jspb.BinaryWriter.prototype.writePackedFloat=function(e,t){if(null!=t&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(4*t.length),e=0;e<t.length;e++)this.encoder_.writeFloat(t[e])},goog.exportProperty(jspb.BinaryWriter.prototype,"writePackedFloat",jspb.BinaryWriter.prototype.writePackedFloat),jspb.BinaryWriter.prototype.writePackedDouble=function(e,t){if(null!=t&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),e=0;e<t.length;e++)this.encoder_.writeDouble(t[e])},goog.exportProperty(jspb.BinaryWriter.prototype,"writePackedDouble",jspb.BinaryWriter.prototype.writePackedDouble),jspb.BinaryWriter.prototype.writePackedBool=function(e,t){if(null!=t&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(t.length),e=0;e<t.length;e++)this.encoder_.writeBool(t[e])},goog.exportProperty(jspb.BinaryWriter.prototype,"writePackedBool",jspb.BinaryWriter.prototype.writePackedBool),jspb.BinaryWriter.prototype.writePackedEnum=function(e,t){if(null!=t&&t.length){e=this.beginDelimited_(e);for(var r=0;r<t.length;r++)this.encoder_.writeEnum(t[r]);this.endDelimited_(e)}},goog.exportProperty(jspb.BinaryWriter.prototype,"writePackedEnum",jspb.BinaryWriter.prototype.writePackedEnum),jspb.BinaryWriter.prototype.writePackedFixedHash64=function(e,t){if(null!=t&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),e=0;e<t.length;e++)this.encoder_.writeFixedHash64(t[e])},jspb.BinaryWriter.prototype.writePackedVarintHash64=function(e,t){if(null!=t&&t.length){e=this.beginDelimited_(e);for(var r=0;r<t.length;r++)this.encoder_.writeVarintHash64(t[r]);this.endDelimited_(e)}},jspb.Map=function(e,t){this.arr_=e,this.valueCtor_=t,this.map_={},this.arrClean=!0,0<this.arr_.length&&this.loadFromArray_()},goog.exportSymbol("jspb.Map",jspb.Map),jspb.Map.prototype.loadFromArray_=function(){for(var e=0;e<this.arr_.length;e++){var t=this.arr_[e],r=t[0];this.map_[r.toString()]=new jspb.Map.Entry_(r,t[1])}this.arrClean=!0},jspb.Map.prototype.toArray=function(){if(this.arrClean){if(this.valueCtor_){var e,t=this.map_;for(e in t)if(Object.prototype.hasOwnProperty.call(t,e)){var r=t[e].valueWrapper;r&&r.toArray()}}}else{for(this.arr_.length=0,(t=this.stringKeys_()).sort(),e=0;e<t.length;e++){var n=this.map_[t[e]];(r=n.valueWrapper)&&r.toArray(),this.arr_.push([n.key,n.value])}this.arrClean=!0}return this.arr_},goog.exportProperty(jspb.Map.prototype,"toArray",jspb.Map.prototype.toArray),jspb.Map.prototype.toObject=function(e,t){for(var r=this.toArray(),n=[],o=0;o<r.length;o++){var i=this.map_[r[o][0].toString()];this.wrapEntry_(i);var a=i.valueWrapper;a?(jspb.asserts.assert(t),n.push([i.key,t(e,a)])):n.push([i.key,i.value])}return n},goog.exportProperty(jspb.Map.prototype,"toObject",jspb.Map.prototype.toObject),jspb.Map.fromObject=function(e,t,r){t=new jspb.Map([],t);for(var n=0;n<e.length;n++){var o=e[n][0],i=r(e[n][1]);t.set(o,i)}return t},goog.exportProperty(jspb.Map,"fromObject",jspb.Map.fromObject),jspb.Map.ArrayIteratorIterable_=function(e){this.idx_=0,this.arr_=e},jspb.Map.ArrayIteratorIterable_.prototype.next=function(){return this.idx_<this.arr_.length?{done:!1,value:this.arr_[this.idx_++]}:{done:!0,value:void 0}},"undefined"!=typeof Symbol&&(jspb.Map.ArrayIteratorIterable_.prototype[Symbol.iterator]=function(){return this}),jspb.Map.prototype.getLength=function(){return this.stringKeys_().length},goog.exportProperty(jspb.Map.prototype,"getLength",jspb.Map.prototype.getLength),jspb.Map.prototype.clear=function(){this.map_={},this.arrClean=!1},goog.exportProperty(jspb.Map.prototype,"clear",jspb.Map.prototype.clear),jspb.Map.prototype.del=function(e){e=e.toString();var t=this.map_.hasOwnProperty(e);return delete this.map_[e],this.arrClean=!1,t},goog.exportProperty(jspb.Map.prototype,"del",jspb.Map.prototype.del),jspb.Map.prototype.getEntryList=function(){var e=[],t=this.stringKeys_();t.sort();for(var r=0;r<t.length;r++){var n=this.map_[t[r]];e.push([n.key,n.value])}return e},goog.exportProperty(jspb.Map.prototype,"getEntryList",jspb.Map.prototype.getEntryList),jspb.Map.prototype.entries=function(){var e=[],t=this.stringKeys_();t.sort();for(var r=0;r<t.length;r++){var n=this.map_[t[r]];e.push([n.key,this.wrapEntry_(n)])}return new jspb.Map.ArrayIteratorIterable_(e)},goog.exportProperty(jspb.Map.prototype,"entries",jspb.Map.prototype.entries),jspb.Map.prototype.keys=function(){var e=[],t=this.stringKeys_();t.sort();for(var r=0;r<t.length;r++)e.push(this.map_[t[r]].key);return new jspb.Map.ArrayIteratorIterable_(e)},goog.exportProperty(jspb.Map.prototype,"keys",jspb.Map.prototype.keys),jspb.Map.prototype.values=function(){var e=[],t=this.stringKeys_();t.sort();for(var r=0;r<t.length;r++)e.push(this.wrapEntry_(this.map_[t[r]]));return new jspb.Map.ArrayIteratorIterable_(e)},goog.exportProperty(jspb.Map.prototype,"values",jspb.Map.prototype.values),jspb.Map.prototype.forEach=function(e,t){var r=this.stringKeys_();r.sort();for(var n=0;n<r.length;n++){var o=this.map_[r[n]];e.call(t,this.wrapEntry_(o),o.key,this)}},goog.exportProperty(jspb.Map.prototype,"forEach",jspb.Map.prototype.forEach),jspb.Map.prototype.set=function(e,t){var r=new jspb.Map.Entry_(e);return this.valueCtor_?(r.valueWrapper=t,r.value=t.toArray()):r.value=t,this.map_[e.toString()]=r,this.arrClean=!1,this},goog.exportProperty(jspb.Map.prototype,"set",jspb.Map.prototype.set),jspb.Map.prototype.wrapEntry_=function(e){return this.valueCtor_?(e.valueWrapper||(e.valueWrapper=new this.valueCtor_(e.value)),e.valueWrapper):e.value},jspb.Map.prototype.get=function(e){if(e=this.map_[e.toString()])return this.wrapEntry_(e)},goog.exportProperty(jspb.Map.prototype,"get",jspb.Map.prototype.get),jspb.Map.prototype.has=function(e){return e.toString()in this.map_},goog.exportProperty(jspb.Map.prototype,"has",jspb.Map.prototype.has),jspb.Map.prototype.serializeBinary=function(e,t,r,n,o){var i=this.stringKeys_();i.sort();for(var a=0;a<i.length;a++){var s=this.map_[i[a]];t.beginSubMessage(e),r.call(t,1,s.key),this.valueCtor_?n.call(t,2,this.wrapEntry_(s),o):n.call(t,2,s.value),t.endSubMessage()}},goog.exportProperty(jspb.Map.prototype,"serializeBinary",jspb.Map.prototype.serializeBinary),jspb.Map.deserializeBinary=function(e,t,r,n,o,i,a){for(;t.nextField()&&!t.isEndGroup();){var s=t.getFieldNumber();1==s?i=r.call(t):2==s&&(e.valueCtor_?(jspb.asserts.assert(o),a||(a=new e.valueCtor_),n.call(t,a,o)):a=n.call(t))}jspb.asserts.assert(null!=i),jspb.asserts.assert(null!=a),e.set(i,a)},goog.exportProperty(jspb.Map,"deserializeBinary",jspb.Map.deserializeBinary),jspb.Map.prototype.stringKeys_=function(){var e,t=this.map_,r=[];for(e in t)Object.prototype.hasOwnProperty.call(t,e)&&r.push(e);return r},jspb.Map.Entry_=function(e,t){this.key=e,this.value=t,this.valueWrapper=void 0},jspb.ExtensionFieldInfo=function(e,t,r,n,o){this.fieldIndex=e,this.fieldName=t,this.ctor=r,this.toObjectFn=n,this.isRepeated=o},goog.exportSymbol("jspb.ExtensionFieldInfo",jspb.ExtensionFieldInfo),jspb.ExtensionFieldBinaryInfo=function(e,t,r,n,o,i){this.fieldInfo=e,this.binaryReaderFn=t,this.binaryWriterFn=r,this.binaryMessageSerializeFn=n,this.binaryMessageDeserializeFn=o,this.isPacked=i},goog.exportSymbol("jspb.ExtensionFieldBinaryInfo",jspb.ExtensionFieldBinaryInfo),jspb.ExtensionFieldInfo.prototype.isMessageType=function(){return!!this.ctor},goog.exportProperty(jspb.ExtensionFieldInfo.prototype,"isMessageType",jspb.ExtensionFieldInfo.prototype.isMessageType),jspb.Message=function(){},goog.exportSymbol("jspb.Message",jspb.Message),jspb.Message.GENERATE_TO_OBJECT=!0,goog.exportProperty(jspb.Message,"GENERATE_TO_OBJECT",jspb.Message.GENERATE_TO_OBJECT),jspb.Message.GENERATE_FROM_OBJECT=!goog.DISALLOW_TEST_ONLY_CODE,goog.exportProperty(jspb.Message,"GENERATE_FROM_OBJECT",jspb.Message.GENERATE_FROM_OBJECT),jspb.Message.GENERATE_TO_STRING=!0,jspb.Message.ASSUME_LOCAL_ARRAYS=!1,jspb.Message.SERIALIZE_EMPTY_TRAILING_FIELDS=!0,jspb.Message.SUPPORTS_UINT8ARRAY_="function"==typeof Uint8Array,jspb.Message.prototype.getJsPbMessageId=function(){return this.messageId_},goog.exportProperty(jspb.Message.prototype,"getJsPbMessageId",jspb.Message.prototype.getJsPbMessageId),jspb.Message.getIndex_=function(e,t){return t+e.arrayIndexOffset_},jspb.Message.hiddenES6Property_=function(){},jspb.Message.getFieldNumber_=function(e,t){return t-e.arrayIndexOffset_},jspb.Message.initialize=function(e,t,r,n,o,i){if(e.wrappers_=null,t||(t=r?[r]:[]),e.messageId_=r?String(r):void 0,e.arrayIndexOffset_=0===r?-1:0,e.array=t,jspb.Message.initPivotAndExtensionObject_(e,n),e.convertedPrimitiveFields_={},jspb.Message.SERIALIZE_EMPTY_TRAILING_FIELDS||(e.repeatedFields=o),o)for(t=0;t<o.length;t++)(r=o[t])<e.pivot_?(r=jspb.Message.getIndex_(e,r),e.array[r]=e.array[r]||jspb.Message.EMPTY_LIST_SENTINEL_):(jspb.Message.maybeInitEmptyExtensionObject_(e),e.extensionObject_[r]=e.extensionObject_[r]||jspb.Message.EMPTY_LIST_SENTINEL_);if(i&&i.length)for(t=0;t<i.length;t++)jspb.Message.computeOneofCase(e,i[t])},goog.exportProperty(jspb.Message,"initialize",jspb.Message.initialize),jspb.Message.EMPTY_LIST_SENTINEL_=goog.DEBUG&&Object.freeze?Object.freeze([]):[],jspb.Message.isArray_=function(e){return jspb.Message.ASSUME_LOCAL_ARRAYS?e instanceof Array:Array.isArray(e)},jspb.Message.isExtensionObject_=function(e){return!(null===e||"object"!=typeof e||jspb.Message.isArray_(e)||jspb.Message.SUPPORTS_UINT8ARRAY_&&e instanceof Uint8Array)},jspb.Message.initPivotAndExtensionObject_=function(e,t){var r=e.array.length,n=-1;if(r&&(n=r-1,r=e.array[n],jspb.Message.isExtensionObject_(r)))return e.pivot_=jspb.Message.getFieldNumber_(e,n),void(e.extensionObject_=r);-1<t?(e.pivot_=Math.max(t,jspb.Message.getFieldNumber_(e,n+1)),e.extensionObject_=null):e.pivot_=Number.MAX_VALUE},jspb.Message.maybeInitEmptyExtensionObject_=function(e){var t=jspb.Message.getIndex_(e,e.pivot_);e.array[t]||(e.extensionObject_=e.array[t]={})},jspb.Message.toObjectList=function(e,t,r){for(var n=[],o=0;o<e.length;o++)n[o]=t.call(e[o],r,e[o]);return n},goog.exportProperty(jspb.Message,"toObjectList",jspb.Message.toObjectList),jspb.Message.toObjectExtension=function(e,t,r,n,o){for(var i in r){var a=r[i],s=n.call(e,a);if(null!=s){for(var u in a.fieldName)if(a.fieldName.hasOwnProperty(u))break;t[u]=a.toObjectFn?a.isRepeated?jspb.Message.toObjectList(s,a.toObjectFn,o):a.toObjectFn(o,s):s}}},goog.exportProperty(jspb.Message,"toObjectExtension",jspb.Message.toObjectExtension),jspb.Message.serializeBinaryExtensions=function(e,t,r,n){for(var o in r){var i=r[o],a=i.fieldInfo;if(!i.binaryWriterFn)throw Error("Message extension present that was generated without binary serialization support");var s=n.call(e,a);if(null!=s)if(a.isMessageType()){if(!i.binaryMessageSerializeFn)throw Error("Message extension present holding submessage without binary support enabled, and message is being serialized to binary format");i.binaryWriterFn.call(t,a.fieldIndex,s,i.binaryMessageSerializeFn)}else i.binaryWriterFn.call(t,a.fieldIndex,s)}},goog.exportProperty(jspb.Message,"serializeBinaryExtensions",jspb.Message.serializeBinaryExtensions),jspb.Message.readBinaryExtension=function(e,t,r,n,o){var i=r[t.getFieldNumber()];if(i){if(r=i.fieldInfo,!i.binaryReaderFn)throw Error("Deserializing extension whose generated code does not support binary format");if(r.isMessageType()){var a=new r.ctor;i.binaryReaderFn.call(t,a,i.binaryMessageDeserializeFn)}else a=i.binaryReaderFn.call(t);r.isRepeated&&!i.isPacked?(t=n.call(e,r))?t.push(a):o.call(e,r,[a]):o.call(e,r,a)}else t.skipField()},goog.exportProperty(jspb.Message,"readBinaryExtension",jspb.Message.readBinaryExtension),jspb.Message.getField=function(e,t){if(t<e.pivot_){t=jspb.Message.getIndex_(e,t);var r=e.array[t];return r===jspb.Message.EMPTY_LIST_SENTINEL_?e.array[t]=[]:r}if(e.extensionObject_)return(r=e.extensionObject_[t])===jspb.Message.EMPTY_LIST_SENTINEL_?e.extensionObject_[t]=[]:r},goog.exportProperty(jspb.Message,"getField",jspb.Message.getField),jspb.Message.getRepeatedField=function(e,t){return jspb.Message.getField(e,t)},goog.exportProperty(jspb.Message,"getRepeatedField",jspb.Message.getRepeatedField),jspb.Message.getOptionalFloatingPointField=function(e,t){return null==(e=jspb.Message.getField(e,t))?e:+e},goog.exportProperty(jspb.Message,"getOptionalFloatingPointField",jspb.Message.getOptionalFloatingPointField),jspb.Message.getBooleanField=function(e,t){return null==(e=jspb.Message.getField(e,t))?e:!!e},goog.exportProperty(jspb.Message,"getBooleanField",jspb.Message.getBooleanField),jspb.Message.getRepeatedFloatingPointField=function(e,t){var r=jspb.Message.getRepeatedField(e,t);if(e.convertedPrimitiveFields_||(e.convertedPrimitiveFields_={}),!e.convertedPrimitiveFields_[t]){for(var n=0;n<r.length;n++)r[n]=+r[n];e.convertedPrimitiveFields_[t]=!0}return r},goog.exportProperty(jspb.Message,"getRepeatedFloatingPointField",jspb.Message.getRepeatedFloatingPointField),jspb.Message.getRepeatedBooleanField=function(e,t){var r=jspb.Message.getRepeatedField(e,t);if(e.convertedPrimitiveFields_||(e.convertedPrimitiveFields_={}),!e.convertedPrimitiveFields_[t]){for(var n=0;n<r.length;n++)r[n]=!!r[n];e.convertedPrimitiveFields_[t]=!0}return r},goog.exportProperty(jspb.Message,"getRepeatedBooleanField",jspb.Message.getRepeatedBooleanField),jspb.Message.bytesAsB64=function(e){return null==e||"string"==typeof e?e:jspb.Message.SUPPORTS_UINT8ARRAY_&&e instanceof Uint8Array?goog.crypt.base64.encodeByteArray(e):(jspb.asserts.fail("Cannot coerce to b64 string: "+goog.typeOf(e)),null)},goog.exportProperty(jspb.Message,"bytesAsB64",jspb.Message.bytesAsB64),jspb.Message.bytesAsU8=function(e){return null==e||e instanceof Uint8Array?e:"string"==typeof e?goog.crypt.base64.decodeStringToUint8Array(e):(jspb.asserts.fail("Cannot coerce to Uint8Array: "+goog.typeOf(e)),null)},goog.exportProperty(jspb.Message,"bytesAsU8",jspb.Message.bytesAsU8),jspb.Message.bytesListAsB64=function(e){return jspb.Message.assertConsistentTypes_(e),e.length&&"string"!=typeof e[0]?goog.array.map(e,jspb.Message.bytesAsB64):e},goog.exportProperty(jspb.Message,"bytesListAsB64",jspb.Message.bytesListAsB64),jspb.Message.bytesListAsU8=function(e){return jspb.Message.assertConsistentTypes_(e),!e.length||e[0]instanceof Uint8Array?e:goog.array.map(e,jspb.Message.bytesAsU8)},goog.exportProperty(jspb.Message,"bytesListAsU8",jspb.Message.bytesListAsU8),jspb.Message.assertConsistentTypes_=function(e){if(goog.DEBUG&&e&&1<e.length){var t=goog.typeOf(e[0]);goog.array.forEach(e,(function(e){goog.typeOf(e)!=t&&jspb.asserts.fail("Inconsistent type in JSPB repeated field array. Got "+goog.typeOf(e)+" expected "+t)}))}},jspb.Message.getFieldWithDefault=function(e,t,r){return null==(e=jspb.Message.getField(e,t))?r:e},goog.exportProperty(jspb.Message,"getFieldWithDefault",jspb.Message.getFieldWithDefault),jspb.Message.getBooleanFieldWithDefault=function(e,t,r){return null==(e=jspb.Message.getBooleanField(e,t))?r:e},goog.exportProperty(jspb.Message,"getBooleanFieldWithDefault",jspb.Message.getBooleanFieldWithDefault),jspb.Message.getFloatingPointFieldWithDefault=function(e,t,r){return null==(e=jspb.Message.getOptionalFloatingPointField(e,t))?r:e},goog.exportProperty(jspb.Message,"getFloatingPointFieldWithDefault",jspb.Message.getFloatingPointFieldWithDefault),jspb.Message.getFieldProto3=jspb.Message.getFieldWithDefault,goog.exportProperty(jspb.Message,"getFieldProto3",jspb.Message.getFieldProto3),jspb.Message.getMapField=function(e,t,r,n){if(e.wrappers_||(e.wrappers_={}),t in e.wrappers_)return e.wrappers_[t];var o=jspb.Message.getField(e,t);if(!o){if(r)return;o=[],jspb.Message.setField(e,t,o)}return e.wrappers_[t]=new jspb.Map(o,n)},goog.exportProperty(jspb.Message,"getMapField",jspb.Message.getMapField),jspb.Message.setField=function(e,t,r){return jspb.asserts.assertInstanceof(e,jspb.Message),t<e.pivot_?e.array[jspb.Message.getIndex_(e,t)]=r:(jspb.Message.maybeInitEmptyExtensionObject_(e),e.extensionObject_[t]=r),e},goog.exportProperty(jspb.Message,"setField",jspb.Message.setField),jspb.Message.setProto3IntField=function(e,t,r){return jspb.Message.setFieldIgnoringDefault_(e,t,r,0)},goog.exportProperty(jspb.Message,"setProto3IntField",jspb.Message.setProto3IntField),jspb.Message.setProto3FloatField=function(e,t,r){return jspb.Message.setFieldIgnoringDefault_(e,t,r,0)},goog.exportProperty(jspb.Message,"setProto3FloatField",jspb.Message.setProto3FloatField),jspb.Message.setProto3BooleanField=function(e,t,r){return jspb.Message.setFieldIgnoringDefault_(e,t,r,!1)},goog.exportProperty(jspb.Message,"setProto3BooleanField",jspb.Message.setProto3BooleanField),jspb.Message.setProto3StringField=function(e,t,r){return jspb.Message.setFieldIgnoringDefault_(e,t,r,"")},goog.exportProperty(jspb.Message,"setProto3StringField",jspb.Message.setProto3StringField),jspb.Message.setProto3BytesField=function(e,t,r){return jspb.Message.setFieldIgnoringDefault_(e,t,r,"")},goog.exportProperty(jspb.Message,"setProto3BytesField",jspb.Message.setProto3BytesField),jspb.Message.setProto3EnumField=function(e,t,r){return jspb.Message.setFieldIgnoringDefault_(e,t,r,0)},goog.exportProperty(jspb.Message,"setProto3EnumField",jspb.Message.setProto3EnumField),jspb.Message.setProto3StringIntField=function(e,t,r){return jspb.Message.setFieldIgnoringDefault_(e,t,r,"0")},goog.exportProperty(jspb.Message,"setProto3StringIntField",jspb.Message.setProto3StringIntField),jspb.Message.setFieldIgnoringDefault_=function(e,t,r,n){return jspb.asserts.assertInstanceof(e,jspb.Message),r!==n?jspb.Message.setField(e,t,r):t<e.pivot_?e.array[jspb.Message.getIndex_(e,t)]=null:(jspb.Message.maybeInitEmptyExtensionObject_(e),delete e.extensionObject_[t]),e},jspb.Message.addToRepeatedField=function(e,t,r,n){return jspb.asserts.assertInstanceof(e,jspb.Message),t=jspb.Message.getRepeatedField(e,t),null!=n?t.splice(n,0,r):t.push(r),e},goog.exportProperty(jspb.Message,"addToRepeatedField",jspb.Message.addToRepeatedField),jspb.Message.setOneofField=function(e,t,r,n){return jspb.asserts.assertInstanceof(e,jspb.Message),(r=jspb.Message.computeOneofCase(e,r))&&r!==t&&void 0!==n&&(e.wrappers_&&r in e.wrappers_&&(e.wrappers_[r]=void 0),jspb.Message.setField(e,r,void 0)),jspb.Message.setField(e,t,n)},goog.exportProperty(jspb.Message,"setOneofField",jspb.Message.setOneofField),jspb.Message.computeOneofCase=function(e,t){for(var r,n,o=0;o<t.length;o++){var i=t[o],a=jspb.Message.getField(e,i);null!=a&&(r=i,n=a,jspb.Message.setField(e,i,void 0))}return r?(jspb.Message.setField(e,r,n),r):0},goog.exportProperty(jspb.Message,"computeOneofCase",jspb.Message.computeOneofCase),jspb.Message.getWrapperField=function(e,t,r,n){if(e.wrappers_||(e.wrappers_={}),!e.wrappers_[r]){var o=jspb.Message.getField(e,r);(n||o)&&(e.wrappers_[r]=new t(o))}return e.wrappers_[r]},goog.exportProperty(jspb.Message,"getWrapperField",jspb.Message.getWrapperField),jspb.Message.getRepeatedWrapperField=function(e,t,r){return jspb.Message.wrapRepeatedField_(e,t,r),(t=e.wrappers_[r])==jspb.Message.EMPTY_LIST_SENTINEL_&&(t=e.wrappers_[r]=[]),t},goog.exportProperty(jspb.Message,"getRepeatedWrapperField",jspb.Message.getRepeatedWrapperField),jspb.Message.wrapRepeatedField_=function(e,t,r){if(e.wrappers_||(e.wrappers_={}),!e.wrappers_[r]){for(var n=jspb.Message.getRepeatedField(e,r),o=[],i=0;i<n.length;i++)o[i]=new t(n[i]);e.wrappers_[r]=o}},jspb.Message.setWrapperField=function(e,t,r){jspb.asserts.assertInstanceof(e,jspb.Message),e.wrappers_||(e.wrappers_={});var n=r?r.toArray():r;return e.wrappers_[t]=r,jspb.Message.setField(e,t,n)},goog.exportProperty(jspb.Message,"setWrapperField",jspb.Message.setWrapperField),jspb.Message.setOneofWrapperField=function(e,t,r,n){jspb.asserts.assertInstanceof(e,jspb.Message),e.wrappers_||(e.wrappers_={});var o=n?n.toArray():n;return e.wrappers_[t]=n,jspb.Message.setOneofField(e,t,r,o)},goog.exportProperty(jspb.Message,"setOneofWrapperField",jspb.Message.setOneofWrapperField),jspb.Message.setRepeatedWrapperField=function(e,t,r){jspb.asserts.assertInstanceof(e,jspb.Message),e.wrappers_||(e.wrappers_={}),r=r||[];for(var n=[],o=0;o<r.length;o++)n[o]=r[o].toArray();return e.wrappers_[t]=r,jspb.Message.setField(e,t,n)},goog.exportProperty(jspb.Message,"setRepeatedWrapperField",jspb.Message.setRepeatedWrapperField),jspb.Message.addToRepeatedWrapperField=function(e,t,r,n,o){jspb.Message.wrapRepeatedField_(e,n,t);var i=e.wrappers_[t];return i||(i=e.wrappers_[t]=[]),r=r||new n,e=jspb.Message.getRepeatedField(e,t),null!=o?(i.splice(o,0,r),e.splice(o,0,r.toArray())):(i.push(r),e.push(r.toArray())),r},goog.exportProperty(jspb.Message,"addToRepeatedWrapperField",jspb.Message.addToRepeatedWrapperField),jspb.Message.toMap=function(e,t,r,n){for(var o={},i=0;i<e.length;i++)o[t.call(e[i])]=r?r.call(e[i],n,e[i]):e[i];return o},goog.exportProperty(jspb.Message,"toMap",jspb.Message.toMap),jspb.Message.prototype.syncMapFields_=function(){if(this.wrappers_)for(var e in this.wrappers_){var t=this.wrappers_[e];if(Array.isArray(t))for(var r=0;r<t.length;r++)t[r]&&t[r].toArray();else t&&t.toArray()}},jspb.Message.prototype.toArray=function(){return this.syncMapFields_(),this.array},goog.exportProperty(jspb.Message.prototype,"toArray",jspb.Message.prototype.toArray),jspb.Message.GENERATE_TO_STRING&&(jspb.Message.prototype.toString=function(){return this.syncMapFields_(),this.array.toString()}),jspb.Message.prototype.getExtension=function(e){if(this.extensionObject_){this.wrappers_||(this.wrappers_={});var t=e.fieldIndex;if(e.isRepeated){if(e.isMessageType())return this.wrappers_[t]||(this.wrappers_[t]=goog.array.map(this.extensionObject_[t]||[],(function(t){return new e.ctor(t)}))),this.wrappers_[t]}else if(e.isMessageType())return!this.wrappers_[t]&&this.extensionObject_[t]&&(this.wrappers_[t]=new e.ctor(this.extensionObject_[t])),this.wrappers_[t];return this.extensionObject_[t]}},goog.exportProperty(jspb.Message.prototype,"getExtension",jspb.Message.prototype.getExtension),jspb.Message.prototype.setExtension=function(e,t){this.wrappers_||(this.wrappers_={}),jspb.Message.maybeInitEmptyExtensionObject_(this);var r=e.fieldIndex;return e.isRepeated?(t=t||[],e.isMessageType()?(this.wrappers_[r]=t,this.extensionObject_[r]=goog.array.map(t,(function(e){return e.toArray()}))):this.extensionObject_[r]=t):e.isMessageType()?(this.wrappers_[r]=t,this.extensionObject_[r]=t?t.toArray():t):this.extensionObject_[r]=t,this},goog.exportProperty(jspb.Message.prototype,"setExtension",jspb.Message.prototype.setExtension),jspb.Message.difference=function(e,t){if(!(e instanceof t.constructor))throw Error("Messages have different types.");var r=e.toArray();t=t.toArray();var n=[],o=0,i=r.length>t.length?r.length:t.length;for(e.getJsPbMessageId()&&(n[0]=e.getJsPbMessageId(),o=1);o<i;o++)jspb.Message.compareFields(r[o],t[o])||(n[o]=t[o]);return new e.constructor(n)},goog.exportProperty(jspb.Message,"difference",jspb.Message.difference),jspb.Message.equals=function(e,t){return e==t||!(!e||!t)&&e instanceof t.constructor&&jspb.Message.compareFields(e.toArray(),t.toArray())},goog.exportProperty(jspb.Message,"equals",jspb.Message.equals),jspb.Message.compareExtensions=function(e,t){e=e||{},t=t||{};var r,n={};for(r in e)n[r]=0;for(r in t)n[r]=0;for(r in n)if(!jspb.Message.compareFields(e[r],t[r]))return!1;return!0},goog.exportProperty(jspb.Message,"compareExtensions",jspb.Message.compareExtensions),jspb.Message.compareFields=function(e,t){if(e==t)return!0;if(!goog.isObject(e)||!goog.isObject(t))return!!("number"==typeof e&&isNaN(e)||"number"==typeof t&&isNaN(t))&&String(e)==String(t);if(e.constructor!=t.constructor)return!1;if(jspb.Message.SUPPORTS_UINT8ARRAY_&&e.constructor===Uint8Array){if(e.length!=t.length)return!1;for(var r=0;r<e.length;r++)if(e[r]!=t[r])return!1;return!0}if(e.constructor===Array){var n=void 0,o=void 0,i=Math.max(e.length,t.length);for(r=0;r<i;r++){var a=e[r],s=t[r];if(a&&a.constructor==Object&&(jspb.asserts.assert(void 0===n),jspb.asserts.assert(r===e.length-1),n=a,a=void 0),s&&s.constructor==Object&&(jspb.asserts.assert(void 0===o),jspb.asserts.assert(r===t.length-1),o=s,s=void 0),!jspb.Message.compareFields(a,s))return!1}return!n&&!o||(n=n||{},o=o||{},jspb.Message.compareExtensions(n,o))}if(e.constructor===Object)return jspb.Message.compareExtensions(e,t);throw Error("Invalid type in JSPB array")},goog.exportProperty(jspb.Message,"compareFields",jspb.Message.compareFields),jspb.Message.prototype.cloneMessage=function(){return jspb.Message.cloneMessage(this)},goog.exportProperty(jspb.Message.prototype,"cloneMessage",jspb.Message.prototype.cloneMessage),jspb.Message.prototype.clone=function(){return jspb.Message.cloneMessage(this)},goog.exportProperty(jspb.Message.prototype,"clone",jspb.Message.prototype.clone),jspb.Message.clone=function(e){return jspb.Message.cloneMessage(e)},goog.exportProperty(jspb.Message,"clone",jspb.Message.clone),jspb.Message.cloneMessage=function(e){return new e.constructor(jspb.Message.clone_(e.toArray()))},jspb.Message.copyInto=function(e,t){jspb.asserts.assertInstanceof(e,jspb.Message),jspb.asserts.assertInstanceof(t,jspb.Message),jspb.asserts.assert(e.constructor==t.constructor,"Copy source and target message should have the same type."),e=jspb.Message.clone(e);for(var r=t.toArray(),n=e.toArray(),o=r.length=0;o<n.length;o++)r[o]=n[o];t.wrappers_=e.wrappers_,t.extensionObject_=e.extensionObject_},goog.exportProperty(jspb.Message,"copyInto",jspb.Message.copyInto),jspb.Message.clone_=function(e){if(Array.isArray(e)){for(var t=Array(e.length),r=0;r<e.length;r++){var n=e[r];null!=n&&(t[r]="object"==typeof n?jspb.Message.clone_(jspb.asserts.assert(n)):n)}return t}if(jspb.Message.SUPPORTS_UINT8ARRAY_&&e instanceof Uint8Array)return new Uint8Array(e);for(r in t={},e)null!=(n=e[r])&&(t[r]="object"==typeof n?jspb.Message.clone_(jspb.asserts.assert(n)):n);return t},jspb.Message.registerMessageType=function(e,t){t.messageId=e},goog.exportProperty(jspb.Message,"registerMessageType",jspb.Message.registerMessageType),jspb.Message.messageSetExtensions={},jspb.Message.messageSetExtensionsBinary={},jspb.Export={},exports.Map=jspb.Map,exports.Message=jspb.Message,exports.BinaryReader=jspb.BinaryReader,exports.BinaryWriter=jspb.BinaryWriter,exports.ExtensionFieldInfo=jspb.ExtensionFieldInfo,exports.ExtensionFieldBinaryInfo=jspb.ExtensionFieldBinaryInfo,exports.exportSymbol=goog.exportSymbol,exports.inherits=goog.inherits,exports.object={extend:goog.object.extend},exports.typeOf=goog.typeOf},3820:(e,t,r)=>{"use strict";var n=r(7701)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(e){n=null}e.exports=n},1405:e=>{"use strict";var t="undefined"!=typeof BigInt&&BigInt;e.exports=function(){return"function"==typeof t&&"function"==typeof BigInt&&"bigint"==typeof t(42)&&"bigint"==typeof BigInt(42)}},1020:(e,t,r)=>{"use strict";var n=r(7701)("%Object.defineProperty%",!0),o=function(){if(n)try{return n({},"a",{value:1}),!0}catch(e){return!1}return!1};o.hasArrayLengthDefineBug=function(){if(!o())return null;try{return 1!==n([],"length",{value:1}).length}catch(e){return!0}},e.exports=o},8489:(e,t,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,o=r(7027);e.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&o()}},7027:e=>{"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(e,t);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},1191:(e,t,r)=>{"use strict";var n=r(7027);e.exports=function(){return n()&&!!Symbol.toStringTag}},1888:(e,t,r)=>{"use strict";var n=r(3767);e.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},3226:(e,t)=>{t.read=function(e,t,r,n,o){var i,a,s=8*o-n-1,u=(1<<s)-1,l=u>>1,c=-7,f=r?o-1:0,d=r?-1:1,g=e[t+f];for(f+=d,i=g&(1<<-c)-1,g>>=-c,c+=s;c>0;i=256*i+e[t+f],f+=d,c-=8);for(a=i&(1<<-c)-1,i>>=-c,c+=n;c>0;a=256*a+e[t+f],f+=d,c-=8);if(0===i)i=1-l;else{if(i===u)return a?NaN:1/0*(g?-1:1);a+=Math.pow(2,n),i-=l}return(g?-1:1)*a*Math.pow(2,i-n)},t.write=function(e,t,r,n,o,i){var a,s,u,l=8*i-o-1,c=(1<<l)-1,f=c>>1,d=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:i-1,p=n?1:-1,h=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+f>=1?d/u:d*Math.pow(2,1-f))*u>=2&&(a++,u/=2),a+f>=c?(s=0,a=c):a+f>=1?(s=(t*u-1)*Math.pow(2,o),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;e[r+g]=255&s,g+=p,s/=256,o-=8);for(a=a<<o|s,l+=o;l>0;e[r+g]=255&a,g+=p,a/=256,l-=8);e[r+g-p]|=128*h}},1736:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},1187:(e,t,r)=>{"use strict";var n=r(7701),o=r(1888),i=r(95)(),a=n("%TypeError%"),s={assert:function(e,t){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new a("`O` is not an object");if("string"!=typeof t)throw new a("`slot` must be a string");if(i.assert(e),!s.has(e,t))throw new a("`"+t+"` is not present on `O`")},get:function(e,t){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new a("`O` is not an object");if("string"!=typeof t)throw new a("`slot` must be a string");var r=i.get(e);return r&&r["$"+t]},has:function(e,t){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new a("`O` is not an object");if("string"!=typeof t)throw new a("`slot` must be a string");var r=i.get(e);return!!r&&o(r,"$"+t)},set:function(e,t,r){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new a("`O` is not an object");if("string"!=typeof t)throw new a("`slot` must be a string");var n=i.get(e);n||(n={},i.set(e,n)),n["$"+t]=r}};Object.freeze&&Object.freeze(s),e.exports=s},9446:(e,t,r)=>{"use strict";var n=r(1191)(),o=r(593)("Object.prototype.toString"),i=function(e){return!(n&&e&&"object"==typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===o(e)},a=function(e){return!!i(e)||null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==o(e)&&"[object Function]"===o(e.callee)},s=function(){return i(arguments)}();i.isLegacyArguments=a,e.exports=s?i:a},752:(e,t,r)=>{"use strict";var n=r(4373),o=r(593),i=r(7701),a=r(8915),s=i("ArrayBuffer",!0),u=i("Float32Array",!0),l=o("ArrayBuffer.prototype.byteLength",!0),c=s&&!l&&(new s).slice,f=c&&n(c);e.exports=l||f?function(e){if(!e||"object"!=typeof e)return!1;try{return l?l(e):f(e,0),!0}catch(e){return!1}}:u?function(e){try{return new u(e).buffer===e&&!a(e)}catch(t){return"object"==typeof e&&"RangeError"===t.name}}:function(e){return!1}},5238:(e,t,r)=>{"use strict";if(r(1405)()){var n=BigInt.prototype.valueOf;e.exports=function(e){return null!=e&&"boolean"!=typeof e&&"string"!=typeof e&&"number"!=typeof e&&"symbol"!=typeof e&&"function"!=typeof e&&("bigint"==typeof e||function(e){try{return n.call(e),!0}catch(e){}return!1}(e))}}else e.exports=function(e){return!1}},9046:(e,t,r)=>{"use strict";var n=r(593),o=n("Boolean.prototype.toString"),i=n("Object.prototype.toString"),a=r(1191)();e.exports=function(e){return"boolean"==typeof e||null!==e&&"object"==typeof e&&(a&&Symbol.toStringTag in e?function(e){try{return o(e),!0}catch(e){return!1}}(e):"[object Boolean]"===i(e))}},5212:e=>{function t(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}e.exports=function(e){return null!=e&&(t(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&t(e.slice(0,0))}(e)||!!e._isBuffer)}},1493:e=>{"use strict";var t,r,n=Function.prototype.toString,o="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof o&&"function"==typeof Object.defineProperty)try{t=Object.defineProperty({},"length",{get:function(){throw r}}),r={},o((function(){throw 42}),null,t)}catch(e){e!==r&&(o=null)}else o=null;var i=/^\s*class\b/,a=function(e){try{var t=n.call(e);return i.test(t)}catch(e){return!1}},s=function(e){try{return!a(e)&&(n.call(e),!0)}catch(e){return!1}},u=Object.prototype.toString,l="function"==typeof Symbol&&!!Symbol.toStringTag,c=!(0 in[,]),f=function(){return!1};if("object"==typeof document){var d=document.all;u.call(d)===u.call(document.all)&&(f=function(e){if((c||!e)&&(void 0===e||"object"==typeof e))try{var t=u.call(e);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==e("")}catch(e){}return!1})}e.exports=o?function(e){if(f(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;try{o(e,null,t)}catch(e){if(e!==r)return!1}return!a(e)&&s(e)}:function(e){if(f(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if(l)return s(e);if(a(e))return!1;var t=u.call(e);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&s(e)}},3258:(e,t,r)=>{"use strict";var n=Date.prototype.getDay,o=Object.prototype.toString,i=r(1191)();e.exports=function(e){return"object"==typeof e&&null!==e&&(i?function(e){try{return n.call(e),!0}catch(e){return!1}}(e):"[object Date]"===o.call(e))}},4477:(e,t,r)=>{"use strict";var n,o=Object.prototype.toString,i=Function.prototype.toString,a=/^\s*(?:function)?\*/,s=r(1191)(),u=Object.getPrototypeOf;e.exports=function(e){if("function"!=typeof e)return!1;if(a.test(i.call(e)))return!0;if(!s)return"[object GeneratorFunction]"===o.call(e);if(!u)return!1;if(void 0===n){var t=function(){if(!s)return!1;try{return Function("return function*() {}")()}catch(e){}}();n=!!t&&u(t)}return u(e)===n}},5588:e=>{"use strict";var t,r="function"==typeof Map&&Map.prototype?Map:null,n="function"==typeof Set&&Set.prototype?Set:null;r||(t=function(e){return!1});var o=r?Map.prototype.has:null,i=n?Set.prototype.has:null;t||o||(t=function(e){return!1}),e.exports=t||function(e){if(!e||"object"!=typeof e)return!1;try{if(o.call(e),i)try{i.call(e)}catch(e){return!0}return e instanceof r}catch(e){}return!1}},8903:e=>{"use strict";e.exports=function(e){return e!=e}},3054:(e,t,r)=>{"use strict";var n=r(4373),o=r(4347),i=r(8903),a=r(7713),s=r(3373),u=n(a(),Number);o(u,{getPolyfill:a,implementation:i,shim:s}),e.exports=u},7713:(e,t,r)=>{"use strict";var n=r(8903);e.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:n}},3373:(e,t,r)=>{"use strict";var n=r(4347),o=r(7713);e.exports=function(){var e=o();return n(Number,{isNaN:e},{isNaN:function(){return Number.isNaN!==e}}),e}},1698:(e,t,r)=>{"use strict";var n=Number.prototype.toString,o=Object.prototype.toString,i=r(1191)();e.exports=function(e){return"number"==typeof e||"object"==typeof e&&(i?function(e){try{return n.call(e),!0}catch(e){return!1}}(e):"[object Number]"===o.call(e))}},4803:(e,t,r)=>{"use strict";var n,o,i,a,s=r(593),u=r(1191)();if(u){n=s("Object.prototype.hasOwnProperty"),o=s("RegExp.prototype.exec"),i={};var l=function(){throw i};a={toString:l,valueOf:l},"symbol"==typeof Symbol.toPrimitive&&(a[Symbol.toPrimitive]=l)}var c=s("Object.prototype.toString"),f=Object.getOwnPropertyDescriptor;e.exports=u?function(e){if(!e||"object"!=typeof e)return!1;var t=f(e,"lastIndex");if(!t||!n(t,"value"))return!1;try{o(e,a)}catch(e){return e===i}}:function(e){return!(!e||"object"!=typeof e&&"function"!=typeof e)&&"[object RegExp]"===c(e)}},6157:e=>{"use strict";var t,r="function"==typeof Map&&Map.prototype?Map:null,n="function"==typeof Set&&Set.prototype?Set:null;n||(t=function(e){return!1});var o=r?Map.prototype.has:null,i=n?Set.prototype.has:null;t||i||(t=function(e){return!1}),e.exports=t||function(e){if(!e||"object"!=typeof e)return!1;try{if(i.call(e),o)try{o.call(e)}catch(e){return!0}return e instanceof n}catch(e){}return!1}},185:(e,t,r)=>{"use strict";var n=r(593)("SharedArrayBuffer.prototype.byteLength",!0);e.exports=n?function(e){if(!e||"object"!=typeof e)return!1;try{return n(e),!0}catch(e){return!1}}:function(e){return!1}},1753:(e,t,r)=>{"use strict";var n=String.prototype.valueOf,o=Object.prototype.toString,i=r(1191)();e.exports=function(e){return"string"==typeof e||"object"==typeof e&&(i?function(e){try{return n.call(e),!0}catch(e){return!1}}(e):"[object String]"===o.call(e))}},8247:(e,t,r)=>{"use strict";var n=Object.prototype.toString;if(r(8489)()){var o=Symbol.prototype.toString,i=/^Symbol\(.*\)$/;e.exports=function(e){if("symbol"==typeof e)return!0;if("[object Symbol]"!==n.call(e))return!1;try{return function(e){return"symbol"==typeof e.valueOf()&&i.test(o.call(e))}(e)}catch(e){return!1}}}else e.exports=function(e){return!1}},8915:(e,t,r)=>{"use strict";var n=r(8184),o=r(3604),i=r(593),a=i("Object.prototype.toString"),s=r(1191)(),u=r(3820),l="undefined"==typeof globalThis?r.g:globalThis,c=o(),f=i("Array.prototype.indexOf",!0)||function(e,t){for(var r=0;r<e.length;r+=1)if(e[r]===t)return r;return-1},d=i("String.prototype.slice"),g={},p=Object.getPrototypeOf;s&&u&&p&&n(c,(function(e){var t=new l[e];if(Symbol.toStringTag in t){var r=p(t),n=u(r,Symbol.toStringTag);if(!n){var o=p(r);n=u(o,Symbol.toStringTag)}g[e]=n.get}})),e.exports=function(e){if(!e||"object"!=typeof e)return!1;if(!s||!(Symbol.toStringTag in e)){var t=d(a(e),8,-1);return f(c,t)>-1}return!!u&&function(e){var t=!1;return n(g,(function(r,n){if(!t)try{t=r.call(e)===n}catch(e){}})),t}(e)}},2913:e=>{"use strict";var t,r="function"==typeof WeakMap&&WeakMap.prototype?WeakMap:null,n="function"==typeof WeakSet&&WeakSet.prototype?WeakSet:null;r||(t=function(e){return!1});var o=r?r.prototype.has:null,i=n?n.prototype.has:null;t||o||(t=function(e){return!1}),e.exports=t||function(e){if(!e||"object"!=typeof e)return!1;try{if(o.call(e,o),i)try{i.call(e,i)}catch(e){return!0}return e instanceof r}catch(e){}return!1}},9920:(e,t,r)=>{"use strict";var n=r(7701),o=r(593),i=n("%WeakSet%",!0),a=o("WeakSet.prototype.has",!0);if(a){var s=o("WeakMap.prototype.has",!0);e.exports=function(e){if(!e||"object"!=typeof e)return!1;try{if(a(e,a),s)try{s(e,s)}catch(e){return!0}return e instanceof i}catch(e){}return!1}}else e.exports=function(e){return!1}},9484:e=>{var t={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==t.call(e)}},6875:(e,t,r)=>{"use strict";const n=r(3502),o=Symbol("max"),i=Symbol("length"),a=Symbol("lengthCalculator"),s=Symbol("allowStale"),u=Symbol("maxAge"),l=Symbol("dispose"),c=Symbol("noDisposeOnSet"),f=Symbol("lruList"),d=Symbol("cache"),g=Symbol("updateAgeOnGet"),p=()=>1,h=(e,t,r)=>{const n=e[d].get(t);if(n){const t=n.value;if(y(e,t)){if(b(e,n),!e[s])return}else r&&(e[g]&&(n.value.now=Date.now()),e[f].unshiftNode(n));return t.value}},y=(e,t)=>{if(!t||!t.maxAge&&!e[u])return!1;const r=Date.now()-t.now;return t.maxAge?r>t.maxAge:e[u]&&r>e[u]},m=e=>{if(e[i]>e[o])for(let t=e[f].tail;e[i]>e[o]&&null!==t;){const r=t.prev;b(e,t),t=r}},b=(e,t)=>{if(t){const r=t.value;e[l]&&e[l](r.key,r.value),e[i]-=r.length,e[d].delete(r.key),e[f].removeNode(t)}};class _{constructor(e,t,r,n,o){this.key=e,this.value=t,this.length=r,this.now=n,this.maxAge=o||0}}const w=(e,t,r,n)=>{let o=r.value;y(e,o)&&(b(e,r),e[s]||(o=void 0)),o&&t.call(n,o.value,o.key,e)};e.exports=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[o]=e.max||1/0;const t=e.length||p;if(this[a]="function"!=typeof t?p:t,this[s]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[u]=e.maxAge||0,this[l]=e.dispose,this[c]=e.noDisposeOnSet||!1,this[g]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[o]=e||1/0,m(this)}get max(){return this[o]}set allowStale(e){this[s]=!!e}get allowStale(){return this[s]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[u]=e,m(this)}get maxAge(){return this[u]}set lengthCalculator(e){"function"!=typeof e&&(e=p),e!==this[a]&&(this[a]=e,this[i]=0,this[f].forEach((e=>{e.length=this[a](e.value,e.key),this[i]+=e.length}))),m(this)}get lengthCalculator(){return this[a]}get length(){return this[i]}get itemCount(){return this[f].length}rforEach(e,t){t=t||this;for(let r=this[f].tail;null!==r;){const n=r.prev;w(this,e,r,t),r=n}}forEach(e,t){t=t||this;for(let r=this[f].head;null!==r;){const n=r.next;w(this,e,r,t),r=n}}keys(){return this[f].toArray().map((e=>e.key))}values(){return this[f].toArray().map((e=>e.value))}reset(){this[l]&&this[f]&&this[f].length&&this[f].forEach((e=>this[l](e.key,e.value))),this[d]=new Map,this[f]=new n,this[i]=0}dump(){return this[f].map((e=>!y(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[f]}set(e,t,r){if((r=r||this[u])&&"number"!=typeof r)throw new TypeError("maxAge must be a number");const n=r?Date.now():0,s=this[a](t,e);if(this[d].has(e)){if(s>this[o])return b(this,this[d].get(e)),!1;const a=this[d].get(e).value;return this[l]&&(this[c]||this[l](e,a.value)),a.now=n,a.maxAge=r,a.value=t,this[i]+=s-a.length,a.length=s,this.get(e),m(this),!0}const g=new _(e,t,s,n,r);return g.length>this[o]?(this[l]&&this[l](e,t),!1):(this[i]+=g.length,this[f].unshift(g),this[d].set(e,this[f].head),m(this),!0)}has(e){if(!this[d].has(e))return!1;const t=this[d].get(e).value;return!y(this,t)}get(e){return h(this,e,!0)}peek(e){return h(this,e,!1)}pop(){const e=this[f].tail;return e?(b(this,e),e.value):null}del(e){b(this,this[d].get(e))}load(e){this.reset();const t=Date.now();for(let r=e.length-1;r>=0;r--){const n=e[r],o=n.e||0;if(0===o)this.set(n.k,n.v);else{const e=o-t;e>0&&this.set(n.k,n.v,e)}}}prune(){this[d].forEach(((e,t)=>h(this,t,!1)))}}},8432:e=>{"use strict";e.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}},3502:(e,t,r)=>{"use strict";function n(e){var t=this;if(t instanceof n||(t=new n),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach((function(e){t.push(e)}));else if(arguments.length>0)for(var r=0,o=arguments.length;r<o;r++)t.push(arguments[r]);return t}function o(e,t,r){var n=t===e.head?new s(r,null,t,e):new s(r,t,t.next,e);return null===n.next&&(e.tail=n),null===n.prev&&(e.head=n),e.length++,n}function i(e,t){e.tail=new s(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function a(e,t){e.head=new s(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function s(e,t,r,n){if(!(this instanceof s))return new s(e,t,r,n);this.list=n,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,r?(r.prev=this,this.next=r):this.next=null}e.exports=n,n.Node=s,n.create=n,n.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,r=e.prev;return t&&(t.prev=r),r&&(r.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=r),e.list.length--,e.next=null,e.prev=null,e.list=null,t},n.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}},n.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}},n.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)i(this,arguments[e]);return this.length},n.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)a(this,arguments[e]);return this.length},n.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}},n.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}},n.prototype.forEach=function(e,t){t=t||this;for(var r=this.head,n=0;null!==r;n++)e.call(t,r.value,n,this),r=r.next},n.prototype.forEachReverse=function(e,t){t=t||this;for(var r=this.tail,n=this.length-1;null!==r;n--)e.call(t,r.value,n,this),r=r.prev},n.prototype.get=function(e){for(var t=0,r=this.head;null!==r&&t<e;t++)r=r.next;if(t===e&&null!==r)return r.value},n.prototype.getReverse=function(e){for(var t=0,r=this.tail;null!==r&&t<e;t++)r=r.prev;if(t===e&&null!==r)return r.value},n.prototype.map=function(e,t){t=t||this;for(var r=new n,o=this.head;null!==o;)r.push(e.call(t,o.value,this)),o=o.next;return r},n.prototype.mapReverse=function(e,t){t=t||this;for(var r=new n,o=this.tail;null!==o;)r.push(e.call(t,o.value,this)),o=o.prev;return r},n.prototype.reduce=function(e,t){var r,n=this.head;if(arguments.length>1)r=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");n=this.head.next,r=this.head.value}for(var o=0;null!==n;o++)r=e(r,n.value,o),n=n.next;return r},n.prototype.reduceReverse=function(e,t){var r,n=this.tail;if(arguments.length>1)r=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");n=this.tail.prev,r=this.tail.value}for(var o=this.length-1;null!==n;o--)r=e(r,n.value,o),n=n.prev;return r},n.prototype.toArray=function(){for(var e=new Array(this.length),t=0,r=this.head;null!==r;t++)e[t]=r.value,r=r.next;return e},n.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,r=this.tail;null!==r;t++)e[t]=r.value,r=r.prev;return e},n.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new n;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var o=0,i=this.head;null!==i&&o<e;o++)i=i.next;for(;null!==i&&o<t;o++,i=i.next)r.push(i.value);return r},n.prototype.sliceReverse=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new n;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var o=this.length,i=this.tail;null!==i&&o>t;o--)i=i.prev;for(;null!==i&&o>e;o--,i=i.prev)r.push(i.value);return r},n.prototype.splice=function(e,t){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var r=0,n=this.head;null!==n&&r<e;r++)n=n.next;var i=[];for(r=0;n&&r<t;r++)i.push(n.value),n=this.removeNode(n);for(null===n&&(n=this.tail),n!==this.head&&n!==this.tail&&(n=n.prev),r=2;r<arguments.length;r++)n=o(this,n,arguments[r]);return i},n.prototype.reverse=function(){for(var e=this.head,t=this.tail,r=e;null!==r;r=r.prev){var n=r.prev;r.prev=r.next,r.next=n}return this.head=t,this.tail=e,this};try{r(8432)(n)}catch(e){}},3650:(e,t,r)=>{var n,o,i,a,s;n=r(2843),o=r(4366).utf8,i=r(5212),a=r(4366).bin,(s=function(e,t){e.constructor==String?e=t&&"binary"===t.encoding?a.stringToBytes(e):o.stringToBytes(e):i(e)?e=Array.prototype.slice.call(e,0):Array.isArray(e)||e.constructor===Uint8Array||(e=e.toString());for(var r=n.bytesToWords(e),u=8*e.length,l=1732584193,c=-271733879,f=-1732584194,d=271733878,g=0;g<r.length;g++)r[g]=16711935&(r[g]<<8|r[g]>>>24)|4278255360&(r[g]<<24|r[g]>>>8);r[u>>>5]|=128<<u%32,r[14+(u+64>>>9<<4)]=u;var p=s._ff,h=s._gg,y=s._hh,m=s._ii;for(g=0;g<r.length;g+=16){var b=l,_=c,w=f,E=d;l=p(l,c,f,d,r[g+0],7,-680876936),d=p(d,l,c,f,r[g+1],12,-389564586),f=p(f,d,l,c,r[g+2],17,606105819),c=p(c,f,d,l,r[g+3],22,-1044525330),l=p(l,c,f,d,r[g+4],7,-176418897),d=p(d,l,c,f,r[g+5],12,1200080426),f=p(f,d,l,c,r[g+6],17,-1473231341),c=p(c,f,d,l,r[g+7],22,-45705983),l=p(l,c,f,d,r[g+8],7,1770035416),d=p(d,l,c,f,r[g+9],12,-1958414417),f=p(f,d,l,c,r[g+10],17,-42063),c=p(c,f,d,l,r[g+11],22,-1990404162),l=p(l,c,f,d,r[g+12],7,1804603682),d=p(d,l,c,f,r[g+13],12,-40341101),f=p(f,d,l,c,r[g+14],17,-1502002290),l=h(l,c=p(c,f,d,l,r[g+15],22,1236535329),f,d,r[g+1],5,-165796510),d=h(d,l,c,f,r[g+6],9,-1069501632),f=h(f,d,l,c,r[g+11],14,643717713),c=h(c,f,d,l,r[g+0],20,-373897302),l=h(l,c,f,d,r[g+5],5,-701558691),d=h(d,l,c,f,r[g+10],9,38016083),f=h(f,d,l,c,r[g+15],14,-660478335),c=h(c,f,d,l,r[g+4],20,-405537848),l=h(l,c,f,d,r[g+9],5,568446438),d=h(d,l,c,f,r[g+14],9,-1019803690),f=h(f,d,l,c,r[g+3],14,-187363961),c=h(c,f,d,l,r[g+8],20,1163531501),l=h(l,c,f,d,r[g+13],5,-1444681467),d=h(d,l,c,f,r[g+2],9,-51403784),f=h(f,d,l,c,r[g+7],14,1735328473),l=y(l,c=h(c,f,d,l,r[g+12],20,-1926607734),f,d,r[g+5],4,-378558),d=y(d,l,c,f,r[g+8],11,-2022574463),f=y(f,d,l,c,r[g+11],16,1839030562),c=y(c,f,d,l,r[g+14],23,-35309556),l=y(l,c,f,d,r[g+1],4,-1530992060),d=y(d,l,c,f,r[g+4],11,1272893353),f=y(f,d,l,c,r[g+7],16,-155497632),c=y(c,f,d,l,r[g+10],23,-1094730640),l=y(l,c,f,d,r[g+13],4,681279174),d=y(d,l,c,f,r[g+0],11,-358537222),f=y(f,d,l,c,r[g+3],16,-722521979),c=y(c,f,d,l,r[g+6],23,76029189),l=y(l,c,f,d,r[g+9],4,-640364487),d=y(d,l,c,f,r[g+12],11,-421815835),f=y(f,d,l,c,r[g+15],16,530742520),l=m(l,c=y(c,f,d,l,r[g+2],23,-995338651),f,d,r[g+0],6,-198630844),d=m(d,l,c,f,r[g+7],10,1126891415),f=m(f,d,l,c,r[g+14],15,-1416354905),c=m(c,f,d,l,r[g+5],21,-57434055),l=m(l,c,f,d,r[g+12],6,1700485571),d=m(d,l,c,f,r[g+3],10,-1894986606),f=m(f,d,l,c,r[g+10],15,-1051523),c=m(c,f,d,l,r[g+1],21,-2054922799),l=m(l,c,f,d,r[g+8],6,1873313359),d=m(d,l,c,f,r[g+15],10,-30611744),f=m(f,d,l,c,r[g+6],15,-1560198380),c=m(c,f,d,l,r[g+13],21,1309151649),l=m(l,c,f,d,r[g+4],6,-145523070),d=m(d,l,c,f,r[g+11],10,-1120210379),f=m(f,d,l,c,r[g+2],15,718787259),c=m(c,f,d,l,r[g+9],21,-343485551),l=l+b>>>0,c=c+_>>>0,f=f+w>>>0,d=d+E>>>0}return n.endian([l,c,f,d])})._ff=function(e,t,r,n,o,i,a){var s=e+(t&r|~t&n)+(o>>>0)+a;return(s<<i|s>>>32-i)+t},s._gg=function(e,t,r,n,o,i,a){var s=e+(t&n|r&~n)+(o>>>0)+a;return(s<<i|s>>>32-i)+t},s._hh=function(e,t,r,n,o,i,a){var s=e+(t^r^n)+(o>>>0)+a;return(s<<i|s>>>32-i)+t},s._ii=function(e,t,r,n,o,i,a){var s=e+(r^(t|~n))+(o>>>0)+a;return(s<<i|s>>>32-i)+t},s._blocksize=16,s._digestsize=16,e.exports=function(e,t){if(null==e)throw new Error("Illegal argument "+e);var r=n.wordsToBytes(s(e,t));return t&&t.asBytes?r:t&&t.asString?a.bytesToString(r):n.bytesToHex(r)}},5584:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2858),o=r(1224),i=n.constants.S_IFMT,a=n.constants.S_IFDIR,s=n.constants.S_IFREG,u=n.constants.S_IFBLK,l=n.constants.S_IFCHR,c=n.constants.S_IFLNK,f=n.constants.S_IFIFO,d=n.constants.S_IFSOCK,g=function(){function e(){this.name="",this.mode=0}return e.build=function(t,r){var n=new e,i=t.getNode().mode;return n.name=o.strToEncoding(t.getName(),r),n.mode=i,n},e.prototype._checkModeProperty=function(e){return(this.mode&i)===e},e.prototype.isDirectory=function(){return this._checkModeProperty(a)},e.prototype.isFile=function(){return this._checkModeProperty(s)},e.prototype.isBlockDevice=function(){return this._checkModeProperty(u)},e.prototype.isCharacterDevice=function(){return this._checkModeProperty(l)},e.prototype.isSymbolicLink=function(){return this._checkModeProperty(c)},e.prototype.isFIFO=function(){return this._checkModeProperty(f)},e.prototype.isSocket=function(){return this._checkModeProperty(d)},e}();t.Dirent=g,t.default=g},8895:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2858),o=r(5497),i=n.constants.S_IFMT,a=n.constants.S_IFDIR,s=n.constants.S_IFREG,u=n.constants.S_IFBLK,l=n.constants.S_IFCHR,c=n.constants.S_IFLNK,f=n.constants.S_IFIFO,d=n.constants.S_IFSOCK,g=function(){function e(){}return e.build=function(t,r){void 0===r&&(r=!1);var n=new e,i=t.uid,a=t.gid,s=t.atime,u=t.mtime,l=t.ctime,c=r?o.default:function(e){return e};n.uid=c(i),n.gid=c(a),n.rdev=c(0),n.blksize=c(4096),n.ino=c(t.ino),n.size=c(t.getSize()),n.blocks=c(1),n.atime=s,n.mtime=u,n.ctime=l,n.birthtime=l,n.atimeMs=c(s.getTime()),n.mtimeMs=c(u.getTime());var f=c(l.getTime());return n.ctimeMs=f,n.birthtimeMs=f,n.dev=c(0),n.mode=c(t.mode),n.nlink=c(t.nlink),n},e.prototype._checkModeProperty=function(e){return(Number(this.mode)&i)===e},e.prototype.isDirectory=function(){return this._checkModeProperty(a)},e.prototype.isFile=function(){return this._checkModeProperty(s)},e.prototype.isBlockDevice=function(){return this._checkModeProperty(u)},e.prototype.isCharacterDevice=function(){return this._checkModeProperty(l)},e.prototype.isSymbolicLink=function(){return this._checkModeProperty(c)},e.prototype.isFIFO=function(){return this._checkModeProperty(f)},e.prototype.isSocket=function(){return this._checkModeProperty(d)},e}();t.Stats=g,t.default=g},2858:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.constants={O_RDONLY:0,O_WRONLY:1,O_RDWR:2,S_IFMT:61440,S_IFREG:32768,S_IFDIR:16384,S_IFCHR:8192,S_IFBLK:24576,S_IFIFO:4096,S_IFLNK:40960,S_IFSOCK:49152,O_CREAT:64,O_EXCL:128,O_NOCTTY:256,O_TRUNC:512,O_APPEND:1024,O_DIRECTORY:65536,O_NOATIME:262144,O_NOFOLLOW:131072,O_SYNC:1052672,O_DIRECT:16384,O_NONBLOCK:2048,S_IRWXU:448,S_IRUSR:256,S_IWUSR:128,S_IXUSR:64,S_IRWXG:56,S_IRGRP:32,S_IWGRP:16,S_IXGRP:8,S_IRWXO:7,S_IROTH:4,S_IWOTH:2,S_IXOTH:1,F_OK:0,R_OK:4,W_OK:2,X_OK:1,UV_FS_SYMLINK_DIR:1,UV_FS_SYMLINK_JUNCTION:2,UV_FS_COPYFILE_EXCL:1,UV_FS_COPYFILE_FICLONE:2,UV_FS_COPYFILE_FICLONE_FORCE:4,COPYFILE_EXCL:1,COPYFILE_FICLONE:2,COPYFILE_FICLONE_FORCE:4}},1224:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(6018),o=r(5921);t.ENCODING_UTF8="utf8",t.assertEncoding=function(e){if(e&&!n.Buffer.isEncoding(e))throw new o.TypeError("ERR_INVALID_OPT_VALUE_ENCODING",e)},t.strToEncoding=function(e,r){return r&&r!==t.ENCODING_UTF8?"buffer"===r?new n.Buffer(e):new n.Buffer(e).toString(r):e}},5497:(e,t)=>{"function"==typeof BigInt?t.default=BigInt:t.default=function(){throw new Error("BigInt is not supported in this environment.")}},1275:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var o=r(8895),i=r(5584),a=r(376),s=r(2125),u=s.fsSyncMethods,l=s.fsAsyncMethods,c=r(2858),f=c.constants.F_OK,d=c.constants.R_OK,g=c.constants.W_OK,p=c.constants.X_OK;function h(e){for(var t={F_OK:f,R_OK:d,W_OK:g,X_OK:p,constants:c.constants,Stats:o.default,Dirent:i.default},r=0,n=u;r<n.length;r++)"function"==typeof e[y=n[r]]&&(t[y]=e[y].bind(e));for(var s=0,h=l;s<h.length;s++){var y;"function"==typeof e[y=h[s]]&&(t[y]=e[y].bind(e))}return t.StatWatcher=e.StatWatcher,t.FSWatcher=e.FSWatcher,t.WriteStream=e.WriteStream,t.ReadStream=e.ReadStream,t.promises=e.promises,t._toUnixTimestamp=a.toUnixTimestamp,t}t.Volume=a.Volume,t.vol=new a.Volume,t.createFsFromVolume=h,t.fs=h(t.vol),e.exports=n(n({},e.exports),t.fs),e.exports.semantic=!0},6018:function(e,t,r){"use strict";var n=this&&this.__spreadArrays||function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),o=0;for(t=0;t<r;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,o++)n[o]=i[a];return n};Object.defineProperty(t,"__esModule",{value:!0});var o=r(9033);function i(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return new(o.Buffer.bind.apply(o.Buffer,n([void 0,e],t)))}t.Buffer=o.Buffer;var a=o.Buffer.allocUnsafe||i;t.bufferAllocUnsafe=a;var s=o.Buffer.from||i;t.bufferFrom=s},5921:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var i=r(4475),a=r(5058),s="undefined"==typeof Symbol?"_kCode":Symbol("code"),u={};function l(e){return function(e){function t(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];var o=e.call(this,f(t,r))||this;return o.code=t,o[s]=t,o.name=e.prototype.name+" ["+o[s]+"]",o}return o(t,e),t}(e)}var c=function(e){function r(r){var n=this;if("object"!=typeof r||null===r)throw new t.TypeError("ERR_INVALID_ARG_TYPE","options","object");return(n=r.message?e.call(this,r.message)||this:e.call(this,a.inspect(r.actual).slice(0,128)+" "+r.operator+" "+a.inspect(r.expected).slice(0,128))||this).generatedMessage=!r.message,n.name="AssertionError [ERR_ASSERTION]",n.code="ERR_ASSERTION",n.actual=r.actual,n.expected=r.expected,n.operator=r.operator,t.Error.captureStackTrace(n,r.stackStartFunction),n}return o(r,e),r}(r.g.Error);function f(e,t){i.strictEqual(typeof e,"string");var r,n=u[e];if(i(n,"An invalid error message key was used: "+e+"."),"function"==typeof n)r=n;else{if(r=a.format,void 0===t||0===t.length)return n;t.unshift(n)}return String(r.apply(null,t))}function d(e,t){u[e]="function"==typeof t?t:String(t)}function g(e,t){if(i(e,"expected is required"),i("string"==typeof t,"thing is required"),Array.isArray(e)){var r=e.length;return i(r>0,"At least one expected value needs to be specified"),e=e.map((function(e){return String(e)})),r>2?"one of "+t+" "+e.slice(0,r-1).join(", ")+", or "+e[r-1]:2===r?"one of "+t+" "+e[0]+" or "+e[1]:"of "+t+" "+e[0]}return"of "+t+" "+String(e)}t.AssertionError=c,t.message=f,t.E=d,t.Error=l(r.g.Error),t.TypeError=l(r.g.TypeError),t.RangeError=l(r.g.RangeError),d("ERR_ARG_NOT_ITERABLE","%s must be iterable"),d("ERR_ASSERTION","%s"),d("ERR_BUFFER_OUT_OF_BOUNDS",(function(e,t){return t?"Attempt to write outside buffer bounds":'"'+e+'" is outside of buffer bounds'})),d("ERR_CHILD_CLOSED_BEFORE_REPLY","Child closed before reply received"),d("ERR_CONSOLE_WRITABLE_STREAM","Console expects a writable stream instance for %s"),d("ERR_CPU_USAGE","Unable to obtain cpu usage %s"),d("ERR_DNS_SET_SERVERS_FAILED",(function(e,t){return'c-ares failed to set servers: "'+e+'" ['+t+"]"})),d("ERR_FALSY_VALUE_REJECTION","Promise was rejected with falsy value"),d("ERR_ENCODING_NOT_SUPPORTED",(function(e){return'The "'+e+'" encoding is not supported'})),d("ERR_ENCODING_INVALID_ENCODED_DATA",(function(e){return"The encoded data was not valid for encoding "+e})),d("ERR_HTTP_HEADERS_SENT","Cannot render headers after they are sent to the client"),d("ERR_HTTP_INVALID_STATUS_CODE","Invalid status code: %s"),d("ERR_HTTP_TRAILER_INVALID","Trailers are invalid with this transfer encoding"),d("ERR_INDEX_OUT_OF_RANGE","Index out of range"),d("ERR_INVALID_ARG_TYPE",(function(e,t,r){var n,o;if(i(e,"name is required"),t.includes("not ")?(n="must not be",t=t.split("not ")[1]):n="must be",Array.isArray(e))o="The "+e.map((function(e){return'"'+e+'"'})).join(", ")+" arguments "+n+" "+g(t,"type");else if(e.includes(" argument"))o="The "+e+" "+n+" "+g(t,"type");else{var a=e.includes(".")?"property":"argument";o='The "'+e+'" '+a+" "+n+" "+g(t,"type")}return arguments.length>=3&&(o+=". Received type "+(null!==r?typeof r:"null")),o})),d("ERR_INVALID_ARRAY_LENGTH",(function(e,t,r){return i.strictEqual(typeof r,"number"),'The array "'+e+'" (length '+r+") must be of length "+t+"."})),d("ERR_INVALID_BUFFER_SIZE","Buffer size must be a multiple of %s"),d("ERR_INVALID_CALLBACK","Callback must be a function"),d("ERR_INVALID_CHAR","Invalid character in %s"),d("ERR_INVALID_CURSOR_POS","Cannot set cursor row without setting its column"),d("ERR_INVALID_FD",'"fd" must be a positive integer: %s'),d("ERR_INVALID_FILE_URL_HOST",'File URL host must be "localhost" or empty on %s'),d("ERR_INVALID_FILE_URL_PATH","File URL path %s"),d("ERR_INVALID_HANDLE_TYPE","This handle type cannot be sent"),d("ERR_INVALID_IP_ADDRESS","Invalid IP address: %s"),d("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+String(t)+'" is invalid for option "'+e+'"'})),d("ERR_INVALID_OPT_VALUE_ENCODING",(function(e){return'The value "'+String(e)+'" is invalid for option "encoding"'})),d("ERR_INVALID_REPL_EVAL_CONFIG",'Cannot specify both "breakEvalOnSigint" and "eval" for REPL'),d("ERR_INVALID_SYNC_FORK_INPUT","Asynchronous forks do not support Buffer, Uint8Array or string input: %s"),d("ERR_INVALID_THIS",'Value of "this" must be of type %s'),d("ERR_INVALID_TUPLE","%s must be an iterable %s tuple"),d("ERR_INVALID_URL","Invalid URL: %s"),d("ERR_INVALID_URL_SCHEME",(function(e){return"The URL must be "+g(e,"scheme")})),d("ERR_IPC_CHANNEL_CLOSED","Channel closed"),d("ERR_IPC_DISCONNECTED","IPC channel is already disconnected"),d("ERR_IPC_ONE_PIPE","Child process can have only one IPC pipe"),d("ERR_IPC_SYNC_FORK","IPC cannot be used with synchronous forks"),d("ERR_MISSING_ARGS",(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];i(e.length>0,"At least one arg needs to be specified");var r="The ",n=e.length;switch(e=e.map((function(e){return'"'+e+'"'})),n){case 1:r+=e[0]+" argument";break;case 2:r+=e[0]+" and "+e[1]+" arguments";break;default:r+=e.slice(0,n-1).join(", "),r+=", and "+e[n-1]+" arguments"}return r+" must be specified"})),d("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),d("ERR_NAPI_CONS_FUNCTION","Constructor must be a function"),d("ERR_NAPI_CONS_PROTOTYPE_OBJECT","Constructor.prototype must be an object"),d("ERR_NO_CRYPTO","Node.js is not compiled with OpenSSL crypto support"),d("ERR_NO_LONGER_SUPPORTED","%s is no longer supported"),d("ERR_PARSE_HISTORY_DATA","Could not parse history data in %s"),d("ERR_SOCKET_ALREADY_BOUND","Socket is already bound"),d("ERR_SOCKET_BAD_PORT","Port should be > 0 and < 65536"),d("ERR_SOCKET_BAD_TYPE","Bad socket type specified. Valid types are: udp4, udp6"),d("ERR_SOCKET_CANNOT_SEND","Unable to send data"),d("ERR_SOCKET_CLOSED","Socket is closed"),d("ERR_SOCKET_DGRAM_NOT_RUNNING","Not running"),d("ERR_STDERR_CLOSE","process.stderr cannot be closed"),d("ERR_STDOUT_CLOSE","process.stdout cannot be closed"),d("ERR_STREAM_WRAP","Stream has StringDecoder set or is in objectMode"),d("ERR_TLS_CERT_ALTNAME_INVALID","Hostname/IP does not match certificate's altnames: %s"),d("ERR_TLS_DH_PARAM_SIZE",(function(e){return"DH parameter size "+e+" is less than 2048"})),d("ERR_TLS_HANDSHAKE_TIMEOUT","TLS handshake timeout"),d("ERR_TLS_RENEGOTIATION_FAILED","Failed to renegotiate"),d("ERR_TLS_REQUIRED_SERVER_NAME",'"servername" is required parameter for Server.addContext'),d("ERR_TLS_SESSION_ATTACK","TSL session renegotiation attack detected"),d("ERR_TRANSFORM_ALREADY_TRANSFORMING","Calling transform done when still transforming"),d("ERR_TRANSFORM_WITH_LENGTH_0","Calling transform done when writableState.length != 0"),d("ERR_UNKNOWN_ENCODING","Unknown encoding: %s"),d("ERR_UNKNOWN_SIGNAL","Unknown signal: %s"),d("ERR_UNKNOWN_STDIN_TYPE","Unknown stdin file type"),d("ERR_UNKNOWN_STREAM_TYPE","Unknown stream file type"),d("ERR_V8BREAKITERATOR","Full ICU data not installed. See https://github.com/nodejs/node/wiki/Intl")},4184:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var i=r(1317),a=r(6018),s=r(2858),u=r(8291),l=r(8895),c=s.constants.S_IFMT,f=s.constants.S_IFDIR,d=s.constants.S_IFREG,g=s.constants.S_IFLNK,p=s.constants.O_APPEND;t.SEP="/";var h=function(e){function t(t,r){void 0===r&&(r=438);var n=e.call(this)||this;return n.uid=i.default.getuid(),n.gid=i.default.getgid(),n.atime=new Date,n.mtime=new Date,n.ctime=new Date,n.perm=438,n.mode=d,n.nlink=1,n.perm=r,n.mode|=r,n.ino=t,n}return o(t,e),t.prototype.getString=function(e){return void 0===e&&(e="utf8"),this.getBuffer().toString(e)},t.prototype.setString=function(e){this.buf=a.bufferFrom(e,"utf8"),this.touch()},t.prototype.getBuffer=function(){return this.buf||this.setBuffer(a.bufferAllocUnsafe(0)),a.bufferFrom(this.buf)},t.prototype.setBuffer=function(e){this.buf=a.bufferFrom(e),this.touch()},t.prototype.getSize=function(){return this.buf?this.buf.length:0},t.prototype.setModeProperty=function(e){this.mode=this.mode&~c|e},t.prototype.setIsFile=function(){this.setModeProperty(d)},t.prototype.setIsDirectory=function(){this.setModeProperty(f)},t.prototype.setIsSymlink=function(){this.setModeProperty(g)},t.prototype.isFile=function(){return(this.mode&c)===d},t.prototype.isDirectory=function(){return(this.mode&c)===f},t.prototype.isSymlink=function(){return(this.mode&c)===g},t.prototype.makeSymlink=function(e){this.symlink=e,this.setIsSymlink()},t.prototype.write=function(e,t,r,n){if(void 0===t&&(t=0),void 0===r&&(r=e.length),void 0===n&&(n=0),this.buf||(this.buf=a.bufferAllocUnsafe(0)),n+r>this.buf.length){var o=a.bufferAllocUnsafe(n+r);this.buf.copy(o,0,0,this.buf.length),this.buf=o}return e.copy(this.buf,n,t,t+r),this.touch(),r},t.prototype.read=function(e,t,r,n){void 0===t&&(t=0),void 0===r&&(r=e.byteLength),void 0===n&&(n=0),this.buf||(this.buf=a.bufferAllocUnsafe(0));var o=r;return o>e.byteLength&&(o=e.byteLength),o+n>this.buf.length&&(o=this.buf.length-n),this.buf.copy(e,t,n,n+o),o},t.prototype.truncate=function(e){if(void 0===e&&(e=0),e)if(this.buf||(this.buf=a.bufferAllocUnsafe(0)),e<=this.buf.length)this.buf=this.buf.slice(0,e);else{var t=a.bufferAllocUnsafe(0);this.buf.copy(t),t.fill(0,e)}else this.buf=a.bufferAllocUnsafe(0);this.touch()},t.prototype.chmod=function(e){this.perm=e,this.mode=-512&this.mode|e,this.touch()},t.prototype.chown=function(e,t){this.uid=e,this.gid=t,this.touch()},t.prototype.touch=function(){this.mtime=new Date,this.emit("change",this)},t.prototype.canRead=function(e,t){return void 0===e&&(e=i.default.getuid()),void 0===t&&(t=i.default.getgid()),!!(4&this.perm)||!!(t===this.gid&&32&this.perm)||!!(e===this.uid&&256&this.perm)},t.prototype.canWrite=function(e,t){return void 0===e&&(e=i.default.getuid()),void 0===t&&(t=i.default.getgid()),!!(2&this.perm)||!!(t===this.gid&&16&this.perm)||!!(e===this.uid&&128&this.perm)},t.prototype.del=function(){this.emit("delete",this)},t.prototype.toJSON=function(){return{ino:this.ino,uid:this.uid,gid:this.gid,atime:this.atime.getTime(),mtime:this.mtime.getTime(),ctime:this.ctime.getTime(),perm:this.perm,mode:this.mode,nlink:this.nlink,symlink:this.symlink,data:this.getString()}},t}(u.EventEmitter);t.Node=h;var y=function(e){function r(t,r,n){var o=e.call(this)||this;return o.children={},o.steps=[],o.ino=0,o.length=0,o.vol=t,o.parent=r,o.steps=r?r.steps.concat([n]):[n],o}return o(r,e),r.prototype.setNode=function(e){this.node=e,this.ino=e.ino},r.prototype.getNode=function(){return this.node},r.prototype.createChild=function(e,t){void 0===t&&(t=this.vol.createNode());var n=new r(this.vol,this,e);return n.setNode(t),t.isDirectory(),this.setChild(e,n),n},r.prototype.setChild=function(e,t){return void 0===t&&(t=new r(this.vol,this,e)),this.children[e]=t,t.parent=this,this.length++,this.emit("child:add",t,this),t},r.prototype.deleteChild=function(e){delete this.children[e.getName()],this.length--,this.emit("child:delete",e,this)},r.prototype.getChild=function(e){if(Object.hasOwnProperty.call(this.children,e))return this.children[e]},r.prototype.getPath=function(){return this.steps.join(t.SEP)},r.prototype.getName=function(){return this.steps[this.steps.length-1]},r.prototype.walk=function(e,t,r){if(void 0===t&&(t=e.length),void 0===r&&(r=0),r>=e.length)return this;if(r>=t)return this;var n=e[r],o=this.getChild(n);return o?o.walk(e,t,r+1):null},r.prototype.toJSON=function(){return{steps:this.steps,ino:this.ino,children:Object.keys(this.children)}},r}(u.EventEmitter);t.Link=y;var m=function(){function e(e,t,r,n){this.position=0,this.link=e,this.node=t,this.flags=r,this.fd=n}return e.prototype.getString=function(e){return void 0===e&&(e="utf8"),this.node.getString()},e.prototype.setString=function(e){this.node.setString(e)},e.prototype.getBuffer=function(){return this.node.getBuffer()},e.prototype.setBuffer=function(e){this.node.setBuffer(e)},e.prototype.getSize=function(){return this.node.getSize()},e.prototype.truncate=function(e){this.node.truncate(e)},e.prototype.seekTo=function(e){this.position=e},e.prototype.stats=function(){return l.default.build(this.node)},e.prototype.write=function(e,t,r,n){void 0===t&&(t=0),void 0===r&&(r=e.length),"number"!=typeof n&&(n=this.position),this.flags&p&&(n=this.getSize());var o=this.node.write(e,t,r,n);return this.position=n+o,o},e.prototype.read=function(e,t,r,n){void 0===t&&(t=0),void 0===r&&(r=e.byteLength),"number"!=typeof n&&(n=this.position);var o=this.node.read(e,t,r,n);return this.position=n+o,o},e.prototype.chmod=function(e){this.node.chmod(e)},e.prototype.chown=function(e,t){this.node.chown(e,t)},e}();t.File=m},1317:(e,t,r)=>{"use strict";var n=r(9142);function o(){var e=function(){if(void 0!==n)return n;try{return r(9142)}catch(e){return}}()||{};return e.getuid||(e.getuid=function(){return 0}),e.getgid||(e.getgid=function(){return 0}),e.cwd||(e.cwd=function(){return"/"}),e.nextTick||(e.nextTick=r(4069).default),e.emitWarning||(e.emitWarning=function(e,t){console.warn(t+(t?": ":"")+e)}),e.env||(e.env={}),e}Object.defineProperty(t,"__esModule",{value:!0}),t.createProcess=o,t.default=o()},859:function(e,t){"use strict";var r=this&&this.__spreadArrays||function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),o=0;for(t=0;t<r;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,o++)n[o]=i[a];return n};function n(e,t,n){return void 0===n&&(n=function(e){return e}),function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];return new Promise((function(i,a){e[t].bind(e).apply(void 0,r(o,[function(e,t){return e?a(e):i(n(t))}]))}))}}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){this.vol=e,this.fd=t}return e.prototype.appendFile=function(e,t){return n(this.vol,"appendFile")(this.fd,e,t)},e.prototype.chmod=function(e){return n(this.vol,"fchmod")(this.fd,e)},e.prototype.chown=function(e,t){return n(this.vol,"fchown")(this.fd,e,t)},e.prototype.close=function(){return n(this.vol,"close")(this.fd)},e.prototype.datasync=function(){return n(this.vol,"fdatasync")(this.fd)},e.prototype.read=function(e,t,r,o){return n(this.vol,"read",(function(t){return{bytesRead:t,buffer:e}}))(this.fd,e,t,r,o)},e.prototype.readFile=function(e){return n(this.vol,"readFile")(this.fd,e)},e.prototype.stat=function(e){return n(this.vol,"fstat")(this.fd,e)},e.prototype.sync=function(){return n(this.vol,"fsync")(this.fd)},e.prototype.truncate=function(e){return n(this.vol,"ftruncate")(this.fd,e)},e.prototype.utimes=function(e,t){return n(this.vol,"futimes")(this.fd,e,t)},e.prototype.write=function(e,t,r,o){return n(this.vol,"write",(function(t){return{bytesWritten:t,buffer:e}}))(this.fd,e,t,r,o)},e.prototype.writeFile=function(e,t){return n(this.vol,"writeFile")(this.fd,e,t)},e}();t.FileHandle=o,t.default=function(e){return"undefined"==typeof Promise?null:{FileHandle:o,access:function(t,r){return n(e,"access")(t,r)},appendFile:function(t,r,i){return n(e,"appendFile")(t instanceof o?t.fd:t,r,i)},chmod:function(t,r){return n(e,"chmod")(t,r)},chown:function(t,r,o){return n(e,"chown")(t,r,o)},copyFile:function(t,r,o){return n(e,"copyFile")(t,r,o)},lchmod:function(t,r){return n(e,"lchmod")(t,r)},lchown:function(t,r,o){return n(e,"lchown")(t,r,o)},link:function(t,r){return n(e,"link")(t,r)},lstat:function(t,r){return n(e,"lstat")(t,r)},mkdir:function(t,r){return n(e,"mkdir")(t,r)},mkdtemp:function(t,r){return n(e,"mkdtemp")(t,r)},open:function(t,r,i){return n(e,"open",(function(t){return new o(e,t)}))(t,r,i)},readdir:function(t,r){return n(e,"readdir")(t,r)},readFile:function(t,r){return n(e,"readFile")(t instanceof o?t.fd:t,r)},readlink:function(t,r){return n(e,"readlink")(t,r)},realpath:function(t,r){return n(e,"realpath")(t,r)},rename:function(t,r){return n(e,"rename")(t,r)},rmdir:function(t){return n(e,"rmdir")(t)},stat:function(t,r){return n(e,"stat")(t,r)},symlink:function(t,r,o){return n(e,"symlink")(t,r,o)},truncate:function(t,r){return n(e,"truncate")(t,r)},unlink:function(t){return n(e,"unlink")(t)},utimes:function(t,r,o){return n(e,"utimes")(t,r,o)},writeFile:function(t,r,i){return n(e,"writeFile")(t instanceof o?t.fd:t,r,i)}}}},4069:(e,t,r)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),n="function"==typeof setImmediate?setImmediate.bind(r.g):setTimeout.bind(r.g),t.default=n},338:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r){var n=setTimeout.apply(null,arguments);return n&&"object"==typeof n&&"function"==typeof n.unref&&n.unref(),n}},376:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__spreadArrays||function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),o=0;for(t=0;t<r;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,o++)n[o]=i[a];return n};Object.defineProperty(t,"__esModule",{value:!0});var a,s,u=r(5724),l=r(4184),c=r(8895),f=r(5584),d=r(6018),g=r(4069),p=r(1317),h=r(338),y=r(7245),m=r(2858),b=r(8291),_=r(1224),w=r(5921),E=r(5058),v=r(859),S=u.resolve,T=m.constants.O_RDONLY,O=m.constants.O_WRONLY,A=m.constants.O_RDWR,I=m.constants.O_CREAT,R=m.constants.O_EXCL,N=m.constants.O_TRUNC,D=m.constants.O_APPEND,j=m.constants.O_SYNC,k=m.constants.O_DIRECTORY,C=m.constants.F_OK,M=m.constants.COPYFILE_EXCL,L=m.constants.COPYFILE_FICLONE_FORCE;if(u.posix){var x=u.posix;a=x.sep,s=x.relative}else a=u.sep,s=u.relative;var B,F="win32"===p.default.platform,U={PATH_STR:"path must be a string or Buffer",FD:"fd must be a file descriptor",MODE_INT:"mode must be an int",CB:"callback must be a function",UID:"uid must be an unsigned int",GID:"gid must be an unsigned int",LEN:"len must be an integer",ATIME:"atime must be an integer",MTIME:"mtime must be an integer",PREFIX:"filename prefix is required",BUFFER:"buffer must be an instance of Buffer or StaticBuffer",OFFSET:"offset must be an integer",LENGTH:"length must be an integer",POSITION:"position must be an integer"},P=function(e){return"Expected options to be either an object or a string, but got "+e+" instead"},W="ENOENT",H="EBADF",z="EINVAL",V="EEXIST",$="ENOTDIR",q="EMFILE",G="EACCES",Y="EISDIR",Z="ENOTEMPTY",K="ENOSYS";function J(e,t,r,n,o){void 0===t&&(t=""),void 0===r&&(r=""),void 0===n&&(n=""),void 0===o&&(o=Error);var i=new o(function(e,t,r,n){void 0===t&&(t=""),void 0===r&&(r=""),void 0===n&&(n="");var o="";switch(r&&(o=" '"+r+"'"),n&&(o+=" -> '"+n+"'"),e){case W:return"ENOENT: no such file or directory, "+t+o;case H:return"EBADF: bad file descriptor, "+t+o;case z:return"EINVAL: invalid argument, "+t+o;case"EPERM":return"EPERM: operation not permitted, "+t+o;case"EPROTO":return"EPROTO: protocol error, "+t+o;case V:return"EEXIST: file already exists, "+t+o;case $:return"ENOTDIR: not a directory, "+t+o;case Y:return"EISDIR: illegal operation on a directory, "+t+o;case G:return"EACCES: permission denied, "+t+o;case Z:return"ENOTEMPTY: directory not empty, "+t+o;case q:return"EMFILE: too many open files, "+t+o;case K:return"ENOSYS: function not implemented, "+t+o;default:return e+": error occurred, "+t+o}}(e,t,r,n));return i.code=e,i}function X(e){if("number"==typeof e)return e;if("string"==typeof e){var t=B[e];if(void 0!==t)return t}throw new w.TypeError("ERR_INVALID_OPT_VALUE","flags",e)}function Q(e,t){var r;if(!t)return e;var n=typeof t;switch(n){case"string":r=Object.assign({},e,{encoding:t});break;case"object":r=Object.assign({},e,t);break;default:throw TypeError(P(n))}return"buffer"!==r.encoding&&_.assertEncoding(r.encoding),r}function ee(e){return function(t){return Q(e,t)}}function te(e){if("function"!=typeof e)throw TypeError(U.CB);return e}function re(e){return function(t,r){return"function"==typeof t?[e(),t]:[e(t),te(r)]}}!function(e){e[e.r=T]="r",e[e["r+"]=A]="r+",e[e.rs=T|j]="rs",e[e.sr=e.rs]="sr",e[e["rs+"]=A|j]="rs+",e[e["sr+"]=e["rs+"]]="sr+",e[e.w=O|I|N]="w",e[e.wx=O|I|N|R]="wx",e[e.xw=e.wx]="xw",e[e["w+"]=A|I|N]="w+",e[e["wx+"]=A|I|N|R]="wx+",e[e["xw+"]=e["wx+"]]="xw+",e[e.a=O|D|I]="a",e[e.ax=O|D|I|R]="ax",e[e.xa=e.ax]="xa",e[e["a+"]=A|D|I]="a+",e[e["ax+"]=A|D|I|R]="ax+",e[e["xa+"]=e["ax+"]]="xa+"}(B=t.FLAGS||(t.FLAGS={})),t.flagsToNumber=X;var ne={encoding:"utf8"},oe=ee(ne),ie=re(oe),ae=ee({flag:"r"}),se={encoding:"utf8",mode:438,flag:B[B.w]},ue=ee(se),le={encoding:"utf8",mode:438,flag:B[B.a]},ce=ee(le),fe=re(ce),de=ee(ne),ge=re(de),pe={mode:511,recursive:!1},he=function(e){return"number"==typeof e?Object.assign({},pe,{mode:e}):Object.assign({},pe,e)},ye={recursive:!1},me=function(e){return Object.assign({},ye,e)},be=ee({encoding:"utf8",withFileTypes:!1}),_e=re(be),we={bigint:!1},Ee=function(e){return void 0===e&&(e={}),Object.assign({},we,e)},ve=function(e,t){return"function"==typeof e?[Ee(),e]:[Ee(e),te(t)]};function Se(e){if("string"!=typeof e&&!d.Buffer.isBuffer(e)){try{if(!(e instanceof r(8119).URL))throw new TypeError(U.PATH_STR)}catch(e){throw new TypeError(U.PATH_STR)}e=function(e){if(""!==e.hostname)throw new w.TypeError("ERR_INVALID_FILE_URL_HOST",p.default.platform);for(var t=e.pathname,r=0;r<t.length;r++)if("%"===t[r]){var n=32|t.codePointAt(r+2);if("2"===t[r+1]&&102===n)throw new w.TypeError("ERR_INVALID_FILE_URL_PATH","must not include encoded / characters")}return decodeURIComponent(t)}(e)}var t=String(e);return je(t),t}t.pathToFilename=Se;var Te=function(e,t){return void 0===t&&(t=p.default.cwd()),S(t,e)};if(F){var Oe=Te,Ae=r(8996).Z4;Te=function(e,t){return Ae(Oe(e,t))}}function Ie(e,t){var r=Te(e,t).substr(1);return r?r.split(a):[]}function Re(e){return Ie(Se(e))}function Ne(e,t){return void 0===t&&(t=_.ENCODING_UTF8),d.Buffer.isBuffer(e)?e:e instanceof Uint8Array?d.bufferFrom(e):d.bufferFrom(String(e),t)}function De(e,t){return t&&"buffer"!==t?e.toString(t):e}function je(e,t){if(-1!==(""+e).indexOf("\0")){var r=new Error("Path must be a string without null bytes");if(r.code=W,"function"!=typeof t)throw r;return p.default.nextTick(t,r),!1}return!0}function ke(e,t){var r=function(e,t){return"number"==typeof e?e:"string"==typeof e?parseInt(e,8):t?ke(t):void 0}(e,t);if("number"!=typeof r||isNaN(r))throw new TypeError(U.MODE_INT);return r}function Ce(e){return e>>>0===e}function Me(e){if(!Ce(e))throw TypeError(U.FD)}function Le(e){if("string"==typeof e&&+e==e)return+e;if(e instanceof Date)return e.getTime()/1e3;if(isFinite(e))return e<0?Date.now()/1e3:e;throw new Error("Cannot parse time: "+e)}function xe(e){if("number"!=typeof e)throw TypeError(U.UID)}function Be(e){if("number"!=typeof e)throw TypeError(U.GID)}t.filenameToSteps=Ie,t.pathToSteps=Re,t.dataToStr=function(e,t){return void 0===t&&(t=_.ENCODING_UTF8),d.Buffer.isBuffer(e)?e.toString(t):e instanceof Uint8Array?d.bufferFrom(e).toString(t):String(e)},t.dataToBuffer=Ne,t.bufferToEncoding=De,t.toUnixTimestamp=Le;var Fe=function(){function e(e){void 0===e&&(e={}),this.ino=0,this.inodes={},this.releasedInos=[],this.fds={},this.releasedFds=[],this.maxFiles=1e4,this.openFiles=0,this.promisesApi=v.default(this),this.statWatchers={},this.props=Object.assign({Node:l.Node,Link:l.Link,File:l.File},e);var t=this.createLink();t.setNode(this.createNode(!0));var r=this;this.StatWatcher=function(e){function t(){return e.call(this,r)||this}return o(t,e),t}(We);var n=He;this.ReadStream=function(e){function t(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.apply(this,i([r],t))||this}return o(t,e),t}(n);var a=Ve;this.WriteStream=function(e){function t(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.apply(this,i([r],t))||this}return o(t,e),t}(a),this.FSWatcher=function(e){function t(){return e.call(this,r)||this}return o(t,e),t}($e),this.root=t}return e.fromJSON=function(t,r){var n=new e;return n.fromJSON(t,r),n},Object.defineProperty(e.prototype,"promises",{get:function(){if(null===this.promisesApi)throw new Error("Promise is not supported in this environment.");return this.promisesApi},enumerable:!0,configurable:!0}),e.prototype.createLink=function(e,t,r,n){if(void 0===r&&(r=!1),!e)return new this.props.Link(this,null,"");if(!t)throw new Error("createLink: name cannot be empty");return e.createChild(t,this.createNode(r,n))},e.prototype.deleteLink=function(e){var t=e.parent;return!!t&&(t.deleteChild(e),!0)},e.prototype.newInoNumber=function(){return this.releasedInos.pop()||(this.ino=(this.ino+1)%4294967295,this.ino)},e.prototype.newFdNumber=function(){var t=this.releasedFds.pop();return"number"==typeof t?t:e.fd--},e.prototype.createNode=function(e,t){void 0===e&&(e=!1);var r=new this.props.Node(this.newInoNumber(),t);return e&&r.setIsDirectory(),this.inodes[r.ino]=r,r},e.prototype.getNode=function(e){return this.inodes[e]},e.prototype.deleteNode=function(e){e.del(),delete this.inodes[e.ino],this.releasedInos.push(e.ino)},e.prototype.genRndStr=function(){var e=(Math.random()+1).toString(36).substr(2,6);return 6===e.length?e:this.genRndStr()},e.prototype.getLink=function(e){return this.root.walk(e)},e.prototype.getLinkOrThrow=function(e,t){var r=Ie(e),n=this.getLink(r);if(!n)throw J(W,t,e);return n},e.prototype.getResolvedLink=function(e){for(var t="string"==typeof e?Ie(e):e,r=this.root,n=0;n<t.length;){var o=t[n];if(!(r=r.getChild(o)))return null;var i=r.getNode();i.isSymlink()?(t=i.symlink.concat(t.slice(n+1)),r=this.root,n=0):n++}return r},e.prototype.getResolvedLinkOrThrow=function(e,t){var r=this.getResolvedLink(e);if(!r)throw J(W,t,e);return r},e.prototype.resolveSymlinks=function(e){return this.getResolvedLink(e.steps.slice(1))},e.prototype.getLinkAsDirOrThrow=function(e,t){var r=this.getLinkOrThrow(e,t);if(!r.getNode().isDirectory())throw J($,t,e);return r},e.prototype.getLinkParent=function(e){return this.root.walk(e,e.length-1)},e.prototype.getLinkParentAsDirOrThrow=function(e,t){var r=e instanceof Array?e:Ie(e),n=this.getLinkParent(r);if(!n)throw J(W,t,a+r.join(a));if(!n.getNode().isDirectory())throw J($,t,a+r.join(a));return n},e.prototype.getFileByFd=function(e){return this.fds[String(e)]},e.prototype.getFileByFdOrThrow=function(e,t){if(!Ce(e))throw TypeError(U.FD);var r=this.getFileByFd(e);if(!r)throw J(H,t);return r},e.prototype.getNodeByIdOrCreate=function(e,t,r){if("number"==typeof e){var n=this.getFileByFd(e);if(!n)throw Error("File nto found");return n.node}var o=Re(e),i=this.getLink(o);if(i)return i.getNode();if(t&I){var a=this.getLinkParent(o);if(a){var s=o[o.length-1];return(i=this.createLink(a,s,!1,r)).getNode()}}throw J(W,"getNodeByIdOrCreate",Se(e))},e.prototype.wrapAsync=function(e,t,r){var n=this;te(r),g.default((function(){try{r(null,e.apply(n,t))}catch(e){r(e)}}))},e.prototype._toJSON=function(e,t,r){var n;void 0===e&&(e=this.root),void 0===t&&(t={});var o=!0,i=e.children;for(var a in e.getNode().isFile()&&((n={})[e.getName()]=e.parent.getChild(e.getName()),i=n,e=e.parent),i){o=!1;var u=e.getChild(a);if(!u)throw new Error("_toJSON: unexpected undefined");var l=u.getNode();if(l.isFile()){var c=u.getPath();r&&(c=s(r,c)),t[c]=l.getString()}else l.isDirectory()&&this._toJSON(u,t,r)}var f=e.getPath();return r&&(f=s(r,f)),f&&o&&(t[f]=null),t},e.prototype.toJSON=function(e,t,r){void 0===t&&(t={}),void 0===r&&(r=!1);var n=[];if(e){e instanceof Array||(e=[e]);for(var o=0,i=e;o<i.length;o++){var a=Se(i[o]);(l=this.getResolvedLink(a))&&n.push(l)}}else n.push(this.root);if(!n.length)return t;for(var s=0,u=n;s<u.length;s++){var l=u[s];this._toJSON(l,t,r?l.getPath():"")}return t},e.prototype.fromJSON=function(e,t){for(var r in void 0===t&&(t=p.default.cwd()),e){var n=e[r];if("string"==typeof n){var o=Ie(r=Te(r,t));if(o.length>1){var i=a+o.slice(0,o.length-1).join(a);this.mkdirpBase(i,511)}this.writeFileSync(r,n)}else this.mkdirpBase(r,511)}},e.prototype.reset=function(){this.ino=0,this.inodes={},this.releasedInos=[],this.fds={},this.releasedFds=[],this.openFiles=0,this.root=this.createLink(),this.root.setNode(this.createNode(!0))},e.prototype.mountSync=function(e,t){this.fromJSON(t,e)},e.prototype.openLink=function(e,t,r){if(void 0===r&&(r=!0),this.openFiles>=this.maxFiles)throw J(q,"open",e.getPath());var n=e;if(r&&(n=this.resolveSymlinks(e)),!n)throw J(W,"open",e.getPath());var o=n.getNode();if(o.isDirectory()){if((t&(T|A|O))!==T)throw J(Y,"open",e.getPath())}else if(t&k)throw J($,"open",e.getPath());if(!(t&O||o.canRead()))throw J(G,"open",e.getPath());var i=new this.props.File(e,o,t,this.newFdNumber());return this.fds[i.fd]=i,this.openFiles++,t&N&&i.truncate(),i},e.prototype.openFile=function(e,t,r,n){void 0===n&&(n=!0);var o=Ie(e),i=n?this.getResolvedLink(o):this.getLink(o);if(!i&&t&I){var s=this.getResolvedLink(o.slice(0,o.length-1));if(!s)throw J(W,"open",a+o.join(a));t&I&&"number"==typeof r&&(i=this.createLink(s,o[o.length-1],!1,r))}if(i)return this.openLink(i,t,n);throw J(W,"open",e)},e.prototype.openBase=function(e,t,r,n){void 0===n&&(n=!0);var o=this.openFile(e,t,r,n);if(!o)throw J(W,"open",e);return o.fd},e.prototype.openSync=function(e,t,r){void 0===r&&(r=438);var n=ke(r),o=Se(e),i=X(t);return this.openBase(o,i,n)},e.prototype.open=function(e,t,r,n){var o=r,i=n;"function"==typeof r&&(o=438,i=r);var a=ke(o=o||438),s=Se(e),u=X(t);this.wrapAsync(this.openBase,[s,u,a],i)},e.prototype.closeFile=function(e){this.fds[e.fd]&&(this.openFiles--,delete this.fds[e.fd],this.releasedFds.push(e.fd))},e.prototype.closeSync=function(e){Me(e);var t=this.getFileByFdOrThrow(e,"close");this.closeFile(t)},e.prototype.close=function(e,t){Me(e),this.wrapAsync(this.closeSync,[e],t)},e.prototype.openFileOrGetById=function(e,t,r){if("number"==typeof e){var n=this.fds[e];if(!n)throw J(W);return n}return this.openFile(Se(e),t,r)},e.prototype.readBase=function(e,t,r,n,o){return this.getFileByFdOrThrow(e).read(t,Number(r),Number(n),o)},e.prototype.readSync=function(e,t,r,n,o){return Me(e),this.readBase(e,t,r,n,o)},e.prototype.read=function(e,t,r,n,o,i){var a=this;if(te(i),0===n)return p.default.nextTick((function(){i&&i(null,0,t)}));g.default((function(){try{var s=a.readBase(e,t,r,n,o);i(null,s,t)}catch(e){i(e)}}))},e.prototype.readFileBase=function(e,t,r){var n,o,i="number"==typeof e&&Ce(e);if(i)o=e;else{var a=Ie(Se(e)),s=this.getResolvedLink(a);if(s&&s.getNode().isDirectory())throw J(Y,"open",s.getPath());o=this.openSync(e,t)}try{n=De(this.getFileByFdOrThrow(o).getBuffer(),r)}finally{i||this.closeSync(o)}return n},e.prototype.readFileSync=function(e,t){var r=ae(t),n=X(r.flag);return this.readFileBase(e,n,r.encoding)},e.prototype.readFile=function(e,t,r){var n=re(ae)(t,r),o=n[0],i=n[1],a=X(o.flag);this.wrapAsync(this.readFileBase,[e,a,o.encoding],i)},e.prototype.writeBase=function(e,t,r,n,o){return this.getFileByFdOrThrow(e,"write").write(t,r,n,o)},e.prototype.writeSync=function(e,t,r,n,o){var i,a,s,u;Me(e);var l="string"!=typeof t;l?(a=0|(r||0),s=n,u=o):(u=r,i=n);var c=Ne(t,i);return l?void 0===s&&(s=c.length):(a=0,s=c.length),this.writeBase(e,c,a,s,u)},e.prototype.write=function(e,t,r,n,o,i){var a,s,u,l,c,f=this;Me(e);var d=typeof t,p=typeof r,h=typeof n,y=typeof o;"string"!==d?"function"===p?c=r:"function"===h?(a=0|r,c=n):"function"===y?(a=0|r,s=n,c=o):(a=0|r,s=n,u=o,c=i):"function"===p?c=r:"function"===h?(u=r,c=n):"function"===y&&(u=r,l=n,c=o);var m=Ne(t,l);"string"!==d?void 0===s&&(s=m.length):(a=0,s=m.length);var b=te(c);g.default((function(){try{var r=f.writeBase(e,m,a,s,u);b(null,r,"string"!==d?m:t)}catch(e){b(e)}}))},e.prototype.writeFileBase=function(e,t,r,n){var o,i="number"==typeof e;o=i?e:this.openBase(Se(e),r,n);var a=0,s=t.length,u=r&D?void 0:0;try{for(;s>0;){var l=this.writeSync(o,t,a,s,u);a+=l,s-=l,void 0!==u&&(u+=l)}}finally{i||this.closeSync(o)}},e.prototype.writeFileSync=function(e,t,r){var n=ue(r),o=X(n.flag),i=ke(n.mode),a=Ne(t,n.encoding);this.writeFileBase(e,a,o,i)},e.prototype.writeFile=function(e,t,r,n){var o=r,i=n;"function"==typeof r&&(o=se,i=r);var a=te(i),s=ue(o),u=X(s.flag),l=ke(s.mode),c=Ne(t,s.encoding);this.wrapAsync(this.writeFileBase,[e,c,u,l],a)},e.prototype.linkBase=function(e,t){var r=Ie(e),n=this.getLink(r);if(!n)throw J(W,"link",e,t);var o=Ie(t),i=this.getLinkParent(o);if(!i)throw J(W,"link",e,t);var a=o[o.length-1];if(i.getChild(a))throw J(V,"link",e,t);var s=n.getNode();s.nlink++,i.createChild(a,s)},e.prototype.copyFileBase=function(e,t,r){var n=this.readFileSync(e);if(r&M&&this.existsSync(t))throw J(V,"copyFile",e,t);if(r&L)throw J(K,"copyFile",e,t);this.writeFileBase(t,n,B.w,438)},e.prototype.copyFileSync=function(e,t,r){var n=Se(e),o=Se(t);return this.copyFileBase(n,o,0|(r||0))},e.prototype.copyFile=function(e,t,r,n){var o,i,a=Se(e),s=Se(t);"function"==typeof r?(o=0,i=r):(o=r,i=n),te(i),this.wrapAsync(this.copyFileBase,[a,s,o],i)},e.prototype.linkSync=function(e,t){var r=Se(e),n=Se(t);this.linkBase(r,n)},e.prototype.link=function(e,t,r){var n=Se(e),o=Se(t);this.wrapAsync(this.linkBase,[n,o],r)},e.prototype.unlinkBase=function(e){var t=Ie(e),r=this.getLink(t);if(!r)throw J(W,"unlink",e);if(r.length)throw Error("Dir not empty...");this.deleteLink(r);var n=r.getNode();n.nlink--,n.nlink<=0&&this.deleteNode(n)},e.prototype.unlinkSync=function(e){var t=Se(e);this.unlinkBase(t)},e.prototype.unlink=function(e,t){var r=Se(e);this.wrapAsync(this.unlinkBase,[r],t)},e.prototype.symlinkBase=function(e,t){var r=Ie(t),n=this.getLinkParent(r);if(!n)throw J(W,"symlink",e,t);var o=r[r.length-1];if(n.getChild(o))throw J(V,"symlink",e,t);var i=n.createChild(o);return i.getNode().makeSymlink(Ie(e)),i},e.prototype.symlinkSync=function(e,t,r){var n=Se(e),o=Se(t);this.symlinkBase(n,o)},e.prototype.symlink=function(e,t,r,n){var o=te("function"==typeof r?r:n),i=Se(e),a=Se(t);this.wrapAsync(this.symlinkBase,[i,a],o)},e.prototype.realpathBase=function(e,t){var r=Ie(e),n=this.getResolvedLink(r);if(!n)throw J(W,"realpath",e);return _.strToEncoding(n.getPath(),t)},e.prototype.realpathSync=function(e,t){return this.realpathBase(Se(e),de(t).encoding)},e.prototype.realpath=function(e,t,r){var n=ge(t,r),o=n[0],i=n[1],a=Se(e);this.wrapAsync(this.realpathBase,[a,o.encoding],i)},e.prototype.lstatBase=function(e,t){void 0===t&&(t=!1);var r=this.getLink(Ie(e));if(!r)throw J(W,"lstat",e);return c.default.build(r.getNode(),t)},e.prototype.lstatSync=function(e,t){return this.lstatBase(Se(e),Ee(t).bigint)},e.prototype.lstat=function(e,t,r){var n=ve(t,r),o=n[0],i=n[1];this.wrapAsync(this.lstatBase,[Se(e),o.bigint],i)},e.prototype.statBase=function(e,t){void 0===t&&(t=!1);var r=this.getResolvedLink(Ie(e));if(!r)throw J(W,"stat",e);return c.default.build(r.getNode(),t)},e.prototype.statSync=function(e,t){return this.statBase(Se(e),Ee(t).bigint)},e.prototype.stat=function(e,t,r){var n=ve(t,r),o=n[0],i=n[1];this.wrapAsync(this.statBase,[Se(e),o.bigint],i)},e.prototype.fstatBase=function(e,t){void 0===t&&(t=!1);var r=this.getFileByFd(e);if(!r)throw J(H,"fstat");return c.default.build(r.node,t)},e.prototype.fstatSync=function(e,t){return this.fstatBase(e,Ee(t).bigint)},e.prototype.fstat=function(e,t,r){var n=ve(t,r),o=n[0],i=n[1];this.wrapAsync(this.fstatBase,[e,o.bigint],i)},e.prototype.renameBase=function(e,t){var r=this.getLink(Ie(e));if(!r)throw J(W,"rename",e,t);var n=Ie(t),o=this.getLinkParent(n);if(!o)throw J(W,"rename",e,t);var a=r.parent;a&&a.deleteChild(r);var s=n[n.length-1];r.steps=i(o.steps,[s]),o.setChild(r.getName(),r)},e.prototype.renameSync=function(e,t){var r=Se(e),n=Se(t);this.renameBase(r,n)},e.prototype.rename=function(e,t,r){var n=Se(e),o=Se(t);this.wrapAsync(this.renameBase,[n,o],r)},e.prototype.existsBase=function(e){return!!this.statBase(e)},e.prototype.existsSync=function(e){try{return this.existsBase(Se(e))}catch(e){return!1}},e.prototype.exists=function(e,t){var r=this,n=Se(e);if("function"!=typeof t)throw Error(U.CB);g.default((function(){try{t(r.existsBase(n))}catch(e){t(!1)}}))},e.prototype.accessBase=function(e,t){this.getLinkOrThrow(e,"access")},e.prototype.accessSync=function(e,t){void 0===t&&(t=C);var r=Se(e);t|=0,this.accessBase(r,t)},e.prototype.access=function(e,t,r){var n,o=C;"function"!=typeof t?(o=0|t,n=te(r)):n=t;var i=Se(e);this.wrapAsync(this.accessBase,[i,o],n)},e.prototype.appendFileSync=function(e,t,r){void 0===r&&(r=le);var n=ce(r);n.flag&&!Ce(e)||(n.flag="a"),this.writeFileSync(e,t,n)},e.prototype.appendFile=function(e,t,r,n){var o=fe(r,n),i=o[0],a=o[1];i.flag&&!Ce(e)||(i.flag="a"),this.writeFile(e,t,i,a)},e.prototype.readdirBase=function(e,t){var r=Ie(e),n=this.getResolvedLink(r);if(!n)throw J(W,"readdir",e);if(!n.getNode().isDirectory())throw J($,"scandir",e);if(t.withFileTypes){var o=[];for(var i in n.children){var a=n.getChild(i);a&&o.push(f.default.build(a,t.encoding))}return F||"buffer"===t.encoding||o.sort((function(e,t){return e.name<t.name?-1:e.name>t.name?1:0})),o}var s=[];for(var u in n.children)s.push(_.strToEncoding(u,t.encoding));return F||"buffer"===t.encoding||s.sort(),s},e.prototype.readdirSync=function(e,t){var r=be(t),n=Se(e);return this.readdirBase(n,r)},e.prototype.readdir=function(e,t,r){var n=_e(t,r),o=n[0],i=n[1],a=Se(e);this.wrapAsync(this.readdirBase,[a,o],i)},e.prototype.readlinkBase=function(e,t){var r=this.getLinkOrThrow(e,"readlink").getNode();if(!r.isSymlink())throw J(z,"readlink",e);var n=a+r.symlink.join(a);return _.strToEncoding(n,t)},e.prototype.readlinkSync=function(e,t){var r=oe(t),n=Se(e);return this.readlinkBase(n,r.encoding)},e.prototype.readlink=function(e,t,r){var n=ie(t,r),o=n[0],i=n[1],a=Se(e);this.wrapAsync(this.readlinkBase,[a,o.encoding],i)},e.prototype.fsyncBase=function(e){this.getFileByFdOrThrow(e,"fsync")},e.prototype.fsyncSync=function(e){this.fsyncBase(e)},e.prototype.fsync=function(e,t){this.wrapAsync(this.fsyncBase,[e],t)},e.prototype.fdatasyncBase=function(e){this.getFileByFdOrThrow(e,"fdatasync")},e.prototype.fdatasyncSync=function(e){this.fdatasyncBase(e)},e.prototype.fdatasync=function(e,t){this.wrapAsync(this.fdatasyncBase,[e],t)},e.prototype.ftruncateBase=function(e,t){this.getFileByFdOrThrow(e,"ftruncate").truncate(t)},e.prototype.ftruncateSync=function(e,t){this.ftruncateBase(e,t)},e.prototype.ftruncate=function(e,t,r){var n="number"==typeof t?t:0,o=te("number"==typeof t?r:t);this.wrapAsync(this.ftruncateBase,[e,n],o)},e.prototype.truncateBase=function(e,t){var r=this.openSync(e,"r+");try{this.ftruncateSync(r,t)}finally{this.closeSync(r)}},e.prototype.truncateSync=function(e,t){if(Ce(e))return this.ftruncateSync(e,t);this.truncateBase(e,t)},e.prototype.truncate=function(e,t,r){var n="number"==typeof t?t:0,o=te("number"==typeof t?r:t);if(Ce(e))return this.ftruncate(e,n,o);this.wrapAsync(this.truncateBase,[e,n],o)},e.prototype.futimesBase=function(e,t,r){var n=this.getFileByFdOrThrow(e,"futimes").node;n.atime=new Date(1e3*t),n.mtime=new Date(1e3*r)},e.prototype.futimesSync=function(e,t,r){this.futimesBase(e,Le(t),Le(r))},e.prototype.futimes=function(e,t,r,n){this.wrapAsync(this.futimesBase,[e,Le(t),Le(r)],n)},e.prototype.utimesBase=function(e,t,r){var n=this.openSync(e,"r+");try{this.futimesBase(n,t,r)}finally{this.closeSync(n)}},e.prototype.utimesSync=function(e,t,r){this.utimesBase(Se(e),Le(t),Le(r))},e.prototype.utimes=function(e,t,r,n){this.wrapAsync(this.utimesBase,[Se(e),Le(t),Le(r)],n)},e.prototype.mkdirBase=function(e,t){var r=Ie(e);if(!r.length)throw J(Y,"mkdir",e);var n=this.getLinkParentAsDirOrThrow(e,"mkdir"),o=r[r.length-1];if(n.getChild(o))throw J(V,"mkdir",e);n.createChild(o,this.createNode(!0,t))},e.prototype.mkdirpBase=function(e,t){for(var r=Ie(e),n=this.root,o=0;o<r.length;o++){var i=r[o];if(!n.getNode().isDirectory())throw J($,"mkdir",n.getPath());var a=n.getChild(i);if(a){if(!a.getNode().isDirectory())throw J($,"mkdir",a.getPath());n=a}else n=n.createChild(i,this.createNode(!0,t))}},e.prototype.mkdirSync=function(e,t){var r=he(t),n=ke(r.mode,511),o=Se(e);r.recursive?this.mkdirpBase(o,n):this.mkdirBase(o,n)},e.prototype.mkdir=function(e,t,r){var n=he(t),o=te("function"==typeof t?t:r),i=ke(n.mode,511),a=Se(e);n.recursive?this.wrapAsync(this.mkdirpBase,[a,i],o):this.wrapAsync(this.mkdirBase,[a,i],o)},e.prototype.mkdirpSync=function(e,t){this.mkdirSync(e,{mode:t,recursive:!0})},e.prototype.mkdirp=function(e,t,r){var n="function"==typeof t?void 0:t,o=te("function"==typeof t?t:r);this.mkdir(e,{mode:n,recursive:!0},o)},e.prototype.mkdtempBase=function(e,t,r){void 0===r&&(r=5);var n=e+this.genRndStr();try{return this.mkdirBase(n,511),_.strToEncoding(n,t)}catch(n){if(n.code===V){if(r>1)return this.mkdtempBase(e,t,r-1);throw Error("Could not create temp dir.")}throw n}},e.prototype.mkdtempSync=function(e,t){var r=oe(t).encoding;if(!e||"string"!=typeof e)throw new TypeError("filename prefix is required");return je(e),this.mkdtempBase(e,r)},e.prototype.mkdtemp=function(e,t,r){var n=ie(t,r),o=n[0].encoding,i=n[1];if(!e||"string"!=typeof e)throw new TypeError("filename prefix is required");je(e)&&this.wrapAsync(this.mkdtempBase,[e,o],i)},e.prototype.rmdirBase=function(e,t){var r=me(t),n=this.getLinkAsDirOrThrow(e,"rmdir");if(n.length&&!r.recursive)throw J(Z,"rmdir",e);this.deleteLink(n)},e.prototype.rmdirSync=function(e,t){this.rmdirBase(Se(e),t)},e.prototype.rmdir=function(e,t,r){var n=me(t),o=te("function"==typeof t?t:r);this.wrapAsync(this.rmdirBase,[Se(e),n],o)},e.prototype.fchmodBase=function(e,t){this.getFileByFdOrThrow(e,"fchmod").chmod(t)},e.prototype.fchmodSync=function(e,t){this.fchmodBase(e,ke(t))},e.prototype.fchmod=function(e,t,r){this.wrapAsync(this.fchmodBase,[e,ke(t)],r)},e.prototype.chmodBase=function(e,t){var r=this.openSync(e,"r+");try{this.fchmodBase(r,t)}finally{this.closeSync(r)}},e.prototype.chmodSync=function(e,t){var r=ke(t),n=Se(e);this.chmodBase(n,r)},e.prototype.chmod=function(e,t,r){var n=ke(t),o=Se(e);this.wrapAsync(this.chmodBase,[o,n],r)},e.prototype.lchmodBase=function(e,t){var r=this.openBase(e,A,0,!1);try{this.fchmodBase(r,t)}finally{this.closeSync(r)}},e.prototype.lchmodSync=function(e,t){var r=ke(t),n=Se(e);this.lchmodBase(n,r)},e.prototype.lchmod=function(e,t,r){var n=ke(t),o=Se(e);this.wrapAsync(this.lchmodBase,[o,n],r)},e.prototype.fchownBase=function(e,t,r){this.getFileByFdOrThrow(e,"fchown").chown(t,r)},e.prototype.fchownSync=function(e,t,r){xe(t),Be(r),this.fchownBase(e,t,r)},e.prototype.fchown=function(e,t,r,n){xe(t),Be(r),this.wrapAsync(this.fchownBase,[e,t,r],n)},e.prototype.chownBase=function(e,t,r){this.getResolvedLinkOrThrow(e,"chown").getNode().chown(t,r)},e.prototype.chownSync=function(e,t,r){xe(t),Be(r),this.chownBase(Se(e),t,r)},e.prototype.chown=function(e,t,r,n){xe(t),Be(r),this.wrapAsync(this.chownBase,[Se(e),t,r],n)},e.prototype.lchownBase=function(e,t,r){this.getLinkOrThrow(e,"lchown").getNode().chown(t,r)},e.prototype.lchownSync=function(e,t,r){xe(t),Be(r),this.lchownBase(Se(e),t,r)},e.prototype.lchown=function(e,t,r,n){xe(t),Be(r),this.wrapAsync(this.lchownBase,[Se(e),t,r],n)},e.prototype.watchFile=function(e,t,r){var n=Se(e),o=t,i=r;if("function"==typeof o&&(i=t,o=null),"function"!=typeof i)throw Error('"watchFile()" requires a listener function');var a=5007,s=!0;o&&"object"==typeof o&&("number"==typeof o.interval&&(a=o.interval),"boolean"==typeof o.persistent&&(s=o.persistent));var u=this.statWatchers[n];return u||((u=new this.StatWatcher).start(n,s,a),this.statWatchers[n]=u),u.addListener("change",i),u},e.prototype.unwatchFile=function(e,t){var r=Se(e),n=this.statWatchers[r];n&&("function"==typeof t?n.removeListener("change",t):n.removeAllListeners("change"),0===n.listenerCount("change")&&(n.stop(),delete this.statWatchers[r]))},e.prototype.createReadStream=function(e,t){return new this.ReadStream(e,t)},e.prototype.createWriteStream=function(e,t){return new this.WriteStream(e,t)},e.prototype.watch=function(e,t,r){var n=Se(e),o=t;"function"==typeof t&&(r=t,o=null);var i=oe(o),a=i.persistent,s=i.recursive,u=i.encoding;void 0===a&&(a=!0),void 0===s&&(s=!1);var l=new this.FSWatcher;return l.start(n,a,s,u),r&&l.addListener("change",r),l},e.fd=2147483647,e}();function Ue(e){e.emit("stop")}t.Volume=Fe;var Pe,We=function(e){function t(t){var r=e.call(this)||this;return r.onInterval=function(){try{var e=r.vol.statSync(r.filename);r.hasChanged(e)&&(r.emit("change",e,r.prev),r.prev=e)}finally{r.loop()}},r.vol=t,r}return o(t,e),t.prototype.loop=function(){this.timeoutRef=this.setTimeout(this.onInterval,this.interval)},t.prototype.hasChanged=function(e){return e.mtimeMs>this.prev.mtimeMs||e.nlink!==this.prev.nlink},t.prototype.start=function(e,t,r){void 0===t&&(t=!0),void 0===r&&(r=5007),this.filename=Se(e),this.setTimeout=t?setTimeout:h.default,this.interval=r,this.prev=this.vol.statSync(this.filename),this.loop()},t.prototype.stop=function(){clearTimeout(this.timeoutRef),p.default.nextTick(Ue,this)},t}(b.EventEmitter);function He(e,t,r){if(!(this instanceof He))return new He(e,t,r);if(this._vol=e,void 0===(r=Object.assign({},Q(r,{}))).highWaterMark&&(r.highWaterMark=65536),y.Readable.call(this,r),this.path=Se(t),this.fd=void 0===r.fd?null:r.fd,this.flags=void 0===r.flags?"r":r.flags,this.mode=void 0===r.mode?438:r.mode,this.start=r.start,this.end=r.end,this.autoClose=void 0===r.autoClose||r.autoClose,this.pos=void 0,this.bytesRead=0,void 0!==this.start){if("number"!=typeof this.start)throw new TypeError('"start" option must be a Number');if(void 0===this.end)this.end=1/0;else if("number"!=typeof this.end)throw new TypeError('"end" option must be a Number');if(this.start>this.end)throw new Error('"start" option must be <= "end" option');this.pos=this.start}"number"!=typeof this.fd&&this.open(),this.on("end",(function(){this.autoClose&&this.destroy&&this.destroy()}))}function ze(e){this.close()}function Ve(e,t,r){if(!(this instanceof Ve))return new Ve(e,t,r);if(this._vol=e,r=Object.assign({},Q(r,{})),y.Writable.call(this,r),this.path=Se(t),this.fd=void 0===r.fd?null:r.fd,this.flags=void 0===r.flags?"w":r.flags,this.mode=void 0===r.mode?438:r.mode,this.start=r.start,this.autoClose=void 0===r.autoClose||!!r.autoClose,this.pos=void 0,this.bytesWritten=0,void 0!==this.start){if("number"!=typeof this.start)throw new TypeError('"start" option must be a Number');if(this.start<0)throw new Error('"start" must be >= zero');this.pos=this.start}r.encoding&&this.setDefaultEncoding(r.encoding),"number"!=typeof this.fd&&this.open(),this.once("finish",(function(){this.autoClose&&this.close()}))}t.StatWatcher=We,E.inherits(He,y.Readable),t.ReadStream=He,He.prototype.open=function(){var e=this;this._vol.open(this.path,this.flags,this.mode,(function(t,r){if(t)return e.autoClose&&e.destroy&&e.destroy(),void e.emit("error",t);e.fd=r,e.emit("open",r),e.read()}))},He.prototype._read=function(e){if("number"!=typeof this.fd)return this.once("open",(function(){this._read(e)}));if(!this.destroyed){var t;(!Pe||Pe.length-Pe.used<128)&&(t=this._readableState.highWaterMark,(Pe=d.bufferAllocUnsafe(t)).used=0);var r=Pe,n=Math.min(Pe.length-Pe.used,e),o=Pe.used;if(void 0!==this.pos&&(n=Math.min(this.end-this.pos+1,n)),n<=0)return this.push(null);var i=this;this._vol.read(this.fd,Pe,Pe.used,n,this.pos,(function(e,t){if(e)i.autoClose&&i.destroy&&i.destroy(),i.emit("error",e);else{var n=null;t>0&&(i.bytesRead+=t,n=r.slice(o,o+t)),i.push(n)}})),void 0!==this.pos&&(this.pos+=n),Pe.used+=n}},He.prototype._destroy=function(e,t){this.close((function(r){t(e||r)}))},He.prototype.close=function(e){var t=this;if(e&&this.once("close",e),this.closed||"number"!=typeof this.fd)return"number"!=typeof this.fd?void this.once("open",ze):p.default.nextTick((function(){return t.emit("close")}));this.closed=!0,this._vol.close(this.fd,(function(e){e?t.emit("error",e):t.emit("close")})),this.fd=null},E.inherits(Ve,y.Writable),t.WriteStream=Ve,Ve.prototype.open=function(){this._vol.open(this.path,this.flags,this.mode,function(e,t){if(e)return this.autoClose&&this.destroy&&this.destroy(),void this.emit("error",e);this.fd=t,this.emit("open",t)}.bind(this))},Ve.prototype._write=function(e,t,r){if(!(e instanceof d.Buffer))return this.emit("error",new Error("Invalid data"));if("number"!=typeof this.fd)return this.once("open",(function(){this._write(e,t,r)}));var n=this;this._vol.write(this.fd,e,0,e.length,this.pos,(function(e,t){if(e)return n.autoClose&&n.destroy&&n.destroy(),r(e);n.bytesWritten+=t,r()})),void 0!==this.pos&&(this.pos+=e.length)},Ve.prototype._writev=function(e,t){if("number"!=typeof this.fd)return this.once("open",(function(){this._writev(e,t)}));for(var r=this,n=e.length,o=new Array(n),i=0,a=0;a<n;a++){var s=e[a].chunk;o[a]=s,i+=s.length}var u=d.Buffer.concat(o);this._vol.write(this.fd,u,0,u.length,this.pos,(function(e,n){if(e)return r.destroy&&r.destroy(),t(e);r.bytesWritten+=n,t()})),void 0!==this.pos&&(this.pos+=i)},Ve.prototype._destroy=He.prototype._destroy,Ve.prototype.close=He.prototype.close,Ve.prototype.destroySoon=Ve.prototype.end;var $e=function(e){function t(t){var r=e.call(this)||this;return r._filename="",r._filenameEncoded="",r._recursive=!1,r._encoding=_.ENCODING_UTF8,r._onNodeChange=function(){r._emit("change")},r._onParentChild=function(e){e.getName()===r._getName()&&r._emit("rename")},r._emit=function(e){r.emit("change",e,r._filenameEncoded)},r._persist=function(){r._timer=setTimeout(r._persist,1e6)},r._vol=t,r}return o(t,e),t.prototype._getName=function(){return this._steps[this._steps.length-1]},t.prototype.start=function(e,t,r,n){void 0===t&&(t=!0),void 0===r&&(r=!1),void 0===n&&(n=_.ENCODING_UTF8),this._filename=Se(e),this._steps=Ie(this._filename),this._filenameEncoded=_.strToEncoding(this._filename),this._recursive=r,this._encoding=n;try{this._link=this._vol.getLinkOrThrow(this._filename,"FSWatcher")}catch(e){var o=new Error("watch "+this._filename+" "+e.code);throw o.code=e.code,o.errno=e.code,o}this._link.getNode().on("change",this._onNodeChange),this._link.on("child:add",this._onNodeChange),this._link.on("child:delete",this._onNodeChange);var i=this._link.parent;i&&(i.setMaxListeners(i.getMaxListeners()+1),i.on("child:delete",this._onParentChild)),t&&this._persist()},t.prototype.close=function(){clearTimeout(this._timer),this._link.getNode().removeListener("change",this._onNodeChange);var e=this._link.parent;e&&e.removeListener("child:delete",this._onParentChild)},t}(b.EventEmitter);t.FSWatcher=$e},8996:(e,t,r)=>{"use strict";var n=r(9142);t.Z4=function(e){return o?(e=function(e,t){if("string"!=typeof e)throw new TypeError("expected a string");return e=e.replace(/[\\\/]+/g,"/"),!1!==t&&(e=function(e){var t=e.length-1;if(t<2)return e;for(;i(e,t);)t--;return e.substr(0,t+1)}(e)),e}(e,!(arguments.length>1&&void 0!==arguments[1])||arguments[1])).replace(/^([a-zA-Z]+:|\.\/)/,""):e};var o="win32"===n.platform;function i(e,t){var r=e[t];return t>0&&("/"===r||o&&"\\"===r)}},2125:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fsProps=["constants","F_OK","R_OK","W_OK","X_OK","Stats"],t.fsSyncMethods=["renameSync","ftruncateSync","truncateSync","chownSync","fchownSync","lchownSync","chmodSync","fchmodSync","lchmodSync","statSync","lstatSync","fstatSync","linkSync","symlinkSync","readlinkSync","realpathSync","unlinkSync","rmdirSync","mkdirSync","mkdirpSync","readdirSync","closeSync","openSync","utimesSync","futimesSync","fsyncSync","writeSync","readSync","readFileSync","writeFileSync","appendFileSync","existsSync","accessSync","fdatasyncSync","mkdtempSync","copyFileSync","createReadStream","createWriteStream"],t.fsAsyncMethods=["rename","ftruncate","truncate","chown","fchown","lchown","chmod","fchmod","lchmod","stat","lstat","fstat","link","symlink","readlink","realpath","unlink","rmdir","mkdir","mkdirp","readdir","close","open","utimes","futimes","fsync","write","read","readFile","writeFile","appendFile","exists","access","fdatasync","mkdtemp","copyFile","watchFile","unwatchFile","watch"]},8850:e=>{!function(){function t(e,t){var r,n,o,i,a,s,u,l;for(r=3&e.length,n=e.length-r,o=t,a=3432918353,s=461845907,l=0;l<n;)u=255&e.charCodeAt(l)|(255&e.charCodeAt(++l))<<8|(255&e.charCodeAt(++l))<<16|(255&e.charCodeAt(++l))<<24,++l,o=27492+(65535&(i=5*(65535&(o=(o^=u=(65535&(u=(u=(65535&u)*a+(((u>>>16)*a&65535)<<16)&4294967295)<<15|u>>>17))*s+(((u>>>16)*s&65535)<<16)&4294967295)<<13|o>>>19))+((5*(o>>>16)&65535)<<16)&4294967295))+((58964+(i>>>16)&65535)<<16);switch(u=0,r){case 3:u^=(255&e.charCodeAt(l+2))<<16;case 2:u^=(255&e.charCodeAt(l+1))<<8;case 1:o^=u=(65535&(u=(u=(65535&(u^=255&e.charCodeAt(l)))*a+(((u>>>16)*a&65535)<<16)&4294967295)<<15|u>>>17))*s+(((u>>>16)*s&65535)<<16)&4294967295}return o^=e.length,o=2246822507*(65535&(o^=o>>>16))+((2246822507*(o>>>16)&65535)<<16)&4294967295,o=3266489909*(65535&(o^=o>>>13))+((3266489909*(o>>>16)&65535)<<16)&4294967295,(o^=o>>>16)>>>0}var r=t;r.v2=function(e,t){for(var r,n=e.length,o=t^n,i=0;n>=4;)r=1540483477*(65535&(r=255&e.charCodeAt(i)|(255&e.charCodeAt(++i))<<8|(255&e.charCodeAt(++i))<<16|(255&e.charCodeAt(++i))<<24))+((1540483477*(r>>>16)&65535)<<16),o=1540483477*(65535&o)+((1540483477*(o>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),n-=4,++i;switch(n){case 3:o^=(255&e.charCodeAt(i+2))<<16;case 2:o^=(255&e.charCodeAt(i+1))<<8;case 1:o=1540483477*(65535&(o^=255&e.charCodeAt(i)))+((1540483477*(o>>>16)&65535)<<16)}return o=1540483477*(65535&(o^=o>>>13))+((1540483477*(o>>>16)&65535)<<16),(o^=o>>>15)>>>0},r.v3=t,e.exports=r}()},7594:(e,t,r)=>{var n="function"==typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,i=n&&o&&"function"==typeof o.get?o.get:null,a=n&&Map.prototype.forEach,s="function"==typeof Set&&Set.prototype,u=Object.getOwnPropertyDescriptor&&s?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,l=s&&u&&"function"==typeof u.get?u.get:null,c=s&&Set.prototype.forEach,f="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,d="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,g="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,p=Boolean.prototype.valueOf,h=Object.prototype.toString,y=Function.prototype.toString,m=String.prototype.match,b=String.prototype.slice,_=String.prototype.replace,w=String.prototype.toUpperCase,E=String.prototype.toLowerCase,v=RegExp.prototype.test,S=Array.prototype.concat,T=Array.prototype.join,O=Array.prototype.slice,A=Math.floor,I="function"==typeof BigInt?BigInt.prototype.valueOf:null,R=Object.getOwnPropertySymbols,N="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,D="function"==typeof Symbol&&"object"==typeof Symbol.iterator,j="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,k=Object.prototype.propertyIsEnumerable,C=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function M(e,t){if(e===1/0||e===-1/0||e!=e||e&&e>-1e3&&e<1e3||v.call(/e/,t))return t;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof e){var n=e<0?-A(-e):A(e);if(n!==e){var o=String(n),i=b.call(t,o.length+1);return _.call(o,r,"$&_")+"."+_.call(_.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return _.call(t,r,"$&_")}var L=r(4654),x=L.custom,B=H(x)?x:null;function F(e,t,r){var n="double"===(r.quoteStyle||t)?'"':"'";return n+e+n}function U(e){return _.call(String(e),/"/g,""")}function P(e){return!("[object Array]"!==$(e)||j&&"object"==typeof e&&j in e)}function W(e){return!("[object RegExp]"!==$(e)||j&&"object"==typeof e&&j in e)}function H(e){if(D)return e&&"object"==typeof e&&e instanceof Symbol;if("symbol"==typeof e)return!0;if(!e||"object"!=typeof e||!N)return!1;try{return N.call(e),!0}catch(e){}return!1}e.exports=function e(t,r,n,o){var s=r||{};if(V(s,"quoteStyle")&&"single"!==s.quoteStyle&&"double"!==s.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(V(s,"maxStringLength")&&("number"==typeof s.maxStringLength?s.maxStringLength<0&&s.maxStringLength!==1/0:null!==s.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var u=!V(s,"customInspect")||s.customInspect;if("boolean"!=typeof u&&"symbol"!==u)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(V(s,"indent")&&null!==s.indent&&"\t"!==s.indent&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(V(s,"numericSeparator")&&"boolean"!=typeof s.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var h=s.numericSeparator;if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return G(t,s);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var w=String(t);return h?M(t,w):w}if("bigint"==typeof t){var v=String(t)+"n";return h?M(t,v):v}var A=void 0===s.depth?5:s.depth;if(void 0===n&&(n=0),n>=A&&A>0&&"object"==typeof t)return P(t)?"[Array]":"[Object]";var R,x=function(e,t){var r;if("\t"===e.indent)r="\t";else{if(!("number"==typeof e.indent&&e.indent>0))return null;r=T.call(Array(e.indent+1)," ")}return{base:r,prev:T.call(Array(t+1),r)}}(s,n);if(void 0===o)o=[];else if(q(o,t)>=0)return"[Circular]";function z(t,r,i){if(r&&(o=O.call(o)).push(r),i){var a={depth:s.depth};return V(s,"quoteStyle")&&(a.quoteStyle=s.quoteStyle),e(t,a,n+1,o)}return e(t,s,n+1,o)}if("function"==typeof t&&!W(t)){var Y=function(e){if(e.name)return e.name;var t=m.call(y.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}(t),ee=Q(t,z);return"[Function"+(Y?": "+Y:" (anonymous)")+"]"+(ee.length>0?" { "+T.call(ee,", ")+" }":"")}if(H(t)){var te=D?_.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):N.call(t);return"object"!=typeof t||D?te:Z(te)}if((R=t)&&"object"==typeof R&&("undefined"!=typeof HTMLElement&&R instanceof HTMLElement||"string"==typeof R.nodeName&&"function"==typeof R.getAttribute)){for(var re="<"+E.call(String(t.nodeName)),ne=t.attributes||[],oe=0;oe<ne.length;oe++)re+=" "+ne[oe].name+"="+F(U(ne[oe].value),"double",s);return re+=">",t.childNodes&&t.childNodes.length&&(re+="..."),re+"</"+E.call(String(t.nodeName))+">"}if(P(t)){if(0===t.length)return"[]";var ie=Q(t,z);return x&&!function(e){for(var t=0;t<e.length;t++)if(q(e[t],"\n")>=0)return!1;return!0}(ie)?"["+X(ie,x)+"]":"[ "+T.call(ie,", ")+" ]"}if(function(e){return!("[object Error]"!==$(e)||j&&"object"==typeof e&&j in e)}(t)){var ae=Q(t,z);return"cause"in Error.prototype||!("cause"in t)||k.call(t,"cause")?0===ae.length?"["+String(t)+"]":"{ ["+String(t)+"] "+T.call(ae,", ")+" }":"{ ["+String(t)+"] "+T.call(S.call("[cause]: "+z(t.cause),ae),", ")+" }"}if("object"==typeof t&&u){if(B&&"function"==typeof t[B]&&L)return L(t,{depth:A-n});if("symbol"!==u&&"function"==typeof t.inspect)return t.inspect()}if(function(e){if(!i||!e||"object"!=typeof e)return!1;try{i.call(e);try{l.call(e)}catch(e){return!0}return e instanceof Map}catch(e){}return!1}(t)){var se=[];return a&&a.call(t,(function(e,r){se.push(z(r,t,!0)+" => "+z(e,t))})),J("Map",i.call(t),se,x)}if(function(e){if(!l||!e||"object"!=typeof e)return!1;try{l.call(e);try{i.call(e)}catch(e){return!0}return e instanceof Set}catch(e){}return!1}(t)){var ue=[];return c&&c.call(t,(function(e){ue.push(z(e,t))})),J("Set",l.call(t),ue,x)}if(function(e){if(!f||!e||"object"!=typeof e)return!1;try{f.call(e,f);try{d.call(e,d)}catch(e){return!0}return e instanceof WeakMap}catch(e){}return!1}(t))return K("WeakMap");if(function(e){if(!d||!e||"object"!=typeof e)return!1;try{d.call(e,d);try{f.call(e,f)}catch(e){return!0}return e instanceof WeakSet}catch(e){}return!1}(t))return K("WeakSet");if(function(e){if(!g||!e||"object"!=typeof e)return!1;try{return g.call(e),!0}catch(e){}return!1}(t))return K("WeakRef");if(function(e){return!("[object Number]"!==$(e)||j&&"object"==typeof e&&j in e)}(t))return Z(z(Number(t)));if(function(e){if(!e||"object"!=typeof e||!I)return!1;try{return I.call(e),!0}catch(e){}return!1}(t))return Z(z(I.call(t)));if(function(e){return!("[object Boolean]"!==$(e)||j&&"object"==typeof e&&j in e)}(t))return Z(p.call(t));if(function(e){return!("[object String]"!==$(e)||j&&"object"==typeof e&&j in e)}(t))return Z(z(String(t)));if(!function(e){return!("[object Date]"!==$(e)||j&&"object"==typeof e&&j in e)}(t)&&!W(t)){var le=Q(t,z),ce=C?C(t)===Object.prototype:t instanceof Object||t.constructor===Object,fe=t instanceof Object?"":"null prototype",de=!ce&&j&&Object(t)===t&&j in t?b.call($(t),8,-1):fe?"Object":"",ge=(ce||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(de||fe?"["+T.call(S.call([],de||[],fe||[]),": ")+"] ":"");return 0===le.length?ge+"{}":x?ge+"{"+X(le,x)+"}":ge+"{ "+T.call(le,", ")+" }"}return String(t)};var z=Object.prototype.hasOwnProperty||function(e){return e in this};function V(e,t){return z.call(e,t)}function $(e){return h.call(e)}function q(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}function G(e,t){if(e.length>t.maxStringLength){var r=e.length-t.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return G(b.call(e,0,t.maxStringLength),t)+n}return F(_.call(_.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Y),"single",t)}function Y(e){var t=e.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return r?"\\"+r:"\\x"+(t<16?"0":"")+w.call(t.toString(16))}function Z(e){return"Object("+e+")"}function K(e){return e+" { ? }"}function J(e,t,r,n){return e+" ("+t+") {"+(n?X(r,n):T.call(r,", "))+"}"}function X(e,t){if(0===e.length)return"";var r="\n"+t.prev+t.base;return r+T.call(e,","+r)+"\n"+t.prev}function Q(e,t){var r=P(e),n=[];if(r){n.length=e.length;for(var o=0;o<e.length;o++)n[o]=V(e,o)?t(e[o],e):""}var i,a="function"==typeof R?R(e):[];if(D){i={};for(var s=0;s<a.length;s++)i["$"+a[s]]=a[s]}for(var u in e)V(e,u)&&(r&&String(Number(u))===u&&u<e.length||D&&i["$"+u]instanceof Symbol||(v.call(/[^\w$]/,u)?n.push(t(u,e)+": "+t(e[u],e)):n.push(u+": "+t(e[u],e))));if("function"==typeof R)for(var l=0;l<a.length;l++)k.call(e,a[l])&&n.push("["+t(a[l])+"]: "+t(e[a[l]],e));return n}},4782:e=>{"use strict";var t=function(e){return e!=e};e.exports=function(e,r){return 0===e&&0===r?1/e==1/r:e===r||!(!t(e)||!t(r))}},731:(e,t,r)=>{"use strict";var n=r(4347),o=r(4373),i=r(4782),a=r(1210),s=r(1453),u=o(a(),Object);n(u,{getPolyfill:a,implementation:i,shim:s}),e.exports=u},1210:(e,t,r)=>{"use strict";var n=r(4782);e.exports=function(){return"function"==typeof Object.is?Object.is:n}},1453:(e,t,r)=>{"use strict";var n=r(1210),o=r(4347);e.exports=function(){var e=n();return o(Object,{is:e},{is:function(){return Object.is!==e}}),e}},1561:(e,t,r)=>{"use strict";var n;if(!Object.keys){var o=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=r(8013),s=Object.prototype.propertyIsEnumerable,u=!s.call({toString:null},"toString"),l=s.call((function(){}),"prototype"),c=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],f=function(e){var t=e.constructor;return t&&t.prototype===e},d={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},g=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!d["$"+e]&&o.call(window,e)&&null!==window[e]&&"object"==typeof window[e])try{f(window[e])}catch(e){return!0}}catch(e){return!0}return!1}();n=function(e){var t=null!==e&&"object"==typeof e,r="[object Function]"===i.call(e),n=a(e),s=t&&"[object String]"===i.call(e),d=[];if(!t&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var p=l&&r;if(s&&e.length>0&&!o.call(e,0))for(var h=0;h<e.length;++h)d.push(String(h));if(n&&e.length>0)for(var y=0;y<e.length;++y)d.push(String(y));else for(var m in e)p&&"prototype"===m||!o.call(e,m)||d.push(String(m));if(u)for(var b=function(e){if("undefined"==typeof window||!g)return f(e);try{return f(e)}catch(e){return!1}}(e),_=0;_<c.length;++_)b&&"constructor"===c[_]||!o.call(e,c[_])||d.push(c[_]);return d}}e.exports=n},8204:(e,t,r)=>{"use strict";var n=Array.prototype.slice,o=r(8013),i=Object.keys,a=i?function(e){return i(e)}:r(1561),s=Object.keys;a.shim=function(){if(Object.keys){var e=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);e||(Object.keys=function(e){return o(e)?s(n.call(e)):s(e)})}else Object.keys=a;return Object.keys||a},e.exports=a},8013:e=>{"use strict";var t=Object.prototype.toString;e.exports=function(e){var r=t.call(e),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Function]"===t.call(e.callee)),n}},8922:(e,t,r)=>{"use strict";var n=r(8204),o=r(7027)(),i=r(593),a=Object,s=i("Array.prototype.push"),u=i("Object.prototype.propertyIsEnumerable"),l=o?Object.getOwnPropertySymbols:null;e.exports=function(e,t){if(null==e)throw new TypeError("target must be an object");var r=a(e);if(1===arguments.length)return r;for(var i=1;i<arguments.length;++i){var c=a(arguments[i]),f=n(c),d=o&&(Object.getOwnPropertySymbols||l);if(d)for(var g=d(c),p=0;p<g.length;++p){var h=g[p];u(c,h)&&s(f,h)}for(var y=0;y<f.length;++y){var m=f[y];if(u(c,m)){var b=c[m];r[m]=b}}}return r}},9519:(e,t,r)=>{"use strict";var n=r(4347),o=r(4373),i=r(8922),a=r(1063),s=r(2610),u=o.apply(a()),l=function(e,t){return u(Object,arguments)};n(l,{getPolyfill:a,implementation:i,shim:s}),e.exports=l},1063:(e,t,r)=>{"use strict";var n=r(8922);e.exports=function(){return Object.assign?function(){if(!Object.assign)return!1;for(var e="abcdefghijklmnopqrst",t=e.split(""),r={},n=0;n<t.length;++n)r[t[n]]=t[n];var o=Object.assign({},r),i="";for(var a in o)i+=a;return e!==i}()||function(){if(!Object.assign||!Object.preventExtensions)return!1;var e=Object.preventExtensions({1:2});try{Object.assign(e,"xy")}catch(t){return"y"===e[1]}return!1}()?n:Object.assign:n}},2610:(e,t,r)=>{"use strict";var n=r(4347),o=r(1063);e.exports=function(){var e=o();return n(Object,{assign:e},{assign:function(){return Object.assign!==e}}),e}},1307:(e,t)=>{"use strict";var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var o in r)n(r,o)&&(e[o]=r[o])}}return e},t.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var o={arraySet:function(e,t,r,n,o){if(t.subarray&&e.subarray)e.set(t.subarray(r,r+n),o);else for(var i=0;i<n;i++)e[o+i]=t[r+i]},flattenChunks:function(e){var t,r,n,o,i,a;for(n=0,t=0,r=e.length;t<r;t++)n+=e[t].length;for(a=new Uint8Array(n),o=0,t=0,r=e.length;t<r;t++)i=e[t],a.set(i,o),o+=i.length;return a}},i={arraySet:function(e,t,r,n,o){for(var i=0;i<n;i++)e[o+i]=t[r+i]},flattenChunks:function(e){return[].concat.apply([],e)}};t.setTyped=function(e){e?(t.Buf8=Uint8Array,t.Buf16=Uint16Array,t.Buf32=Int32Array,t.assign(t,o)):(t.Buf8=Array,t.Buf16=Array,t.Buf32=Array,t.assign(t,i))},t.setTyped(r)},7506:e=>{"use strict";e.exports=function(e,t,r,n){for(var o=65535&e|0,i=e>>>16&65535|0,a=0;0!==r;){r-=a=r>2e3?2e3:r;do{i=i+(o=o+t[n++]|0)|0}while(--a);o%=65521,i%=65521}return o|i<<16|0}},9806:e=>{"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},8548:e=>{"use strict";var t=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();e.exports=function(e,r,n,o){var i=t,a=o+n;e^=-1;for(var s=o;s<a;s++)e=e>>>8^i[255&(e^r[s])];return-1^e}},4151:(e,t,r)=>{"use strict";var n,o=r(1307),i=r(5280),a=r(7506),s=r(8548),u=r(8021),l=0,c=4,f=0,d=-2,g=2,p=8,h=286,y=30,m=19,b=2*h+1,_=15,w=3,E=258,v=E+w+1,S=42,T=103,O=113,A=666,I=1,R=2,N=3,D=4;function j(e,t){return e.msg=u[t],t}function k(e){return(e<<1)-(e>4?9:0)}function C(e){for(var t=e.length;--t>=0;)e[t]=0}function M(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(o.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function L(e,t){i._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,M(e.strm)}function x(e,t){e.pending_buf[e.pending++]=t}function B(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function F(e,t){var r,n,o=e.max_chain_length,i=e.strstart,a=e.prev_length,s=e.nice_match,u=e.strstart>e.w_size-v?e.strstart-(e.w_size-v):0,l=e.window,c=e.w_mask,f=e.prev,d=e.strstart+E,g=l[i+a-1],p=l[i+a];e.prev_length>=e.good_match&&(o>>=2),s>e.lookahead&&(s=e.lookahead);do{if(l[(r=t)+a]===p&&l[r+a-1]===g&&l[r]===l[i]&&l[++r]===l[i+1]){i+=2,r++;do{}while(l[++i]===l[++r]&&l[++i]===l[++r]&&l[++i]===l[++r]&&l[++i]===l[++r]&&l[++i]===l[++r]&&l[++i]===l[++r]&&l[++i]===l[++r]&&l[++i]===l[++r]&&i<d);if(n=E-(d-i),i=d-E,n>a){if(e.match_start=t,a=n,n>=s)break;g=l[i+a-1],p=l[i+a]}}}while((t=f[t&c])>u&&0!=--o);return a<=e.lookahead?a:e.lookahead}function U(e){var t,r,n,i,u,l,c,f,d,g,p=e.w_size;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=p+(p-v)){o.arraySet(e.window,e.window,p,p,0),e.match_start-=p,e.strstart-=p,e.block_start-=p,t=r=e.hash_size;do{n=e.head[--t],e.head[t]=n>=p?n-p:0}while(--r);t=r=p;do{n=e.prev[--t],e.prev[t]=n>=p?n-p:0}while(--r);i+=p}if(0===e.strm.avail_in)break;if(l=e.strm,c=e.window,f=e.strstart+e.lookahead,d=i,g=void 0,(g=l.avail_in)>d&&(g=d),r=0===g?0:(l.avail_in-=g,o.arraySet(c,l.input,l.next_in,g,f),1===l.state.wrap?l.adler=a(l.adler,c,g,f):2===l.state.wrap&&(l.adler=s(l.adler,c,g,f)),l.next_in+=g,l.total_in+=g,g),e.lookahead+=r,e.lookahead+e.insert>=w)for(u=e.strstart-e.insert,e.ins_h=e.window[u],e.ins_h=(e.ins_h<<e.hash_shift^e.window[u+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[u+w-1])&e.hash_mask,e.prev[u&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=u,u++,e.insert--,!(e.lookahead+e.insert<w)););}while(e.lookahead<v&&0!==e.strm.avail_in)}function P(e,t){for(var r,n;;){if(e.lookahead<v){if(U(e),e.lookahead<v&&t===l)return I;if(0===e.lookahead)break}if(r=0,e.lookahead>=w&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+w-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==r&&e.strstart-r<=e.w_size-v&&(e.match_length=F(e,r)),e.match_length>=w)if(n=i._tr_tally(e,e.strstart-e.match_start,e.match_length-w),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=w){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+w-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else n=i._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(L(e,!1),0===e.strm.avail_out))return I}return e.insert=e.strstart<w-1?e.strstart:w-1,t===c?(L(e,!0),0===e.strm.avail_out?N:D):e.last_lit&&(L(e,!1),0===e.strm.avail_out)?I:R}function W(e,t){for(var r,n,o;;){if(e.lookahead<v){if(U(e),e.lookahead<v&&t===l)return I;if(0===e.lookahead)break}if(r=0,e.lookahead>=w&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+w-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=w-1,0!==r&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-v&&(e.match_length=F(e,r),e.match_length<=5&&(1===e.strategy||e.match_length===w&&e.strstart-e.match_start>4096)&&(e.match_length=w-1)),e.prev_length>=w&&e.match_length<=e.prev_length){o=e.strstart+e.lookahead-w,n=i._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-w),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=o&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+w-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=w-1,e.strstart++,n&&(L(e,!1),0===e.strm.avail_out))return I}else if(e.match_available){if((n=i._tr_tally(e,0,e.window[e.strstart-1]))&&L(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return I}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=i._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<w-1?e.strstart:w-1,t===c?(L(e,!0),0===e.strm.avail_out?N:D):e.last_lit&&(L(e,!1),0===e.strm.avail_out)?I:R}function H(e,t,r,n,o){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=o}function z(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=p,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new o.Buf16(2*b),this.dyn_dtree=new o.Buf16(2*(2*y+1)),this.bl_tree=new o.Buf16(2*(2*m+1)),C(this.dyn_ltree),C(this.dyn_dtree),C(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new o.Buf16(_+1),this.heap=new o.Buf16(2*h+1),C(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new o.Buf16(2*h+1),C(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function V(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=g,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?S:O,e.adler=2===t.wrap?0:1,t.last_flush=l,i._tr_init(t),f):j(e,d)}function $(e){var t,r=V(e);return r===f&&((t=e.state).window_size=2*t.w_size,C(t.head),t.max_lazy_match=n[t.level].max_lazy,t.good_match=n[t.level].good_length,t.nice_match=n[t.level].nice_length,t.max_chain_length=n[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=w-1,t.match_available=0,t.ins_h=0),r}function q(e,t,r,n,i,a){if(!e)return d;var s=1;if(-1===t&&(t=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),i<1||i>9||r!==p||n<8||n>15||t<0||t>9||a<0||a>4)return j(e,d);8===n&&(n=9);var u=new z;return e.state=u,u.strm=e,u.wrap=s,u.gzhead=null,u.w_bits=n,u.w_size=1<<u.w_bits,u.w_mask=u.w_size-1,u.hash_bits=i+7,u.hash_size=1<<u.hash_bits,u.hash_mask=u.hash_size-1,u.hash_shift=~~((u.hash_bits+w-1)/w),u.window=new o.Buf8(2*u.w_size),u.head=new o.Buf16(u.hash_size),u.prev=new o.Buf16(u.w_size),u.lit_bufsize=1<<i+6,u.pending_buf_size=4*u.lit_bufsize,u.pending_buf=new o.Buf8(u.pending_buf_size),u.d_buf=1*u.lit_bufsize,u.l_buf=3*u.lit_bufsize,u.level=t,u.strategy=a,u.method=r,$(e)}n=[new H(0,0,0,0,(function(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(U(e),0===e.lookahead&&t===l)return I;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,L(e,!1),0===e.strm.avail_out))return I;if(e.strstart-e.block_start>=e.w_size-v&&(L(e,!1),0===e.strm.avail_out))return I}return e.insert=0,t===c?(L(e,!0),0===e.strm.avail_out?N:D):(e.strstart>e.block_start&&(L(e,!1),e.strm.avail_out),I)})),new H(4,4,8,4,P),new H(4,5,16,8,P),new H(4,6,32,32,P),new H(4,4,16,16,W),new H(8,16,32,32,W),new H(8,16,128,128,W),new H(8,32,128,256,W),new H(32,128,258,1024,W),new H(32,258,258,4096,W)],t.deflateInit=function(e,t){return q(e,t,p,15,8,0)},t.deflateInit2=q,t.deflateReset=$,t.deflateResetKeep=V,t.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?d:(e.state.gzhead=t,f):d},t.deflate=function(e,t){var r,o,a,u;if(!e||!e.state||t>5||t<0)return e?j(e,d):d;if(o=e.state,!e.output||!e.input&&0!==e.avail_in||o.status===A&&t!==c)return j(e,0===e.avail_out?-5:d);if(o.strm=e,r=o.last_flush,o.last_flush=t,o.status===S)if(2===o.wrap)e.adler=0,x(o,31),x(o,139),x(o,8),o.gzhead?(x(o,(o.gzhead.text?1:0)+(o.gzhead.hcrc?2:0)+(o.gzhead.extra?4:0)+(o.gzhead.name?8:0)+(o.gzhead.comment?16:0)),x(o,255&o.gzhead.time),x(o,o.gzhead.time>>8&255),x(o,o.gzhead.time>>16&255),x(o,o.gzhead.time>>24&255),x(o,9===o.level?2:o.strategy>=2||o.level<2?4:0),x(o,255&o.gzhead.os),o.gzhead.extra&&o.gzhead.extra.length&&(x(o,255&o.gzhead.extra.length),x(o,o.gzhead.extra.length>>8&255)),o.gzhead.hcrc&&(e.adler=s(e.adler,o.pending_buf,o.pending,0)),o.gzindex=0,o.status=69):(x(o,0),x(o,0),x(o,0),x(o,0),x(o,0),x(o,9===o.level?2:o.strategy>=2||o.level<2?4:0),x(o,3),o.status=O);else{var g=p+(o.w_bits-8<<4)<<8;g|=(o.strategy>=2||o.level<2?0:o.level<6?1:6===o.level?2:3)<<6,0!==o.strstart&&(g|=32),g+=31-g%31,o.status=O,B(o,g),0!==o.strstart&&(B(o,e.adler>>>16),B(o,65535&e.adler)),e.adler=1}if(69===o.status)if(o.gzhead.extra){for(a=o.pending;o.gzindex<(65535&o.gzhead.extra.length)&&(o.pending!==o.pending_buf_size||(o.gzhead.hcrc&&o.pending>a&&(e.adler=s(e.adler,o.pending_buf,o.pending-a,a)),M(e),a=o.pending,o.pending!==o.pending_buf_size));)x(o,255&o.gzhead.extra[o.gzindex]),o.gzindex++;o.gzhead.hcrc&&o.pending>a&&(e.adler=s(e.adler,o.pending_buf,o.pending-a,a)),o.gzindex===o.gzhead.extra.length&&(o.gzindex=0,o.status=73)}else o.status=73;if(73===o.status)if(o.gzhead.name){a=o.pending;do{if(o.pending===o.pending_buf_size&&(o.gzhead.hcrc&&o.pending>a&&(e.adler=s(e.adler,o.pending_buf,o.pending-a,a)),M(e),a=o.pending,o.pending===o.pending_buf_size)){u=1;break}u=o.gzindex<o.gzhead.name.length?255&o.gzhead.name.charCodeAt(o.gzindex++):0,x(o,u)}while(0!==u);o.gzhead.hcrc&&o.pending>a&&(e.adler=s(e.adler,o.pending_buf,o.pending-a,a)),0===u&&(o.gzindex=0,o.status=91)}else o.status=91;if(91===o.status)if(o.gzhead.comment){a=o.pending;do{if(o.pending===o.pending_buf_size&&(o.gzhead.hcrc&&o.pending>a&&(e.adler=s(e.adler,o.pending_buf,o.pending-a,a)),M(e),a=o.pending,o.pending===o.pending_buf_size)){u=1;break}u=o.gzindex<o.gzhead.comment.length?255&o.gzhead.comment.charCodeAt(o.gzindex++):0,x(o,u)}while(0!==u);o.gzhead.hcrc&&o.pending>a&&(e.adler=s(e.adler,o.pending_buf,o.pending-a,a)),0===u&&(o.status=T)}else o.status=T;if(o.status===T&&(o.gzhead.hcrc?(o.pending+2>o.pending_buf_size&&M(e),o.pending+2<=o.pending_buf_size&&(x(o,255&e.adler),x(o,e.adler>>8&255),e.adler=0,o.status=O)):o.status=O),0!==o.pending){if(M(e),0===e.avail_out)return o.last_flush=-1,f}else if(0===e.avail_in&&k(t)<=k(r)&&t!==c)return j(e,-5);if(o.status===A&&0!==e.avail_in)return j(e,-5);if(0!==e.avail_in||0!==o.lookahead||t!==l&&o.status!==A){var h=2===o.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(U(e),0===e.lookahead)){if(t===l)return I;break}if(e.match_length=0,r=i._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(L(e,!1),0===e.strm.avail_out))return I}return e.insert=0,t===c?(L(e,!0),0===e.strm.avail_out?N:D):e.last_lit&&(L(e,!1),0===e.strm.avail_out)?I:R}(o,t):3===o.strategy?function(e,t){for(var r,n,o,a,s=e.window;;){if(e.lookahead<=E){if(U(e),e.lookahead<=E&&t===l)return I;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=w&&e.strstart>0&&(n=s[o=e.strstart-1])===s[++o]&&n===s[++o]&&n===s[++o]){a=e.strstart+E;do{}while(n===s[++o]&&n===s[++o]&&n===s[++o]&&n===s[++o]&&n===s[++o]&&n===s[++o]&&n===s[++o]&&n===s[++o]&&o<a);e.match_length=E-(a-o),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=w?(r=i._tr_tally(e,1,e.match_length-w),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=i._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(L(e,!1),0===e.strm.avail_out))return I}return e.insert=0,t===c?(L(e,!0),0===e.strm.avail_out?N:D):e.last_lit&&(L(e,!1),0===e.strm.avail_out)?I:R}(o,t):n[o.level].func(o,t);if(h!==N&&h!==D||(o.status=A),h===I||h===N)return 0===e.avail_out&&(o.last_flush=-1),f;if(h===R&&(1===t?i._tr_align(o):5!==t&&(i._tr_stored_block(o,0,0,!1),3===t&&(C(o.head),0===o.lookahead&&(o.strstart=0,o.block_start=0,o.insert=0))),M(e),0===e.avail_out))return o.last_flush=-1,f}return t!==c?f:o.wrap<=0?1:(2===o.wrap?(x(o,255&e.adler),x(o,e.adler>>8&255),x(o,e.adler>>16&255),x(o,e.adler>>24&255),x(o,255&e.total_in),x(o,e.total_in>>8&255),x(o,e.total_in>>16&255),x(o,e.total_in>>24&255)):(B(o,e.adler>>>16),B(o,65535&e.adler)),M(e),o.wrap>0&&(o.wrap=-o.wrap),0!==o.pending?f:1)},t.deflateEnd=function(e){var t;return e&&e.state?(t=e.state.status)!==S&&69!==t&&73!==t&&91!==t&&t!==T&&t!==O&&t!==A?j(e,d):(e.state=null,t===O?j(e,-3):f):d},t.deflateSetDictionary=function(e,t){var r,n,i,s,u,l,c,g,p=t.length;if(!e||!e.state)return d;if(2===(s=(r=e.state).wrap)||1===s&&r.status!==S||r.lookahead)return d;for(1===s&&(e.adler=a(e.adler,t,p,0)),r.wrap=0,p>=r.w_size&&(0===s&&(C(r.head),r.strstart=0,r.block_start=0,r.insert=0),g=new o.Buf8(r.w_size),o.arraySet(g,t,p-r.w_size,r.w_size,0),t=g,p=r.w_size),u=e.avail_in,l=e.next_in,c=e.input,e.avail_in=p,e.next_in=0,e.input=t,U(r);r.lookahead>=w;){n=r.strstart,i=r.lookahead-(w-1);do{r.ins_h=(r.ins_h<<r.hash_shift^r.window[n+w-1])&r.hash_mask,r.prev[n&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=n,n++}while(--i);r.strstart=n,r.lookahead=w-1,U(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=w-1,r.match_available=0,e.next_in=l,e.input=c,e.avail_in=u,r.wrap=s,f},t.deflateInfo="pako deflate (from Nodeca project)"},2399:e=>{"use strict";e.exports=function(e,t){var r,n,o,i,a,s,u,l,c,f,d,g,p,h,y,m,b,_,w,E,v,S,T,O,A;r=e.state,n=e.next_in,O=e.input,o=n+(e.avail_in-5),i=e.next_out,A=e.output,a=i-(t-e.avail_out),s=i+(e.avail_out-257),u=r.dmax,l=r.wsize,c=r.whave,f=r.wnext,d=r.window,g=r.hold,p=r.bits,h=r.lencode,y=r.distcode,m=(1<<r.lenbits)-1,b=(1<<r.distbits)-1;e:do{p<15&&(g+=O[n++]<<p,p+=8,g+=O[n++]<<p,p+=8),_=h[g&m];t:for(;;){if(g>>>=w=_>>>24,p-=w,0==(w=_>>>16&255))A[i++]=65535&_;else{if(!(16&w)){if(0==(64&w)){_=h[(65535&_)+(g&(1<<w)-1)];continue t}if(32&w){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}E=65535&_,(w&=15)&&(p<w&&(g+=O[n++]<<p,p+=8),E+=g&(1<<w)-1,g>>>=w,p-=w),p<15&&(g+=O[n++]<<p,p+=8,g+=O[n++]<<p,p+=8),_=y[g&b];r:for(;;){if(g>>>=w=_>>>24,p-=w,!(16&(w=_>>>16&255))){if(0==(64&w)){_=y[(65535&_)+(g&(1<<w)-1)];continue r}e.msg="invalid distance code",r.mode=30;break e}if(v=65535&_,p<(w&=15)&&(g+=O[n++]<<p,(p+=8)<w&&(g+=O[n++]<<p,p+=8)),(v+=g&(1<<w)-1)>u){e.msg="invalid distance too far back",r.mode=30;break e}if(g>>>=w,p-=w,v>(w=i-a)){if((w=v-w)>c&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(S=0,T=d,0===f){if(S+=l-w,w<E){E-=w;do{A[i++]=d[S++]}while(--w);S=i-v,T=A}}else if(f<w){if(S+=l+f-w,(w-=f)<E){E-=w;do{A[i++]=d[S++]}while(--w);if(S=0,f<E){E-=w=f;do{A[i++]=d[S++]}while(--w);S=i-v,T=A}}}else if(S+=f-w,w<E){E-=w;do{A[i++]=d[S++]}while(--w);S=i-v,T=A}for(;E>2;)A[i++]=T[S++],A[i++]=T[S++],A[i++]=T[S++],E-=3;E&&(A[i++]=T[S++],E>1&&(A[i++]=T[S++]))}else{S=i-v;do{A[i++]=A[S++],A[i++]=A[S++],A[i++]=A[S++],E-=3}while(E>2);E&&(A[i++]=A[S++],E>1&&(A[i++]=A[S++]))}break}}break}}while(n<o&&i<s);n-=E=p>>3,g&=(1<<(p-=E<<3))-1,e.next_in=n,e.next_out=i,e.avail_in=n<o?o-n+5:5-(n-o),e.avail_out=i<s?s-i+257:257-(i-s),r.hold=g,r.bits=p}},3534:(e,t,r)=>{"use strict";var n=r(1307),o=r(7506),i=r(8548),a=r(2399),s=r(1721),u=1,l=2,c=0,f=-2,d=1,g=12,p=30,h=852,y=592;function m(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function b(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function _(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=d,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new n.Buf32(h),t.distcode=t.distdyn=new n.Buf32(y),t.sane=1,t.back=-1,c):f}function w(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,_(e)):f}function E(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?f:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,w(e))):f}function v(e,t){var r,n;return e?(n=new b,e.state=n,n.window=null,(r=E(e,t))!==c&&(e.state=null),r):f}var S,T,O=!0;function A(e){if(O){var t;for(S=new n.Buf32(512),T=new n.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(s(u,e.lens,0,288,S,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;s(l,e.lens,0,32,T,0,e.work,{bits:5}),O=!1}e.lencode=S,e.lenbits=9,e.distcode=T,e.distbits=5}function I(e,t,r,o){var i,a=e.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new n.Buf8(a.wsize)),o>=a.wsize?(n.arraySet(a.window,t,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):((i=a.wsize-a.wnext)>o&&(i=o),n.arraySet(a.window,t,r-o,i,a.wnext),(o-=i)?(n.arraySet(a.window,t,r-o,o,0),a.wnext=o,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=i))),0}t.inflateReset=w,t.inflateReset2=E,t.inflateResetKeep=_,t.inflateInit=function(e){return v(e,15)},t.inflateInit2=v,t.inflate=function(e,t){var r,h,y,b,_,w,E,v,S,T,O,R,N,D,j,k,C,M,L,x,B,F,U,P,W=0,H=new n.Buf8(4),z=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return f;(r=e.state).mode===g&&(r.mode=13),_=e.next_out,y=e.output,E=e.avail_out,b=e.next_in,h=e.input,w=e.avail_in,v=r.hold,S=r.bits,T=w,O=E,F=c;e:for(;;)switch(r.mode){case d:if(0===r.wrap){r.mode=13;break}for(;S<16;){if(0===w)break e;w--,v+=h[b++]<<S,S+=8}if(2&r.wrap&&35615===v){r.check=0,H[0]=255&v,H[1]=v>>>8&255,r.check=i(r.check,H,2,0),v=0,S=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&v)<<8)+(v>>8))%31){e.msg="incorrect header check",r.mode=p;break}if(8!=(15&v)){e.msg="unknown compression method",r.mode=p;break}if(S-=4,B=8+(15&(v>>>=4)),0===r.wbits)r.wbits=B;else if(B>r.wbits){e.msg="invalid window size",r.mode=p;break}r.dmax=1<<B,e.adler=r.check=1,r.mode=512&v?10:g,v=0,S=0;break;case 2:for(;S<16;){if(0===w)break e;w--,v+=h[b++]<<S,S+=8}if(r.flags=v,8!=(255&r.flags)){e.msg="unknown compression method",r.mode=p;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=p;break}r.head&&(r.head.text=v>>8&1),512&r.flags&&(H[0]=255&v,H[1]=v>>>8&255,r.check=i(r.check,H,2,0)),v=0,S=0,r.mode=3;case 3:for(;S<32;){if(0===w)break e;w--,v+=h[b++]<<S,S+=8}r.head&&(r.head.time=v),512&r.flags&&(H[0]=255&v,H[1]=v>>>8&255,H[2]=v>>>16&255,H[3]=v>>>24&255,r.check=i(r.check,H,4,0)),v=0,S=0,r.mode=4;case 4:for(;S<16;){if(0===w)break e;w--,v+=h[b++]<<S,S+=8}r.head&&(r.head.xflags=255&v,r.head.os=v>>8),512&r.flags&&(H[0]=255&v,H[1]=v>>>8&255,r.check=i(r.check,H,2,0)),v=0,S=0,r.mode=5;case 5:if(1024&r.flags){for(;S<16;){if(0===w)break e;w--,v+=h[b++]<<S,S+=8}r.length=v,r.head&&(r.head.extra_len=v),512&r.flags&&(H[0]=255&v,H[1]=v>>>8&255,r.check=i(r.check,H,2,0)),v=0,S=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((R=r.length)>w&&(R=w),R&&(r.head&&(B=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),n.arraySet(r.head.extra,h,b,R,B)),512&r.flags&&(r.check=i(r.check,h,R,b)),w-=R,b+=R,r.length-=R),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===w)break e;R=0;do{B=h[b+R++],r.head&&B&&r.length<65536&&(r.head.name+=String.fromCharCode(B))}while(B&&R<w);if(512&r.flags&&(r.check=i(r.check,h,R,b)),w-=R,b+=R,B)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=8;case 8:if(4096&r.flags){if(0===w)break e;R=0;do{B=h[b+R++],r.head&&B&&r.length<65536&&(r.head.comment+=String.fromCharCode(B))}while(B&&R<w);if(512&r.flags&&(r.check=i(r.check,h,R,b)),w-=R,b+=R,B)break e}else r.head&&(r.head.comment=null);r.mode=9;case 9:if(512&r.flags){for(;S<16;){if(0===w)break e;w--,v+=h[b++]<<S,S+=8}if(v!==(65535&r.check)){e.msg="header crc mismatch",r.mode=p;break}v=0,S=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=g;break;case 10:for(;S<32;){if(0===w)break e;w--,v+=h[b++]<<S,S+=8}e.adler=r.check=m(v),v=0,S=0,r.mode=11;case 11:if(0===r.havedict)return e.next_out=_,e.avail_out=E,e.next_in=b,e.avail_in=w,r.hold=v,r.bits=S,2;e.adler=r.check=1,r.mode=g;case g:if(5===t||6===t)break e;case 13:if(r.last){v>>>=7&S,S-=7&S,r.mode=27;break}for(;S<3;){if(0===w)break e;w--,v+=h[b++]<<S,S+=8}switch(r.last=1&v,S-=1,3&(v>>>=1)){case 0:r.mode=14;break;case 1:if(A(r),r.mode=20,6===t){v>>>=2,S-=2;break e}break;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=p}v>>>=2,S-=2;break;case 14:for(v>>>=7&S,S-=7&S;S<32;){if(0===w)break e;w--,v+=h[b++]<<S,S+=8}if((65535&v)!=(v>>>16^65535)){e.msg="invalid stored block lengths",r.mode=p;break}if(r.length=65535&v,v=0,S=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(R=r.length){if(R>w&&(R=w),R>E&&(R=E),0===R)break e;n.arraySet(y,h,b,R,_),w-=R,b+=R,E-=R,_+=R,r.length-=R;break}r.mode=g;break;case 17:for(;S<14;){if(0===w)break e;w--,v+=h[b++]<<S,S+=8}if(r.nlen=257+(31&v),v>>>=5,S-=5,r.ndist=1+(31&v),v>>>=5,S-=5,r.ncode=4+(15&v),v>>>=4,S-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=p;break}r.have=0,r.mode=18;case 18:for(;r.have<r.ncode;){for(;S<3;){if(0===w)break e;w--,v+=h[b++]<<S,S+=8}r.lens[z[r.have++]]=7&v,v>>>=3,S-=3}for(;r.have<19;)r.lens[z[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,U={bits:r.lenbits},F=s(0,r.lens,0,19,r.lencode,0,r.work,U),r.lenbits=U.bits,F){e.msg="invalid code lengths set",r.mode=p;break}r.have=0,r.mode=19;case 19:for(;r.have<r.nlen+r.ndist;){for(;k=(W=r.lencode[v&(1<<r.lenbits)-1])>>>16&255,C=65535&W,!((j=W>>>24)<=S);){if(0===w)break e;w--,v+=h[b++]<<S,S+=8}if(C<16)v>>>=j,S-=j,r.lens[r.have++]=C;else{if(16===C){for(P=j+2;S<P;){if(0===w)break e;w--,v+=h[b++]<<S,S+=8}if(v>>>=j,S-=j,0===r.have){e.msg="invalid bit length repeat",r.mode=p;break}B=r.lens[r.have-1],R=3+(3&v),v>>>=2,S-=2}else if(17===C){for(P=j+3;S<P;){if(0===w)break e;w--,v+=h[b++]<<S,S+=8}S-=j,B=0,R=3+(7&(v>>>=j)),v>>>=3,S-=3}else{for(P=j+7;S<P;){if(0===w)break e;w--,v+=h[b++]<<S,S+=8}S-=j,B=0,R=11+(127&(v>>>=j)),v>>>=7,S-=7}if(r.have+R>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=p;break}for(;R--;)r.lens[r.have++]=B}}if(r.mode===p)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=p;break}if(r.lenbits=9,U={bits:r.lenbits},F=s(u,r.lens,0,r.nlen,r.lencode,0,r.work,U),r.lenbits=U.bits,F){e.msg="invalid literal/lengths set",r.mode=p;break}if(r.distbits=6,r.distcode=r.distdyn,U={bits:r.distbits},F=s(l,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,U),r.distbits=U.bits,F){e.msg="invalid distances set",r.mode=p;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(w>=6&&E>=258){e.next_out=_,e.avail_out=E,e.next_in=b,e.avail_in=w,r.hold=v,r.bits=S,a(e,O),_=e.next_out,y=e.output,E=e.avail_out,b=e.next_in,h=e.input,w=e.avail_in,v=r.hold,S=r.bits,r.mode===g&&(r.back=-1);break}for(r.back=0;k=(W=r.lencode[v&(1<<r.lenbits)-1])>>>16&255,C=65535&W,!((j=W>>>24)<=S);){if(0===w)break e;w--,v+=h[b++]<<S,S+=8}if(k&&0==(240&k)){for(M=j,L=k,x=C;k=(W=r.lencode[x+((v&(1<<M+L)-1)>>M)])>>>16&255,C=65535&W,!(M+(j=W>>>24)<=S);){if(0===w)break e;w--,v+=h[b++]<<S,S+=8}v>>>=M,S-=M,r.back+=M}if(v>>>=j,S-=j,r.back+=j,r.length=C,0===k){r.mode=26;break}if(32&k){r.back=-1,r.mode=g;break}if(64&k){e.msg="invalid literal/length code",r.mode=p;break}r.extra=15&k,r.mode=22;case 22:if(r.extra){for(P=r.extra;S<P;){if(0===w)break e;w--,v+=h[b++]<<S,S+=8}r.length+=v&(1<<r.extra)-1,v>>>=r.extra,S-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;k=(W=r.distcode[v&(1<<r.distbits)-1])>>>16&255,C=65535&W,!((j=W>>>24)<=S);){if(0===w)break e;w--,v+=h[b++]<<S,S+=8}if(0==(240&k)){for(M=j,L=k,x=C;k=(W=r.distcode[x+((v&(1<<M+L)-1)>>M)])>>>16&255,C=65535&W,!(M+(j=W>>>24)<=S);){if(0===w)break e;w--,v+=h[b++]<<S,S+=8}v>>>=M,S-=M,r.back+=M}if(v>>>=j,S-=j,r.back+=j,64&k){e.msg="invalid distance code",r.mode=p;break}r.offset=C,r.extra=15&k,r.mode=24;case 24:if(r.extra){for(P=r.extra;S<P;){if(0===w)break e;w--,v+=h[b++]<<S,S+=8}r.offset+=v&(1<<r.extra)-1,v>>>=r.extra,S-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=p;break}r.mode=25;case 25:if(0===E)break e;if(R=O-E,r.offset>R){if((R=r.offset-R)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=p;break}R>r.wnext?(R-=r.wnext,N=r.wsize-R):N=r.wnext-R,R>r.length&&(R=r.length),D=r.window}else D=y,N=_-r.offset,R=r.length;R>E&&(R=E),E-=R,r.length-=R;do{y[_++]=D[N++]}while(--R);0===r.length&&(r.mode=21);break;case 26:if(0===E)break e;y[_++]=r.length,E--,r.mode=21;break;case 27:if(r.wrap){for(;S<32;){if(0===w)break e;w--,v|=h[b++]<<S,S+=8}if(O-=E,e.total_out+=O,r.total+=O,O&&(e.adler=r.check=r.flags?i(r.check,y,O,_-O):o(r.check,y,O,_-O)),O=E,(r.flags?v:m(v))!==r.check){e.msg="incorrect data check",r.mode=p;break}v=0,S=0}r.mode=28;case 28:if(r.wrap&&r.flags){for(;S<32;){if(0===w)break e;w--,v+=h[b++]<<S,S+=8}if(v!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=p;break}v=0,S=0}r.mode=29;case 29:F=1;break e;case p:F=-3;break e;case 31:return-4;default:return f}return e.next_out=_,e.avail_out=E,e.next_in=b,e.avail_in=w,r.hold=v,r.bits=S,(r.wsize||O!==e.avail_out&&r.mode<p&&(r.mode<27||4!==t))&&I(e,e.output,e.next_out,O-e.avail_out)?(r.mode=31,-4):(T-=e.avail_in,O-=e.avail_out,e.total_in+=T,e.total_out+=O,r.total+=O,r.wrap&&O&&(e.adler=r.check=r.flags?i(r.check,y,O,e.next_out-O):o(r.check,y,O,e.next_out-O)),e.data_type=r.bits+(r.last?64:0)+(r.mode===g?128:0)+(20===r.mode||15===r.mode?256:0),(0===T&&0===O||4===t)&&F===c&&(F=-5),F)},t.inflateEnd=function(e){if(!e||!e.state)return f;var t=e.state;return t.window&&(t.window=null),e.state=null,c},t.inflateGetHeader=function(e,t){var r;return e&&e.state?0==(2&(r=e.state).wrap)?f:(r.head=t,t.done=!1,c):f},t.inflateSetDictionary=function(e,t){var r,n=t.length;return e&&e.state?0!==(r=e.state).wrap&&11!==r.mode?f:11===r.mode&&o(1,t,n,0)!==r.check?-3:I(e,t,n,n)?(r.mode=31,-4):(r.havedict=1,c):f},t.inflateInfo="pako inflate (from Nodeca project)"},1721:(e,t,r)=>{"use strict";var n=r(1307),o=[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],i=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],a=[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,0,0],s=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(e,t,r,u,l,c,f,d){var g,p,h,y,m,b,_,w,E,v=d.bits,S=0,T=0,O=0,A=0,I=0,R=0,N=0,D=0,j=0,k=0,C=null,M=0,L=new n.Buf16(16),x=new n.Buf16(16),B=null,F=0;for(S=0;S<=15;S++)L[S]=0;for(T=0;T<u;T++)L[t[r+T]]++;for(I=v,A=15;A>=1&&0===L[A];A--);if(I>A&&(I=A),0===A)return l[c++]=20971520,l[c++]=20971520,d.bits=1,0;for(O=1;O<A&&0===L[O];O++);for(I<O&&(I=O),D=1,S=1;S<=15;S++)if(D<<=1,(D-=L[S])<0)return-1;if(D>0&&(0===e||1!==A))return-1;for(x[1]=0,S=1;S<15;S++)x[S+1]=x[S]+L[S];for(T=0;T<u;T++)0!==t[r+T]&&(f[x[t[r+T]]++]=T);if(0===e?(C=B=f,b=19):1===e?(C=o,M-=257,B=i,F-=257,b=256):(C=a,B=s,b=-1),k=0,T=0,S=O,m=c,R=I,N=0,h=-1,y=(j=1<<I)-1,1===e&&j>852||2===e&&j>592)return 1;for(;;){_=S-N,f[T]<b?(w=0,E=f[T]):f[T]>b?(w=B[F+f[T]],E=C[M+f[T]]):(w=96,E=0),g=1<<S-N,O=p=1<<R;do{l[m+(k>>N)+(p-=g)]=_<<24|w<<16|E|0}while(0!==p);for(g=1<<S-1;k&g;)g>>=1;if(0!==g?(k&=g-1,k+=g):k=0,T++,0==--L[S]){if(S===A)break;S=t[r+f[T]]}if(S>I&&(k&y)!==h){for(0===N&&(N=I),m+=O,D=1<<(R=S-N);R+N<A&&!((D-=L[R+N])<=0);)R++,D<<=1;if(j+=1<<R,1===e&&j>852||2===e&&j>592)return 1;l[h=k&y]=I<<24|R<<16|m-c|0}}return 0!==k&&(l[m+k]=S-N<<24|64<<16|0),d.bits=I,0}},8021:e=>{"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},5280:(e,t,r)=>{"use strict";var n=r(1307);function o(e){for(var t=e.length;--t>=0;)e[t]=0}var i=256,a=i+1+29,s=30,u=19,l=2*a+1,c=15,f=16,d=256,g=[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],p=[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],h=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],y=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],m=new Array(2*(a+2));o(m);var b=new Array(60);o(b);var _=new Array(512);o(_);var w=new Array(256);o(w);var E=new Array(29);o(E);var v,S,T,O=new Array(s);function A(e,t,r,n,o){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=o,this.has_stree=e&&e.length}function I(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function R(e){return e<256?_[e]:_[256+(e>>>7)]}function N(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function D(e,t,r){e.bi_valid>f-r?(e.bi_buf|=t<<e.bi_valid&65535,N(e,e.bi_buf),e.bi_buf=t>>f-e.bi_valid,e.bi_valid+=r-f):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)}function j(e,t,r){D(e,r[2*t],r[2*t+1])}function k(e,t){var r=0;do{r|=1&e,e>>>=1,r<<=1}while(--t>0);return r>>>1}function C(e,t,r){var n,o,i=new Array(c+1),a=0;for(n=1;n<=c;n++)i[n]=a=a+r[n-1]<<1;for(o=0;o<=t;o++){var s=e[2*o+1];0!==s&&(e[2*o]=k(i[s]++,s))}}function M(e){var t;for(t=0;t<a;t++)e.dyn_ltree[2*t]=0;for(t=0;t<s;t++)e.dyn_dtree[2*t]=0;for(t=0;t<u;t++)e.bl_tree[2*t]=0;e.dyn_ltree[2*d]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function L(e){e.bi_valid>8?N(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function x(e,t,r,n){var o=2*t,i=2*r;return e[o]<e[i]||e[o]===e[i]&&n[t]<=n[r]}function B(e,t,r){for(var n=e.heap[r],o=r<<1;o<=e.heap_len&&(o<e.heap_len&&x(t,e.heap[o+1],e.heap[o],e.depth)&&o++,!x(t,n,e.heap[o],e.depth));)e.heap[r]=e.heap[o],r=o,o<<=1;e.heap[r]=n}function F(e,t,r){var n,o,a,s,u=0;if(0!==e.last_lit)do{n=e.pending_buf[e.d_buf+2*u]<<8|e.pending_buf[e.d_buf+2*u+1],o=e.pending_buf[e.l_buf+u],u++,0===n?j(e,o,t):(j(e,(a=w[o])+i+1,t),0!==(s=g[a])&&D(e,o-=E[a],s),j(e,a=R(--n),r),0!==(s=p[a])&&D(e,n-=O[a],s))}while(u<e.last_lit);j(e,d,t)}function U(e,t){var r,n,o,i=t.dyn_tree,a=t.stat_desc.static_tree,s=t.stat_desc.has_stree,u=t.stat_desc.elems,f=-1;for(e.heap_len=0,e.heap_max=l,r=0;r<u;r++)0!==i[2*r]?(e.heap[++e.heap_len]=f=r,e.depth[r]=0):i[2*r+1]=0;for(;e.heap_len<2;)i[2*(o=e.heap[++e.heap_len]=f<2?++f:0)]=1,e.depth[o]=0,e.opt_len--,s&&(e.static_len-=a[2*o+1]);for(t.max_code=f,r=e.heap_len>>1;r>=1;r--)B(e,i,r);o=u;do{r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],B(e,i,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,i[2*o]=i[2*r]+i[2*n],e.depth[o]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,i[2*r+1]=i[2*n+1]=o,e.heap[1]=o++,B(e,i,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,n,o,i,a,s,u=t.dyn_tree,f=t.max_code,d=t.stat_desc.static_tree,g=t.stat_desc.has_stree,p=t.stat_desc.extra_bits,h=t.stat_desc.extra_base,y=t.stat_desc.max_length,m=0;for(i=0;i<=c;i++)e.bl_count[i]=0;for(u[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r<l;r++)(i=u[2*u[2*(n=e.heap[r])+1]+1]+1)>y&&(i=y,m++),u[2*n+1]=i,n>f||(e.bl_count[i]++,a=0,n>=h&&(a=p[n-h]),s=u[2*n],e.opt_len+=s*(i+a),g&&(e.static_len+=s*(d[2*n+1]+a)));if(0!==m){do{for(i=y-1;0===e.bl_count[i];)i--;e.bl_count[i]--,e.bl_count[i+1]+=2,e.bl_count[y]--,m-=2}while(m>0);for(i=y;0!==i;i--)for(n=e.bl_count[i];0!==n;)(o=e.heap[--r])>f||(u[2*o+1]!==i&&(e.opt_len+=(i-u[2*o+1])*u[2*o],u[2*o+1]=i),n--)}}(e,t),C(i,f,e.bl_count)}function P(e,t,r){var n,o,i=-1,a=t[1],s=0,u=7,l=4;for(0===a&&(u=138,l=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)o=a,a=t[2*(n+1)+1],++s<u&&o===a||(s<l?e.bl_tree[2*o]+=s:0!==o?(o!==i&&e.bl_tree[2*o]++,e.bl_tree[32]++):s<=10?e.bl_tree[34]++:e.bl_tree[36]++,s=0,i=o,0===a?(u=138,l=3):o===a?(u=6,l=3):(u=7,l=4))}function W(e,t,r){var n,o,i=-1,a=t[1],s=0,u=7,l=4;for(0===a&&(u=138,l=3),n=0;n<=r;n++)if(o=a,a=t[2*(n+1)+1],!(++s<u&&o===a)){if(s<l)do{j(e,o,e.bl_tree)}while(0!=--s);else 0!==o?(o!==i&&(j(e,o,e.bl_tree),s--),j(e,16,e.bl_tree),D(e,s-3,2)):s<=10?(j(e,17,e.bl_tree),D(e,s-3,3)):(j(e,18,e.bl_tree),D(e,s-11,7));s=0,i=o,0===a?(u=138,l=3):o===a?(u=6,l=3):(u=7,l=4)}}o(O);var H=!1;function z(e,t,r,o){D(e,0+(o?1:0),3),function(e,t,r,o){L(e),N(e,r),N(e,~r),n.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}(e,t,r)}t._tr_init=function(e){H||(function(){var e,t,r,n,o,l=new Array(c+1);for(r=0,n=0;n<28;n++)for(E[n]=r,e=0;e<1<<g[n];e++)w[r++]=n;for(w[r-1]=n,o=0,n=0;n<16;n++)for(O[n]=o,e=0;e<1<<p[n];e++)_[o++]=n;for(o>>=7;n<s;n++)for(O[n]=o<<7,e=0;e<1<<p[n]-7;e++)_[256+o++]=n;for(t=0;t<=c;t++)l[t]=0;for(e=0;e<=143;)m[2*e+1]=8,e++,l[8]++;for(;e<=255;)m[2*e+1]=9,e++,l[9]++;for(;e<=279;)m[2*e+1]=7,e++,l[7]++;for(;e<=287;)m[2*e+1]=8,e++,l[8]++;for(C(m,a+1,l),e=0;e<s;e++)b[2*e+1]=5,b[2*e]=k(e,5);v=new A(m,g,i+1,a,c),S=new A(b,p,0,s,c),T=new A(new Array(0),h,0,u,7)}(),H=!0),e.l_desc=new I(e.dyn_ltree,v),e.d_desc=new I(e.dyn_dtree,S),e.bl_desc=new I(e.bl_tree,T),e.bi_buf=0,e.bi_valid=0,M(e)},t._tr_stored_block=z,t._tr_flush_block=function(e,t,r,n){var o,a,s=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<i;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0}(e)),U(e,e.l_desc),U(e,e.d_desc),s=function(e){var t;for(P(e,e.dyn_ltree,e.l_desc.max_code),P(e,e.dyn_dtree,e.d_desc.max_code),U(e,e.bl_desc),t=u-1;t>=3&&0===e.bl_tree[2*y[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),o=e.opt_len+3+7>>>3,(a=e.static_len+3+7>>>3)<=o&&(o=a)):o=a=r+5,r+4<=o&&-1!==t?z(e,t,r,n):4===e.strategy||a===o?(D(e,2+(n?1:0),3),F(e,m,b)):(D(e,4+(n?1:0),3),function(e,t,r,n){var o;for(D(e,t-257,5),D(e,r-1,5),D(e,n-4,4),o=0;o<n;o++)D(e,e.bl_tree[2*y[o]+1],3);W(e,e.dyn_ltree,t-1),W(e,e.dyn_dtree,r-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,s+1),F(e,e.dyn_ltree,e.dyn_dtree)),M(e),n&&L(e)},t._tr_tally=function(e,t,r){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(w[r]+i+1)]++,e.dyn_dtree[2*R(t)]++),e.last_lit===e.lit_bufsize-1},t._tr_align=function(e){D(e,2,3),j(e,d,m),function(e){16===e.bi_valid?(N(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},7563:e=>{"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},5724:(e,t,r)=>{"use strict";var n=r(9142);function o(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function i(e,t){for(var r,n="",o=0,i=-1,a=0,s=0;s<=e.length;++s){if(s<e.length)r=e.charCodeAt(s);else{if(47===r)break;r=47}if(47===r){if(i===s-1||1===a);else if(i!==s-1&&2===a){if(n.length<2||2!==o||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2))if(n.length>2){var u=n.lastIndexOf("/");if(u!==n.length-1){-1===u?(n="",o=0):o=(n=n.slice(0,u)).length-1-n.lastIndexOf("/"),i=s,a=0;continue}}else if(2===n.length||1===n.length){n="",o=0,i=s,a=0;continue}t&&(n.length>0?n+="/..":n="..",o=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),o=s-i-1;i=s,a=0}else 46===r&&-1!==a?++a:a=-1}return n}var a={resolve:function(){for(var e,t="",r=!1,a=arguments.length-1;a>=-1&&!r;a--){var s;a>=0?s=arguments[a]:(void 0===e&&(e=n.cwd()),s=e),o(s),0!==s.length&&(t=s+"/"+t,r=47===s.charCodeAt(0))}return t=i(t,!r),r?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function(e){if(o(e),0===e.length)return".";var t=47===e.charCodeAt(0),r=47===e.charCodeAt(e.length-1);return 0!==(e=i(e,!t)).length||t||(e="."),e.length>0&&r&&(e+="/"),t?"/"+e:e},isAbsolute:function(e){return o(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,t=0;t<arguments.length;++t){var r=arguments[t];o(r),r.length>0&&(void 0===e?e=r:e+="/"+r)}return void 0===e?".":a.normalize(e)},relative:function(e,t){if(o(e),o(t),e===t)return"";if((e=a.resolve(e))===(t=a.resolve(t)))return"";for(var r=1;r<e.length&&47===e.charCodeAt(r);++r);for(var n=e.length,i=n-r,s=1;s<t.length&&47===t.charCodeAt(s);++s);for(var u=t.length-s,l=i<u?i:u,c=-1,f=0;f<=l;++f){if(f===l){if(u>l){if(47===t.charCodeAt(s+f))return t.slice(s+f+1);if(0===f)return t.slice(s+f)}else i>l&&(47===e.charCodeAt(r+f)?c=f:0===f&&(c=0));break}var d=e.charCodeAt(r+f);if(d!==t.charCodeAt(s+f))break;47===d&&(c=f)}var g="";for(f=r+c+1;f<=n;++f)f!==n&&47!==e.charCodeAt(f)||(0===g.length?g+="..":g+="/..");return g.length>0?g+t.slice(s+c):(s+=c,47===t.charCodeAt(s)&&++s,t.slice(s))},_makeLong:function(e){return e},dirname:function(e){if(o(e),0===e.length)return".";for(var t=e.charCodeAt(0),r=47===t,n=-1,i=!0,a=e.length-1;a>=1;--a)if(47===(t=e.charCodeAt(a))){if(!i){n=a;break}}else i=!1;return-1===n?r?"/":".":r&&1===n?"//":e.slice(0,n)},basename:function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');o(e);var r,n=0,i=-1,a=!0;if(void 0!==t&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return"";var s=t.length-1,u=-1;for(r=e.length-1;r>=0;--r){var l=e.charCodeAt(r);if(47===l){if(!a){n=r+1;break}}else-1===u&&(a=!1,u=r+1),s>=0&&(l===t.charCodeAt(s)?-1==--s&&(i=r):(s=-1,i=u))}return n===i?i=u:-1===i&&(i=e.length),e.slice(n,i)}for(r=e.length-1;r>=0;--r)if(47===e.charCodeAt(r)){if(!a){n=r+1;break}}else-1===i&&(a=!1,i=r+1);return-1===i?"":e.slice(n,i)},extname:function(e){o(e);for(var t=-1,r=0,n=-1,i=!0,a=0,s=e.length-1;s>=0;--s){var u=e.charCodeAt(s);if(47!==u)-1===n&&(i=!1,n=s+1),46===u?-1===t?t=s:1!==a&&(a=1):-1!==t&&(a=-1);else if(!i){r=s+1;break}}return-1===t||-1===n||0===a||1===a&&t===n-1&&t===r+1?"":e.slice(t,n)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var r=t.dir||t.root,n=t.base||(t.name||"")+(t.ext||"");return r?r===t.root?r+n:r+"/"+n:n}(0,e)},parse:function(e){o(e);var t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;var r,n=e.charCodeAt(0),i=47===n;i?(t.root="/",r=1):r=0;for(var a=-1,s=0,u=-1,l=!0,c=e.length-1,f=0;c>=r;--c)if(47!==(n=e.charCodeAt(c)))-1===u&&(l=!1,u=c+1),46===n?-1===a?a=c:1!==f&&(f=1):-1!==a&&(f=-1);else if(!l){s=c+1;break}return-1===a||-1===u||0===f||1===f&&a===u-1&&a===s+1?-1!==u&&(t.base=t.name=0===s&&i?e.slice(1,u):e.slice(s,u)):(0===s&&i?(t.name=e.slice(1,a),t.base=e.slice(1,u)):(t.name=e.slice(s,a),t.base=e.slice(s,u)),t.ext=e.slice(a,u)),s>0?t.dir=e.slice(0,s-1):i&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};a.posix=a,e.exports=a},9142:e=>{var t,r,n=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{r="function"==typeof clearTimeout?clearTimeout:i}catch(e){r=i}}();var s,u=[],l=!1,c=-1;function f(){l&&s&&(l=!1,s.length?u=s.concat(u):c=-1,u.length&&d())}function d(){if(!l){var e=a(f);l=!0;for(var t=u.length;t;){for(s=u,u=[];++c<t;)s&&s[c].run();c=-1,t=u.length}s=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===i||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{return r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function g(e,t){this.fun=e,this.array=t}function p(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new g(e,t)),1!==u.length||l||a(d)},g.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=p,n.addListener=p,n.once=p,n.off=p,n.removeListener=p,n.removeAllListeners=p,n.emit=p,n.prependListener=p,n.prependOnceListener=p,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},9024:e=>{"use strict";var t={};function r(e,r,n){n||(n=Error);var o=function(e){var t,n;function o(t,n,o){return e.call(this,function(e,t,n){return"string"==typeof r?r:r(e,t,n)}(t,n,o))||this}return n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,o}(n);o.prototype.name=n.name,o.prototype.code=e,t[e]=o}function n(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}r("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),r("ERR_INVALID_ARG_TYPE",(function(e,t,r){var o,i,a,s,u;if("string"==typeof t&&(i="not ",t.substr(0,4)===i)?(o="must not be",t=t.replace(/^not /,"")):o="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-9,r)===t}(e," argument"))a="The ".concat(e," ").concat(o," ").concat(n(t,"type"));else{var l=("number"!=typeof u&&(u=0),u+1>(s=e).length||-1===s.indexOf(".",u)?"argument":"property");a='The "'.concat(e,'" ').concat(l," ").concat(o," ").concat(n(t,"type"))}return a+". Received type ".concat(typeof r)}),TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.q=t},6884:(e,t,r)=>{"use strict";var n=r(9142),o=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=c;var i=r(6297),a=r(1471);r(1736)(c,i);for(var s=o(a.prototype),u=0;u<s.length;u++){var l=s[u];c.prototype[l]||(c.prototype[l]=a.prototype[l])}function c(e){if(!(this instanceof c))return new c(e);i.call(this,e),a.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",f)))}function f(){this._writableState.ended||n.nextTick(d,this)}function d(e){e.end()}Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(c.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(c.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(c.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})},3582:(e,t,r)=>{"use strict";e.exports=o;var n=r(9154);function o(e){if(!(this instanceof o))return new o(e);n.call(this,e)}r(1736)(o,n),o.prototype._transform=function(e,t,r){r(null,e)}},6297:(e,t,r)=>{"use strict";var n,o=r(9142);e.exports=O,O.ReadableState=T,r(8291).EventEmitter;var i,a=function(e,t){return e.listeners(t).length},s=r(7144),u=r(9033).Buffer,l=(void 0!==r.g?r.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},c=r(4616);i=c&&c.debuglog?c.debuglog("stream"):function(){};var f,d,g,p=r(5392),h=r(7572),y=r(6756).getHighWaterMark,m=r(9024).q,b=m.ERR_INVALID_ARG_TYPE,_=m.ERR_STREAM_PUSH_AFTER_EOF,w=m.ERR_METHOD_NOT_IMPLEMENTED,E=m.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(1736)(O,s);var v=h.errorOrDestroy,S=["error","close","destroy","pause","resume"];function T(e,t,o){n=n||r(6884),e=e||{},"boolean"!=typeof o&&(o=t instanceof n),this.objectMode=!!e.objectMode,o&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=y(this,e,"readableHighWaterMark",o),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(f||(f=r(3462).StringDecoder),this.decoder=new f(e.encoding),this.encoding=e.encoding)}function O(e){if(n=n||r(6884),!(this instanceof O))return new O(e);var t=this instanceof n;this._readableState=new T(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),s.call(this)}function A(e,t,r,n,o){i("readableAddChunk",t);var a,s=e._readableState;if(null===t)s.reading=!1,function(e,t){if(i("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?D(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,j(e)))}}(e,s);else if(o||(a=function(e,t){var r,n;return n=t,u.isBuffer(n)||n instanceof l||"string"==typeof t||void 0===t||e.objectMode||(r=new b("chunk",["string","Buffer","Uint8Array"],t)),r}(s,t)),a)v(e,a);else if(s.objectMode||t&&t.length>0)if("string"==typeof t||s.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=function(e){return u.from(e)}(t)),n)s.endEmitted?v(e,new E):I(e,s,t,!0);else if(s.ended)v(e,new _);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!r?(t=s.decoder.write(t),s.objectMode||0!==t.length?I(e,s,t,!1):k(e,s)):I(e,s,t,!1)}else n||(s.reading=!1,k(e,s));return!s.ended&&(s.length<s.highWaterMark||0===s.length)}function I(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&D(e)),k(e,t)}Object.defineProperty(O.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),O.prototype.destroy=h.destroy,O.prototype._undestroy=h.undestroy,O.prototype._destroy=function(e,t){t(e)},O.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=u.from(e,t),t=""),r=!0),A(this,e,t,!1,r)},O.prototype.unshift=function(e){return A(this,e,null,!0,!1)},O.prototype.isPaused=function(){return!1===this._readableState.flowing},O.prototype.setEncoding=function(e){f||(f=r(3462).StringDecoder);var t=new f(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,o="";null!==n;)o+=t.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==o&&this._readableState.buffer.push(o),this._readableState.length=o.length,this};var R=1073741824;function N(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=R?e=R:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function D(e){var t=e._readableState;i("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(i("emitReadable",t.flowing),t.emittedReadable=!0,o.nextTick(j,e))}function j(e){var t=e._readableState;i("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,B(e)}function k(e,t){t.readingMore||(t.readingMore=!0,o.nextTick(C,e,t))}function C(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(i("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function M(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function L(e){i("readable nexttick read 0"),e.read(0)}function x(e,t){i("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),B(e),t.flowing&&!t.reading&&e.read(0)}function B(e){var t=e._readableState;for(i("flow",t.flowing);t.flowing&&null!==e.read(););}function F(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function U(e){var t=e._readableState;i("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,o.nextTick(P,t,e))}function P(e,t){if(i("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function W(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}O.prototype.read=function(e){i("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return i("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?U(this):D(this),null;if(0===(e=N(e,t))&&t.ended)return 0===t.length&&U(this),null;var n,o=t.needReadable;return i("need readable",o),(0===t.length||t.length-e<t.highWaterMark)&&i("length less than watermark",o=!0),t.ended||t.reading?i("reading or ended",o=!1):o&&(i("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=N(r,t))),null===(n=e>0?F(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&U(this)),null!==n&&this.emit("data",n),n},O.prototype._read=function(e){v(this,new w("_read()"))},O.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,i("pipe count=%d opts=%j",n.pipesCount,t);var s=t&&!1===t.end||e===o.stdout||e===o.stderr?h:u;function u(){i("onend"),e.end()}n.endEmitted?o.nextTick(s):r.once("end",s),e.on("unpipe",(function t(o,a){i("onunpipe"),o===r&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,i("cleanup"),e.removeListener("close",g),e.removeListener("finish",p),e.removeListener("drain",l),e.removeListener("error",d),e.removeListener("unpipe",t),r.removeListener("end",u),r.removeListener("end",h),r.removeListener("data",f),c=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||l())}));var l=function(e){return function(){var t=e._readableState;i("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&a(e,"data")&&(t.flowing=!0,B(e))}}(r);e.on("drain",l);var c=!1;function f(t){i("ondata");var o=e.write(t);i("dest.write",o),!1===o&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==W(n.pipes,e))&&!c&&(i("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function d(t){i("onerror",t),h(),e.removeListener("error",d),0===a(e,"error")&&v(e,t)}function g(){e.removeListener("finish",p),h()}function p(){i("onfinish"),e.removeListener("close",g),h()}function h(){i("unpipe"),r.unpipe(e)}return r.on("data",f),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",d),e.once("close",g),e.once("finish",p),e.emit("pipe",r),n.flowing||(i("pipe resume"),r.resume()),e},O.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,o=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i<o;i++)n[i].emit("unpipe",this,{hasUnpiped:!1});return this}var a=W(t.pipes,e);return-1===a||(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},O.prototype.on=function(e,t){var r=s.prototype.on.call(this,e,t),n=this._readableState;return"data"===e?(n.readableListening=this.listenerCount("readable")>0,!1!==n.flowing&&this.resume()):"readable"===e&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,i("on readable",n.length,n.reading),n.length?D(this):n.reading||o.nextTick(L,this))),r},O.prototype.addListener=O.prototype.on,O.prototype.removeListener=function(e,t){var r=s.prototype.removeListener.call(this,e,t);return"readable"===e&&o.nextTick(M,this),r},O.prototype.removeAllListeners=function(e){var t=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||o.nextTick(M,this),t},O.prototype.resume=function(){var e=this._readableState;return e.flowing||(i("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,o.nextTick(x,e,t))}(this,e)),e.paused=!1,this},O.prototype.pause=function(){return i("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(i("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},O.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var o in e.on("end",(function(){if(i("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(o){i("wrapped data"),r.decoder&&(o=r.decoder.write(o)),r.objectMode&&null==o||(r.objectMode||o&&o.length)&&(t.push(o)||(n=!0,e.pause()))})),e)void 0===this[o]&&"function"==typeof e[o]&&(this[o]=function(t){return function(){return e[t].apply(e,arguments)}}(o));for(var a=0;a<S.length;a++)e.on(S[a],this.emit.bind(this,S[a]));return this._read=function(t){i("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(O.prototype[Symbol.asyncIterator]=function(){return void 0===d&&(d=r(2317)),d(this)}),Object.defineProperty(O.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(O.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(O.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),O._fromList=F,Object.defineProperty(O.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(O.from=function(e,t){return void 0===g&&(g=r(6218)),g(O,e,t)})},9154:(e,t,r)=>{"use strict";e.exports=c;var n=r(9024).q,o=n.ERR_METHOD_NOT_IMPLEMENTED,i=n.ERR_MULTIPLE_CALLBACK,a=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=n.ERR_TRANSFORM_WITH_LENGTH_0,u=r(6884);function l(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new i);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var o=this._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}function c(e){if(!(this instanceof c))return new c(e);u.call(this,e),this._transformState={afterTransform:l.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",f)}function f(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?d(this,null,null):this._flush((function(t,r){d(e,t,r)}))}function d(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new s;if(e._transformState.transforming)throw new a;return e.push(null)}r(1736)(c,u),c.prototype.push=function(e,t){return this._transformState.needTransform=!1,u.prototype.push.call(this,e,t)},c.prototype._transform=function(e,t,r){r(new o("_transform()"))},c.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var o=this._readableState;(n.needTransform||o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}},c.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},c.prototype._destroy=function(e,t){u.prototype._destroy.call(this,e,(function(e){t(e)}))}},1471:(e,t,r)=>{"use strict";var n,o=r(9142);function i(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;for(e.entry=null;n;){var o=n.callback;t.pendingcb--,o(undefined),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}e.exports=O,O.WritableState=T;var a,s={deprecate:r(6219)},u=r(7144),l=r(9033).Buffer,c=(void 0!==r.g?r.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},f=r(7572),d=r(6756).getHighWaterMark,g=r(9024).q,p=g.ERR_INVALID_ARG_TYPE,h=g.ERR_METHOD_NOT_IMPLEMENTED,y=g.ERR_MULTIPLE_CALLBACK,m=g.ERR_STREAM_CANNOT_PIPE,b=g.ERR_STREAM_DESTROYED,_=g.ERR_STREAM_NULL_VALUES,w=g.ERR_STREAM_WRITE_AFTER_END,E=g.ERR_UNKNOWN_ENCODING,v=f.errorOrDestroy;function S(){}function T(e,t,a){n=n||r(6884),e=e||{},"boolean"!=typeof a&&(a=t instanceof n),this.objectMode=!!e.objectMode,a&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=d(this,e,"writableHighWaterMark",a),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===e.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if("function"!=typeof i)throw new y;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,i){--t.pendingcb,r?(o.nextTick(i,n),o.nextTick(j,e,t),e._writableState.errorEmitted=!0,v(e,n)):(i(n),e._writableState.errorEmitted=!0,v(e,n),j(e,t))}(e,r,n,t,i);else{var a=N(r)||e.destroyed;a||r.corked||r.bufferProcessing||!r.bufferedRequest||R(e,r),n?o.nextTick(I,e,r,a,i):I(e,r,a,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new i(this)}function O(e){var t=this instanceof(n=n||r(6884));if(!t&&!a.call(O,this))return new O(e);this._writableState=new T(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),u.call(this)}function A(e,t,r,n,o,i,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new b("write")):r?e._writev(o,t.onwrite):e._write(o,i,t.onwrite),t.sync=!1}function I(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),j(e,t)}function R(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,o=new Array(n),a=t.corkedRequestsFree;a.entry=r;for(var s=0,u=!0;r;)o[s]=r,r.isBuf||(u=!1),r=r.next,s+=1;o.allBuffers=u,A(e,t,!0,t.length,o,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new i(t),t.bufferedRequestCount=0}else{for(;r;){var l=r.chunk,c=r.encoding,f=r.callback;if(A(e,t,!1,t.objectMode?1:l.length,l,c,f),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function N(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function D(e,t){e._final((function(r){t.pendingcb--,r&&v(e,r),t.prefinished=!0,e.emit("prefinish"),j(e,t)}))}function j(e,t){var r=N(t);if(r&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,o.nextTick(D,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}r(1736)(O,u),T.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(T.prototype,"buffer",{get:s.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(a=Function.prototype[Symbol.hasInstance],Object.defineProperty(O,Symbol.hasInstance,{value:function(e){return!!a.call(this,e)||this===O&&e&&e._writableState instanceof T}})):a=function(e){return e instanceof this},O.prototype.pipe=function(){v(this,new m)},O.prototype.write=function(e,t,r){var n,i=this._writableState,a=!1,s=!i.objectMode&&(n=e,l.isBuffer(n)||n instanceof c);return s&&!l.isBuffer(e)&&(e=function(e){return l.from(e)}(e)),"function"==typeof t&&(r=t,t=null),s?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof r&&(r=S),i.ending?function(e,t){var r=new w;v(e,r),o.nextTick(t,r)}(this,r):(s||function(e,t,r,n){var i;return null===r?i=new _:"string"==typeof r||t.objectMode||(i=new p("chunk",["string","Buffer"],r)),!i||(v(e,i),o.nextTick(n,i),!1)}(this,i,e,r))&&(i.pendingcb++,a=function(e,t,r,n,o,i){if(!r){var a=function(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=l.from(t,r)),t}(t,n,o);n!==a&&(r=!0,o="buffer",n=a)}var s=t.objectMode?1:n.length;t.length+=s;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:o,isBuf:r,callback:i,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else A(e,t,!1,s,n,o,i);return u}(this,i,s,e,t,r)),a},O.prototype.cork=function(){this._writableState.corked++},O.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||R(this,e))},O.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new E(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(O.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(O.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),O.prototype._write=function(e,t,r){r(new h("_write()"))},O.prototype._writev=null,O.prototype.end=function(e,t,r){var n=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,j(e,t),r&&(t.finished?o.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}(this,n,r),this},Object.defineProperty(O.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(O.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),O.prototype.destroy=f.destroy,O.prototype._undestroy=f.undestroy,O.prototype._destroy=function(e,t){t(e)}},2317:(e,t,r)=>{"use strict";var n,o=r(9142);function i(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var a=r(5831),s=Symbol("lastResolve"),u=Symbol("lastReject"),l=Symbol("error"),c=Symbol("ended"),f=Symbol("lastPromise"),d=Symbol("handlePromise"),g=Symbol("stream");function p(e,t){return{value:e,done:t}}function h(e){var t=e[s];if(null!==t){var r=e[g].read();null!==r&&(e[f]=null,e[s]=null,e[u]=null,t(p(r,!1)))}}function y(e){o.nextTick(h,e)}var m=Object.getPrototypeOf((function(){})),b=Object.setPrototypeOf((i(n={get stream(){return this[g]},next:function(){var e=this,t=this[l];if(null!==t)return Promise.reject(t);if(this[c])return Promise.resolve(p(void 0,!0));if(this[g].destroyed)return new Promise((function(t,r){o.nextTick((function(){e[l]?r(e[l]):t(p(void 0,!0))}))}));var r,n=this[f];if(n)r=new Promise(function(e,t){return function(r,n){e.then((function(){t[c]?r(p(void 0,!0)):t[d](r,n)}),n)}}(n,this));else{var i=this[g].read();if(null!==i)return Promise.resolve(p(i,!1));r=new Promise(this[d])}return this[f]=r,r}},Symbol.asyncIterator,(function(){return this})),i(n,"return",(function(){var e=this;return new Promise((function(t,r){e[g].destroy(null,(function(e){e?r(e):t(p(void 0,!0))}))}))})),n),m);e.exports=function(e){var t,r=Object.create(b,(i(t={},g,{value:e,writable:!0}),i(t,s,{value:null,writable:!0}),i(t,u,{value:null,writable:!0}),i(t,l,{value:null,writable:!0}),i(t,c,{value:e._readableState.endEmitted,writable:!0}),i(t,d,{value:function(e,t){var n=r[g].read();n?(r[f]=null,r[s]=null,r[u]=null,e(p(n,!1))):(r[s]=e,r[u]=t)},writable:!0}),t));return r[f]=null,a(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[u];return null!==t&&(r[f]=null,r[s]=null,r[u]=null,t(e)),void(r[l]=e)}var n=r[s];null!==n&&(r[f]=null,r[s]=null,r[u]=null,n(p(void 0,!0))),r[c]=!0})),e.on("readable",y.bind(null,r)),r}},5392:(e,t,r)=>{"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach((function(t){i(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function i(e,t,r){return(t=s(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,s(n.key),n)}}function s(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}var u=r(9033).Buffer,l=r(2361).inspect,c=l&&l.custom||"inspect";e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var t,r;return t=e,(r=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return u.alloc(0);for(var t,r,n,o=u.allocUnsafe(e>>>0),i=this.head,a=0;i;)t=i.data,r=o,n=a,u.prototype.copy.call(t,r,n),a+=i.data.length,i=i.next;return o}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,n=t.data;for(e-=n.length;t=t.next;){var o=t.data,i=e>o.length?o.length:e;if(i===o.length?n+=o:n+=o.slice(0,e),0==(e-=i)){i===o.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=o.slice(i));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=u.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var o=r.data,i=e>o.length?o.length:e;if(o.copy(t,t.length-e,0,i),0==(e-=i)){i===o.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=o.slice(i));break}++n}return this.length-=n,t}},{key:c,value:function(e,t){return l(this,o(o({},t),{},{depth:0,customInspect:!1}))}}])&&a(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},7572:(e,t,r)=>{"use strict";var n=r(9142);function o(e,t){a(e,t),i(e)}function i(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function a(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var r=this,s=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return s||u?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(a,this,e)):n.nextTick(a,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?r._writableState?r._writableState.errorEmitted?n.nextTick(i,r):(r._writableState.errorEmitted=!0,n.nextTick(o,r,e)):n.nextTick(o,r,e):t?(n.nextTick(i,r),t(e)):n.nextTick(i,r)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}},5831:(e,t,r)=>{"use strict";var n=r(9024).q.ERR_STREAM_PREMATURE_CLOSE;function o(){}e.exports=function e(t,r,i){if("function"==typeof r)return e(t,null,r);r||(r={}),i=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];e.apply(this,n)}}}(i||o);var a=r.readable||!1!==r.readable&&t.readable,s=r.writable||!1!==r.writable&&t.writable,u=function(){t.writable||c()},l=t._writableState&&t._writableState.finished,c=function(){s=!1,l=!0,a||i.call(t)},f=t._readableState&&t._readableState.endEmitted,d=function(){a=!1,f=!0,s||i.call(t)},g=function(e){i.call(t,e)},p=function(){var e;return a&&!f?(t._readableState&&t._readableState.ended||(e=new n),i.call(t,e)):s&&!l?(t._writableState&&t._writableState.ended||(e=new n),i.call(t,e)):void 0},h=function(){t.req.on("finish",c)};return function(e){return e.setHeader&&"function"==typeof e.abort}(t)?(t.on("complete",c),t.on("abort",p),t.req?h():t.on("request",h)):s&&!t._writableState&&(t.on("end",u),t.on("close",u)),t.on("end",d),t.on("finish",c),!1!==r.error&&t.on("error",g),t.on("close",p),function(){t.removeListener("complete",c),t.removeListener("abort",p),t.removeListener("request",h),t.req&&t.req.removeListener("finish",c),t.removeListener("end",u),t.removeListener("close",u),t.removeListener("finish",c),t.removeListener("end",d),t.removeListener("error",g),t.removeListener("close",p)}}},6218:e=>{e.exports=function(){throw new Error("Readable.from is not available in the browser")}},384:(e,t,r)=>{"use strict";var n,o=r(9024).q,i=o.ERR_MISSING_ARGS,a=o.ERR_STREAM_DESTROYED;function s(e){if(e)throw e}function u(e){e()}function l(e,t){return e.pipe(t)}e.exports=function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];var c,f=function(e){return e.length?"function"!=typeof e[e.length-1]?s:e.pop():s}(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new i("streams");var d=t.map((function(e,o){var i=o<t.length-1;return function(e,t,o,i){i=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(i);var s=!1;e.on("close",(function(){s=!0})),void 0===n&&(n=r(5831)),n(e,{readable:t,writable:o},(function(e){if(e)return i(e);s=!0,i()}));var u=!1;return function(t){if(!s&&!u)return u=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void i(t||new a("pipe"))}}(e,i,o>0,(function(e){c||(c=e),e&&d.forEach(u),i||(d.forEach(u),f(c))}))}));return t.reduce(l)}},6756:(e,t,r)=>{"use strict";var n=r(9024).q.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,r,o){var i=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,o,r);if(null!=i){if(!isFinite(i)||Math.floor(i)!==i||i<0)throw new n(o?r:"highWaterMark",i);return Math.floor(i)}return e.objectMode?16:16384}}},7144:(e,t,r)=>{e.exports=r(8291).EventEmitter},2720:(e,t,r)=>{"use strict";var n=r(3067).functionsHaveConfigurableNames(),o=Object,i=TypeError;e.exports=function(){if(null!=this&&this!==o(this))throw new i("RegExp.prototype.flags getter called on non-object");var e="";return this.hasIndices&&(e+="d"),this.global&&(e+="g"),this.ignoreCase&&(e+="i"),this.multiline&&(e+="m"),this.dotAll&&(e+="s"),this.unicode&&(e+="u"),this.unicodeSets&&(e+="v"),this.sticky&&(e+="y"),e},n&&Object.defineProperty&&Object.defineProperty(e.exports,"name",{value:"get flags"})},5045:(e,t,r)=>{"use strict";var n=r(4347),o=r(4373),i=r(2720),a=r(8958),s=r(7880),u=o(a());n(u,{getPolyfill:a,implementation:i,shim:s}),e.exports=u},8958:(e,t,r)=>{"use strict";var n=r(2720),o=r(4347).supportsDescriptors,i=Object.getOwnPropertyDescriptor;e.exports=function(){if(o&&"gim"===/a/gim.flags){var e=i(RegExp.prototype,"flags");if(e&&"function"==typeof e.get&&"boolean"==typeof RegExp.prototype.dotAll&&"boolean"==typeof RegExp.prototype.hasIndices){var t="",r={};if(Object.defineProperty(r,"hasIndices",{get:function(){t+="d"}}),Object.defineProperty(r,"sticky",{get:function(){t+="y"}}),"dy"===t)return e.get}}return n}},7880:(e,t,r)=>{"use strict";var n=r(4347).supportsDescriptors,o=r(8958),i=Object.getOwnPropertyDescriptor,a=Object.defineProperty,s=TypeError,u=Object.getPrototypeOf,l=/a/;e.exports=function(){if(!n||!u)throw new s("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var e=o(),t=u(l),r=i(t,"flags");return r&&r.get===e||a(t,"flags",{configurable:!0,enumerable:!1,get:e}),e}},7625:(e,t,r)=>{var n=r(9033),o=n.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return o(e,t,r)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=n:(i(n,t),t.Buffer=a),a.prototype=Object.create(o.prototype),i(o,a),a.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return o(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=o(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return o(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},95:(e,t,r)=>{"use strict";var n=r(7701),o=r(593),i=r(7594),a=n("%TypeError%"),s=n("%WeakMap%",!0),u=n("%Map%",!0),l=o("WeakMap.prototype.get",!0),c=o("WeakMap.prototype.set",!0),f=o("WeakMap.prototype.has",!0),d=o("Map.prototype.get",!0),g=o("Map.prototype.set",!0),p=o("Map.prototype.has",!0),h=function(e,t){for(var r,n=e;null!==(r=n.next);n=r)if(r.key===t)return n.next=r.next,r.next=e.next,e.next=r,r};e.exports=function(){var e,t,r,n={assert:function(e){if(!n.has(e))throw new a("Side channel does not contain "+i(e))},get:function(n){if(s&&n&&("object"==typeof n||"function"==typeof n)){if(e)return l(e,n)}else if(u){if(t)return d(t,n)}else if(r)return function(e,t){var r=h(e,t);return r&&r.value}(r,n)},has:function(n){if(s&&n&&("object"==typeof n||"function"==typeof n)){if(e)return f(e,n)}else if(u){if(t)return p(t,n)}else if(r)return function(e,t){return!!h(e,t)}(r,n);return!1},set:function(n,o){s&&n&&("object"==typeof n||"function"==typeof n)?(e||(e=new s),c(e,n,o)):u?(t||(t=new u),g(t,n,o)):(r||(r={key:{},next:null}),function(e,t,r){var n=h(e,t);n?n.value=r:e.next={key:t,next:e.next,value:r}}(r,n,o))}};return n}},4314:e=>{"use strict";e.exports=e=>{const t=/^\\\\\?\\/.test(e),r=/[^\u0000-\u0080]+/.test(e);return t||r?e:e.replace(/\\/g,"/")}},5859:(e,t,r)=>{"use strict";var n=r(1187),o=SyntaxError,i="object"==typeof StopIteration?StopIteration:null;e.exports=function(e){if(!i)throw new o("this environment lacks StopIteration");n.set(e,"[[Done]]",!1);var t={next:function(){var e=n.get(this,"[[Iterator]]"),t=n.get(e,"[[Done]]");try{return{done:t,value:t?void 0:e.next()}}catch(t){if(n.set(e,"[[Done]]",!0),t!==i)throw t;return{done:!0,value:void 0}}}};return n.set(t,"[[Iterator]]",e),t}},7245:(e,t,r)=>{e.exports=o;var n=r(8291).EventEmitter;function o(){n.call(this)}r(1736)(o,n),o.Readable=r(6297),o.Writable=r(1471),o.Duplex=r(6884),o.Transform=r(9154),o.PassThrough=r(3582),o.finished=r(5831),o.pipeline=r(384),o.Stream=o,o.prototype.pipe=function(e,t){var r=this;function o(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function i(){r.readable&&r.resume&&r.resume()}r.on("data",o),e.on("drain",i),e._isStdio||t&&!1===t.end||(r.on("end",s),r.on("close",u));var a=!1;function s(){a||(a=!0,e.end())}function u(){a||(a=!0,"function"==typeof e.destroy&&e.destroy())}function l(e){if(c(),0===n.listenerCount(this,"error"))throw e}function c(){r.removeListener("data",o),e.removeListener("drain",i),r.removeListener("end",s),r.removeListener("close",u),r.removeListener("error",l),e.removeListener("error",l),r.removeListener("end",c),r.removeListener("close",c),e.removeListener("close",c)}return r.on("error",l),e.on("error",l),r.on("end",c),r.on("close",c),e.on("close",c),e.emit("pipe",r),e}},3462:(e,t,r)=>{"use strict";var n=r(7625).Buffer,o=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function i(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===o||!o(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=l,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=c,this.end=f,t=3;break;default:return this.write=d,void(this.end=g)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function l(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function c(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function g(e){return e&&e.length?this.write(e):""}t.StringDecoder=i,i.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},i.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},i.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var o=a(t[n]);return o>=0?(o>0&&(e.lastNeed=o-1),o):--n<r||-2===o?0:(o=a(t[n]))>=0?(o>0&&(e.lastNeed=o-2),o):--n<r||-2===o?0:(o=a(t[n]))>=0?(o>0&&(2===o?o=0:e.lastNeed=o-3),o):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},i.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},6219:(e,t,r)=>{function n(e){try{if(!r.g.localStorage)return!1}catch(e){return!1}var t=r.g.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}e.exports=function(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}},6248:e=>{e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},7092:(e,t,r)=>{"use strict";var n=r(9446),o=r(4477),i=r(2337),a=r(8915);function s(e){return e.call.bind(e)}var u="undefined"!=typeof BigInt,l="undefined"!=typeof Symbol,c=s(Object.prototype.toString),f=s(Number.prototype.valueOf),d=s(String.prototype.valueOf),g=s(Boolean.prototype.valueOf);if(u)var p=s(BigInt.prototype.valueOf);if(l)var h=s(Symbol.prototype.valueOf);function y(e,t){if("object"!=typeof e)return!1;try{return t(e),!0}catch(e){return!1}}function m(e){return"[object Map]"===c(e)}function b(e){return"[object Set]"===c(e)}function _(e){return"[object WeakMap]"===c(e)}function w(e){return"[object WeakSet]"===c(e)}function E(e){return"[object ArrayBuffer]"===c(e)}function v(e){return"undefined"!=typeof ArrayBuffer&&(E.working?E(e):e instanceof ArrayBuffer)}function S(e){return"[object DataView]"===c(e)}function T(e){return"undefined"!=typeof DataView&&(S.working?S(e):e instanceof DataView)}t.isArgumentsObject=n,t.isGeneratorFunction=o,t.isTypedArray=a,t.isPromise=function(e){return"undefined"!=typeof Promise&&e instanceof Promise||null!==e&&"object"==typeof e&&"function"==typeof e.then&&"function"==typeof e.catch},t.isArrayBufferView=function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):a(e)||T(e)},t.isUint8Array=function(e){return"Uint8Array"===i(e)},t.isUint8ClampedArray=function(e){return"Uint8ClampedArray"===i(e)},t.isUint16Array=function(e){return"Uint16Array"===i(e)},t.isUint32Array=function(e){return"Uint32Array"===i(e)},t.isInt8Array=function(e){return"Int8Array"===i(e)},t.isInt16Array=function(e){return"Int16Array"===i(e)},t.isInt32Array=function(e){return"Int32Array"===i(e)},t.isFloat32Array=function(e){return"Float32Array"===i(e)},t.isFloat64Array=function(e){return"Float64Array"===i(e)},t.isBigInt64Array=function(e){return"BigInt64Array"===i(e)},t.isBigUint64Array=function(e){return"BigUint64Array"===i(e)},m.working="undefined"!=typeof Map&&m(new Map),t.isMap=function(e){return"undefined"!=typeof Map&&(m.working?m(e):e instanceof Map)},b.working="undefined"!=typeof Set&&b(new Set),t.isSet=function(e){return"undefined"!=typeof Set&&(b.working?b(e):e instanceof Set)},_.working="undefined"!=typeof WeakMap&&_(new WeakMap),t.isWeakMap=function(e){return"undefined"!=typeof WeakMap&&(_.working?_(e):e instanceof WeakMap)},w.working="undefined"!=typeof WeakSet&&w(new WeakSet),t.isWeakSet=function(e){return w(e)},E.working="undefined"!=typeof ArrayBuffer&&E(new ArrayBuffer),t.isArrayBuffer=v,S.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&S(new DataView(new ArrayBuffer(1),0,1)),t.isDataView=T;var O="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function A(e){return"[object SharedArrayBuffer]"===c(e)}function I(e){return void 0!==O&&(void 0===A.working&&(A.working=A(new O)),A.working?A(e):e instanceof O)}function R(e){return y(e,f)}function N(e){return y(e,d)}function D(e){return y(e,g)}function j(e){return u&&y(e,p)}function k(e){return l&&y(e,h)}t.isSharedArrayBuffer=I,t.isAsyncFunction=function(e){return"[object AsyncFunction]"===c(e)},t.isMapIterator=function(e){return"[object Map Iterator]"===c(e)},t.isSetIterator=function(e){return"[object Set Iterator]"===c(e)},t.isGeneratorObject=function(e){return"[object Generator]"===c(e)},t.isWebAssemblyCompiledModule=function(e){return"[object WebAssembly.Module]"===c(e)},t.isNumberObject=R,t.isStringObject=N,t.isBooleanObject=D,t.isBigIntObject=j,t.isSymbolObject=k,t.isBoxedPrimitive=function(e){return R(e)||N(e)||D(e)||j(e)||k(e)},t.isAnyArrayBuffer=function(e){return"undefined"!=typeof Uint8Array&&(v(e)||I(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(e){Object.defineProperty(t,e,{enumerable:!1,value:function(){throw new Error(e+" is not supported in userland")}})}))},5058:(e,t,r)=>{var n=r(9142),o=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n<t.length;n++)r[t[n]]=Object.getOwnPropertyDescriptor(e,t[n]);return r},i=/%[sdj%]/g;t.format=function(e){if(!_(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(l(arguments[r]));return t.join(" ")}r=1;for(var n=arguments,o=n.length,a=String(e).replace(i,(function(e){if("%%"===e)return"%";if(r>=o)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}})),s=n[r];r<o;s=n[++r])m(s)||!v(s)?a+=" "+s:a+=" "+l(s);return a},t.deprecate=function(e,r){if(void 0!==n&&!0===n.noDeprecation)return e;if(void 0===n)return function(){return t.deprecate(e,r).apply(this,arguments)};var o=!1;return function(){if(!o){if(n.throwDeprecation)throw new Error(r);n.traceDeprecation?console.trace(r):console.error(r),o=!0}return e.apply(this,arguments)}};var a={},s=/^$/;if({}.NODE_DEBUG){var u={}.NODE_DEBUG;u=u.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),s=new RegExp("^"+u+"$","i")}function l(e,r){var n={seen:[],stylize:f};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),y(r)?n.showHidden=r:r&&t._extend(n,r),w(n.showHidden)&&(n.showHidden=!1),w(n.depth)&&(n.depth=2),w(n.colors)&&(n.colors=!1),w(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=c),d(n,e,n.depth)}function c(e,t){var r=l.styles[t];return r?"["+l.colors[r][0]+"m"+e+"["+l.colors[r][1]+"m":e}function f(e,t){return e}function d(e,r,n){if(e.customInspect&&r&&O(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var o=r.inspect(n,e);return _(o)||(o=d(e,o,n)),o}var i=function(e,t){if(w(t))return e.stylize("undefined","undefined");if(_(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return b(t)?e.stylize(""+t,"number"):y(t)?e.stylize(""+t,"boolean"):m(t)?e.stylize("null","null"):void 0}(e,r);if(i)return i;var a=Object.keys(r),s=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(r)),T(r)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return g(r);if(0===a.length){if(O(r)){var u=r.name?": "+r.name:"";return e.stylize("[Function"+u+"]","special")}if(E(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(S(r))return e.stylize(Date.prototype.toString.call(r),"date");if(T(r))return g(r)}var l,c="",f=!1,v=["{","}"];return h(r)&&(f=!0,v=["[","]"]),O(r)&&(c=" [Function"+(r.name?": "+r.name:"")+"]"),E(r)&&(c=" "+RegExp.prototype.toString.call(r)),S(r)&&(c=" "+Date.prototype.toUTCString.call(r)),T(r)&&(c=" "+g(r)),0!==a.length||f&&0!=r.length?n<0?E(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),l=f?function(e,t,r,n,o){for(var i=[],a=0,s=t.length;a<s;++a)N(t,String(a))?i.push(p(e,t,r,n,String(a),!0)):i.push("");return o.forEach((function(o){o.match(/^\d+$/)||i.push(p(e,t,r,n,o,!0))})),i}(e,r,n,s,a):a.map((function(t){return p(e,r,n,s,t,f)})),e.seen.pop(),function(e,t,r){return e.reduce((function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}(l,c,v)):v[0]+c+v[1]}function g(e){return"["+Error.prototype.toString.call(e)+"]"}function p(e,t,r,n,o,i){var a,s,u;if((u=Object.getOwnPropertyDescriptor(t,o)||{value:t[o]}).get?s=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(s=e.stylize("[Setter]","special")),N(n,o)||(a="["+o+"]"),s||(e.seen.indexOf(u.value)<0?(s=m(r)?d(e,u.value,null):d(e,u.value,r-1)).indexOf("\n")>-1&&(s=i?s.split("\n").map((function(e){return" "+e})).join("\n").slice(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),w(a)){if(i&&o.match(/^\d+$/))return s;(a=JSON.stringify(""+o)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.slice(1,-1),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function h(e){return Array.isArray(e)}function y(e){return"boolean"==typeof e}function m(e){return null===e}function b(e){return"number"==typeof e}function _(e){return"string"==typeof e}function w(e){return void 0===e}function E(e){return v(e)&&"[object RegExp]"===A(e)}function v(e){return"object"==typeof e&&null!==e}function S(e){return v(e)&&"[object Date]"===A(e)}function T(e){return v(e)&&("[object Error]"===A(e)||e instanceof Error)}function O(e){return"function"==typeof e}function A(e){return Object.prototype.toString.call(e)}function I(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(e=e.toUpperCase(),!a[e])if(s.test(e)){var r=n.pid;a[e]=function(){var n=t.format.apply(t,arguments);console.error("%s %d: %s",e,r,n)}}else a[e]=function(){};return a[e]},t.inspect=l,l.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},l.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=r(7092),t.isArray=h,t.isBoolean=y,t.isNull=m,t.isNullOrUndefined=function(e){return null==e},t.isNumber=b,t.isString=_,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=w,t.isRegExp=E,t.types.isRegExp=E,t.isObject=v,t.isDate=S,t.types.isDate=S,t.isError=T,t.types.isNativeError=T,t.isFunction=O,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(6248);var R=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function N(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){var e,r;console.log("%s - %s",(e=new Date,r=[I(e.getHours()),I(e.getMinutes()),I(e.getSeconds())].join(":"),[e.getDate(),R[e.getMonth()],r].join(" ")),t.format.apply(t,arguments))},t.inherits=r(1736),t._extend=function(e,t){if(!t||!v(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var D="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function j(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(D&&e[D]){var t;if("function"!=typeof(t=e[D]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,D,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,n=new Promise((function(e,n){t=e,r=n})),o=[],i=0;i<arguments.length;i++)o.push(arguments[i]);o.push((function(e,n){e?r(e):t(n)}));try{e.apply(this,o)}catch(e){r(e)}return n}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),D&&Object.defineProperty(t,D,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,o(e))},t.promisify.custom=D,t.callbackify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');function t(){for(var t=[],r=0;r<arguments.length;r++)t.push(arguments[r]);var o=t.pop();if("function"!=typeof o)throw new TypeError("The last argument must be of type Function");var i=this,a=function(){return o.apply(i,arguments)};e.apply(this,t).then((function(e){n.nextTick(a.bind(null,null,e))}),(function(e){n.nextTick(j.bind(null,e,a))}))}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),Object.defineProperties(t,o(e)),t}},2679:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"NIL",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"parse",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(t,"v1",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(t,"v3",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"v4",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"v5",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"validate",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(t,"version",{enumerable:!0,get:function(){return u.default}});var n=d(r(5999)),o=d(r(8231)),i=d(r(8647)),a=d(r(5025)),s=d(r(5996)),u=d(r(8928)),l=d(r(6163)),c=d(r(2982)),f=d(r(1729));function d(e){return e&&e.__esModule?e:{default:e}}},6792:(e,t)=>{"use strict";function r(e){return 14+(e+64>>>9<<4)+1}function n(e,t){const r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function o(e,t,r,o,i,a){return n((s=n(n(t,e),n(o,a)))<<(u=i)|s>>>32-u,r);var s,u}function i(e,t,r,n,i,a,s){return o(t&r|~t&n,e,t,i,a,s)}function a(e,t,r,n,i,a,s){return o(t&n|r&~n,e,t,i,a,s)}function s(e,t,r,n,i,a,s){return o(t^r^n,e,t,i,a,s)}function u(e,t,r,n,i,a,s){return o(r^(t|~n),e,t,i,a,s)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default=function(e){if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(let r=0;r<t.length;++r)e[r]=t.charCodeAt(r)}return function(e){const t=[],r=32*e.length,n="0123456789abcdef";for(let o=0;o<r;o+=8){const r=e[o>>5]>>>o%32&255,i=parseInt(n.charAt(r>>>4&15)+n.charAt(15&r),16);t.push(i)}return t}(function(e,t){e[t>>5]|=128<<t%32,e[r(t)-1]=t;let o=1732584193,l=-271733879,c=-1732584194,f=271733878;for(let t=0;t<e.length;t+=16){const r=o,d=l,g=c,p=f;o=i(o,l,c,f,e[t],7,-680876936),f=i(f,o,l,c,e[t+1],12,-389564586),c=i(c,f,o,l,e[t+2],17,606105819),l=i(l,c,f,o,e[t+3],22,-1044525330),o=i(o,l,c,f,e[t+4],7,-176418897),f=i(f,o,l,c,e[t+5],12,1200080426),c=i(c,f,o,l,e[t+6],17,-1473231341),l=i(l,c,f,o,e[t+7],22,-45705983),o=i(o,l,c,f,e[t+8],7,1770035416),f=i(f,o,l,c,e[t+9],12,-1958414417),c=i(c,f,o,l,e[t+10],17,-42063),l=i(l,c,f,o,e[t+11],22,-1990404162),o=i(o,l,c,f,e[t+12],7,1804603682),f=i(f,o,l,c,e[t+13],12,-40341101),c=i(c,f,o,l,e[t+14],17,-1502002290),l=i(l,c,f,o,e[t+15],22,1236535329),o=a(o,l,c,f,e[t+1],5,-165796510),f=a(f,o,l,c,e[t+6],9,-1069501632),c=a(c,f,o,l,e[t+11],14,643717713),l=a(l,c,f,o,e[t],20,-373897302),o=a(o,l,c,f,e[t+5],5,-701558691),f=a(f,o,l,c,e[t+10],9,38016083),c=a(c,f,o,l,e[t+15],14,-660478335),l=a(l,c,f,o,e[t+4],20,-405537848),o=a(o,l,c,f,e[t+9],5,568446438),f=a(f,o,l,c,e[t+14],9,-1019803690),c=a(c,f,o,l,e[t+3],14,-187363961),l=a(l,c,f,o,e[t+8],20,1163531501),o=a(o,l,c,f,e[t+13],5,-1444681467),f=a(f,o,l,c,e[t+2],9,-51403784),c=a(c,f,o,l,e[t+7],14,1735328473),l=a(l,c,f,o,e[t+12],20,-1926607734),o=s(o,l,c,f,e[t+5],4,-378558),f=s(f,o,l,c,e[t+8],11,-2022574463),c=s(c,f,o,l,e[t+11],16,1839030562),l=s(l,c,f,o,e[t+14],23,-35309556),o=s(o,l,c,f,e[t+1],4,-1530992060),f=s(f,o,l,c,e[t+4],11,1272893353),c=s(c,f,o,l,e[t+7],16,-155497632),l=s(l,c,f,o,e[t+10],23,-1094730640),o=s(o,l,c,f,e[t+13],4,681279174),f=s(f,o,l,c,e[t],11,-358537222),c=s(c,f,o,l,e[t+3],16,-722521979),l=s(l,c,f,o,e[t+6],23,76029189),o=s(o,l,c,f,e[t+9],4,-640364487),f=s(f,o,l,c,e[t+12],11,-421815835),c=s(c,f,o,l,e[t+15],16,530742520),l=s(l,c,f,o,e[t+2],23,-995338651),o=u(o,l,c,f,e[t],6,-198630844),f=u(f,o,l,c,e[t+7],10,1126891415),c=u(c,f,o,l,e[t+14],15,-1416354905),l=u(l,c,f,o,e[t+5],21,-57434055),o=u(o,l,c,f,e[t+12],6,1700485571),f=u(f,o,l,c,e[t+3],10,-1894986606),c=u(c,f,o,l,e[t+10],15,-1051523),l=u(l,c,f,o,e[t+1],21,-2054922799),o=u(o,l,c,f,e[t+8],6,1873313359),f=u(f,o,l,c,e[t+15],10,-30611744),c=u(c,f,o,l,e[t+6],15,-1560198380),l=u(l,c,f,o,e[t+13],21,1309151649),o=u(o,l,c,f,e[t+4],6,-145523070),f=u(f,o,l,c,e[t+11],10,-1120210379),c=u(c,f,o,l,e[t+2],15,718787259),l=u(l,c,f,o,e[t+9],21,-343485551),o=n(o,r),l=n(l,d),c=n(c,g),f=n(f,p)}return[o,l,c,f]}(function(e){if(0===e.length)return[];const t=8*e.length,n=new Uint32Array(r(t));for(let r=0;r<t;r+=8)n[r>>5]|=(255&e[r/8])<<r%32;return n}(e),8*e.length))}},1788:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};t.default=r},5996:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default="00000000-0000-0000-0000-000000000000"},1729:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,o=(n=r(6163))&&n.__esModule?n:{default:n};t.default=function(e){if(!(0,o.default)(e))throw TypeError("Invalid UUID");let t;const r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=255&t,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=255&t,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=255&t,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=255&t,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=255&t,r}},7300:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i},4402:(e,t)=>{"use strict";let r;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){if(!r&&(r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!r))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(n)};const n=new Uint8Array(16)},2702:(e,t)=>{"use strict";function r(e,t,r,n){switch(e){case 0:return t&r^~t&n;case 1:case 3:return t^r^n;case 2:return t&r^t&n^r&n}}function n(e,t){return e<<t|e>>>32-t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default=function(e){const t=[1518500249,1859775393,2400959708,3395469782],o=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);const i=e.length/4+2,a=Math.ceil(i/16),s=new Array(a);for(let t=0;t<a;++t){const r=new Uint32Array(16);for(let n=0;n<16;++n)r[n]=e[64*t+4*n]<<24|e[64*t+4*n+1]<<16|e[64*t+4*n+2]<<8|e[64*t+4*n+3];s[t]=r}s[a-1][14]=8*(e.length-1)/Math.pow(2,32),s[a-1][14]=Math.floor(s[a-1][14]),s[a-1][15]=8*(e.length-1)&4294967295;for(let e=0;e<a;++e){const i=new Uint32Array(80);for(let t=0;t<16;++t)i[t]=s[e][t];for(let e=16;e<80;++e)i[e]=n(i[e-3]^i[e-8]^i[e-14]^i[e-16],1);let a=o[0],u=o[1],l=o[2],c=o[3],f=o[4];for(let e=0;e<80;++e){const o=Math.floor(e/20),s=n(a,5)+r(o,u,l,c)+f+t[o]+i[e]>>>0;f=c,c=l,l=n(u,30)>>>0,u=a,a=s}o[0]=o[0]+a>>>0,o[1]=o[1]+u>>>0,o[2]=o[2]+l>>>0,o[3]=o[3]+c>>>0,o[4]=o[4]+f>>>0}return[o[0]>>24&255,o[0]>>16&255,o[0]>>8&255,255&o[0],o[1]>>24&255,o[1]>>16&255,o[1]>>8&255,255&o[1],o[2]>>24&255,o[2]>>16&255,o[2]>>8&255,255&o[2],o[3]>>24&255,o[3]>>16&255,o[3]>>8&255,255&o[3],o[4]>>24&255,o[4]>>16&255,o[4]>>8&255,255&o[4]]}},2982:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.unsafeStringify=a;var n,o=(n=r(6163))&&n.__esModule?n:{default:n};const i=[];for(let e=0;e<256;++e)i.push((e+256).toString(16).slice(1));function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(i[e[t+0]]+i[e[t+1]]+i[e[t+2]]+i[e[t+3]]+"-"+i[e[t+4]]+i[e[t+5]]+"-"+i[e[t+6]]+i[e[t+7]]+"-"+i[e[t+8]]+i[e[t+9]]+"-"+i[e[t+10]]+i[e[t+11]]+i[e[t+12]]+i[e[t+13]]+i[e[t+14]]+i[e[t+15]]).toLowerCase()}t.default=function(e){const t=a(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0);if(!(0,o.default)(t))throw TypeError("Stringified UUID is invalid");return t}},5999:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,o=(n=r(4402))&&n.__esModule?n:{default:n},i=r(2982);let a,s,u=0,l=0;t.default=function(e,t,r){let n=t&&r||0;const c=t||new Array(16);let f=(e=e||{}).node||a,d=void 0!==e.clockseq?e.clockseq:s;if(null==f||null==d){const t=e.random||(e.rng||o.default)();null==f&&(f=a=[1|t[0],t[1],t[2],t[3],t[4],t[5]]),null==d&&(d=s=16383&(t[6]<<8|t[7]))}let g=void 0!==e.msecs?e.msecs:Date.now(),p=void 0!==e.nsecs?e.nsecs:l+1;const h=g-u+(p-l)/1e4;if(h<0&&void 0===e.clockseq&&(d=d+1&16383),(h<0||g>u)&&void 0===e.nsecs&&(p=0),p>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");u=g,l=p,s=d,g+=122192928e5;const y=(1e4*(268435455&g)+p)%4294967296;c[n++]=y>>>24&255,c[n++]=y>>>16&255,c[n++]=y>>>8&255,c[n++]=255&y;const m=g/4294967296*1e4&268435455;c[n++]=m>>>8&255,c[n++]=255&m,c[n++]=m>>>24&15|16,c[n++]=m>>>16&255,c[n++]=d>>>8|128,c[n++]=255&d;for(let e=0;e<6;++e)c[n+e]=f[e];return t||(0,i.unsafeStringify)(c)}},8231:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=i(r(6125)),o=i(r(6792));function i(e){return e&&e.__esModule?e:{default:e}}var a=(0,n.default)("v3",48,o.default);t.default=a},6125:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.URL=t.DNS=void 0,t.default=function(e,t,r){function n(e,n,a,s){var u;if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));const t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}(e)),"string"==typeof n&&(n=(0,i.default)(n)),16!==(null===(u=n)||void 0===u?void 0:u.length))throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let l=new Uint8Array(16+e.length);if(l.set(n),l.set(e,n.length),l=r(l),l[6]=15&l[6]|t,l[8]=63&l[8]|128,a){s=s||0;for(let e=0;e<16;++e)a[s+e]=l[e];return a}return(0,o.unsafeStringify)(l)}try{n.name=e}catch(e){}return n.DNS=a,n.URL=s,n};var n,o=r(2982),i=(n=r(1729))&&n.__esModule?n:{default:n};const a="6ba7b810-9dad-11d1-80b4-00c04fd430c8";t.DNS=a;const s="6ba7b811-9dad-11d1-80b4-00c04fd430c8";t.URL=s},8647:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=a(r(1788)),o=a(r(4402)),i=r(2982);function a(e){return e&&e.__esModule?e:{default:e}}t.default=function(e,t,r){if(n.default.randomUUID&&!t&&!e)return n.default.randomUUID();const a=(e=e||{}).random||(e.rng||o.default)();if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,t){r=r||0;for(let e=0;e<16;++e)t[r+e]=a[e];return t}return(0,i.unsafeStringify)(a)}},5025:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=i(r(6125)),o=i(r(2702));function i(e){return e&&e.__esModule?e:{default:e}}var a=(0,n.default)("v5",80,o.default);t.default=a},6163:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,o=(n=r(7300))&&n.__esModule?n:{default:n};t.default=function(e){return"string"==typeof e&&o.default.test(e)}},8928:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,o=(n=r(6163))&&n.__esModule?n:{default:n};t.default=function(e){if(!(0,o.default)(e))throw TypeError("Invalid UUID");return parseInt(e.slice(14,15),16)}},1668:(e,t,r)=>{"use strict";var n=r(1753),o=r(1698),i=r(9046),a=r(8247),s=r(5238);e.exports=function(e){return null==e||"object"!=typeof e&&"function"!=typeof e?null:n(e)?"String":o(e)?"Number":i(e)?"Boolean":a(e)?"Symbol":s(e)?"BigInt":void 0}},2337:(e,t,r)=>{"use strict";var n=r(8184),o=r(3604),i=r(593),a=r(3820),s=i("Object.prototype.toString"),u=r(1191)(),l="undefined"==typeof globalThis?r.g:globalThis,c=o(),f=i("String.prototype.slice"),d={},g=Object.getPrototypeOf;u&&a&&g&&n(c,(function(e){if("function"==typeof l[e]){var t=new l[e];if(Symbol.toStringTag in t){var r=g(t),n=a(r,Symbol.toStringTag);if(!n){var o=g(r);n=a(o,Symbol.toStringTag)}d[e]=n.get}}}));var p=r(8915);e.exports=function(e){return!!p(e)&&(u&&Symbol.toStringTag in e?function(e){var t=!1;return n(d,(function(r,n){if(!t)try{var o=r.call(e);o===n&&(t=o)}catch(e){}})),t}(e):f(s(e),8,-1))}},3529:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(8933),t)},2405:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Timestamp=t.deserializeClock=t.serializeClock=t.makeClientId=t.makeClock=t.setClock=t.getClock=t.merkle=void 0;const a=i(r(2162));t.merkle=a;var s=r(5210);Object.defineProperty(t,"getClock",{enumerable:!0,get:function(){return s.getClock}}),Object.defineProperty(t,"setClock",{enumerable:!0,get:function(){return s.setClock}}),Object.defineProperty(t,"makeClock",{enumerable:!0,get:function(){return s.makeClock}}),Object.defineProperty(t,"makeClientId",{enumerable:!0,get:function(){return s.makeClientId}}),Object.defineProperty(t,"serializeClock",{enumerable:!0,get:function(){return s.serializeClock}}),Object.defineProperty(t,"deserializeClock",{enumerable:!0,get:function(){return s.deserializeClock}}),Object.defineProperty(t,"Timestamp",{enumerable:!0,get:function(){return s.Timestamp}})},2162:(e,t)=>{"use strict";function r(e){return Object.keys(e).filter((e=>"hash"!==e))}function n(e){let t=e+"0".repeat(16-e.length);return 1e3*parseInt(t,3)*60}function o(e,t){let r=t.hash(),n=Number(Math.floor(t.millis()/1e3/60)).toString(3);return i(e=Object.assign({},e,{hash:e.hash^r}),n,r)}function i(e,t,r){if(0===t.length)return e;const n=t[0],o=e[n]||{};return Object.assign({},e,{[n]:Object.assign({},o,i(o,t.slice(1),r),{hash:o.hash^r})})}Object.defineProperty(t,"__esModule",{value:!0}),t.debug=t.prune=t.diff=t.build=t.insert=t.keyToTimestamp=t.getKeys=t.emptyTrie=void 0,t.emptyTrie=function(){return{hash:0}},t.getKeys=r,t.keyToTimestamp=n,t.insert=o,t.build=function(e){let t={hash:0};for(let r of e)o(t,r);return t},t.diff=function(e,t){if(e.hash===t.hash)return null;let o=e,i=t,a="";for(;;){let e=[...new Set([...r(o),...r(i)]).values()];e.sort();let t=null;for(let r=0;r<e.length;r++){let n=e[r];if(!o[n]||!i[n])break;let a=o[n],s=i[n];if(a.hash!==s.hash){t=n;break}}if(!t)return n(a);a+=t,o=o[t]||{hash:0},i=i[t]||{hash:0}}},t.prune=function e(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;if(!t.hash)return t;let o=r(t);o.sort();let i={hash:t.hash};for(let r of o.slice(-n))i[r]=e(t[r],n);return i},t.debug=function e(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return" ".repeat(o)+(""!==n?`k: ${n} `:"")+`hash: ${t.hash||"(empty)"}\n`+r(t).map((r=>e(t[r],r,o+2))).join("")}},5210:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Timestamp=t.makeClientId=t.deserializeClock=t.serializeClock=t.makeClock=t.getClock=t.setClock=void 0;const o=n(r(8850)),i=r(2679);let a=null;function s(e){a=e}function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{timestamp:g.from(e),merkle:t}}function l(){return(0,i.v4)().replace(/-/g,"").slice(-16)}t.setClock=s,t.getClock=function(){return a},t.makeClock=u,t.serializeClock=function(e){return JSON.stringify({timestamp:e.timestamp.toString(),merkle:e.merkle})},t.deserializeClock=function(e){let t;try{t=JSON.parse(e)}catch(e){t={timestamp:"1970-01-01T00:00:00.000Z-0000-"+l(),merkle:{}}}return{timestamp:g.from(d.parse(t.timestamp)),merkle:t.merkle}},t.makeClientId=l;let c={maxDrift:3e5};const f=parseInt("0xFFFF");class d{constructor(e,t,r){this._state={millis:e,counter:t,node:r}}valueOf(){return this.toString()}toString(){return[new Date(this.millis()).toISOString(),("0000"+this.counter().toString(16).toUpperCase()).slice(-4),("0000000000000000"+this.node()).slice(-16)].join("-")}millis(){return this._state.millis}counter(){return this._state.counter}node(){return this._state.node}hash(){return o.default.v3(this.toString())}static init(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.maxDrift&&(c.maxDrift=e.maxDrift),s(u(new d(0,0,e.node?("0000000000000000"+e.node).toString().slice(-16):"")))}static parse(e){if(e instanceof d)return e;if("string"==typeof e){let t=e.split("-");if(t&&5===t.length){let e=Date.parse(t.slice(0,3).join("-")).valueOf(),r=parseInt(t[3],16),n=t[4];if(!isNaN(e)&&e>=0&&!isNaN(r)&&r<=f&&"string"==typeof n&&n.length<=16)return new d(e,r,n)}}return null}static send(){if(!a)return null;let e=Date.now(),t=a.timestamp.millis(),r=a.timestamp.counter(),n=Math.max(t,e),o=t===n?r+1:0;if(n-e>c.maxDrift)throw new d.ClockDriftError(n,e,c.maxDrift);if(o>f)throw new d.OverflowError;return a.timestamp.setMillis(n),a.timestamp.setCounter(o),new d(a.timestamp.millis(),a.timestamp.counter(),a.timestamp.node())}static recv(e){if(!a)return null;let t=Date.now(),r=e.millis(),n=e.counter();if(r-t>c.maxDrift)throw new d.ClockDriftError;let o=a.timestamp.millis(),i=a.timestamp.counter(),s=Math.max(Math.max(o,t),r),u=s===o&&s===r?Math.max(i,n)+1:s===o?i+1:s===r?n+1:0;if(s-t>c.maxDrift)throw new d.ClockDriftError;if(u>f)throw new d.OverflowError;return a.timestamp.setMillis(s),a.timestamp.setCounter(u),new d(a.timestamp.millis(),a.timestamp.counter(),a.timestamp.node())}}d.max=d.parse("9999-12-31T23:59:59.999Z-FFFF-FFFFFFFFFFFFFFFF"),d.zero=d.parse("1970-01-01T00:00:00.000Z-0000-0000000000000000"),d.since=e=>e+"-0000-0000000000000000",d.DuplicateNodeError=class extends Error{constructor(e){super("duplicate node identifier "+e),this.name="DuplicateNodeError"}},d.ClockDriftError=class extends Error{constructor(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];super(["maximum clock drift exceeded"].concat(t).join(" ")),this.name="ClockDriftError"}},d.OverflowError=class extends Error{constructor(){super("timestamp counter overflow"),this.name="OverflowError"}},t.Timestamp=d;class g extends d{static from(e){return new g(e.millis(),e.counter(),e.node())}setMillis(e){this._state.millis=e}setCounter(e){this._state.counter=e}setNode(e){this._state.node=e}}},8933:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.SyncProtoBuf=t.Timestamp=t.deserializeClock=t.serializeClock=t.makeClientId=t.makeClock=t.setClock=t.getClock=t.merkle=void 0;const a=i(r(4425));var s=r(2405);Object.defineProperty(t,"merkle",{enumerable:!0,get:function(){return s.merkle}}),Object.defineProperty(t,"getClock",{enumerable:!0,get:function(){return s.getClock}}),Object.defineProperty(t,"setClock",{enumerable:!0,get:function(){return s.setClock}}),Object.defineProperty(t,"makeClock",{enumerable:!0,get:function(){return s.makeClock}}),Object.defineProperty(t,"makeClientId",{enumerable:!0,get:function(){return s.makeClientId}}),Object.defineProperty(t,"serializeClock",{enumerable:!0,get:function(){return s.serializeClock}}),Object.defineProperty(t,"deserializeClock",{enumerable:!0,get:function(){return s.deserializeClock}}),Object.defineProperty(t,"Timestamp",{enumerable:!0,get:function(){return s.Timestamp}}),t.SyncProtoBuf=a},4425:(e,t,r)=>{var n=r(469),o=n,i=globalThis;o.exportSymbol("proto.EncryptedData",null,i),o.exportSymbol("proto.Message",null,i),o.exportSymbol("proto.MessageEnvelope",null,i),o.exportSymbol("proto.SyncRequest",null,i),o.exportSymbol("proto.SyncResponse",null,i),proto.EncryptedData=function(e){n.Message.initialize(this,e,0,-1,null,null)},o.inherits(proto.EncryptedData,n.Message),o.DEBUG&&!COMPILED&&(proto.EncryptedData.displayName="proto.EncryptedData"),proto.Message=function(e){n.Message.initialize(this,e,0,-1,null,null)},o.inherits(proto.Message,n.Message),o.DEBUG&&!COMPILED&&(proto.Message.displayName="proto.Message"),proto.MessageEnvelope=function(e){n.Message.initialize(this,e,0,-1,null,null)},o.inherits(proto.MessageEnvelope,n.Message),o.DEBUG&&!COMPILED&&(proto.MessageEnvelope.displayName="proto.MessageEnvelope"),proto.SyncRequest=function(e){n.Message.initialize(this,e,0,-1,proto.SyncRequest.repeatedFields_,null)},o.inherits(proto.SyncRequest,n.Message),o.DEBUG&&!COMPILED&&(proto.SyncRequest.displayName="proto.SyncRequest"),proto.SyncResponse=function(e){n.Message.initialize(this,e,0,-1,proto.SyncResponse.repeatedFields_,null)},o.inherits(proto.SyncResponse,n.Message),o.DEBUG&&!COMPILED&&(proto.SyncResponse.displayName="proto.SyncResponse"),n.Message.GENERATE_TO_OBJECT&&(proto.EncryptedData.prototype.toObject=function(e){return proto.EncryptedData.toObject(e,this)},proto.EncryptedData.toObject=function(e,t){var r={iv:t.getIv_asB64(),authtag:t.getAuthtag_asB64(),data:t.getData_asB64()};return e&&(r.$jspbMessageInstance=t),r}),proto.EncryptedData.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new proto.EncryptedData;return proto.EncryptedData.deserializeBinaryFromReader(r,t)},proto.EncryptedData.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();)switch(t.getFieldNumber()){case 1:var r=t.readBytes();e.setIv(r);break;case 2:r=t.readBytes(),e.setAuthtag(r);break;case 3:r=t.readBytes(),e.setData(r);break;default:t.skipField()}return e},proto.EncryptedData.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return proto.EncryptedData.serializeBinaryToWriter(this,e),e.getResultBuffer()},proto.EncryptedData.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getIv_asU8()).length>0&&t.writeBytes(1,r),(r=e.getAuthtag_asU8()).length>0&&t.writeBytes(2,r),(r=e.getData_asU8()).length>0&&t.writeBytes(3,r)},proto.EncryptedData.prototype.getIv=function(){return n.Message.getFieldWithDefault(this,1,"")},proto.EncryptedData.prototype.getIv_asB64=function(){return n.Message.bytesAsB64(this.getIv())},proto.EncryptedData.prototype.getIv_asU8=function(){return n.Message.bytesAsU8(this.getIv())},proto.EncryptedData.prototype.setIv=function(e){return n.Message.setProto3BytesField(this,1,e)},proto.EncryptedData.prototype.getAuthtag=function(){return n.Message.getFieldWithDefault(this,2,"")},proto.EncryptedData.prototype.getAuthtag_asB64=function(){return n.Message.bytesAsB64(this.getAuthtag())},proto.EncryptedData.prototype.getAuthtag_asU8=function(){return n.Message.bytesAsU8(this.getAuthtag())},proto.EncryptedData.prototype.setAuthtag=function(e){return n.Message.setProto3BytesField(this,2,e)},proto.EncryptedData.prototype.getData=function(){return n.Message.getFieldWithDefault(this,3,"")},proto.EncryptedData.prototype.getData_asB64=function(){return n.Message.bytesAsB64(this.getData())},proto.EncryptedData.prototype.getData_asU8=function(){return n.Message.bytesAsU8(this.getData())},proto.EncryptedData.prototype.setData=function(e){return n.Message.setProto3BytesField(this,3,e)},n.Message.GENERATE_TO_OBJECT&&(proto.Message.prototype.toObject=function(e){return proto.Message.toObject(e,this)},proto.Message.toObject=function(e,t){var r={dataset:n.Message.getFieldWithDefault(t,1,""),row:n.Message.getFieldWithDefault(t,2,""),column:n.Message.getFieldWithDefault(t,3,""),value:n.Message.getFieldWithDefault(t,4,"")};return e&&(r.$jspbMessageInstance=t),r}),proto.Message.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new proto.Message;return proto.Message.deserializeBinaryFromReader(r,t)},proto.Message.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();)switch(t.getFieldNumber()){case 1:var r=t.readString();e.setDataset(r);break;case 2:r=t.readString(),e.setRow(r);break;case 3:r=t.readString(),e.setColumn(r);break;case 4:r=t.readString(),e.setValue(r);break;default:t.skipField()}return e},proto.Message.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return proto.Message.serializeBinaryToWriter(this,e),e.getResultBuffer()},proto.Message.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getDataset()).length>0&&t.writeString(1,r),(r=e.getRow()).length>0&&t.writeString(2,r),(r=e.getColumn()).length>0&&t.writeString(3,r),(r=e.getValue()).length>0&&t.writeString(4,r)},proto.Message.prototype.getDataset=function(){return n.Message.getFieldWithDefault(this,1,"")},proto.Message.prototype.setDataset=function(e){return n.Message.setProto3StringField(this,1,e)},proto.Message.prototype.getRow=function(){return n.Message.getFieldWithDefault(this,2,"")},proto.Message.prototype.setRow=function(e){return n.Message.setProto3StringField(this,2,e)},proto.Message.prototype.getColumn=function(){return n.Message.getFieldWithDefault(this,3,"")},proto.Message.prototype.setColumn=function(e){return n.Message.setProto3StringField(this,3,e)},proto.Message.prototype.getValue=function(){return n.Message.getFieldWithDefault(this,4,"")},proto.Message.prototype.setValue=function(e){return n.Message.setProto3StringField(this,4,e)},n.Message.GENERATE_TO_OBJECT&&(proto.MessageEnvelope.prototype.toObject=function(e){return proto.MessageEnvelope.toObject(e,this)},proto.MessageEnvelope.toObject=function(e,t){var r={timestamp:n.Message.getFieldWithDefault(t,1,""),isencrypted:n.Message.getBooleanFieldWithDefault(t,2,!1),content:t.getContent_asB64()};return e&&(r.$jspbMessageInstance=t),r}),proto.MessageEnvelope.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new proto.MessageEnvelope;return proto.MessageEnvelope.deserializeBinaryFromReader(r,t)},proto.MessageEnvelope.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();)switch(t.getFieldNumber()){case 1:var r=t.readString();e.setTimestamp(r);break;case 2:r=t.readBool(),e.setIsencrypted(r);break;case 3:r=t.readBytes(),e.setContent(r);break;default:t.skipField()}return e},proto.MessageEnvelope.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return proto.MessageEnvelope.serializeBinaryToWriter(this,e),e.getResultBuffer()},proto.MessageEnvelope.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getTimestamp()).length>0&&t.writeString(1,r),(r=e.getIsencrypted())&&t.writeBool(2,r),(r=e.getContent_asU8()).length>0&&t.writeBytes(3,r)},proto.MessageEnvelope.prototype.getTimestamp=function(){return n.Message.getFieldWithDefault(this,1,"")},proto.MessageEnvelope.prototype.setTimestamp=function(e){return n.Message.setProto3StringField(this,1,e)},proto.MessageEnvelope.prototype.getIsencrypted=function(){return n.Message.getBooleanFieldWithDefault(this,2,!1)},proto.MessageEnvelope.prototype.setIsencrypted=function(e){return n.Message.setProto3BooleanField(this,2,e)},proto.MessageEnvelope.prototype.getContent=function(){return n.Message.getFieldWithDefault(this,3,"")},proto.MessageEnvelope.prototype.getContent_asB64=function(){return n.Message.bytesAsB64(this.getContent())},proto.MessageEnvelope.prototype.getContent_asU8=function(){return n.Message.bytesAsU8(this.getContent())},proto.MessageEnvelope.prototype.setContent=function(e){return n.Message.setProto3BytesField(this,3,e)},proto.SyncRequest.repeatedFields_=[1],n.Message.GENERATE_TO_OBJECT&&(proto.SyncRequest.prototype.toObject=function(e){return proto.SyncRequest.toObject(e,this)},proto.SyncRequest.toObject=function(e,t){var r={messagesList:n.Message.toObjectList(t.getMessagesList(),proto.MessageEnvelope.toObject,e),fileid:n.Message.getFieldWithDefault(t,2,""),groupid:n.Message.getFieldWithDefault(t,3,""),keyid:n.Message.getFieldWithDefault(t,5,""),since:n.Message.getFieldWithDefault(t,6,"")};return e&&(r.$jspbMessageInstance=t),r}),proto.SyncRequest.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new proto.SyncRequest;return proto.SyncRequest.deserializeBinaryFromReader(r,t)},proto.SyncRequest.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();)switch(t.getFieldNumber()){case 1:var r=new proto.MessageEnvelope;t.readMessage(r,proto.MessageEnvelope.deserializeBinaryFromReader),e.addMessages(r);break;case 2:r=t.readString(),e.setFileid(r);break;case 3:r=t.readString(),e.setGroupid(r);break;case 5:r=t.readString(),e.setKeyid(r);break;case 6:r=t.readString(),e.setSince(r);break;default:t.skipField()}return e},proto.SyncRequest.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return proto.SyncRequest.serializeBinaryToWriter(this,e),e.getResultBuffer()},proto.SyncRequest.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getMessagesList()).length>0&&t.writeRepeatedMessage(1,r,proto.MessageEnvelope.serializeBinaryToWriter),(r=e.getFileid()).length>0&&t.writeString(2,r),(r=e.getGroupid()).length>0&&t.writeString(3,r),(r=e.getKeyid()).length>0&&t.writeString(5,r),(r=e.getSince()).length>0&&t.writeString(6,r)},proto.SyncRequest.prototype.getMessagesList=function(){return n.Message.getRepeatedWrapperField(this,proto.MessageEnvelope,1)},proto.SyncRequest.prototype.setMessagesList=function(e){return n.Message.setRepeatedWrapperField(this,1,e)},proto.SyncRequest.prototype.addMessages=function(e,t){return n.Message.addToRepeatedWrapperField(this,1,e,proto.MessageEnvelope,t)},proto.SyncRequest.prototype.clearMessagesList=function(){return this.setMessagesList([])},proto.SyncRequest.prototype.getFileid=function(){return n.Message.getFieldWithDefault(this,2,"")},proto.SyncRequest.prototype.setFileid=function(e){return n.Message.setProto3StringField(this,2,e)},proto.SyncRequest.prototype.getGroupid=function(){return n.Message.getFieldWithDefault(this,3,"")},proto.SyncRequest.prototype.setGroupid=function(e){return n.Message.setProto3StringField(this,3,e)},proto.SyncRequest.prototype.getKeyid=function(){return n.Message.getFieldWithDefault(this,5,"")},proto.SyncRequest.prototype.setKeyid=function(e){return n.Message.setProto3StringField(this,5,e)},proto.SyncRequest.prototype.getSince=function(){return n.Message.getFieldWithDefault(this,6,"")},proto.SyncRequest.prototype.setSince=function(e){return n.Message.setProto3StringField(this,6,e)},proto.SyncResponse.repeatedFields_=[1],n.Message.GENERATE_TO_OBJECT&&(proto.SyncResponse.prototype.toObject=function(e){return proto.SyncResponse.toObject(e,this)},proto.SyncResponse.toObject=function(e,t){var r={messagesList:n.Message.toObjectList(t.getMessagesList(),proto.MessageEnvelope.toObject,e),merkle:n.Message.getFieldWithDefault(t,2,"")};return e&&(r.$jspbMessageInstance=t),r}),proto.SyncResponse.deserializeBinary=function(e){var t=new n.BinaryReader(e),r=new proto.SyncResponse;return proto.SyncResponse.deserializeBinaryFromReader(r,t)},proto.SyncResponse.deserializeBinaryFromReader=function(e,t){for(;t.nextField()&&!t.isEndGroup();)switch(t.getFieldNumber()){case 1:var r=new proto.MessageEnvelope;t.readMessage(r,proto.MessageEnvelope.deserializeBinaryFromReader),e.addMessages(r);break;case 2:r=t.readString(),e.setMerkle(r);break;default:t.skipField()}return e},proto.SyncResponse.prototype.serializeBinary=function(){var e=new n.BinaryWriter;return proto.SyncResponse.serializeBinaryToWriter(this,e),e.getResultBuffer()},proto.SyncResponse.serializeBinaryToWriter=function(e,t){var r=void 0;(r=e.getMessagesList()).length>0&&t.writeRepeatedMessage(1,r,proto.MessageEnvelope.serializeBinaryToWriter),(r=e.getMerkle()).length>0&&t.writeString(2,r)},proto.SyncResponse.prototype.getMessagesList=function(){return n.Message.getRepeatedWrapperField(this,proto.MessageEnvelope,1)},proto.SyncResponse.prototype.setMessagesList=function(e){return n.Message.setRepeatedWrapperField(this,1,e)},proto.SyncResponse.prototype.addMessages=function(e,t){return n.Message.addToRepeatedWrapperField(this,1,e,proto.MessageEnvelope,t)},proto.SyncResponse.prototype.clearMessagesList=function(){return this.setMessagesList([])},proto.SyncResponse.prototype.getMerkle=function(){return n.Message.getFieldWithDefault(this,2,"")},proto.SyncResponse.prototype.setMerkle=function(e){return n.Message.setProto3StringField(this,2,e)},o.object.extend(t,proto)},5070:function(e,t){var r,n;void 0===(n="function"==typeof(r=function(){"use strict";function e(t,r,n,o){var i=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(i,e.prototype),i.expected=r,i.found=n,i.location=o,i.name="SyntaxError",i}function t(e,t,r){return r=r||" ",e.length>t?e:(t-=e.length,e+(r+=r.repeat(t)).slice(0,t))}return function(e,t){function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r}(e,Error),e.prototype.format=function(e){var r="Error: "+this.message;if(this.location){var n,o=null;for(n=0;n<e.length;n++)if(e[n].source===this.location.source){o=e[n].text.split(/\r\n|\n|\r/g);break}var i=this.location.start,a=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(i):i,s=this.location.source+":"+a.line+":"+a.column;if(o){var u=this.location.end,l=t("",a.line.toString().length," "),c=o[i.line-1],f=(i.line===u.line?u.column:c.length+1)-i.column||1;r+="\n --\x3e "+s+"\n"+l+" |\n"+a.line+" | "+c+"\n"+l+" | "+t("",i.column-1," ")+t("",f,"^")}else r+="\n at "+s}return r},e.buildMessage=function(e,t){var r={literal:function(e){return'"'+o(e.text)+'"'},class:function(e){var t=e.parts.map((function(e){return Array.isArray(e)?i(e[0])+"-"+i(e[1]):i(e)}));return"["+(e.inverted?"^":"")+t.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(e){return e.description}};function n(e){return e.charCodeAt(0).toString(16).toUpperCase()}function o(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+n(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+n(e)}))}function i(e){return e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+n(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+n(e)}))}function a(e){return r[e.type](e)}return"Expected "+function(e){var t,r,n=e.map(a);if(n.sort(),n.length>0){for(t=1,r=1;t<n.length;t++)n[t-1]!==n[t]&&(n[r]=n[t],r++);n.length=r}switch(n.length){case 1:return n[0];case 2:return n[0]+" or "+n[1];default:return n.slice(0,-1).join(", ")+", or "+n[n.length-1]}}(e)+" but "+function(e){return e?'"'+o(e)+'"':"end of input"}(t)+" found."},{SyntaxError:e,parse:function(t,r){var n,o,i,a,s={},u=(r=void 0!==r?r:{}).grammarSource,l={expr:L},c=L,f="source",d="sink",g=" ",p=/^[0-9]/,h=D("source",!1),y=D("sink",!1),m=j("space"),b=D(" ",!1),_=j("digit"),w={type:"class",parts:[["0","9"]],inverted:!1,ignoreCase:!1},E=j("weight"),v=function(){return{type:"source"}},S=function(e){return{type:"sink",weight:+e||1}},T=function(e){return+e},O=0,A=[{line:1,column:1}],I=0,R=[],N=0;if("startRule"in r){if(!(r.startRule in l))throw new Error("Can't start parsing from rule \""+r.startRule+'".');c=l[r.startRule]}function D(e,t){return{type:"literal",text:e,ignoreCase:t}}function j(e){return{type:"other",description:e}}function k(e){var r,n=A[e];if(n)return n;for(r=e-1;!A[r];)r--;for(n={line:(n=A[r]).line,column:n.column};r<e;)10===t.charCodeAt(r)?(n.line++,n.column=1):n.column++,r++;return A[e]=n,n}function C(e,t,r){var n=k(e),o=k(t),i={source:u,start:{offset:e,line:n.line,column:n.column},end:{offset:t,line:o.line,column:o.column}};return r&&u&&"function"==typeof u.offset&&(i.start=u.offset(i.start),i.end=u.offset(i.end)),i}function M(e){O<I||(O>I&&(I=O,R=[]),R.push(e))}function L(){var e,r,n;return e=O,(r=function(){var e;return t.substr(O,6)===f?(e=f,O+=6):(e=s,0===N&&M(h)),e}())!==s&&(r=v()),(e=r)===s&&(e=O,(r=function(){var e;return t.substr(O,4)===d?(e=d,O+=4):(e=s,0===N&&M(y)),e}())!==s?(function(){var e,r;if(N++,e=[],32===t.charCodeAt(O)?(r=g,O++):(r=s,0===N&&M(b)),r!==s)for(;r!==s;)e.push(r),32===t.charCodeAt(O)?(r=g,O++):(r=s,0===N&&M(b));else e=s;N--,e===s&&(r=s,0===N&&M(m))}(),(n=function(){var e,r,n,o;if(N++,e=O,r=O,n=[],(o=x())!==s)for(;o!==s;)n.push(o),o=x();else n=s;return(r=n!==s?t.substring(r,O):n)!==s&&(r=T(r)),N--,(e=r)===s&&(r=s,0===N&&M(E)),e}())===s&&(n=null),e=S(n)):(O=e,e=s)),e}function x(){var e;return N++,p.test(t.charAt(O))?(e=t.charAt(O),O++):(e=s,0===N&&M(w)),N--,e===s&&0===N&&M(_),e}if((n=c())!==s&&O===t.length)return n;throw n!==s&&O<t.length&&M({type:"end"}),o=R,i=I<t.length?t.charAt(I):null,a=I<t.length?C(I,I+1):C(I,I),new e(e.buildMessage(o,i),o,i,a)}}})?r.apply(t,[]):r)||(e.exports=n)},4939:function(e,t){var r,n;void 0===(n="function"==typeof(r=function(){"use strict";function e(t,r,n,o){var i=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(i,e.prototype),i.expected=r,i.found=n,i.location=o,i.name="SyntaxError",i}function t(e,t,r){return r=r||" ",e.length>t?e:(t-=e.length,e+(r+=r.repeat(t)).slice(0,t))}return function(e,t){function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r}(e,Error),e.prototype.format=function(e){var r="Error: "+this.message;if(this.location){var n,o=null;for(n=0;n<e.length;n++)if(e[n].source===this.location.source){o=e[n].text.split(/\r\n|\n|\r/g);break}var i=this.location.start,a=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(i):i,s=this.location.source+":"+a.line+":"+a.column;if(o){var u=this.location.end,l=t("",a.line.toString().length," "),c=o[i.line-1],f=(i.line===u.line?u.column:c.length+1)-i.column||1;r+="\n --\x3e "+s+"\n"+l+" |\n"+a.line+" | "+c+"\n"+l+" | "+t("",i.column-1," ")+t("",f,"^")}else r+="\n at "+s}return r},e.buildMessage=function(e,t){var r={literal:function(e){return'"'+o(e.text)+'"'},class:function(e){var t=e.parts.map((function(e){return Array.isArray(e)?i(e[0])+"-"+i(e[1]):i(e)}));return"["+(e.inverted?"^":"")+t.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(e){return e.description}};function n(e){return e.charCodeAt(0).toString(16).toUpperCase()}function o(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+n(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+n(e)}))}function i(e){return e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+n(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+n(e)}))}function a(e){return r[e.type](e)}return"Expected "+function(e){var t,r,n=e.map(a);if(n.sort(),n.length>0){for(t=1,r=1;t<n.length;t++)n[t-1]!==n[t]&&(n[r]=n[t],r++);n.length=r}switch(n.length){case 1:return n[0];case 2:return n[0]+" or "+n[1];default:return n.slice(0,-1).join(", ")+", or "+n[n.length-1]}}(e)+" but "+function(e){return e?'"'+o(e)+'"':"end of input"}(t)+" found."},{SyntaxError:e,parse:function(t,r){var n,o,i,a,s={},u=(r=void 0!==r?r:{}).grammarSource,l={expr:tt},c=tt,f="month",d="months",g="year",p="years",h="hold",y="spend",m="from",b="week",_="weeks",w="by",E="of",v="repeat",S="every",T="starting",O="up",A="to",I="schedule",R="full",N="-",D="remainder",j=" ",k=".",C="%",M=/^[0-9]/,L=/^[1-9]/,x=/^[^\r\n\t]/,B=Je("repeat interval"),F=Ze("month",!0),U=Ze("months",!0),P=Ze("year",!0),W=Ze("years",!0),H=Ze("hold",!0),z=Ze("spend",!0),V=Ze("from",!0),$=Ze("week",!0),q=Ze("weeks",!0),G=Ze("by",!0),Y=Ze("of",!0),Z=Ze("repeat",!0),K=Ze("every",!0),J=Ze("starting",!0),X=Ze("up",!0),Q=Ze("to",!0),ee=Ze("schedule",!0),te=Ze("full",!0),re=Ze("-",!0),ne=Ze("remainder",!0),oe=Je("space"),ie=Ze(" ",!1),ae=Je("digit"),se=Ke([["0","9"]],!1,!1),ue=Je("number"),le=Ke([["1","9"]],!1,!1),ce=Je("amount"),fe=Ze(".",!1),de=Je("percentage"),ge=Ze("%",!1),pe=Je("year"),he=Je("month"),ye=Ze("-",!1),me=Je("day"),be=Je("currency symbol"),_e={type:"any"},we=Je("Name"),Ee=Ke(["\r","\n","\t"],!0,!1),ve=function(e,t,r){return{type:"percentage",percent:+t,category:r,priority:+e}},Se=function(e,t,r,n,o){return{type:"week",amount:t,weeks:r,starting:n,limit:o,priority:+e}},Te=function(e,t,r,n,o){return{type:n?"spend":"by",amount:t,month:r,...o?o[3]:{},from:n,priority:+e}},Oe=function(e,t,r){return{type:"simple",monthly:t,limit:r,priority:+e}},Ae=function(e,t){return{type:"simple",limit:t,priority:+e}},Ie=function(e,t,r){return{type:"schedule",name:r,priority:+e,full:t}},Re=function(e,t){return{type:"remainder",priority:null,weight:t}},Ne=function(){return{annual:!1}},De=function(e){return{annual:!1,repeat:+e}},je=function(){return{annual:!0}},ke=function(e){return{annual:!0,repeat:+e}},Ce=function(e){return{amount:e,hold:!0}},Me=function(e){return{amount:e,hold:!1}},Le=function(){return null},xe=function(e){return+e},Be=function(e){return e},Fe=function(){return!0},Ue=function(e){return e},Pe=function(e){return+e||1},We=function(e){return+e},He=function(e){return+e},ze=function(e){return/\p{Sc}/u.test(e)},Ve=0,$e=[{line:1,column:1}],qe=0,Ge=[],Ye=0;if("startRule"in r){if(!(r.startRule in l))throw new Error("Can't start parsing from rule \""+r.startRule+'".');c=l[r.startRule]}function Ze(e,t){return{type:"literal",text:e,ignoreCase:t}}function Ke(e,t,r){return{type:"class",parts:e,inverted:t,ignoreCase:r}}function Je(e){return{type:"other",description:e}}function Xe(e){var r,n=$e[e];if(n)return n;for(r=e-1;!$e[r];)r--;for(n={line:(n=$e[r]).line,column:n.column};r<e;)10===t.charCodeAt(r)?(n.line++,n.column=1):n.column++,r++;return $e[e]=n,n}function Qe(e,t,r){var n=Xe(e),o=Xe(t),i={source:u,start:{offset:e,line:n.line,column:n.column},end:{offset:t,line:o.line,column:o.column}};return r&&u&&"function"==typeof u.offset&&(i.start=u.offset(i.start),i.end=u.offset(i.end)),i}function et(e){Ve<qe||(Ve>qe&&(qe=Ve,Ge=[]),Ge.push(e))}function tt(){var e,r,n,o,i,a,u,l,c,h,v,S,O;return e=Ve,(r=it())===s&&(r=null),at(),(n=function(){var e,r,n,o;if(Ye++,e=Ve,r=Ve,n=[],(o=st())!==s)for(;o!==s;)n.push(o),o=st();else n=s;return(r=n!==s?t.substring(r,Ve):n)!==s?((n=at())===s&&(n=null),37===t.charCodeAt(Ve)?(o=C,Ve++):(o=s,0===Ye&&et(ge)),o!==s?e=He(r):(Ve=e,e=s)):(Ve=e,e=s),Ye--,e===s&&(r=s,0===Ye&&et(de)),e}())!==s&&(o=at())!==s&&(i=function(){var e;return t.substr(Ve,2).toLowerCase()===E?(e=t.substr(Ve,2),Ve+=2):(e=s,0===Ye&&et(Y)),e}())!==s&&(a=at())!==s&&(u=dt())!==s?e=ve(r,n,u):(Ve=e,e=s),e===s&&(e=Ve,(r=it())===s&&(r=null),at(),(n=ct())!==s&&(o=at())!==s&&(i=nt())!==s&&(a=at())!==s&&(u=function(){var e,r;return e=Ve,(r=function(){var e;return t.substr(Ve,4).toLowerCase()===b?(e=t.substr(Ve,4),Ve+=4):(e=s,0===Ye&&et($)),e}())!==s&&(r=Le()),(e=r)===s&&(e=Ve,(r=ut())!==s&&at()!==s&&function(){var e;return t.substr(Ve,5).toLowerCase()===_?(e=t.substr(Ve,5),Ve+=5):(e=s,0===Ye&&et(q)),e}()!==s?e=xe(r):(Ve=e,e=s)),e}())!==s&&(l=at())!==s&&(c=function(){var e;return t.substr(Ve,8).toLowerCase()===T?(e=t.substr(Ve,8),Ve+=8):(e=s,0===Ye&&et(J)),e}())!==s&&(h=at())!==s&&(v=function(){var e,r,n,o,i;return e=Ve,r=Ve,(n=ft())!==s?(45===t.charCodeAt(Ve)?(o=N,Ve++):(o=s,0===Ye&&et(ye)),o!==s&&(i=function(){var e,r,n,o;return Ye++,e=Ve,r=Ve,(n=st())!==s&&(o=st())!==s?r=n=[n,o]:(Ve=r,r=s),e=r!==s?t.substring(e,Ve):r,Ye--,e===s&&(r=s,0===Ye&&et(me)),e}())!==s?r=n=[n,o,i]:(Ve=r,r=s)):(Ve=r,r=s),r!==s?t.substring(e,Ve):r}())!==s?((S=rt())===s&&(S=null),e=Se(r,n,u,v,S)):(Ve=e,e=s),e===s&&(e=Ve,(r=it())===s&&(r=null),at(),(n=ct())!==s&&(o=at())!==s&&(i=function(){var e;return t.substr(Ve,2).toLowerCase()===w?(e=t.substr(Ve,2),Ve+=2):(e=s,0===Ye&&et(G)),e}())!==s&&(a=at())!==s&&(u=ft())!==s?((l=function(){var e,r,n,o;return e=Ve,at()!==s?(t.substr(Ve,5).toLowerCase()===y?(r=t.substr(Ve,5),Ve+=5):(r=s,0===Ye&&et(z)),r!==s&&at()!==s?(t.substr(Ve,4).toLowerCase()===m?(n=t.substr(Ve,4),Ve+=4):(n=s,0===Ye&&et(V)),n!==s&&at()!==s&&(o=ft())!==s?e=Be(o):(Ve=e,e=s)):(Ve=e,e=s)):(Ve=e,e=s),e}())===s&&(l=null),c=Ve,(h=at())!==s&&(v=nt())!==s&&(S=at())!==s&&(O=function(){var e,r,n;return Ye++,e=Ve,t.substr(Ve,5).toLowerCase()===f?(r=t.substr(Ve,5),Ve+=5):(r=s,0===Ye&&et(F)),r!==s&&(r=Ne()),(e=r)===s&&(e=Ve,(r=lt())!==s&&at()!==s?(t.substr(Ve,6).toLowerCase()===d?(n=t.substr(Ve,6),Ve+=6):(n=s,0===Ye&&et(U)),n!==s?e=De(r):(Ve=e,e=s)):(Ve=e,e=s),e===s&&(e=Ve,t.substr(Ve,4).toLowerCase()===g?(r=t.substr(Ve,4),Ve+=4):(r=s,0===Ye&&et(P)),r!==s&&(r=je()),(e=r)===s&&(e=Ve,(r=lt())!==s&&at()!==s?(t.substr(Ve,5).toLowerCase()===p?(n=t.substr(Ve,5),Ve+=5):(n=s,0===Ye&&et(W)),n!==s?e=ke(r):(Ve=e,e=s)):(Ve=e,e=s)))),Ye--,e===s&&(r=s,0===Ye&&et(B)),e}())!==s?c=h=[h,v,S,O]:(Ve=c,c=s),c===s&&(c=null),e=Te(r,n,u,l,c)):(Ve=e,e=s),e===s&&(e=Ve,(r=it())===s&&(r=null),at(),(n=ct())!==s?((o=rt())===s&&(o=null),e=Oe(r,n,o)):(Ve=e,e=s),e===s&&(e=Ve,(r=it())===s&&(r=null),at(),(n=rt())!==s?e=Ae(r,n):(Ve=e,e=s),e===s&&(e=Ve,(r=it())===s&&(r=null),at(),(n=function(){var e;return t.substr(Ve,8).toLowerCase()===I?(e=t.substr(Ve,8),Ve+=8):(e=s,0===Ye&&et(ee)),e}())!==s&&(o=at())!==s?((i=function(){var e,r;return e=Ve,t.substr(Ve,4).toLowerCase()===R?(r=t.substr(Ve,4),Ve+=4):(r=s,0===Ye&&et(te)),r!==s&&at()!==s?e=Fe():(Ve=e,e=s),e}())===s&&(i=null),(a=dt())!==s?e=Ie(r,i,a):(Ve=e,e=s)):(Ve=e,e=s),e===s&&(e=Ve,(r=it())===s&&(r=null),at(),(n=function(){var e,r,n;return e=Ve,t.substr(Ve,9).toLowerCase()===D?(r=t.substr(Ve,9),Ve+=9):(r=s,0===Ye&&et(ne)),r!==s?(at(),(n=lt())===s&&(n=null),e=Pe(n)):(Ve=e,e=s),e}())!==s?e=Re(r,n):(Ve=e,e=s))))))),e}function rt(){var e,r,n;return e=Ve,at(),ot()!==s&&at()!==s&&(r=ct())!==s&&at()!==s?(t.substr(Ve,4).toLowerCase()===h?(n=t.substr(Ve,4),Ve+=4):(n=s,0===Ye&&et(H)),n!==s?e=Ce(r):(Ve=e,e=s)):(Ve=e,e=s),e===s&&(e=Ve,at(),ot()!==s&&at()!==s&&(r=ct())!==s?e=Me(r):(Ve=e,e=s)),e}function nt(){var e,r,n,o;return e=Ve,t.substr(Ve,6).toLowerCase()===v?(r=t.substr(Ve,6),Ve+=6):(r=s,0===Ye&&et(Z)),r!==s&&(n=at())!==s?(t.substr(Ve,5).toLowerCase()===S?(o=t.substr(Ve,5),Ve+=5):(o=s,0===Ye&&et(K)),o!==s?e=r=[r,n,o]:(Ve=e,e=s)):(Ve=e,e=s),e}function ot(){var e,r,n,o;return e=Ve,t.substr(Ve,2).toLowerCase()===O?(r=t.substr(Ve,2),Ve+=2):(r=s,0===Ye&&et(X)),r!==s&&(n=at())!==s?(t.substr(Ve,2).toLowerCase()===A?(o=t.substr(Ve,2),Ve+=2):(o=s,0===Ye&&et(Q)),o!==s?e=r=[r,n,o]:(Ve=e,e=s)):(Ve=e,e=s),e}function it(){var e,r,n;return e=Ve,t.substr(Ve,1).toLowerCase()===N?(r=t.charAt(Ve),Ve++):(r=s,0===Ye&&et(re)),r!==s&&(n=ut())!==s&&at()!==s?e=Ue(n):(Ve=e,e=s),e}function at(){var e,r;if(Ye++,e=[],32===t.charCodeAt(Ve)?(r=j,Ve++):(r=s,0===Ye&&et(ie)),r!==s)for(;r!==s;)e.push(r),32===t.charCodeAt(Ve)?(r=j,Ve++):(r=s,0===Ye&&et(ie));else e=s;return Ye--,e===s&&(r=s,0===Ye&&et(oe)),e}function st(){var e;return Ye++,M.test(t.charAt(Ve))?(e=t.charAt(Ve),Ve++):(e=s,0===Ye&&et(se)),Ye--,e===s&&0===Ye&&et(ae),e}function ut(){var e,r,n;if(Ye++,e=Ve,r=[],(n=st())!==s)for(;n!==s;)r.push(n),n=st();else r=s;return e=r!==s?t.substring(e,Ve):r,Ye--,e===s&&(r=s,0===Ye&&et(ue)),e}function lt(){var e,r,n,o,i;if(e=Ve,r=Ve,L.test(t.charAt(Ve))?(n=t.charAt(Ve),Ve++):(n=s,0===Ye&&et(le)),n!==s){for(o=[],M.test(t.charAt(Ve))?(i=t.charAt(Ve),Ve++):(i=s,0===Ye&&et(se));i!==s;)o.push(i),M.test(t.charAt(Ve))?(i=t.charAt(Ve),Ve++):(i=s,0===Ye&&et(se));r=n=[n,o]}else Ve=r,r=s;return r!==s?t.substring(e,Ve):r}function ct(){var e,r,n,o,i,a,u,l,c;if(Ye++,e=Ve,function(){var e,r,n;Ye++,e=Ve,t.length>Ve?(r=t.charAt(Ve),Ve++):(r=s,0===Ye&&et(_e)),r!==s&&(n=(n=ze(r))?void 0:s)!==s?e=r=[r,n]:(Ve=e,e=s),Ye--,e===s&&(r=s,0===Ye&&et(be))}(),at(),r=Ve,n=Ve,o=[],(i=st())!==s)for(;i!==s;)o.push(i),i=st();else o=s;return o!==s?(i=Ve,46===t.charCodeAt(Ve)?(a=k,Ve++):(a=s,0===Ye&&et(fe)),a!==s?(u=Ve,(l=st())!==s?((c=st())===s&&(c=null),u=l=[l,c]):(Ve=u,u=s),u===s&&(u=null),i=a=[a,u]):(Ve=i,i=s),i===s&&(i=null),n=o=[o,i]):(Ve=n,n=s),(r=n!==s?t.substring(r,Ve):n)!==s?e=We(r):(Ve=e,e=s),Ye--,e===s&&0===Ye&&et(ce),e}function ft(){var e,r,n,o,i,a;return Ye++,e=Ve,r=Ve,(n=function(){var e,r,n,o,i,a;return Ye++,e=Ve,r=Ve,(n=st())!==s&&(o=st())!==s&&(i=st())!==s&&(a=st())!==s?r=n=[n,o,i,a]:(Ve=r,r=s),e=r!==s?t.substring(e,Ve):r,Ye--,e===s&&(r=s,0===Ye&&et(pe)),e}())!==s?(45===t.charCodeAt(Ve)?(o=N,Ve++):(o=s,0===Ye&&et(ye)),o!==s&&(i=st())!==s&&(a=st())!==s?r=n=[n,o,i,a]:(Ve=r,r=s)):(Ve=r,r=s),e=r!==s?t.substring(e,Ve):r,Ye--,e===s&&(r=s,0===Ye&&et(he)),e}function dt(){var e,r,n;if(Ye++,e=Ve,r=[],x.test(t.charAt(Ve))?(n=t.charAt(Ve),Ve++):(n=s,0===Ye&&et(Ee)),n!==s)for(;n!==s;)r.push(n),x.test(t.charAt(Ve))?(n=t.charAt(Ve),Ve++):(n=s,0===Ye&&et(Ee));else r=s;return e=r!==s?t.substring(e,Ve):r,Ye--,e===s&&(r=s,0===Ye&&et(we)),e}if((n=c())!==s&&Ve===t.length)return n;throw n!==s&&Ve<t.length&&et({type:"end"}),o=Ge,i=qe<t.length?t.charAt(qe):null,a=qe<t.length?Qe(qe,qe+1):Qe(qe,qe),new e(e.buildMessage(o,i),o,i,a)}}})?r.apply(t,[]):r)||(e.exports=n)},2074:()=>{},1214:()=>{},8119:()=>{},4654:()=>{},2361:()=>{},4616:()=>{},3604:(e,t,r)=>{"use strict";var n=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],o="undefined"==typeof globalThis?r.g:globalThis;e.exports=function(){for(var e=[],t=0;t<n.length;t++)"function"==typeof o[n[t]]&&(e[e.length]=n[t]);return e}},2632:(e,t,r)=>{"use strict";var n=r(9142),o=r(9446),i=r(5859);if(r(8489)()||r(7027)()){var a=Symbol.iterator;e.exports=function(e){return null!=e&&void 0!==e[a]?e[a]():o(e)?Array.prototype[a].call(e):void 0}}else{var s=r(9484),u=r(1753),l=r(7701),c=l("%Map%",!0),f=l("%Set%",!0),d=r(593),g=d("Array.prototype.push"),p=d("String.prototype.charCodeAt"),h=d("String.prototype.slice"),y=function(e){var t=0;return{next:function(){var r,n=t>=e.length;return n||(r=e[t],t+=1),{done:n,value:r}}}},m=function(e,t){if(s(e)||o(e))return y(e);if(u(e)){var r=0;return{next:function(){var t=function(e,t){if(t+1>=e.length)return t+1;var r=p(e,t);if(r<55296||r>56319)return t+1;var n=p(e,t+1);return n<56320||n>57343?t+1:t+2}(e,r),n=h(e,r,t);return r=t,{done:t>e.length,value:n}}}}return t&&void 0!==e["_es6-shim iterator_"]?e["_es6-shim iterator_"]():void 0};if(c||f){var b=r(5588),_=r(6157),w=d("Map.prototype.forEach",!0),E=d("Set.prototype.forEach",!0);if(void 0===n||!n.versions||!n.versions.node)var v=d("Map.prototype.iterator",!0),S=d("Set.prototype.iterator",!0);var T=d("Map.prototype.@@iterator",!0)||d("Map.prototype._es6-shim iterator_",!0),O=d("Set.prototype.@@iterator",!0)||d("Set.prototype._es6-shim iterator_",!0);e.exports=function(e){return function(e){if(b(e)){if(v)return i(v(e));if(T)return T(e);if(w){var t=[];return w(e,(function(e,r){g(t,[r,e])})),y(t)}}if(_(e)){if(S)return i(S(e));if(O)return O(e);if(E){var r=[];return E(e,(function(e){g(r,e)})),y(r)}}}(e)||m(e)}}else e.exports=function(e){if(null!=e)return m(e,!0)}}},8230:(e,t,r)=>{"use strict";var n=r(5588),o=r(6157),i=r(2913),a=r(9920);e.exports=function(e){if(e&&"object"==typeof e){if(n(e))return"Map";if(o(e))return"Set";if(i(e))return"WeakMap";if(a(e))return"WeakSet"}return!1}}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var r=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(r.exports,r,r.exports,__webpack_require__),r.loaded=!0,r.exports}__webpack_require__.m=__webpack_modules__,__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},__webpack_require__.f={},__webpack_require__.e=e=>Promise.all(Object.keys(__webpack_require__.f).reduce(((t,r)=>(__webpack_require__.f[r](e,t),t)),[])),__webpack_require__.u=e=>e+"."+e+".kcab.worker.e800a4a41b9557f2726d.js",__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),__webpack_require__.p="/kcab/",(()=>{var e={main:1};__webpack_require__.f.i=(t,r)=>{e[t]||importScripts(__webpack_require__.p+__webpack_require__.u(t))};var t=self.webpackChunkbackend=self.webpackChunkbackend||[],r=t.push.bind(t);t.push=t=>{var[n,o,i]=t;for(var a in o)__webpack_require__.o(o,a)&&(__webpack_require__.m[a]=o[a]);for(i&&i(__webpack_require__);n.length;)e[n.pop()]=1;r(t)}})();var __webpack_exports__={};(()=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{handlers:()=>lg,init:()=>yg,initApp:()=>hg,lib:()=>mg});var e={};let t;__webpack_require__.r(e),__webpack_require__.d(e,{all:()=>Wa,asyncTransaction:()=>Pa,cache:()=>Fa,closeDatabase:()=>ja,deleteAccount:()=>Ss,deleteCategory:()=>ls,deleteCategoryGroup:()=>is,deletePayee:()=>ds,deleteTransaction:()=>Ds,deleteTransferPayee:()=>gs,delete_:()=>Za,execQuery:()=>xa,first:()=>Ha,firstSync:()=>za,fromDateRepr:()=>dn,getAccounts:()=>ws,getCategories:()=>es,getCategoriesGrouped:()=>ts,getDatabase:()=>Ca,getDatabasePath:()=>Ra,getOrphanedPayees:()=>bs,getPayee:()=>cs,getPayeeByName:()=>_s,getPayees:()=>ys,getTransaction:()=>Os,getTransactions:()=>Is,getTransactionsByDate:()=>As,insert:()=>Ya,insertAccount:()=>Es,insertCategory:()=>as,insertCategoryGroup:()=>rs,insertPayee:()=>fs,insertTransaction:()=>Rs,insertWithSchema:()=>Xa,insertWithUUID:()=>Ga,loadClock:()=>Ma,mergePayees:()=>hs,moveAccount:()=>Ts,moveCategory:()=>us,moveCategoryGroup:()=>os,openDatabase:()=>Na,reopenDatabase:()=>Da,run:()=>Va,runQuery:()=>La,select:()=>$a,selectFirstWithSchema:()=>Ja,selectWithSchema:()=>Ka,setDatabase:()=>ka,syncGetOrphanedPayees:()=>ms,toDateRepr:()=>fn,transaction:()=>Ua,update:()=>qa,updateAccount:()=>vs,updateCategory:()=>ss,updateCategoryGroup:()=>ns,updatePayee:()=>ps,updateTransaction:()=>Ns,updateWithSchema:()=>Qa});var r=__webpack_require__(3529);function n(e,r){return t(e,r)}async function o(e,t){await n("api/start-import",{budgetName:e});try{await t()}catch(e){throw await n("api/abort-import"),e}await n("api/finish-import")}async function i(e){await n("api/batch-budget-start");try{await e()}finally{await n("api/batch-budget-end")}}function a(e,t,r){return n("api/budget-set-amount",{month:e,categoryId:t,amount:r})}function s(e,t,r){return n("api/budget-set-carryover",{month:e,categoryId:t,flag:r})}function u(e,t){return n("api/transactions-add",{accountId:e,transactions:t})}function l(e,t){return n("api/account-create",{account:e,initialBalance:t})}function c(e){return n("api/category-group-create",{group:e})}function f(){return n("api/categories-get",{grouped:!1})}function d(e){return n("api/category-create",{category:e})}function g(){return n("api/payees-get")}function p(e){return n("api/payee-create",{payee:e})}function h(e){return Math.round(100*e)}var y=__webpack_require__(2449),m=__webpack_require__.n(y);function b(e){return b="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},b(e)}function _(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function w(e){_(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"===b(e)&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):("string"!=typeof e&&"[object String]"!==t||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}function E(e){if(_(1,arguments),!function(e){return _(1,arguments),e instanceof Date||"object"===b(e)&&"[object Date]"===Object.prototype.toString.call(e)}(e)&&"number"!=typeof e)return!1;var t=w(e);return!isNaN(Number(t))}function v(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function S(e){_(1,arguments);var t=w(e),r=t.getUTCDay(),n=(r<1?7:0)+r-1;return t.setUTCDate(t.getUTCDate()-n),t.setUTCHours(0,0,0,0),t}function T(e){_(1,arguments);var t=w(e),r=t.getUTCFullYear(),n=new Date(0);n.setUTCFullYear(r+1,0,4),n.setUTCHours(0,0,0,0);var o=S(n),i=new Date(0);i.setUTCFullYear(r,0,4),i.setUTCHours(0,0,0,0);var a=S(i);return t.getTime()>=o.getTime()?r+1:t.getTime()>=a.getTime()?r:r-1}var O={};function A(){return O}function I(e,t){var r,n,o,i,a,s,u,l;_(1,arguments);var c=A(),f=v(null!==(r=null!==(n=null!==(o=null!==(i=null==t?void 0:t.weekStartsOn)&&void 0!==i?i:null==t||null===(a=t.locale)||void 0===a||null===(s=a.options)||void 0===s?void 0:s.weekStartsOn)&&void 0!==o?o:c.weekStartsOn)&&void 0!==n?n:null===(u=c.locale)||void 0===u||null===(l=u.options)||void 0===l?void 0:l.weekStartsOn)&&void 0!==r?r:0);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=w(e),g=d.getUTCDay(),p=(g<f?7:0)+g-f;return d.setUTCDate(d.getUTCDate()-p),d.setUTCHours(0,0,0,0),d}function R(e,t){var r,n,o,i,a,s,u,l;_(1,arguments);var c=w(e),f=c.getUTCFullYear(),d=A(),g=v(null!==(r=null!==(n=null!==(o=null!==(i=null==t?void 0:t.firstWeekContainsDate)&&void 0!==i?i:null==t||null===(a=t.locale)||void 0===a||null===(s=a.options)||void 0===s?void 0:s.firstWeekContainsDate)&&void 0!==o?o:d.firstWeekContainsDate)&&void 0!==n?n:null===(u=d.locale)||void 0===u||null===(l=u.options)||void 0===l?void 0:l.firstWeekContainsDate)&&void 0!==r?r:1);if(!(g>=1&&g<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var p=new Date(0);p.setUTCFullYear(f+1,0,g),p.setUTCHours(0,0,0,0);var h=I(p,t),y=new Date(0);y.setUTCFullYear(f,0,g),y.setUTCHours(0,0,0,0);var m=I(y,t);return c.getTime()>=h.getTime()?f+1:c.getTime()>=m.getTime()?f:f-1}function N(e,t){for(var r=e<0?"-":"",n=Math.abs(e).toString();n.length<t;)n="0"+n;return r+n}const D=function(e,t){var r=e.getUTCFullYear(),n=r>0?r:1-r;return N("yy"===t?n%100:n,t.length)},j=function(e,t){var r=e.getUTCMonth();return"M"===t?String(r+1):N(r+1,2)},k=function(e,t){return N(e.getUTCDate(),t.length)},C=function(e,t){return N(e.getUTCHours()%12||12,t.length)},M=function(e,t){return N(e.getUTCHours(),t.length)},L=function(e,t){return N(e.getUTCMinutes(),t.length)},x=function(e,t){return N(e.getUTCSeconds(),t.length)},B=function(e,t){var r=t.length,n=e.getUTCMilliseconds();return N(Math.floor(n*Math.pow(10,r-3)),t.length)};var F={G:function(e,t,r){var n=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if("yo"===t){var n=e.getUTCFullYear(),o=n>0?n:1-n;return r.ordinalNumber(o,{unit:"year"})}return D(e,t)},Y:function(e,t,r,n){var o=R(e,n),i=o>0?o:1-o;return"YY"===t?N(i%100,2):"Yo"===t?r.ordinalNumber(i,{unit:"year"}):N(i,t.length)},R:function(e,t){return N(T(e),t.length)},u:function(e,t){return N(e.getUTCFullYear(),t.length)},Q:function(e,t,r){var n=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return N(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){var n=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return N(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){var n=e.getUTCMonth();switch(t){case"M":case"MM":return j(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){var n=e.getUTCMonth();switch(t){case"L":return String(n+1);case"LL":return N(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){var o=function(e,t){_(1,arguments);var r=w(e),n=I(r,t).getTime()-function(e,t){var r,n,o,i,a,s,u,l;_(1,arguments);var c=A(),f=v(null!==(r=null!==(n=null!==(o=null!==(i=null==t?void 0:t.firstWeekContainsDate)&&void 0!==i?i:null==t||null===(a=t.locale)||void 0===a||null===(s=a.options)||void 0===s?void 0:s.firstWeekContainsDate)&&void 0!==o?o:c.firstWeekContainsDate)&&void 0!==n?n:null===(u=c.locale)||void 0===u||null===(l=u.options)||void 0===l?void 0:l.firstWeekContainsDate)&&void 0!==r?r:1),d=R(e,t),g=new Date(0);return g.setUTCFullYear(d,0,f),g.setUTCHours(0,0,0,0),I(g,t)}(r,t).getTime();return Math.round(n/6048e5)+1}(e,n);return"wo"===t?r.ordinalNumber(o,{unit:"week"}):N(o,t.length)},I:function(e,t,r){var n=function(e){_(1,arguments);var t=w(e),r=S(t).getTime()-function(e){_(1,arguments);var t=T(e),r=new Date(0);return r.setUTCFullYear(t,0,4),r.setUTCHours(0,0,0,0),S(r)}(t).getTime();return Math.round(r/6048e5)+1}(e);return"Io"===t?r.ordinalNumber(n,{unit:"week"}):N(n,t.length)},d:function(e,t,r){return"do"===t?r.ordinalNumber(e.getUTCDate(),{unit:"date"}):k(e,t)},D:function(e,t,r){var n=function(e){_(1,arguments);var t=w(e),r=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var n=r-t.getTime();return Math.floor(n/864e5)+1}(e);return"Do"===t?r.ordinalNumber(n,{unit:"dayOfYear"}):N(n,t.length)},E:function(e,t,r){var n=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){var o=e.getUTCDay(),i=(o-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return N(i,2);case"eo":return r.ordinalNumber(i,{unit:"day"});case"eee":return r.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(o,{width:"short",context:"formatting"});default:return r.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){var o=e.getUTCDay(),i=(o-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return N(i,t.length);case"co":return r.ordinalNumber(i,{unit:"day"});case"ccc":return r.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(o,{width:"narrow",context:"standalone"});case"cccccc":return r.day(o,{width:"short",context:"standalone"});default:return r.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,r){var n=e.getUTCDay(),o=0===n?7:n;switch(t){case"i":return String(o);case"ii":return N(o,t.length);case"io":return r.ordinalNumber(o,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){var n=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(n,{width:"narrow",context:"formatting"});default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(e,t,r){var n,o=e.getUTCHours();switch(n=12===o?"noon":0===o?"midnight":o/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(n,{width:"narrow",context:"formatting"});default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(e,t,r){var n,o=e.getUTCHours();switch(n=o>=17?"evening":o>=12?"afternoon":o>=4?"morning":"night",t){case"B":case"BB":case"BBB":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(n,{width:"narrow",context:"formatting"});default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(e,t,r){if("ho"===t){var n=e.getUTCHours()%12;return 0===n&&(n=12),r.ordinalNumber(n,{unit:"hour"})}return C(e,t)},H:function(e,t,r){return"Ho"===t?r.ordinalNumber(e.getUTCHours(),{unit:"hour"}):M(e,t)},K:function(e,t,r){var n=e.getUTCHours()%12;return"Ko"===t?r.ordinalNumber(n,{unit:"hour"}):N(n,t.length)},k:function(e,t,r){var n=e.getUTCHours();return 0===n&&(n=24),"ko"===t?r.ordinalNumber(n,{unit:"hour"}):N(n,t.length)},m:function(e,t,r){return"mo"===t?r.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):L(e,t)},s:function(e,t,r){return"so"===t?r.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):x(e,t)},S:function(e,t){return B(e,t)},X:function(e,t,r,n){var o=(n._originalDate||e).getTimezoneOffset();if(0===o)return"Z";switch(t){case"X":return P(o);case"XXXX":case"XX":return W(o);default:return W(o,":")}},x:function(e,t,r,n){var o=(n._originalDate||e).getTimezoneOffset();switch(t){case"x":return P(o);case"xxxx":case"xx":return W(o);default:return W(o,":")}},O:function(e,t,r,n){var o=(n._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+U(o,":");default:return"GMT"+W(o,":")}},z:function(e,t,r,n){var o=(n._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+U(o,":");default:return"GMT"+W(o,":")}},t:function(e,t,r,n){var o=n._originalDate||e;return N(Math.floor(o.getTime()/1e3),t.length)},T:function(e,t,r,n){return N((n._originalDate||e).getTime(),t.length)}};function U(e,t){var r=e>0?"-":"+",n=Math.abs(e),o=Math.floor(n/60),i=n%60;if(0===i)return r+String(o);var a=t||"";return r+String(o)+a+N(i,2)}function P(e,t){return e%60==0?(e>0?"-":"+")+N(Math.abs(e)/60,2):W(e,t)}function W(e,t){var r=t||"",n=e>0?"-":"+",o=Math.abs(e);return n+N(Math.floor(o/60),2)+r+N(o%60,2)}const H=F;var z=function(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},V=function(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}};const $={p:V,P:function(e,t){var r,n=e.match(/(P+)(p+)?/)||[],o=n[1],i=n[2];if(!i)return z(e,t);switch(o){case"P":r=t.dateTime({width:"short"});break;case"PP":r=t.dateTime({width:"medium"});break;case"PPP":r=t.dateTime({width:"long"});break;default:r=t.dateTime({width:"full"})}return r.replace("{{date}}",z(o,t)).replace("{{time}}",V(i,t))}};function q(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}var G=["D","DD"],Y=["YY","YYYY"];function Z(e,t,r){if("YYYY"===e)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(r,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===e)throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(r,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===e)throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(r,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===e)throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(r,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var K={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function J(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}const X={date:J({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:J({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:J({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})};var Q={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function ee(e){return function(t,r){var n;if("formatting"===(null!=r&&r.context?String(r.context):"standalone")&&e.formattingValues){var o=e.defaultFormattingWidth||e.defaultWidth,i=null!=r&&r.width?String(r.width):o;n=e.formattingValues[i]||e.formattingValues[o]}else{var a=e.defaultWidth,s=null!=r&&r.width?String(r.width):e.defaultWidth;n=e.values[s]||e.values[a]}return n[e.argumentCallback?e.argumentCallback(t):t]}}var te,re={ordinalNumber:function(e,t){var r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},era:ee({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:ee({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:ee({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:ee({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:ee({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})};function ne(e){return function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.width,o=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],i=t.match(o);if(!i)return null;var a,s=i[0],u=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(u)?function(e,t){for(var r=0;r<e.length;r++)if(e[r].test(s))return r}(u):function(e,t){for(var r in e)if(e.hasOwnProperty(r)&&e[r].test(s))return r}(u);return a=e.valueCallback?e.valueCallback(l):l,{value:a=r.valueCallback?r.valueCallback(a):a,rest:t.slice(s.length)}}}const oe={code:"en-US",formatDistance:function(e,t,r){var n,o=K[e];return n="string"==typeof o?o:1===t?o.one:o.other.replace("{{count}}",t.toString()),null!=r&&r.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n},formatLong:X,formatRelative:function(e,t,r,n){return Q[e]},localize:re,match:{ordinalNumber:(te={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.match(te.matchPattern);if(!r)return null;var n=r[0],o=e.match(te.parsePattern);if(!o)return null;var i=te.valueCallback?te.valueCallback(o[0]):o[0];return{value:i=t.valueCallback?t.valueCallback(i):i,rest:e.slice(n.length)}}),era:ne({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:ne({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:ne({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:ne({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:ne({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};var ie=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ae=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,se=/^'([^]*?)'?$/,ue=/''/g,le=/[a-zA-Z]/;function ce(e,t,r){var n,o,i,a,s,u,l,c,f,d,g,p,h,y,m,b,S,T;_(2,arguments);var O=String(t),I=A(),R=null!==(n=null!==(o=null==r?void 0:r.locale)&&void 0!==o?o:I.locale)&&void 0!==n?n:oe,N=v(null!==(i=null!==(a=null!==(s=null!==(u=null==r?void 0:r.firstWeekContainsDate)&&void 0!==u?u:null==r||null===(l=r.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==s?s:I.firstWeekContainsDate)&&void 0!==a?a:null===(f=I.locale)||void 0===f||null===(d=f.options)||void 0===d?void 0:d.firstWeekContainsDate)&&void 0!==i?i:1);if(!(N>=1&&N<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var D=v(null!==(g=null!==(p=null!==(h=null!==(y=null==r?void 0:r.weekStartsOn)&&void 0!==y?y:null==r||null===(m=r.locale)||void 0===m||null===(b=m.options)||void 0===b?void 0:b.weekStartsOn)&&void 0!==h?h:I.weekStartsOn)&&void 0!==p?p:null===(S=I.locale)||void 0===S||null===(T=S.options)||void 0===T?void 0:T.weekStartsOn)&&void 0!==g?g:0);if(!(D>=0&&D<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!R.localize)throw new RangeError("locale must contain localize property");if(!R.formatLong)throw new RangeError("locale must contain formatLong property");var j=w(e);if(!E(j))throw new RangeError("Invalid time value");var k=function(e,t){return _(2,arguments),function(e,t){_(2,arguments);var r=w(e).getTime(),n=v(t);return new Date(r+n)}(e,-v(t))}(j,q(j)),C={firstWeekContainsDate:N,weekStartsOn:D,locale:R,_originalDate:j};return O.match(ae).map((function(e){var t=e[0];return"p"===t||"P"===t?(0,$[t])(e,R.formatLong):e})).join("").match(ie).map((function(n){if("''"===n)return"'";var o,i,a=n[0];if("'"===a)return(i=(o=n).match(se))?i[1].replace(ue,"'"):o;var s,u=H[a];if(u)return null!=r&&r.useAdditionalWeekYearTokens||(s=n,-1===Y.indexOf(s))||Z(n,t,String(e)),null!=r&&r.useAdditionalDayOfYearTokens||!function(e){return-1!==G.indexOf(e)}(n)||Z(n,t,String(e)),u(k,n,R.localize,C);if(a.match(le))throw new RangeError("Format string contains an unescaped latin alphabet character `"+a+"`");return n})).join("")}var fe=__webpack_require__(4314),de=__webpack_require__.n(fe);const ge={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let pe;const he=new Uint8Array(16);function ye(){if(!pe&&(pe="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!pe))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return pe(he)}const me=[];for(let e=0;e<256;++e)me.push((e+256).toString(16).slice(1));const be=function(e,t,r){if(ge.randomUUID&&!t&&!e)return ge.randomUUID();const n=(e=e||{}).random||(e.rng||ye)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(let e=0;e<16;++e)t[r+e]=n[e];return t}return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(me[e[t+0]]+me[e[t+1]]+me[e[t+2]]+me[e[t+3]]+"-"+me[e[t+4]]+me[e[t+5]]+"-"+me[e[t+6]]+me[e[t+7]]+"-"+me[e[t+8]]+me[e[t+9]]+"-"+me[e[t+10]]+me[e[t+11]]+me[e[t+12]]+me[e[t+13]]+me[e[t+14]]+me[e[t+15]]).toLowerCase()}(n)};function _e(e,t){return[...e].sort(((e,r)=>e[t]<r[t]?-1:e[t]>r[t]?1:0))}function we(e,t){const r=[...t];return e.masterCategories.forEach((e=>{e.subCategories&&e.subCategories.forEach((e=>{r.find((t=>t.categoryId===e.entityId))||r.push({budgeted:0,categoryId:e.entityId})}))})),r}async function Ee(e){const t=new Map;console.log("Importing Accounts..."),await async function(e,t){const r=_e(e.accounts,"sortableIndex");return Promise.all(r.map((async e=>{if(!e.isTombstone){const r=await l({name:e.accountName,offbudget:!e.onBudget,closed:!!e.hidden});t.set(e.entityId,r)}})))}(e,t),console.log("Importing Categories..."),await async function(e,t){const r=_e(e.masterCategories,"sortableIndex");await Promise.all(r.map((async e=>{if("OUTFLOW"===e.type&&!e.isTombstone&&e.subCategories&&e.subCategories.some((e=>!e.isTombstone))>0){const r=await c({name:e.name,is_income:!1});if(t.set(e.entityId,r),e.subCategories){const r=_e(e.subCategories,"sortableIndex");r.reverse();for(let e of r)if(!e.isTombstone){const r=await d({name:e.name,group_id:t.get(e.masterCategoryId)});t.set(e.entityId,r)}}}})))}(e,t),console.log("Importing Payees..."),await async function(e,t){for(let r of e.payees)if(!r.isTombstone){let e=await p({name:r.name,category:t.get(r.autoFillCategoryId)||null,transfer_acct:t.get(r.targetAccountId)||null});t.set(r.entityId,e)}}(e,t),console.log("Importing Transactions..."),await async function(e,t){const r=(await f()).find((e=>"Income"===e.name)).id,o=await n("api/accounts-get"),i=await g();function a(e){return null==e||"Category/__Split__"===e?null:"Category/__ImmediateIncome__"===e||"Category/__DeferredIncome__"===e?r:t.get(e)}function s(e){let t=o.find((t=>t.id===e));if(!t)throw new Error("Could not find account for transaction when importing");return t.offbudget}for(let r of e.transactions)if(t.set(r.entityId,be()),r.subTransactions)for(let e of r.subTransactions)t.set(e.entityId,be());let l=(c=e.transactions,c.reduce((function(e,t){var r=t.accountId;return e.hasOwnProperty(r)||(e[r]=[]),e[r].push(t),e}),{}));var c;await Promise.all(Object.keys(l).map((async r=>{let n=l[r].map((n=>{if(n.isTombstone)return null;function o(r){let n=t.get(r.transferTransactionId)||null,o=null,a=null;return n?o=i.find((e=>e.transfer_acct===t.get(r.targetAccountId))).id:(o=t.get(r.payeeId),a=e.payees.find((e=>e.entityId===r.payeeId))?.name),{transfer_id:n,payee:o,imported_payee:a}}let u={id:t.get(n.entityId),amount:h(n.amount),category:s(t.get(r))?null:a(n.categoryId),date:n.date,notes:n.memo||null,cleared:"Cleared"===n.cleared,...o(n)};return u.subtransactions=n.subTransactions&&n.subTransactions.map(((e,r)=>({id:t.get(e.entityId),amount:h(e.amount),category:a(e.categoryId),notes:e.memo||null,...o(e)}))),u})).filter((e=>e));await u(t.get(r),n)})))}(e,t),console.log("Importing Budgets..."),await async function(e,t){let r=_e(e.monthlyBudgets,"month");await i((async()=>{for(let n of r){let r=we(e,n.monthlySubCategoryBudgets.filter((e=>!e.isTombstone)));await Promise.all(r.map((async e=>{let r=h(e.budgeted),o=t.get(e.categoryId),i=ce(function(e){if("string"==typeof e){let[t,r,n]=e.split("-");return null!=n?new Date(parseInt(t),parseInt(r)-1,parseInt(n)):null!=r?new Date(parseInt(t),parseInt(r)-1,1):new Date(parseInt(t),0,1)}return e}(n.month),"yyyy-MM");o&&(await a(i,o,r),"AffectsBuffer"===e.overspendingHandling?await s(i,o,!1):"Confined"===e.overspendingHandling&&await s(i,o,!0))})))}}))}(e,t),console.log("Setting up...")}function ve(e,t){let r=e.filter((e=>e.entryName===t));if(0===r.length)throw new Error("Could not find file: "+t);if(r.length>=2)throw new Error("File name matches multiple files: "+t);return r[0]}function Se(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.slice(1).reduce(((e,t)=>e+"/"+t.replace(/^\//,"")),t[0].replace(/\/$/,""))}function Te(e){return Math.round(e/10)}function Oe(e){let t=e.split("-");return t[0]+"-"+t[1]}function Ae(e,t){return e.reduce((function(e,r){var n=r[t];return e.hasOwnProperty(n)||(e[n]=[]),e[n].push(r),e}),{})}Math.pow(10,8);var Ie=6e4,Re=36e5;function Ne(e,t){var r;_(1,arguments);var n=v(null!==(r=null==t?void 0:t.additionalDigits)&&void 0!==r?r:2);if(2!==n&&1!==n&&0!==n)throw new RangeError("additionalDigits must be 0, 1 or 2");if("string"!=typeof e&&"[object String]"!==Object.prototype.toString.call(e))return new Date(NaN);var o,i=function(e){var t,r={},n=e.split(De.dateTimeDelimiter);if(n.length>2)return r;if(/:/.test(n[0])?t=n[0]:(r.date=n[0],t=n[1],De.timeZoneDelimiter.test(r.date)&&(r.date=e.split(De.timeZoneDelimiter)[0],t=e.substr(r.date.length,e.length))),t){var o=De.timezone.exec(t);o?(r.time=t.replace(o[1],""),r.timezone=o[1]):r.time=t}return r}(e);if(i.date){var a=function(e,t){var r=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),n=e.match(r);if(!n)return{year:NaN,restDateString:""};var o=n[1]?parseInt(n[1]):null,i=n[2]?parseInt(n[2]):null;return{year:null===i?o:100*i,restDateString:e.slice((n[1]||n[2]).length)}}(i.date,n);o=function(e,t){if(null===t)return new Date(NaN);var r=e.match(je);if(!r)return new Date(NaN);var n=!!r[4],o=Me(r[1]),i=Me(r[2])-1,a=Me(r[3]),s=Me(r[4]),u=Me(r[5])-1;if(n)return function(e,t,r){return t>=1&&t<=53&&r>=0&&r<=6}(0,s,u)?function(e,t,r){var n=new Date(0);n.setUTCFullYear(e,0,4);var o=7*(t-1)+r+1-(n.getUTCDay()||7);return n.setUTCDate(n.getUTCDate()+o),n}(t,s,u):new Date(NaN);var l=new Date(0);return function(e,t,r){return t>=0&&t<=11&&r>=1&&r<=(xe[t]||(Be(e)?29:28))}(t,i,a)&&function(e,t){return t>=1&&t<=(Be(e)?366:365)}(t,o)?(l.setUTCFullYear(t,i,Math.max(o,a)),l):new Date(NaN)}(a.restDateString,a.year)}if(!o||isNaN(o.getTime()))return new Date(NaN);var s,u=o.getTime(),l=0;if(i.time&&(l=function(e){var t=e.match(ke);if(!t)return NaN;var r=Le(t[1]),n=Le(t[2]),o=Le(t[3]);return function(e,t,r){return 24===e?0===t&&0===r:r>=0&&r<60&&t>=0&&t<60&&e>=0&&e<25}(r,n,o)?r*Re+n*Ie+1e3*o:NaN}(i.time),isNaN(l)))return new Date(NaN);if(!i.timezone){var c=new Date(u+l),f=new Date(0);return f.setFullYear(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()),f.setHours(c.getUTCHours(),c.getUTCMinutes(),c.getUTCSeconds(),c.getUTCMilliseconds()),f}return s=function(e){if("Z"===e)return 0;var t=e.match(Ce);if(!t)return 0;var r="+"===t[1]?-1:1,n=parseInt(t[2]),o=t[3]&&parseInt(t[3])||0;return function(e,t){return t>=0&&t<=59}(0,o)?r*(n*Re+o*Ie):NaN}(i.timezone),isNaN(s)?new Date(NaN):new Date(u+l+s)}var De={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},je=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,ke=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Ce=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Me(e){return e?parseInt(e):1}function Le(e){return e&&parseFloat(e.replace(",","."))||0}var xe=[31,null,31,30,31,30,31,31,30,31,30,31];function Be(e){return e%400==0||e%4==0&&e%100!=0}let Fe=new Promise(((e,t)=>{let r=indexedDB.open("actual",9);r.onupgradeneeded=function(e){let t=e.target.result;t.objectStoreNames.contains("filesystem")&&t.deleteObjectStore("filesystem",{keyPath:"filepath"}),t.objectStoreNames.contains("messages")&&t.deleteObjectStore("messages",{keyPath:"filepath"}),t.objectStoreNames.contains("asyncStorage")||t.createObjectStore("asyncStorage"),t.objectStoreNames.contains("files")||t.createObjectStore("files",{keyPath:"filepath"})},r.onblocked=e=>console.log("blocked",e),r.onerror=e=>{console.log("openRequest error"),t(new Error("indexeddb-failure: Could not open IndexedDB"))},r.onsuccess=function(t){let r=t.target.result;r.onversionchange=()=>{r.close()},r.onerror=function(e){if(console.log("Database error: "+(e.target&&e.target.error)),e.target&&e.target.error&&"QuotaExceededError"===e.target.error.name)throw new Error("indexeddb-quota-error")},e(r)}}));const Ue=function(e,t){let r=e.transaction([t],"readwrite");return{trans:r,store:r.objectStore(t)}},Pe=async function(e,t){return new Promise(((r,n)=>{let o=e.put(t);o.onsuccess=e=>r(void 0),o.onerror=e=>n(e)}))},We=function(){return Fe},He=function(){};function ze(e){e.commit&&e.commit()}const Ve=async function(e){let t=(await We()).transaction(["asyncStorage"],"readonly"),r=t.objectStore("asyncStorage");return new Promise(((n,o)=>{let i=r.get(e);i.onerror=e=>o(e),i.onsuccess=e=>n(e.target.result),ze(t)}))},$e=async function(e,t){let r=(await We()).transaction(["asyncStorage"],"readwrite"),n=r.objectStore("asyncStorage");new Promise(((o,i)=>{let a=n.put(t,e);a.onerror=e=>i(e),a.onsuccess=e=>o(void 0),ze(r)}))},qe=async function(e){let t=(await We()).transaction(["asyncStorage"],"readwrite"),r=t.objectStore("asyncStorage");return new Promise(((n,o)=>{let i=r.delete(e);i.onerror=e=>o(e),i.onsuccess=e=>n(void 0),ze(t)}))},Ge=async function(e){let t=(await We()).transaction(["asyncStorage"],"readonly"),r=t.objectStore("asyncStorage"),n=Promise.all(e.map((e=>new Promise(((t,n)=>{let o=r.get(e);o.onerror=e=>n(e),o.onsuccess=r=>t([e,r.target.result])})))));return ze(t),n};function Ye(e,t){_(2,arguments);var r=w(e),n=v(t);if(isNaN(n))return new Date(NaN);if(!n)return r;var o=r.getDate(),i=new Date(r.getTime());return i.setMonth(r.getMonth()+n+1,0),o>=i.getDate()?i:(r.setFullYear(i.getFullYear(),i.getMonth(),o),r)}function Ze(e,t){return _(2,arguments),Ye(e,-v(t))}function Ke(e,t){_(2,arguments);var r=w(e),n=v(t);return isNaN(n)?new Date(NaN):n?(r.setDate(r.getDate()+n),r):r}function Je(e,t){return _(2,arguments),Ke(e,7*v(t))}function Xe(e,t){return _(2,arguments),Ke(e,-v(t))}function Qe(e,t){_(2,arguments);var r=w(e),n=w(t);return r.getTime()<n.getTime()}function et(e){_(1,arguments);var t=w(e);return t.setDate(1),t.setHours(0,0,0,0),t}function tt(e){_(1,arguments);var t=w(e),r=t.getMonth();return t.setFullYear(t.getFullYear(),r+1,0),t.setHours(23,59,59,999),t}var rt=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function nt(e,t){return e===t||!(!rt(e)||!rt(t))}function ot(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(!nt(e[r],t[r]))return!1;return!0}function it(e,t){void 0===t&&(t=ot);var r=null;function n(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];if(r&&r.lastThis===this&&t(n,r.lastArgs))return r.lastResult;var i=e.apply(this,n);return r={lastResult:i,lastArgs:n,lastThis:this},i}return n.clear=function(){r=null},n}function at(e){if("string"==typeof e){let[t,r,n]=e.split("-");return null!=n?new Date(parseInt(t),parseInt(r)-1,parseInt(n),12):null!=r?new Date(parseInt(t),parseInt(r)-1,1,12):new Date(parseInt(t),0,1,12)}return"number"==typeof e?new Date(e):e}const st=at;function ut(e){return ce(at(e),"yyyy-MM")}function lt(e){return ce(at(e),"yyyy-MM-dd")}function ct(){return __webpack_require__.g.IS_TESTING?__webpack_require__.g.currentMonth||"2017-01":ce(new Date,"yyyy-MM")}function ft(){return __webpack_require__.g.IS_TESTING?"2017-01-01":ce(new Date,"yyyy-MM-dd")}function dt(e){return ce(Ze(at(e),1),"yyyy-MM")}function gt(e,t){return ce(Ye(at(e),t),"yyyy-MM")}function pt(e,t){return function(e,t){_(2,arguments);var r=w(e),n=w(t);return 12*(r.getFullYear()-n.getFullYear())+(r.getMonth()-n.getMonth())}(at(e),at(t))}function ht(e,t){return ce(Ze(at(e),t),"yyyy-MM")}function yt(e,t){return ce(Ke(at(e),t),"yyyy-MM-dd")}function mt(e,t){return ce(Xe(at(e),t),"yyyy-MM-dd")}function bt(e,t){return Qe(at(e),at(t))}function _t(e,t){return function(e,t){_(2,arguments);var r=w(e),n=w(t);return r.getTime()>n.getTime()}(at(e),at(t))}function wt(e){return{start:parseInt(ce(et(at(e)),"yyyyMMdd")),end:parseInt(ce(tt(at(e)),"yyyyMMdd"))}}function Et(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const n=[];let o=ut(e);for(;Qe(at(o),at(t));)n.push(o),o=gt(o,1);return r&&n.push(o),n}function vt(e,t){return Et(e,t)}function St(e,t){return Et(e,t,!0)}function Tt(e){return e.slice(0,7)}function Ot(e){return"budget"+e.replace("-","")}function At(e,t){return ce(at(e),t)}function It(e,t){const r=e.id?{id:e.id}:{},n=Object.keys(t);let o=!1;for(let i=0;i<n.length;i++){let a=n[i];e[a]!==t[a]&&(r[a]=t[a],o=!0)}return o?r:null}function Rt(e,t,r){let n=!1;for(let o=0;o<r.length;o++){let i=r[o];if(e[i]!==t[i]){n=!0;break}}return n}function Nt(e,t,r){let n=new Map;for(let o=0;o<e.length;o++){let i=e[o],a=i[t],s=n.get(a)||[];n.set(a,s.concat([r?r(i):e[o]]))}return n}function Dt(e){let t=new Map;for(let r=0;r<e.length;r++){let n=e[r];t.set(n.id,n)}return t}function jt(e,t){let r=Dt(e),n=Dt(t),o=[],i=[],a=e.filter((e=>!n.has(e.id))).map((e=>({id:e.id})));return t.forEach((e=>{let t=r.get(e.id);if(t){const r=It(t,e);r&&i.push(r)}else o.push(e)})),{added:o,updated:i,deleted:a}}function kt(e,t,r){for(let n=0;n<t.length;n++){const o=t[n];n===t.length-1?e.set(o,r):(e.has(o)||e.set(o,new Map),e=e.get(o))}}function Ct(e,t){let r=e;for(let e=0;e<t.length;e++)if(r=r.get(t[e]),null==r)return r;return r}function Mt(e,t){let r=new Set(e),n=t.values(),o=n.next();for(;!o.done;)r.add(o.value),o=n.next();return r}it((e=>new RegExp(e.replace(/d+/g,"\\d{1,2}").replace(/M+/g,"\\d{1,2}").replace(/y+/g,"\\d{4}")))),it((e=>e.replace(/y+/g,"").replace(/[^\w]$/,"").replace(/^[^\w]/,""))),it((e=>{let t=e.replace(/y+/g,"").replace(/[^\w]$/,"").replace(/^[^\w]/,"").replace(/d+/g,"\\d{1,2}").replace(/M+/g,"\\d{1,2}");return new RegExp("^"+t+"$")})),it((e=>e.replace(/d+/g,"").replace(/[^\w]$/,"").replace(/^[^\w]/,"").replace(/\/\//,"/").replace(/\.\./,".").replace(/--/,"-"))),it((e=>{let t=e.replace(/d+/g,"").replace(/[^\w]$/,"").replace(/^[^\w]/,"").replace(/\/\//,"/").replace(/M+/g,"\\d{1,2}").replace(/y+/g,"\\d{2,4}");return new RegExp("^"+t+"$")})),it((e=>e.replace(/y+/g,"yy"))),it((e=>{let t=e.replace(/[^\w]$/,"").replace(/^[^\w]/,"").replace(/d+/g,"\\d{1,2}").replace(/M+/g,"\\d{1,2}").replace(/y+/g,"\\d{2}");return new RegExp("^"+t+"$")}));let Lt={value:null,formatter:null,regex:null};!function(e){let t,r,n,{format:o,hideFraction:i}={format:"comma-dot",hideFraction:!1};switch(o){case"space-comma":t="en-ZA",r=/[^-0-9,]/g,n=",";break;case"dot-comma":t="de-DE",r=/[^-0-9,]/g,n=",";break;case"space-dot":t="dje",r=/[^-0-9.]/g,n=".";break;default:t="en-US",r=/[^-0-9.]/g,n="."}Lt={value:o,separator:n,formatter:new Intl.NumberFormat(t,{minimumFractionDigits:i?0:2,maximumFractionDigits:i?0:2}),regex:r}}();const xt=2**51-1,Bt=-xt;function Ft(e){if(!Number.isInteger(e))throw new Error("safeNumber: number is not an integer: "+JSON.stringify(e));if(e>xt||e<Bt)throw new Error("safeNumber: can’t safely perform arithmetic with number: "+e);return e}function Ut(e){let t=parseInt(e.replace(/[^-0-9.,]/g,""));return isNaN(t)?null:t}function Pt(e){return Math.round(100*e)}function Wt(e){return parseFloat((Ft(e)/100).toFixed(2))}function Ht(e){function t(e){return isNaN(e)?null:e}function r(e){return e.replace(/[^0-9-]/g,"")}e.startsWith("(")&&e.endsWith(")")&&(e=e.replace("(","-").replace(")",""));let n=e.match(/[.,][^.,]*$/);if(!n||0===n.index)return t(parseFloat(r(e)));let o=r(e.slice(0,n.index)),i=r(e.slice(n.index+1));return t(parseFloat(o+"."+i))}function zt(e){return"number"==typeof e?e:0}function Vt(e,t){return{type:"SplitTransactionError",version:1,difference:zt(t.amount)-e}}function $t(e,t){let r="temp"===e.id?"temp":"";return{amount:0,...t,payee:t.payee||e.payee,id:t.id?t.id:r+be(),account:e.account,date:e.date,cleared:null!=e.cleared?e.cleared:null,starting_balance_flag:null!=e.starting_balance_flag?e.starting_balance_flag:null,is_child:!0,parent_id:e.id,error:null}}function qt(e){const t=e.subtransactions.reduce(((e,t)=>e+zt(t.amount)),0);return{...e,error:t===zt(e.amount)?null:Vt(t,e)}}function Gt(e){return e.reduce(((e,t)=>{let{subtransactions:r,...n}=t;r=r||[],e.push(n);for(let t=0;t<r.length;t++)e.push(r[t]);return e}),[])}function Yt(e){return null==e?null:Gt([e])}function Zt(e,t,r){let n=e.findIndex((e=>e.id===t)),o=e[n],i=[...e];if(-1===n)throw new Error("Tried to edit unknown transaction id: "+t);if(o.is_parent||o.is_child){let t=function(e,t){for(;t>=0;){if(e[t].is_parent)return t;t--}return null}(e,n);if(null==t)return console.log("Cannot find parent index"),{diff:{deleted:[],updated:[]}};let o,a=function(e,t){let r=[e[t]],n=t+1;for(;n<e.length&&e[n].is_child;)r.push(e[n]),n++;return r}(e,t),s=r(function(e){return{...e[0],subtransactions:e.slice(1)}}(a)),u=Yt(s);return null==u?(o={deleted:[{id:a[0].id}],updated:[]},s={id:a[0].id,_deleted:!0},i.splice(t,a.length)):(o=jt(a,u),i.splice(t,a.length,...u)),{data:i,newTransaction:s,diff:o}}{let e=r(o),t=Yt(e)||[];return e&&(e.subtransactions=e.subtransactions||[]),i.splice(n,1,...t),{data:i,newTransaction:e||{id:o.id,_deleted:!0},diff:jt([o],t)}}}var Kt=__webpack_require__(6875),Jt=__webpack_require__.n(Kt);function Xt(e){return(e[16]<<8)+e[17]}function Qt(e,t,r){return function(e,t,r){let n=[];for(let o=e;o<=t;o+=r)n.push(o);return n}(t-t%e,r-1-(r-1)%e,e)}function er(e,t,r,n){let o=Qt(t,r,n),i=0;return o.map((o=>{let a=0,s=t;r>o&&r<o+t&&(a=r-o),n>o&&n<o+t&&(s=n-o);let u=s-a,l=new ArrayBuffer(t);if(r>o+t||n<=o)return null;let c=e.byteOffset+i,f=e.buffer.byteLength-c;if(f<=0)return null;let d=Math.min(u,f);return new Uint8Array(l).set(new Uint8Array(e.buffer,c,d),a),i+=d,{pos:o,data:l,offset:a,length:d}})).filter(Boolean)}class tr{constructor(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this.filename=e,this.buffer=new Map,this.ops=t,this.meta=r,this._metaDirty=!1,this.writeLock=!1,this.openHandles=0}bufferChunks(e){for(let t=0;t<e.length;t++){let r=e[t];this.buffer.set(r.pos,r)}}open(){if(this.openHandles++,1===this.openHandles){this.ops.open();let e=this.ops.readMeta();null==this.meta&&(null==e&&(e={size:0}),this.meta=e)}return this.meta}close(){this.fsync(),this.openHandles=Math.max(this.openHandles-1,0),0===this.openHandles&&this.ops.close()}delete(){this.ops.delete()}load(e){let t=e.reduce(((e,t)=>{let r=this.buffer.get(t);return r?e.chunks.push(r):e.missing.push(t),e}),{chunks:[],missing:[]}),r=[];return t.missing.length>0&&(r=this.ops.readBlocks(t.missing,this.meta.blockSize)),t.chunks.concat(r)}read(e,t,r,n){let o=e.buffer;if(r<=0)return 0;if(n<0)return 0;if(n>=this.meta.size){let e=new Uint8Array(o,t);for(let t=0;t<r;t++)e[t]=0;return r}n=Math.max(n,0);let i=Math.min(r,this.meta.size-n),a=n,s=n+i,u=Qt(this.meta.blockSize,a,s),l=function(e,t,r){let n=new ArrayBuffer(r-t),o=new Uint8Array(n);for(let n=0;n<e.length;n++){let i=e[n];if("ArrayBuffer"!==i.data.constructor.name)throw new Error("Chunk data is not an ArrayBuffer");let a=0,s=i.data.byteLength;if(t>i.pos&&(a=t-i.pos),r<i.pos+i.data.byteLength&&(s=r-i.pos),a>i.data.byteLength||s<0)continue;let u=s-a;o.set(new Uint8Array(i.data,a,u),i.pos-t+a)}return n}(this.load(u),a,s);if(o.byteLength-t<l.byteLength)throw new Error("Buffer given to `read` is too small");let c=new Uint8Array(o);c.set(new Uint8Array(l),t);for(let e=i;e<r;e++)c[t+e]=0;return r}write(e,t,r,n){if(null==this.meta.blockSize){let r=Xt(new Uint8Array(e.buffer,e.byteOffset+t));if(![512,1024,2048,4096,8192,16384,32768,65536].includes(r))throw new Error("File has invalid page size. (the first block of a new file must be written first)");this.setattr({blockSize:r})}let o=e.buffer;if(r<=0)return 0;if(n<0)return 0;if(0===o.byteLength)return 0;r=Math.min(r,o.byteLength-t);let i=er(new Uint8Array(o,t,r),this.meta.blockSize,n,n+r),{partialWrites:a,fullWrites:s}=i.reduce(((e,t)=>(t.length!==this.meta.blockSize?e.partialWrites.push(t):e.fullWrites.push({pos:t.pos,data:t.data}),e)),{fullWrites:[],partialWrites:[]}),u=[];a.length>0&&(u=this.load(a.map((e=>e.pos))));let l=s.concat(u.map((e=>{let t=a.find((t=>t.pos===e.pos));return new Uint8Array(e.data).set(new Uint8Array(t.data,t.offset,t.length),t.offset,t.length),e})));return this.bufferChunks(l),n+r>this.meta.size&&this.setattr({size:n+r}),r}async readIfFallback(){if(this.ops.readIfFallback){let e=await this.ops.readIfFallback();this.meta=e||{size:0}}}lock(e){return this._recordingLock||(this._recordingLock=!0),!!this.ops.lock(e)&&(e>=2&&(this.writeLock=!0),!0)}unlock(e){return 0===e&&(this._recordingLock=!1),this.writeLock&&(this.fsync(),this.writeLock=!1),this.ops.unlock(e)}fsync(){if(this.buffer.size>0){let e=this.buffer.get(0);if(e){let t=Xt(new Uint8Array(e.data));if(t!==this.meta.blockSize){let e=this.buffer;this.buffer=new Map;let r=[...e.values()],n=r.length*this.meta.blockSize,o=new ArrayBuffer(n),i=new Uint8Array(o);for(let e of r)i.set(new Uint8Array(e.data),e.pos);this.bufferChunks(er(i,t,0,n)),this.setattr({blockSize:t})}}this.ops.writeBlocks([...this.buffer.values()],this.meta.blockSize)}this._metaDirty&&(this.ops.writeMeta({size:this.meta.size}),this._metaDirty=!1),this.buffer=new Map}setattr(e){null==this.meta&&(this.meta={}),void 0!==e.mode&&(this.meta.mode=e.mode),void 0!==e.blockSize&&(this.meta.blockSize=e.blockSize),void 0!==e.size&&(this.meta.size=e.size,this._metaDirty=!0)}getattr(){return this.meta}}let rr=3735928559;class nr{constructor(e){let{initialOffset:t=4,useAtomics:r=!0,stream:n=!0,debug:o,name:i}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.buffer=e,this.atomicView=new Int32Array(e),this.offset=t,this.useAtomics=r,this.stream=n,this.debug=o,this.name=i}log(){if(this.debug){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];console.log(`[reader: ${this.name}]`,...t)}}waitWrite(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.useAtomics){for(this.log(`waiting for ${e}`);0===Atomics.load(this.atomicView,0);){if(null!=t&&"timed-out"===Atomics.wait(this.atomicView,0,0,t))throw new Error("timeout");Atomics.wait(this.atomicView,0,0,500)}this.log(`resumed for ${e}`)}else if(1!==this.atomicView[0])throw new Error("`waitWrite` expected array to be readable")}flip(){if(this.log("flip"),this.useAtomics){if(1!==Atomics.compareExchange(this.atomicView,0,1,0))throw new Error("Read data out of sync! This is disastrous");Atomics.notify(this.atomicView,0)}else this.atomicView[0]=0;this.offset=4}done(){this.waitWrite("done");let e=new DataView(this.buffer,this.offset).getUint32(0)===rr;return e&&(this.log("done"),this.flip()),e}peek(e){this.peekOffset=this.offset;let t=e();return this.offset=this.peekOffset,this.peekOffset=null,t}string(e){this.waitWrite("string",e);let t=this._int32(),r=t/2,n=new DataView(this.buffer,this.offset,t),o=[];for(let e=0;e<r;e++)o.push(n.getUint16(2*e));let i=String.fromCharCode.apply(null,o);return this.log("string",i),this.offset+=t,null==this.peekOffset&&this.flip(),i}_int32(){let e=new DataView(this.buffer,this.offset).getInt32();return this.log("_int32",e),this.offset+=4,e}int32(){this.waitWrite("int32");let e=this._int32();return this.log("int32",e),null==this.peekOffset&&this.flip(),e}bytes(){this.waitWrite("bytes");let e=this._int32(),t=new ArrayBuffer(e);return new Uint8Array(t).set(new Uint8Array(this.buffer,this.offset,e)),this.log("bytes",t),this.offset+=e,null==this.peekOffset&&this.flip(),t}}class or{constructor(e){let{initialOffset:t=4,useAtomics:r=!0,stream:n=!0,debug:o,name:i}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.buffer=e,this.atomicView=new Int32Array(e),this.offset=t,this.useAtomics=r,this.stream=n,this.debug=o,this.name=i,this.useAtomics?Atomics.store(this.atomicView,0,0):this.atomicView[0]=0}log(){if(this.debug){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];console.log(`[writer: ${this.name}]`,...t)}}waitRead(e){if(this.useAtomics){if(this.log(`waiting for ${e}`),0!==Atomics.compareExchange(this.atomicView,0,0,1))throw new Error("Wrote something into unwritable buffer! This is disastrous");for(Atomics.notify(this.atomicView,0);1===Atomics.load(this.atomicView,0);)Atomics.wait(this.atomicView,0,1,500);this.log(`resumed for ${e}`)}else this.atomicView[0]=1;this.offset=4}finalize(){this.log("finalizing"),new DataView(this.buffer,this.offset).setUint32(0,rr),this.waitRead("finalize")}string(e){this.log("string",e);let t=2*e.length;this._int32(t);let r=new DataView(this.buffer,this.offset,t);for(let t=0;t<e.length;t++)r.setUint16(2*t,e.charCodeAt(t));this.offset+=t,this.waitRead("string")}_int32(e){new DataView(this.buffer,this.offset).setInt32(0,e),this.offset+=4}int32(e){this.log("int32",e),this._int32(e),this.waitRead("int32")}bytes(e){this.log("bytes",e);let t=e.byteLength;this._int32(t),new Uint8Array(this.buffer,this.offset).set(new Uint8Array(e)),this.offset+=t,this.waitRead("bytes")}}function ir(e,t){return Math.round(e/t)}class ar{constructor(e){this.filename=e}getStoreName(){return this.filename.replace(/\//g,"-")}invokeWorker(e,t){if(null==this.reader||null==this.writer)throw new Error(`Attempted ${e} on ${this.filename} but file not open`);let r=this.reader,n=this.writer;switch(e){case"readBlocks":{let{name:e,positions:o,blockSize:i}=t,a=[];for(let t of o){n.string("readBlock"),n.string(e),n.int32(ir(t,i)),n.finalize();let o=r.bytes();r.done(),a.push({pos:t,data:0===o.byteLength?new ArrayBuffer(i):o})}return a}case"writeBlocks":{let{name:e,writes:o,blockSize:i}=t;n.string("writeBlocks"),n.string(e);for(let e of o)n.int32(ir(e.pos,i)),n.bytes(e.data);n.finalize();let a=r.int32();return r.done(),a}case"readMeta":{n.string("readMeta"),n.string(t.name),n.finalize();let e=r.int32(),o=r.int32();return r.done(),-1===e?null:{size:e,blockSize:o}}case"writeMeta":{let{name:e,meta:o}=t;n.string("writeMeta"),n.string(e),n.int32(o.size),n.finalize();let i=r.int32();return r.done(),i}case"closeFile":{n.string("closeFile"),n.string(t.name),n.finalize();let e=r.int32();return r.done(),e}case"lockFile":{n.string("lockFile"),n.string(t.name),n.int32(t.lockType),n.finalize();let e=r.int32();return r.done(),0===e}case"unlockFile":{n.string("unlockFile"),n.string(t.name),n.int32(t.lockType),n.finalize();let e=r.int32();return r.done(),0===e}}}lock(e){return this.invokeWorker("lockFile",{name:this.getStoreName(),lockType:e})}unlock(e){return this.invokeWorker("unlockFile",{name:this.getStoreName(),lockType:e})}delete(){(this.reader||this.writer)&&this.close();let e=globalThis.indexedDB.deleteDatabase(this.getStoreName());e.onerror=()=>{console.warn(`Deleting ${this.filename} database failed`)},e.onsuccess=()=>{}}open(){let e=new SharedArrayBuffer(36864);this.writer=new or(e,{name:"args (backend)",debug:!1});let t=new SharedArrayBuffer(36864);var r,n;this.reader=new nr(t,{name:"results",debug:!1}),r=this.reader,n=this.writer,self.postMessage({type:"__absurd:spawn-idb-worker",argBuffer:n.buffer,resultBuffer:r.buffer}),self.addEventListener("message",(e=>{switch(e.data.type){case"__perf-deets:start-profile":n.string("profile-start"),n.finalize(),r.int32(),r.done();break;case"__perf-deets:stop-profile":n.string("profile-stop"),n.finalize(),r.int32(),r.done()}}))}close(){this.invokeWorker("closeFile",{name:this.getStoreName()}),this.reader=null,this.writer=null,this.worker=null}readMeta(){return this.invokeWorker("readMeta",{name:this.getStoreName()})}writeMeta(e){return this.invokeWorker("writeMeta",{name:this.getStoreName(),meta:e})}readBlocks(e,t){return this.stats&&(this.stats.read+=e.length),this.invokeWorker("readBlocks",{name:this.getStoreName(),positions:e,blockSize:t})}writeBlocks(e,t){return this.stats&&(this.stats.writes+=e.length),this.invokeWorker("writeBlocks",{name:this.getStoreName(),writes:e,blockSize:t})}}function sr(e,t){return Math.round(e/t)}class ur{constructor(e){this._openDb=null,this.hasAlertedFailure=!1,this.onFallbackFailure=e}async getDb(){return this._openDb||(this._openDb=await async function(e){return new Promise(((t,r)=>{let n=globalThis.indexedDB.open(e,2);n.onsuccess=e=>{let r=e.target.result;r.onversionchange=()=>{console.log("closing because version changed"),r.close()},r.onclose=()=>{},t(r)},n.onupgradeneeded=e=>{let t=e.target.result;t.objectStoreNames.contains("data")||t.createObjectStore("data")},n.onblocked=e=>console.log("blocked",e),n.onerror=n.onabort=e=>r(e.target.error)}))}(this.dbName)),this._openDb}closeDb(){this._openDb&&(this._openDb.close(),this._openDb=null)}async readAll(){let e=await this.getDb(this.dbName),t=new Map,r=e.transaction(["data"],"readonly").objectStore("data");return new Promise(((e,n)=>{let o=r.openCursor(IDBKeyRange.lowerBound(-1));o.onerror=n,o.onsuccess=r=>{let n=r.target.result;n?(t.set(n.key,n.value),n.continue()):e(t)}}))}async write(e,t,r){let n=(await this.getDb(this.dbName)).transaction(["data"],"readwrite"),o=n.objectStore("data");await new Promise(((i,a)=>{let s=o.get(0);s.onsuccess=u=>{if(r&&!function(e,t){if(null!=e&&null!=t){let r=new Uint8Array(e),n=new Uint8Array(t);for(let e=24;e<40;e++)if(r[e]!==n[e])return!1;return!0}return null==e&&null==t}(s.result,t))return this.onFallbackFailure&&!this.hasAlertedFailure&&(this.hasAlertedFailure=!0,this.onFallbackFailure()),void a(new Error("Fallback mode unable to write file changes"));for(let t of e)o.put(t.value,t.key);n.onsuccess=()=>i(),n.onerror=()=>a()},s.onerror=a}))}}class lr{constructor(e,t){this.filename=e,this.dbName=this.filename.replace(/\//g,"-"),this.cachedFirstBlock=null,this.writeQueue=null,this.blocks=new Map,this.lockType=0,this.transferBlockOwnership=!1,this.persistance=new ur(t)}async readIfFallback(){return this.transferBlockOwnership=!0,this.blocks=await this.persistance.readAll(),this.readMeta()}lock(e){return this.cachedFirstBlock=this.blocks.get(0),this.lockType=e,!0}unlock(e){return this.lockType>1&&1===e&&this.flush(),this.lockType=e,!0}delete(){let e=globalThis.indexedDB.deleteDatabase(this.dbName);e.onerror=()=>{console.warn(`Deleting ${this.filename} database failed`)},e.onsuccess=()=>{}}open(){this.writeQueue=[],this.lockType=0}close(){this.flush(),this.transferBlockOwnership?this.transferBlockOwnership=!1:this.blocks=new Map,this.persistance.closeDb()}readMeta(){let e=this.blocks.get(-1);if(e){let t=this.blocks.get(0);return{size:e.size,blockSize:Xt(new Uint8Array(t))}}return null}writeMeta(e){this.blocks.set(-1,e),this.queueWrite(-1,e)}readBlocks(e,t){let r=[];for(let n of e)r.push({pos:n,data:this.blocks.get(sr(n,t))});return r}writeBlocks(e,t){for(let r of e){let e=sr(r.pos,t);this.blocks.set(e,r.data),this.queueWrite(e,r.data)}this.lockType<=1&&this.flush()}queueWrite(e,t){this.writeQueue.push({key:e,value:t})}flush(){this.writeQueue.length>0&&(this.persistance.write(this.writeQueue,this.cachedFirstBlock,this.lockType>1),this.writeQueue=[]),this.cachedFirstBlock=null}}const cr=function(e){console.log("[Exception]",e)},fr=function(e){};function dr(e){let t={running:null,queue:[]};function r(){if(t.queue.length>0){const e=t.queue.shift();n(e.args,e.resolve,e.reject)}else t.running=null}function n(n,o,i){t.running=e(...n),t.running.then((e=>{r(),o(e)}),(e=>{r(),i(e)}))}return function(){for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];return t.running?new Promise(((e,n)=>{t.queue.push({resolve:e,reject:n,args:r})})):new Promise(((e,t)=>n(r,e,t)))}}let gr=new Set,pr=null,hr=new WeakMap,yr=!1,mr=[];function br(e){return hr.set(e,!0),e}function _r(e){return new Promise((t=>setTimeout(t,e)))}async function wr(e,t){let{undoTag:r,name:n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(mr.push(n),mr.length>5&&(mr=mr.slice(-5)),hr.has(e))return Er((()=>e(t)),{undoTag:r});"close-budget"===n&&await async function(){for(await _r(200);gr.size>0;)await Promise.all([...gr.values()]),await _r(100)}();let o=e(t);return gr.add(o),o.then((()=>{gr.delete(o)})),o}const Er=dr((function(e){return pr=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e().finally((()=>{pr=null}))}));function vr(e,t){if(null==pr&&!yr)return fr("Recent methods: "+mr.join(", ")),cr(new Error("withMutatorContext: mutator not running")),t();let r=pr;return pr={...pr,...e},t().finally((()=>{pr=r}))}function Sr(){return null==pr?(fr({category:"server",message:"Recent methods: "+mr.join(", ")}),{}):null==pr&&yr?{}:pr}function Tr(){let e="undefined"!=typeof window?window:"undefined"!=typeof self?self:null;if(!e)throw new Error("Cannot get global object");return e}Tr().__globalServerChannel=null;const Or=function(e,t){const r=e;Tr().__globalServerChannel=r,r.addEventListener("message",(e=>{let n=e.data,o="string"==typeof n?JSON.parse(n):n;if(o.type&&("init"===o.type||o.type.startsWith("__")))return;let{id:i,name:a,args:s,undoTag:u,catchErrors:l}=o;t[a]?wr(t[a],s,{undoTag:u,name:a}).then((e=>{var n;l&&(e={data:e,error:null}),r.postMessage({type:"reply",id:i,result:e,mutated:(n=t[a],hr.has(n)),undoTag:u})}),(e=>{let t=function(e){return e.type&&"APIError"===e.type?e:{type:"InternalError",message:e.message}}(e);a.startsWith("api/")?r.postMessage({type:"reply",id:i,error:t}):l?r.postMessage({type:"reply",id:i,result:{error:t,data:null}}):r.postMessage({type:"error",id:i}),"InternalError"===t.type&&cr(e),l||Ar("server-error")})):(console.warn("Unknown method: "+a),r.postMessage({type:"reply",id:i,result:null,error:{type:"APIError",message:"Unknown method: "+a}}))}),!1),r.postMessage({type:"connect"})},Ar=function(e,t){const{__globalServerChannel:r}=Tr();r&&r.postMessage({type:"push",name:e,args:t})};var Ir=__webpack_require__(7804),Rr=__webpack_require__.n(Ir);let Nr=null;async function Dr(){return new Promise(((e,t)=>{Rr()({locateFile:e=>"/"+e}).then((t=>{Nr=t,e(void 0)}),(e=>{t(e)}))}))}function jr(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];r&&function(e,t){t.forEach((t=>{if("string"!=typeof t&&"number"!=typeof t&&null!==t)throw new Error("Invalid field type "+t+" for sql "+e)}))}(t,r);let o="string"==typeof t?e.prepare(t):t;if(n)try{o.bind(r);let e=[];for(;o.step();)e.push(o.getAsObject());return"string"==typeof t?o.free():o.reset(),e}catch(e){throw console.log(t),e}else try{return o.run(r),{changes:e.getRowsModified()}}catch(e){throw e}}function kr(e,t){e.exec(t)}let Cr=0;function Mr(e,t){let r,n,o;Cr>0?(r="SAVEPOINT __actual_sp",n="RELEASE __actual_sp",o="ROLLBACK TO __actual_sp"):(r="BEGIN",n="COMMIT",o="ROLLBACK"),kr(e,r),Cr++;try{const r=t();return kr(e,n),r}catch(t){throw kr(e,o),"ROLLBACK"!==o&&kr(e,n),t}finally{Cr--}}async function Lr(e){let t=null;if(e)if("string"!=typeof e)t=new Nr.Database(e);else{let r=e;if(":memory:"!==r){if("undefined"==typeof SharedArrayBuffer){let e=Nr.FS.open(Nr.FS.readlink(r),"a+");await e.node.contents.readIfFallback(),Nr.FS.close(e)}t=new Nr.Database(r.includes("/blocked")?r:Nr.FS.readlink(r),{filename:!0}),t.exec("\n PRAGMA journal_mode=MEMORY;\n PRAGMA cache_size=-10000;\n ")}}return null===t&&(t=new Nr.Database),t.create_function("UNICODE_LOWER",(e=>e?.toLowerCase())),t.create_function("UNICODE_UPPER",(e=>e?.toUpperCase())),t}function xr(e){e.close()}const Br=function(){if(0===arguments.length)return".";let e;for(let t=0;t<arguments.length;++t){let r=t<0||arguments.length<=t?void 0:arguments[t];r.length>0&&(void 0===e?e=r:e+="/"+r)}return void 0===e?".":function(e){if(0===e.length)return".";let t=47===e.charCodeAt(0),r=47===e.charCodeAt(e.length-1);return 0!==(e=function(e,t){let r,n="",o=0,i=-1,a=0;for(let s=0;s<=e.length;++s){if(s<e.length)r=e.charCodeAt(s);else{if(47===r)break;r=47}if(47===r){if(i===s-1||1===a);else if(i!==s-1&&2===a){if(n.length<2||2!==o||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2))if(n.length>2){let e=n.lastIndexOf("/");if(e!==n.length-1){-1===e?(n="",o=0):(n=n.slice(0,e),o=n.length-1-n.lastIndexOf("/")),i=s,a=0;continue}}else if(2===n.length||1===n.length){n="",o=0,i=s,a=0;continue}t&&(n.length>0?n+="/..":n="..",o=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),o=s-i-1;i=s,a=0}else 46===r&&-1!==a?++a:a=-1}return n}(e,!t)).length||t||(e="."),e.length>0&&r&&(e+="/"),t?"/"+e:e}(e)};let Fr;const Ur=e=>Fr=e,Pr=()=>{if(!Fr)throw new Error("Document directory is not set");return Fr},Wr=e=>{if(!e)throw new Error("getDocumentDir: id is falsy: "+e);if(e.match(/[^A-Za-z0-9\-_]/))throw new Error(`Invalid budget id “${e}”. Check the id of your budget in the Advanced section of the settings page.`);return Br(Pr(),e)};let Hr=null,zr=null,Vr=!1;const $r=function(e){return e.replace(/^\//,"").replace(/\//g,"-")};function qr(e){try{return Hr.readlink(e),!0}catch(e){}try{return Hr.stat(e),!0}catch(e){}return!1}function Gr(e){let t=e.split("/").filter((e=>""!==e)),r="";for(let e of t)r+="/"+e,qr(r)||Hr.mkdir(r)}function Yr(e){return!Vr&&e.startsWith("/documents")&&(e.endsWith(".sqlite")?qr(e)||Hr.symlink("/blocked/"+$r(e),e):Hr.writeFile(e,"!$@) this should never read !$@)")),e}async function Zr(e,t){if(Vr||!e.startsWith("/documents")||e.endsWith(".sqlite"))return Hr.readFile(Kr(e),t);{if(!qr(e))throw new Error("File does not exist: "+e);let{store:r}=Ue(await We(),"files"),n=await async function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e=>e;return new Promise(((n,o)=>{let i=e.get(t);i.onsuccess=e=>{n(r(i.result))},i.onerror=e=>o(e)}))}(r,e);if(null==n)throw new Error("File does not exist: "+e);return"utf8"===t.encoding&&ArrayBuffer.isView(n.contents)?String.fromCharCode.apply(null,new Uint16Array(n.contents.buffer)):n.contents}}function Kr(e){try{let{node:t}=Hr.lookupPath(e,{follow:!1});return t.link?Hr.readlink(e):e}catch(t){return e}}async function Jr(e,t){if(t instanceof ArrayBuffer?t=new Uint8Array(t):ArrayBuffer.isView(t)&&(t=new Uint8Array(t.buffer)),Yr(e),!Vr&&e.startsWith("/documents")){let r=e.endsWith(".sqlite"),{store:n}=Ue(await We(),"files");r?(await Pe(n,{filepath:e,contents:""}),await Promise.resolve(),Hr.writeFile(Kr(e),t)):await Pe(n,{filepath:e,contents:t})}else Hr.writeFile(Kr(e),t)}const Xr=async function(){let e=function(){if(null==Nr)throw new Error("_getModule: sql.js must be initialized first");return Nr}();Hr=e.FS,Hr.mkdir("/uploads"),Hr.mkdir("/documents"),Hr.mkdir("/blocked");{let t=new class{constructor(e){this.onFallbackFailure=e}createFile(e){let t;t="undefined"!=typeof SharedArrayBuffer?new ar(e):new lr(e,this.onFallbackFailure);let r=new tr(e,t);return{}.PERF_BUILD&&(null==this._files&&(this._files=new Set),this._files.add(r)),r}startProfile(){for(let e of this._files)if(e.ops.writer){let t=e.ops.writer,r=e.ops.reader;t.string("profile-start"),t.finalize(),r.int32(),r.done()}}stopProfile(){for(let e of this._files)if(e.ops.writer){let t=e.ops.writer,r=e.ops.reader;t.string("profile-stop"),t.finalize(),r.int32(),r.done()}}}((()=>{Ar("fallback-write-error")}));zr=new class{constructor(e,t){this.FS=e,this.backend=t,this.node_ops={getattr:t=>{let r=e.isFile(t.mode)?t.contents.getattr():null,n={dev:1};return n.ino=t.id,n.mode=r?r.mode:t.mode,n.nlink=1,n.uid=0,n.gid=0,n.rdev=t.rdev,n.size=r?r.size:e.isDir(t.mode)?4096:0,n.atime=new Date(0),n.mtime=new Date(0),n.ctime=new Date(0),n.blksize=r?r.blockSize:4096,n.blocks=Math.ceil(n.size/n.blksize),n},setattr:(e,t)=>{this.FS.isFile(e.mode)?e.contents.setattr(t):(null!=t.mode&&(e.mode=t.mode),null!=t.size&&(e.size=t.size))},lookup:(e,t)=>{throw new this.FS.ErrnoError(44)},mknod:(e,t,r,n)=>{if(t.endsWith(".lock"))throw new Error("Locking via lockfiles is not supported");return this.createNode(e,t,r,n)},rename:(e,t,r)=>{throw new Error("rename not implemented")},unlink:(e,t)=>{this.FS.lookupNode(e,t).contents.delete(t)},readdir:e=>{throw new Error("readdir not implemented")},symlink:(e,t,r)=>{throw new Error("symlink not implemented")},readlink:e=>{throw new Error("symlink not implemented")}},this.stream_ops={open:e=>{this.FS.isFile(e.node.mode)&&e.node.contents.open()},close:e=>{this.FS.isFile(e.node.mode)&&e.node.contents.close()},read:(e,t,r,n,o)=>e.node.contents.read(t,r,n,o),write:(e,t,r,n,o)=>e.node.contents.write(t,r,n,o),llseek:(t,r,n)=>{var o=r;if(1===n?o+=t.position:2===n&&e.isFile(t.node.mode)&&(o+=t.node.contents.getattr().size),o<0)throw new this.FS.ErrnoError(28);return o},allocate:(e,t,r)=>{e.node.contents.setattr({size:t+r})},mmap:(e,t,r,n,o,i)=>{throw new Error("mmap not implemented")},msync:(e,t,r,n,o)=>{throw new Error("msync not implemented")},fsync:(e,t,r,n,o)=>{e.node.contents.fsync()}}}mount(){return this.createNode(null,"/",16895,0)}lock(e,t){let{node:r}=this.FS.lookupPath(e);return!r||!r.contents||r.contents.lock(t)}unlock(e,t){let{node:r}=this.FS.lookupPath(e);return!r||!r.contents||r.contents.unlock(t)}createNode(e,t,r,n){if(!this.FS.isDir(r)&&!this.FS.isFile(r))throw new this.FS.ErrnoError(63);var o=this.FS.createNode(e,t,r,n);return this.FS.isDir(o.mode)?(o.node_ops={mknod:this.node_ops.mknod,lookup:this.node_ops.lookup,unlink:this.node_ops.unlink,setattr:this.node_ops.setattr},o.stream_ops={},o.contents={}):this.FS.isFile(o.mode)&&(o.node_ops=this.node_ops,o.stream_ops=this.stream_ops,o.contents=this.backend.createFile(t)),e&&(e.contents[t]=o,e.timestamp=o.timestamp),o}}(Hr,t),e.register_for_idb(zr),Hr.mount(zr,{},"/blocked"),await async function(){let e=(await(await fetch("/data-file-index.txt")).text()).split("\n").map((e=>e.trim())).filter((e=>""!==e));await rn("/migrations"),await rn("/demo-budget"),await Promise.all(e.map((async e=>{var t;Jr("/"+e,await(t="/data/"+e,fetch(t).then((e=>e.arrayBuffer()))))})))}()}await async function(){let{store:e}=Ue(await We(),"files"),t=e.getAllKeys(),r=await new Promise(((e,r)=>{t.onsuccess=t=>e(t.target.result),t.onerror=e=>r(e)}));for(let e of r)Gr(Qr(e)),Yr(e)}()},Qr=function(e){return e.split("/").slice(0,-1).join("/")},en=async function(e){return Hr.readdir(e).filter((e=>"."!==e&&".."!==e))},tn=async function(e){return qr(e)},rn=async function(e){Hr.mkdir(e)},nn=async function(e,t){return Jr(t,await Zr(e))},on=async function(e){return Zr(e,{encoding:arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf8"})},an=async function(e,t){return Jr(e,t)},sn=async function(e){return async function(e){if(!Vr&&e.startsWith("/documents")){let t=e.endsWith(".sqlite"),{store:r}=Ue(await We(),"files");if(await async function(e,t){return new Promise(((r,n)=>{let o=e.delete(t);o.onsuccess=e=>r(void 0),o.onerror=e=>n(e)}))}(r,e),t){let t=Kr(e);qr(t)&&Hr.unlink(t)}}Hr.unlink(e)}(e)},un=async function(e){if(await tn(e)){for(let t of await en(e)){let r=Br(e,t),n=Hr.stat(r,!0);Hr.isDir(n.mode)?await un(r):await sn(r)}await async function(e){Hr.rmdir(e)}(e)}},ln=async function(e){throw new Error("getModifiedTime not supported on the web (only used for backups)")};function cn(e,t,r,n){r.forEach((r=>{if(n){if(t.hasOwnProperty(r)&&null==t[r])throw new Error(`${e} is missing field ${r}`)}else if(!t.hasOwnProperty(r)||null==t[r])throw new Error(`${e} is missing field ${r}`)}))}function fn(e){if("string"!=typeof e)throw new Error("toDateRepr not passed a string: "+e);return parseInt(e.replace(/-/g,""))}function dn(e){if("number"!=typeof e)throw new Error("fromDateRepr not passed a number: "+e);const t=e.toString();return t.slice(0,4)+"-"+t.slice(4,6)+"-"+t.slice(6)}const gn={validate(e){let{update:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return cn("account",e,t?["name","offbudget","closed"]:["name"],t),e}},pn={validate(e){let{update:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};cn("category",e,t?["name","is_income","cat_group"]:["name","cat_group"],t);let{sort_order:r,...n}=e;return n}},hn={validate(e){let{update:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};cn("categoryGroup",e,t?["name","is_income"]:["name"],t);let{sort_order:r,...n}=e;return n}},yn={validate(e){let{update:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return cn("payee",e,["name"],t),e}};function mn(e,t){return t.required||"id"===e}function bn(e,t){if(void 0===e)throw new Error("Query value cannot be undefined");if(null===e)return"boolean"===t?0:null;switch(t){case"date":if(e instanceof Date)return fn(lt(e));if(null==e.match(/^\d{4}-\d{2}-\d{2}$/)||e.date<"2000-01-01")throw new Error("Invalid date: "+e);return fn(e);case"date-month":return fn(e.slice(0,7));case"date-year":return fn(e.slice(0,4));case"boolean":return e?1:0;case"id":if("string"!=typeof e&&null!==e)throw new Error("Invalid id, must be string: "+e);return e;case"integer":if("number"==typeof e&&Number.isInteger(e))return e;throw new Error("Can’t convert to integer: "+JSON.stringify(e));case"json":return JSON.stringify(e)}return e}function _n(e,t){if(null===e)return"boolean"!==t&&null;switch(t){case"date":return dn(e);case"date-month":return dn(e).slice(0,7);case"date-year":return dn(e).slice(0,4);case"boolean":return 1===e;case"json":case"json/fallback":try{return JSON.parse(e)}catch(r){return"json/fallback"===t?e:null}}return e}function wn(e,t,r,n){let{skipNull:o=!1}=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},i=e[r];if(null==i)throw new Error(`Table “${r}” does not exist`);let a=t.views||{},s=e=>a[r]&&a[r].fields&&a[r].fields[e]||e;return Object.fromEntries(Object.keys(n).map((e=>{if("_"===e[0])return null;let t=i[e];if(null==t)throw new Error(`Field “${e}” does not exist on table ${r}: ${JSON.stringify(n)}`);if(mn(e,t)&&null==n[e])throw new Error(`“${e}” is required for table “${r}”: ${JSON.stringify(n)}`);return o&&null==n[e]?null:[s(e),bn(n[e],t.type)]})).filter(Boolean))}let En=0;function vn(e){return En++,e+En}class Sn extends Error{}function Tn(e){return parseInt(e.replace(/-/g,""))}function On(e,t,r,n){return null!=e[t].tombstone?`${n} AND ${r}.tombstone = 0`:n}function An(e){let t=e.split(".");return{path:t.slice(0,-1).join("."),field:t[t.length-1]}}function In(e){return-1===e.indexOf(".")&&"group"!==e?e:`"${e}"`}function Rn(e,t){let{literal:r=!1}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return{value:e,type:t,literal:r}}function Nn(e,t){let{schema:r,paths:n}=e,o=t.split(".");if(o.length<2)throw new Sn("Invalid path: "+t);let i,a=o[0],s=o.slice(1).reduce(((e,t)=>{let n=r[e];if(null==n)throw new Sn(`Path error: ${e} table does not exist`);if(!n[t]||null==n[t].ref)throw new Sn(`Field not joinable on table ${e}: “${t}”`);return n[t].ref}),a),u=o.slice(0,-1);if(1===u.length)i=u[0];else{let e=u.join("."),t=n.get(e);if(!t)throw new Sn("Path does not exist: "+e);i=t.tableId}return{tableName:s,tableId:vn(s),joinField:o[o.length-1],joinTable:i}}function Dn(e,t){let r=t.split(".");return r=r.reduce(((e,t)=>{let r=e.context+"."+t;return{context:r,path:[...e.path,r]}}),{context:e.implicitTableName,path:[]}).path,r.forEach((t=>{e.paths.get(t)||e.paths.set(t,Nn(e,t))})),e.paths.get(r[r.length-1])}function jn(e){let t=e.match(/^(\d{4}-\d{2}-\d{2})$/);return t?Rn(Tn(t[1]),"date",{literal:!0}):null}function kn(e){let t=e.match(/^(\d{4}-\d{2})$/);return t?Rn(Tn(t[1]),"date",{literal:!0}):null}function Cn(e,t){throw new Sn(`Bad ${t} format: ${e}`)}function Mn(e,t,r){if(t.type===r)return t;if("param"===t.type)return function(e,t){let r=e.paramType;if(r){let n={date:["string"],"date-month":["date"],"date-year":["date","date-month"],id:["string"],float:["integer"]};if(!(r===t||n[t]&&n[t].includes(r)))throw new Error(`Parameter “${e.paramName}” can’t convert to ${t} (already inferred as ${r})`)}else e.paramType=t}(t,r),Rn(t.value,r);if("null"===t.type){if(!t.literal)throw new Sn("A non-literal null doesn’t make sense");return"boolean"===r?Rn(0,"boolean",{literal:!0}):t}if("date"===r){if("string"===t.type){if(t.literal)return jn(t.value)||Cn(t.value,"date");throw new Sn("Casting string fields to dates is not supported")}throw new Sn(`Can’t cast ${t.type} to date`)}if("date-month"===r){let e;if("date"===t.type)e=t;else{if("string"!==t.type&&"any"!==t.type)throw new Sn(`Can’t cast ${t.type} to date-month`);e=kn(t.value)||jn(t.value)||Cn(t.value,"date-month")}return e.literal?Rn(Tn(e.value.toString().slice(0,6)),"date-month",{literal:!0}):Rn(`CAST(SUBSTR(${e.value}, 1, 6) AS integer)`,"date-month")}if("date-year"===r){let e;if("date"===t.type||"date-month"===t.type)e=t;else{if("string"!==t.type)throw new Sn(`Can’t cast ${t.type} to date-year`);e=function(e){let t=e.match(/^(\d{4})$/);return t?Rn(Tn(t[1]),"date",{literal:!0}):null}(t.value)||kn(t.value)||jn(t.value)||Cn(t.value,"date-year")}return e.literal?Rn(Tn(e.value.toString().slice(0,4)),"date-year",{literal:!0}):Rn(`CAST(SUBSTR(${e.value}, 1, 4) AS integer)`,"date-year")}if("id"===r){if("string"===t.type)return Rn(t.value,"id",{literal:t.literal})}else if("float"===r&&"integer"===t.type)return Rn(t.value,"float",{literal:t.literal});if("any"===t.type)return Rn(t.value,r,{literal:t.literal});throw new Sn(`Can’t convert ${t.type} to ${r}`)}function Ln(e,t,r){let n=t;if(r&&(n=Mn(0,t,r)),n.literal){if("id"===n.type)return`'${n.value}'`;if("string"===n.type)return`'${n.value.replace(/'/g,"''")}'`}return n.value}function xn(e,t,r){return t.map(((e,t)=>Ln(0,e,r?r[t]:null)))}function Bn(e,t,r){if(null==r&&(r=t),null!=t&&e.length<t)throw new Sn("Too few arguments");if(null!=r&&e.length>r)throw new Sn("Too many arguments")}function Fn(e,t){return function(r){if(null==r||null==r.compileStack)throw new Sn("This function cannot track error data. It needs to accept the compiler state as the first argument.");for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];r.compileStack.push({type:e,args:o});let a=t(r,...o);return r.compileStack.pop(),a}}function Un(e){if("string"==typeof e)return e;if(void 0===e)return"undefined";let t=JSON.stringify(e);return t.length>70?JSON.stringify(e,null,2).split("\n").join("\n "):t}function Pn(e){if(void 0===e)throw new Sn("`undefined` is not a valid query value");if(null===e)return Rn("NULL","null",{literal:!0});if(e instanceof Date)return Rn(function(e){let t=e=>(e<10?"0":"")+e;return e.getFullYear()+t(e.getMonth()+1)+t(e.getDate())}(e),"date",{literal:!0});if("string"==typeof e)return Rn(e=e.replace(/\\\$/g,"$"),"string",{literal:!0});if("boolean"==typeof e)return Rn(e?1:0,"boolean",{literal:!0});if("number"==typeof e)return Rn(e,Number.isInteger(e)?"integer":"float",{literal:!0});if(Array.isArray(e))return Rn(e,"array",{literal:!0});throw new Sn("Unsupported type of expression: "+JSON.stringify(e))}const Wn=Fn("expr",((e,t)=>{if("string"==typeof t){if("$"===t[0]){let r="$"===t?e.implicitField:t.slice(1);if(null==r||""===r)throw new Sn("Invalid field reference: "+t);return function(e,t){if("string"!=typeof t)throw new Sn("Invalid field name, must be a string");let r,{path:n,field:o}=An(t);r=""===n?{tableName:e.implicitTableName,tableId:e.implicitTableId}:Dn(e,n);let i=function(e,t,r){if(null==e[t])throw new Sn(`Table “${t}” does not exist in the schema`);let n=e[t][r];if(null==n)throw new Sn(`Field “${r}” does not exist in table “${t}”`);return n}(e.schema,r.tableName,o);if(e.validateRefs&&i.ref&&"id"===i.type&&"id"!==o){let n=e.implicitTableName+"."+t,i=e.paths.get(n);i||(i=Nn(e,n),i.noMapping=!0,e.paths.set(n,i)),o="id",r=i}return Rn(r.tableId+"."+o,i.type)}(e,r)}if(":"===t[0]){let r={value:"?",type:"param",paramName:t.slice(1)};return e.namedParameters.push(r),r}}if(null!==t){if(Array.isArray(t))return Pn(t);if("object"==typeof t&&Object.keys(t).find((e=>"$"===e[0])))return Hn(e,t)}return Pn(t)})),Hn=Fn("function",((e,t)=>{let[r]=Object.keys(t),n=t[r];if(Array.isArray(n)||(n=[n]),"$"!==r[0])throw new Sn(`Unknown property “${r}.” Did you mean to call a function? Try prefixing it with $`);let o=n;switch("$condition"!==r&&(o=n.map((t=>Wn(e,t)))),r){case"$sum":{Bn(o,1);let[e]=xn(0,o,["float"]);return Rn(`SUM(${e})`,o[0].type)}case"$sumOver":{let[t]=xn(0,o,["float"]);return Rn(`(SUM(${t}) OVER (${e.orders?"ORDER BY "+Zn(e,e.orders):""} ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING))`,o[0].type)}case"$count":{Bn(o,1);let[e]=xn(0,o);return Rn(`COUNT(${e})`,"integer")}case"$substr":{Bn(o,2,3);let[e,t,r]=xn(0,o,["string","integer","integer"]);return Rn(`SUBSTR(${e}, ${t}, ${r})`,"string")}case"$lower":{Bn(o,1);let[e]=xn(0,o,["string"]);return Rn(`UNICODE_LOWER(${e})`,"string")}case"$neg":return Bn(o,1),xn(0,o,["float"]),Rn(`(-${Ln(0,o[0])})`,o[0].type);case"$abs":return Bn(o,1),xn(0,o,["float"]),Rn(`ABS(${Ln(0,o[0])})`,o[0].type);case"$idiv":return Bn(o,2),xn(0,o,["integer","integer"]),Rn(`(${Ln(0,o[0])} / ${Ln(0,o[1])})`,o[0].type);case"$month":return Bn(o,1),Mn(0,o[0],"date-month");case"$year":return Bn(o,1),Mn(0,o[0],"date-year");case"$condition":return Bn(o,1),Rn(Vn(e,o[0]).join(" AND "),"boolean");case"$nocase":Bn(o,1);let[t]=xn(0,o,["string"]);return Rn(`${t} COLLATE NOCASE`,o[0].type);case"$literal":if(Bn(o,1),!o[0].literal)throw new Sn("Literal not passed to $literal");return o[0];default:throw new Sn(`Unknown function: ${r}`)}})),zn=Fn("op",((e,t,r)=>{let n,{$transform:o,...i}=r,[a]=Object.keys(i),s=Wn(e,r[a]);switch(n=o?Hn({...e,implicitField:t},"string"==typeof o?{[o]:"$"}:o):Wn(e,"$"+t),a){case"$gte":{let[e,t]=xn(0,[n,s],[null,n.type]);return`${e} >= ${t}`}case"$lte":{let[e,t]=xn(0,[n,s],[null,n.type]);return`${e} <= ${t}`}case"$gt":{let[e,t]=xn(0,[n,s],[null,n.type]);return`${e} > ${t}`}case"$lt":{let[e,t]=xn(0,[n,s],[null,n.type]);return`${e} < ${t}`}case"$eq":{if("null"===Mn(0,s,n.type).type)return`${Ln(0,n)} IS NULL`;let[t,r]=xn(0,[n,s],[null,n.type]);if("param"===s.type){let o=e.namedParameters.map((e=>e===s||e===n?[e,{...e}]:e));return e.namedParameters=[].concat.apply([],o),`CASE\n WHEN ${t} IS NULL THEN ${r} IS NULL\n ELSE ${t} = ${r}\n END`}return`${t} = ${r}`}case"$oneof":{let[e,t]=xn(0,[n,s],[null,"array"]);return`${e} IN (`+[...new Set(t)].map((e=>`'${e}'`)).join(",")+")"}case"$like":{let[e,t]=xn(0,[n,s],["string","string"]);return`${e} LIKE ${t}`}default:throw new Sn(`Unknown operator: ${a}`)}}));function Vn(e,t){return Array.isArray(t)||(t=Object.entries(t).map((e=>({[e[0]]:e[1]})))),t.filter(Boolean).reduce(((t,r)=>{let n=Object.entries(r).map((t=>{let[r,n]=t;return"$and"===r?n?$n(e,n):null:"$or"===r?n?function(e,t){if(!t)return"0";let r=Vn(e,t);return 0===r.length?"0":"("+r.join("\n OR ")+")"}(e,n):null:"string"==typeof n||"number"==typeof n||"boolean"==typeof n||n instanceof Date||null==n?zn(e,r,{$eq:n}):Array.isArray(n)?n.map((t=>zn(e,r,t))).join(" AND "):zn(e,r,n)})).filter(Boolean);return[...t,...n]}),[])}function $n(e,t){if(!t)return"1";let r=Vn(e,t);return 0===r.length?"1":"("+r.join("\n AND ")+")"}const qn=Fn("filter",((e,t)=>$n(e,t))),Gn=Fn("select",((e,t,r,n)=>(r||t.includes("id")||t.includes("*")||(t=t.concat(["id"])),t.map((t=>{if("string"==typeof t){if(-1!==t.indexOf("*")){let r=function(e,t){let r,n;if("*"===t)n={tableName:e.implicitTableName,tableId:e.implicitTableId};else if(t.match(/\.\*$/)){let o=An(t);r=o.path,n=Dn(e,o.path)}let o=e.schema[n.tableName];if(null==o)throw new Error(`Table “${n.tableName}” does not exist`);return Object.keys(o).map((e=>r?`${r}.${e}`:e))}(e,t);return r.map((t=>{let r=Wn(e,"$"+t);return e.outputTypes.set(t,r.type),r.value+" AS "+In(t)})).join(", ")}let r=Wn(e,"$"+t);return e.outputTypes.set(t,r.type),r.value+" AS "+In(t)}let[r,o]=Object.entries(t)[0];if("$"===r[0])throw e.compileStack.push({type:"value",value:t}),new Sn(`Invalid field “${r}”, are you trying to select a function? You need to name the expression`);if("string"==typeof o){let t=Wn(e,"$"+o);return e.outputTypes.set(r,t.type),`${t.value} AS ${In(r)}`}let i=Hn({...e,orders:n},o);return e.outputTypes.set(r,i.type),i.value+` AS ${In(r)}`})).join(", ")))),Yn=Fn("groupBy",((e,t)=>t.map((t=>"string"==typeof t?Wn(e,"$"+t).value:Hn(e,t).value)).join(", "))),Zn=Fn("orderBy",((e,t)=>t.map((t=>{let r,n=null;if("string"==typeof t)r=Wn(e,"$"+t).value;else{let o=Object.entries(t),i=o[0];if(1===o.length&&"$"!==i[0][0])n=i[1],r=Wn(e,"$"+i[0]).value;else{let{$dir:o,...i}=t;n=o,r=Hn(e,i).value}}if(null!=n){if("desc"!==n&&"asc"!==n)throw new Sn("Invalid order direction: "+n);return`${r} ${n}`}return r})).join(", ")));let Kn=["$sum","$count"];function Jn(e){if("object"!=typeof e||Array.isArray(e))return!1;let[t,r]=Object.entries(e)[0];return Array.isArray(r)||(r=[r]),-1!==Kn.indexOf(t)||!!r.find((e=>Jn(e)))}function Xn(e){return e.groupExpressions.length>0||!!e.selectExpressions.find((e=>{if("string"!=typeof e){let[t,r]=Object.entries(e)[0];return Jn(r)}return!1}))}function Qn(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{withDead:n,validateRefs:o=!0,tableOptions:i,rawMode:a}=e,{tableViews:s={},tableFilters:u=(e=>[]),customizeQuery:l=(e=>e)}=r,c=e=>{let t=u(e);for(let e of t){if(Array.isArray(e))throw new Sn("Invalid internal table filter: only object filters are supported");if(-1!==Object.keys(e)[0].indexOf("."))throw new Sn("Invalid internal table filter: field names cannot contain paths")}return t},f=(e,t)=>("function"==typeof s?s(e,{withDead:n,isJoin:t,tableOptions:i}):s[e])||e,d=e.table,{filterExpressions:g,selectExpressions:p,groupExpressions:h,orderExpressions:y,limit:m,offset:b}=l(e),_="",w="",E="",v="",S="",T={schema:t,implicitTableName:d,implicitTableId:f(d),paths:new Map,dependencies:[d],compileStack:[],outputTypes:new Map,validateRefs:o,namedParameters:[]};En=0;try{if(_=Gn(T,p,Xn(e),y),w=g.length>0?"WHERE "+qn(T,g):"WHERE 1",!a){let e=c(d);e.length>0&&(w+=" AND "+$n(T,e))}h.length>0&&(v="GROUP BY "+Yn(T,h)),y.length>0&&(S="ORDER BY "+Zn(T,y)),T.paths.size>0&&(E=function(e,t,r){let n=[];return e.paths.forEach(((o,i)=>{let{tableName:a,tableId:s,joinField:u,joinTable:l,noMapping:c}=e.paths.get(i),f=`${s}.id = ${t(l)}.${In(u)}`,d=r(a);d.length>0&&(f+=" AND "+$n({...e,implicitTableName:a,implicitTableId:s},d)),n.push(`LEFT JOIN ${c?a:t(a,!0)} ${s} ON ${On(e.schema,a,s,f)}`),-1===e.dependencies.indexOf(a)&&e.dependencies.push(a)})),n.join("\n")}(T,f,c))}catch(e){if(e instanceof Sn)throw function(e,t){if(0===t.length)return e;let r=t.slice(1).reverse().map((e=>{switch(e.type){case"expr":case"function":return Un(e.args[0]);case"op":{let[t,r]=e.args;return Un({[t]:r})}case"value":return Un(e.value);default:return""}})).map((e=>"\n "+e)).join("");const n=t[0].type,o=t[0].args[0];r+=`\n ${n}(${Un(1===o.length?o[0]:o)})`;{const t=new Sn;return t.message=`${e.message}\n\nExpression stack:`+r,t.stack=null,t}}(e,T.compileStack);throw e}return{sqlPieces:{select:_,from:f(d),joins:E,where:w,groupBy:v,orderBy:S,limit:m,offset:b},state:T}}function eo(e){return Object.keys(e).map((t=>{let r=e[t],n=r!==t;return r.match(/[ .]/)||(r=`_.${r}`),n?`${r} AS ${In(t)}`:`${r}`})).join(", ")}function to(e,t){return{type:e,...t}}const ro={transactions:{id:to("id"),is_parent:to("boolean"),is_child:to("boolean"),parent_id:to("id"),account:to("id",{ref:"accounts",required:!0}),category:to("id",{ref:"categories"}),amount:to("integer",{default:0,required:!0}),payee:to("id",{ref:"payees"}),notes:to("string"),date:to("date",{required:!0}),imported_id:to("string"),error:to("json"),imported_payee:to("string"),starting_balance_flag:to("boolean"),transfer_id:to("id"),sort_order:to("float",{default:()=>Date.now()}),cleared:to("boolean",{default:!0}),tombstone:to("boolean"),schedule:to("id",{ref:"schedules"})},payees:{id:to("id"),name:to("string",{required:!0}),transfer_acct:to("id",{ref:"accounts"}),tombstone:to("boolean")},accounts:{id:to("id"),name:to("string",{required:!0}),offbudget:to("boolean"),closed:to("boolean"),sort_order:to("float"),tombstone:to("boolean")},categories:{id:to("id"),name:to("string"),is_income:to("boolean"),hidden:to("boolean"),group:to("id",{ref:"category_groups"}),sort_order:to("float"),tombstone:to("boolean")},category_groups:{id:to("id"),name:to("string"),is_income:to("boolean"),hidden:to("boolean"),sort_order:to("float"),tombstone:to("boolean")},schedules:{id:to("id"),name:to("string"),rule:to("id",{ref:"rules",required:!0}),next_date:to("date"),completed:to("boolean"),posts_transaction:to("boolean"),tombstone:to("boolean"),_payee:to("id",{ref:"payees"}),_account:to("id",{ref:"accounts"}),_amount:to("json/fallback"),_amountOp:to("string"),_date:to("json/fallback"),_conditions:to("json"),_actions:to("json")},rules:{id:to("id"),stage:to("string"),conditions_op:to("string"),conditions:to("json"),actions:to("json"),tombstone:to("boolean")},notes:{id:to("id"),note:to("string")},transaction_filters:{id:to("id"),name:to("string"),conditions_op:to("string"),conditions:to("json"),tombstone:to("boolean")}},no={tableViews(e,t){let{isJoin:r,withDead:n,tableOptions:o={splits:void 0}}=t;switch(e){case"transactions":{if(r)return"v_transactions_internal_alive";let e=o.splits||"inline";return n||"inline"!==e&&"none"!==e?"v_transactions_internal":"v_transactions_internal_alive"}case"schedules":return"v_schedules";case"categories":return"v_categories";case"payees":return"v_payees"}return e},customizeQuery(e){let{table:t}=e;return{...e,orderExpressions:function(e){if(e.length>0)return e.concat(["id"]);switch(t){case"transactions":return[{date:"desc"},"starting_balance_flag",{sort_order:"desc"},"id"];case"payees":return[{$condition:{transfer_acct:null},$dir:"desc"},{$nocase:"$name"}];case"accounts":return["sort_order","name"];case"schedules":return[{$condition:{completed:!0}},"next_date"]}return[]}(e.orderExpressions)}},views:{payees:{v_payees:e=>`\n SELECT ${e({name:"COALESCE(__accounts.name, _.name)"})} FROM payees _\n LEFT JOIN accounts __accounts ON (_.transfer_acct = __accounts.id AND __accounts.tombstone = 0)\n -- We never want to show transfer payees that are pointing to deleted accounts.\n -- Either this is not a transfer payee, if the account exists\n WHERE _.transfer_acct IS NULL OR __accounts.id IS NOT NULL\n `},categories:{fields:{group:"cat_group"},v_categories:e=>`SELECT ${e({group:"cat_group"})} FROM categories _`},schedules:{v_schedules:e=>`\n SELECT ${e({next_date:"\n CASE\n WHEN _nd.local_next_date_ts = _nd.base_next_date_ts THEN _nd.local_next_date\n ELSE _nd.base_next_date\n END\n ",_payee:"pm.targetId",_account:"json_extract(_rules.conditions, _paths.account || '.value')",_amount:"json_extract(_rules.conditions, _paths.amount || '.value')",_amountOp:"json_extract(_rules.conditions, _paths.amount || '.op')",_date:"json_extract(_rules.conditions, _paths.date || '.value')",_conditions:"_rules.conditions",_actions:"_rules.actions"})} FROM schedules _\n LEFT JOIN schedules_next_date _nd ON _nd.schedule_id = _.id\n LEFT JOIN schedules_json_paths _paths ON _paths.schedule_id = _.id\n LEFT JOIN rules _rules ON _rules.id = _.rule\n LEFT JOIN payee_mapping pm ON pm.id = json_extract(_rules.conditions, _paths.payee || '.value')\n `},transactions:{fields:{is_parent:"isParent",is_child:"isChild",account:"acct",imported_id:"financial_id",imported_payee:"imported_description",transfer_id:"transferred_id",payee:"description"},v_transactions_internal:e=>`\n SELECT ${e({payee:"pm.targetId",category:"CASE WHEN _.isParent = 1 THEN NULL ELSE cm.transferId END",amount:"IFNULL(_.amount, 0)",parent_id:"CASE WHEN _.isChild = 0 THEN NULL ELSE _.parent_id END"})} FROM transactions _\n LEFT JOIN category_mapping cm ON cm.id = _.category\n LEFT JOIN payee_mapping pm ON pm.id = _.description\n WHERE\n _.date IS NOT NULL AND\n _.acct IS NOT NULL AND\n (_.isChild = 0 OR _.parent_id IS NOT NULL)\n `,v_transactions_internal_alive:"\n SELECT _.* FROM v_transactions_internal _\n LEFT JOIN transactions t2 ON (_.is_child = 1 AND t2.id = _.parent_id)\n WHERE IFNULL(_.tombstone, 0) = 0 AND (_.is_child = 0 OR t2.tombstone = 0)\n ",v_transactions:(e,t)=>`\n SELECT ${t({payee:"p.id",category:"c.id",account:"a.id"})} FROM v_transactions_internal_alive _\n LEFT JOIN payees p ON (p.id = _.payee AND p.tombstone = 0)\n LEFT JOIN categories c ON (c.id = _.category AND c.tombstone = 0)\n LEFT JOIN accounts a ON (a.id = _.account AND a.tombstone = 0)\n ORDER BY _.date desc, _.starting_balance_flag, _.sort_order desc, _.id;\n `}}};class oo{constructor(e){this.state={filterExpressions:e.filterExpressions||[],selectExpressions:e.selectExpressions||[],groupExpressions:e.groupExpressions||[],orderExpressions:e.orderExpressions||[],calculation:!1,rawMode:!1,withDead:!1,validateRefs:!0,limit:null,offset:null,...e}}filter(e){return new oo({...this.state,filterExpressions:[...this.state.filterExpressions,e]})}unfilter(e){let t=new Set(e);return new oo({...this.state,filterExpressions:this.state.filterExpressions.filter((e=>!t.has(Object.keys(e)[0])))})}select(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];Array.isArray(e)||(e=[e]);let t=new oo({...this.state,selectExpressions:e});return t.state.calculation=!1,t}calculate(e){let t=this.select({result:e});return t.state.calculation=!0,t}groupBy(e){return Array.isArray(e)||(e=[e]),new oo({...this.state,groupExpressions:[...this.state.groupExpressions,...e]})}orderBy(e){return Array.isArray(e)||(e=[e]),new oo({...this.state,orderExpressions:[...this.state.orderExpressions,...e]})}limit(e){return new oo({...this.state,limit:e})}offset(e){return new oo({...this.state,offset:e})}raw(){return new oo({...this.state,rawMode:!0})}withDead(){return new oo({...this.state,withDead:!0})}withoutValidatedRefs(){return new oo({...this.state,validateRefs:!1})}options(e){return new oo({...this.state,tableOptions:e})}serialize(){return this.state}}function io(e){return new oo({table:e})}async function ao(e,t,r,n,o){let i=function(e,t,r){let n=r,o=e.withDead?n.where:On(t.schema,t.implicitTableName,t.implicitTableId,n.where);return`\n SELECT ${n.select} FROM ${n.from}\n ${n.joins}\n ${o}\n ${n.groupBy}\n ${n.orderBy}\n ${null!=n.limit?`LIMIT ${n.limit}`:""}\n ${null!=n.offset?`OFFSET ${n.offset}`:""}\n `}(e,t,r),a=await Wa(i,n);return function(e,t){for(let r=0;r<e.length;r++){let n=e[r];Object.keys(n).forEach((e=>{n[e]=_n(n[e],t.get(e))}))}}(a,o),a}async function so(e,t,r){let n,{params:o={},executors:i={}}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=r.namedParameters.map((e=>{let t=e.paramName;if(void 0===o[t])throw new Error(`Parameter ${t} not provided to query`);return bn(o[t],e.paramType)}));if(n=i[r.implicitTableName]?await i[r.implicitTableName](r,e,t,a,r.outputTypes):await ao(e,r,t,a,r.outputTypes),e.calculation)if(n.length>0){let e=n[0];n=e[Object.keys(e)[0]]||0}else n=null;return n}function uo(e,t){return`${t} IN (`+[...new Set(e)].map((e=>`'${e}'`)).join(",")+")"}function lo(e){for(let t of Object.keys(e))if("$or"===t||"$and"===t){if(e[t]&&lo(e[t]))return!0}else if(0!==t.indexOf("account")&&"date"!==t)return!0;return!1}const co={transactions:function(e,t,r,n,o){let i=(t.tableOptions||{}).splits||"inline";if(-1===["all","inline","none","grouped"].indexOf(i))throw new Error(`Invalid “splits” option for transactions: “${i}”`);return"all"===i||"inline"===i||"none"===i?async function(e,t,r,n,o,i){let a={...r};return"all"!==o&&(a.where="none"===o?`${a.where} AND ${a.from}.parent_id IS NULL`:`${a.where} AND ${a.from}.is_parent = 0`),ao(t,e,a,n,i)}(e,t,r,n,i,o):"grouped"===i?async function(e,t,r,n,o,i){let a,{withDead:s}=t,u=s?"":`AND ${r.from}.tombstone = 0`;if(Xn(t)){let o={...r};return o.where=`${o.where} AND ${o.from}.is_parent = 0`,s||(o.from="v_transactions_internal_alive v_transactions_internal"),ao(t,e,o,n,i)}let l=null;if(function(e){return null==e.filterExpressions.find(lo)}(t)){let e=`\n SELECT ${r.from}.id as group_id\n FROM ${r.from}\n ${r.joins}\n ${r.where} AND is_child = 0 ${u}\n ${r.orderBy}\n ${null!=r.limit?`LIMIT ${r.limit}`:""}\n ${null!=r.offset?`OFFSET ${r.offset}`:""}\n `;a=await Wa(e,n)}else{let e=`\n SELECT group_id, matched FROM (\n SELECT\n group_id,\n GROUP_CONCAT(id) as matched\n FROM (\n SELECT ${r.from}.id, IFNULL(${r.from}.parent_id, ${r.from}.id) as group_id\n FROM ${r.from}\n LEFT JOIN transactions _t2 ON ${r.from}.is_child = 1 AND _t2.id = ${r.from}.parent_id\n ${r.joins}\n ${r.where} AND ${r.from}.tombstone = 0 AND IFNULL(_t2.tombstone, 0) = 0\n )\n GROUP BY group_id\n )\n LEFT JOIN ${r.from} ON ${r.from}.id = group_id\n ${r.joins}\n ${r.orderBy}\n ${null!=r.limit?`LIMIT ${r.limit}`:""}\n ${null!=r.offset?`OFFSET ${r.offset}`:""}\n `;a=await Wa(e,n),l=new Set([].concat.apply([],a.map((e=>e.matched.split(",")))))}let c=uo(a.map((e=>e.group_id)),`IFNULL(${r.from}.parent_id, ${r.from}.id)`),f=`\n SELECT ${r.select}, parent_id AS _parent_id FROM ${r.from}\n ${r.joins}\n WHERE ${c} ${u}\n ${r.orderBy}\n `,d=await Wa(f),{parents:g,children:p}=d.reduce(((e,t)=>{let r=t._parent_id;if(delete t._parent_id,null==r)e.parents.push(t);else{let n=e.children.get(r)||[];n.push(t),e.children.set(r,n)}return e}),{parents:[],children:new Map});return function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e=>e;return e.reduce(((e,n)=>{let o=t.get(n.id)||[];return e.push({...r(n),subtransactions:o.map(r)}),e}),[])}(g,p,(e=>(Object.keys(e).forEach((t=>{e[t]=_n(e[t],i.get(t))})),l&&!l.has(e.id)&&(e._unmatched=!0),e)))}(e,t,r,n,0,o):void 0}};function fo(e,t){return e instanceof oo&&(e=e.serialize()),async function(e,t,r,n){let{sqlPieces:o,state:i}=Qn(r,e,t);return{data:await so(r,o,i,n),dependencies:i.dependencies}}(ro,no,e,{params:t,executors:co})}const go={info:function(){console.log(...arguments)},warn:function(){console.warn(...arguments)}},po=!1,ho=!0,yo=!1;let mo=null;async function bo(e){const t=Br(Wr(e),"metadata.json");try{mo=JSON.parse(await on(t))}catch(t){mo={id:e,budgetName:e}}let r=["syncAccount"];for(const e of r)delete mo[`flags.${e}`];for(const e of Object.keys(mo))e.startsWith("notifications.")&&delete mo[e];return mo.id=e,mo}async function _o(e){let{avoidSync:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Object.assign(mo,e),!t){let t=Object.keys(e).map((t=>"budgetType"===t||"budgetName"===t?{dataset:"prefs",row:t,column:"value",value:e[t],timestamp:r.Timestamp.send()}:null)).filter((e=>e));t.length>0&&await ma(t)}if(!mo.dummyTestPrefs){let e=Br(Wr(mo.id),"metadata.json");await an(e,JSON.stringify(mo))}}function wo(){mo=null}function Eo(){return mo}function vo(e){return{all:e=e||new Map,on:function(t,r){var n=e.get(t);n?n.push(r):e.set(t,[r])},off:function(t,r){var n=e.get(t);n&&(r?n.splice(n.indexOf(r)>>>0,1):e.set(t,[]))},emit:function(t,r){var n=e.get(t);n&&n.slice().map((function(e){e(r)})),(n=e.get("*"))&&n.slice().map((function(e){e(t,r)}))}}}const So=function(){let e={addNode:n,removeNode:function(n){return o(n),t.delete(n),r.delete(n),e},adjacent:i,adjacentIncoming:a,addEdge:function(t,r){return n(t),n(r),i(t).add(r),a(r).add(t),e},removeEdge:s,removeIncomingEdges:o,topologicalSort:function(e){const t=new Set,r=[];return e.forEach((e=>{t.has(e)||u(e,t,r)})),r},generateDOT:function(){let e=[];return t.forEach((function(t,r){0!==t.length&&e.push(`${r} -> {${t.join(",")}}`)})),`\n digraph G {\n ${e.join("\n").replace(/!/g,"_")}\n }\n `},getEdges:function(){return{edges:t,incomingEdges:r}}},t=new Map,r=new Map;function n(n){return t.set(n,i(n)),r.set(n,a(n)),e}function o(e){const t=a(e);r.set(e,new Set);let n=t.values(),o=n.next();for(;!o.done;)s(o.value,e),o=n.next()}function i(e){return t.get(e)||new Set}function a(e){return r.get(e)||new Set}function s(n,o){return t.has(n)&&i(n).delete(o),r.has(o)&&a(o).delete(n),e}function u(e,t,r){t.add(e);let n=i(e).values(),o=n.next();for(;!o.done;)t.has(o.value)||u(o.value,t,r),o=n.next();r.unshift(e)}return e};function To(e){let t=e.indexOf("!");return-1!==t?{sheet:e.slice(0,t),name:e.slice(t+1)}:{sheet:null,name:e}}function Oo(e,t){return e+"!"+t}class Ao{constructor(e,t){this.graph=new So,this.nodes=new Map,this.transactionDepth=0,this.saveCache=e,this.setCacheStatus=t,this.dirtyCells=[],this.computeQueue=[],this.events=vo(),this._meta={createdMonths:new Set}}meta(){return this._meta}setMeta(e){this._meta=e}_getNode(e){const{sheet:t}=To(e);return this.nodes.has(e)||this.nodes.set(e,{name:e,expr:null,value:null,sheet:t}),this.nodes.get(e)}getNode(e){return this._getNode(e)}hasCell(e){return this.nodes.has(e)}add(e,t,r){this.set(e,t)}getNodes(){return this.nodes}serialize(){return{graph:this.graph.getEdges(),nodes:[...this.nodes.entries()]}}transaction(e){this.startTransaction();try{e()}catch(e){console.log(e)}return this.endTransaction()}startTransaction(){this.transactionDepth++}endTransaction(){if(this.transactionDepth--,0===this.transactionDepth){const e=this.dirtyCells;this.dirtyCells=[],this.queueComputation(this.graph.topologicalSort(e))}return[]}queueComputation(e){this.computeQueue=this.computeQueue.concat(e),Promise.resolve().then((()=>{this.running||this.runComputations()}))}runComputations(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;for(this.running=!0;e<this.computeQueue.length;){let t,r,n=this.computeQueue[e];try{if(t=this.getNode(n),t._run){let e=t._dependencies.map((e=>this.getNode(e).value));r=t._run(...e),r instanceof Promise&&console.warn(`dynamic cell ${n} returned a promise! this is discouraged because errors are not handled properly`)}else{if(!t.sql){e++;continue}r=so(t.query,t.sql.sqlPieces,t.sql.state,{params:void 0,executors:co})}}catch(e){return console.log("Error while evaluating "+n+":",e),this.running=!1,void(this.computeQueue=[])}if(r instanceof Promise)return void r.then((r=>{t.value=r,this.runComputations(e+1)}),(r=>{console.warn(`Failed running ${t.name}!`,r),this.runComputations(e+1)}));t.value=r,e++}e===this.computeQueue.length&&(this.events.emit("change",{names:this.computeQueue}),"function"==typeof this.saveCache&&this.saveCache(this.computeQueue),this.markCacheSafe(),this.running=!1,this.computeQueue=[])}markCacheSafe(){this.cacheBarrier||this.setCacheStatus&&this.setCacheStatus({clean:!0})}markCacheDirty(){this.setCacheStatus&&this.setCacheStatus({clean:!1})}startCacheBarrier(){this.cacheBarrier=!0,this.markCacheDirty()}endCacheBarrier(){this.cacheBarrier=!1,this.running||this.computeQueue.length>0||this.markCacheSafe()}addEventListener(e,t){return this.events.on(e,t),()=>this.events.off(e,t)}onFinish(e){if(0!==this.transactionDepth)throw new Error("onFinish called while inside a spreadsheet transaction. This is not allowed as it will lead to race conditions");if(!this.running&&0===this.computeQueue.length)return e([]),()=>{};let t=this.addEventListener("change",(function(){return t(),e(...arguments)}));return t}unload(){this.events.all.clear()}getValue(e){return this.getNode(e).value}getExpr(e){return this.getNode(e).expr}getCellValue(e,t){return this.getNode(Oo(e,t)).value}getCellExpr(e,t){return this.getNode(Oo(e,t)).expr}getCellValueLoose(e,t){let r=Oo(e,t);return this.nodes.has(r)?this.getNode(r).value:null}bootup(e){this.onFinish((()=>{e()}))}load(e,t){const r=this._getNode(e);r.expr=t,r.value=t}create(e,t){return this.transaction((()=>{const r=this._getNode(e);r.expr=t,r.value=t,this._markDirty(e)}))}set(e,t){this.create(e,t)}recompute(e){this.transaction((()=>{this.dirtyCells.push(e)}))}recomputeAll(){this.transaction((()=>{this.dirtyCells=[...this.nodes.keys()]}))}createQuery(e,t,r){let n=Oo(e,t),o=this._getNode(n);if(o.query!==r){o.query=r;let{sqlPieces:e,state:t}=Qn(o.query,ro,no);o.sql={sqlPieces:e,state:t},this.transaction((()=>{this._markDirty(n)}))}}createStatic(e,t,r){let n=Oo(e,t);this.nodes.has(n)||this.create(n,r)}createDynamic(e,t,r){let{dependencies:n=[],run:o,initialValue:i,refresh:a=!1}=r,s=Oo(e,t),u=this._getNode(s);u.dynamic||(u.dynamic=!0,u._run=o,n=n.map((t=>{let r;return r=To(t).sheet?t:Oo(e,t),r})),u._dependencies=n,this.graph.removeIncomingEdges(s),n.forEach((e=>{this.graph.addEdge(e,s)})),(null==u.value||a)&&this.transaction((()=>{u.value=i,this._markDirty(s)})))}clearSheet(e){for(let[t,r]of this.nodes.entries())r.sheet===e&&this.nodes.delete(t)}voidCell(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=this.getNode(Oo(e,t));n._run=null,n.dynamic=!1,n.value=r}deleteCell(e,t){this.voidCell(e,t),this.nodes.delete(Oo(e,t))}addDependencies(e,t,r){let n=Oo(e,t);r=r.map((t=>To(t).sheet?t:Oo(e,t)));let o=this.getNode(n),i=r.filter((e=>-1===(o._dependencies||[]).indexOf(e)));i.length>0&&(o._dependencies=(o._dependencies||[]).concat(i),i.forEach((e=>{this.graph.addEdge(e,n)})),this.recompute(n))}removeDependencies(e,t,r){let n=Oo(e,t);r=r.map((t=>To(t).sheet?t:Oo(e,t)));let o=this.getNode(n);o._dependencies=(o._dependencies||[]).filter((e=>-1===r.indexOf(e))),r.forEach((e=>{this.graph.removeEdge(e,n)})),this.recompute(n)}_markDirty(e){this.dirtyCells.push(e)}triggerDatabaseChanges(e,t){let r=new Set([...e.keys(),...t.keys()]);this.startTransaction(),this.nodes.forEach((e=>{e.sql&&e.sql.state.dependencies.some((e=>r.has(e)))&&this._markDirty(e.name)})),this.endTransaction()}}let Io,Ro,No;function Do(){return Io}async function jo(e,t){await Mr(e,(()=>{t.forEach((t=>{const r=Io._getNode(t);null==r.sql&&jr(e,"INSERT OR REPLACE INTO kvcache (key, value) VALUES (?, ?)",[t,JSON.stringify(r.value)])}))}))}function ko(e,t,r){let{clean:n}=r;if(n){let r=1e7*Math.random();jr(t,"INSERT OR REPLACE INTO kvcache_key (id, key) VALUES (1, ?)",[r]),e&&jr(e,"INSERT OR REPLACE INTO kvcache_key (id, key) VALUES (1, ?)",[r])}else jr(t,"DELETE FROM kvcache_key")}async function Co(e,t){let r,n,o=e.getDatabase();if(yo){let t=e.getDatabasePath().replace(/db\.sqlite$/,"cache.sqlite");No=r=Lr(t),kr(r,"\n CREATE TABLE IF NOT EXISTS kvcache (key TEXT PRIMARY KEY, value TEXT);\n CREATE TABLE IF NOT EXISTS kvcache_key (id INTEGER PRIMARY KEY, key REAL)\n ")}else r=o;if(n=new Ao(jo.bind(null,r),ko.bind(null,o,r)),fr({message:"loading spreaadsheet",category:"server"}),Io=n,Ro=t,t&&n.addEventListener("change",t),function(e,t){let r=jr(t,"SELECT key FROM kvcache_key WHERE id = 1",[],!0),n=0===r.length?null:r[0].key;if(null==n)return!0;if(e){let t=jr(e,"SELECT key FROM kvcache_key WHERE id = 1",[],!0);if(0===t.length||t[0].key!==n)return!0}return r=jr(t,"SELECT * FROM kvcache LIMIT 1",[],!0),0===r.length}(o,r))console.log("Loading fresh spreadsheet"),await Lo(e);else{let e=await jr(r,"SELECT * FROM kvcache",[],!0);console.log(`Loaded spreadsheet from cache (${e.length} items)`);for(let t of e){let e=JSON.parse(t.value);n.load(t.key,e)}}return fr({message:"loaded spreaadsheet",category:"server"}),n}function Mo(){Io&&(Io.unload(),Io=null),No&&(xr(No),No=null)}async function Lo(e){let t=Io,{budgetType:r}=Eo()||{},n="report"===r?"reflect_budgets":"zero_budgets",o=await e.all(`\n SELECT * FROM ${n} b\n LEFT JOIN categories c ON c.id = b.category\n WHERE c.tombstone = 0\n `);t.startTransaction();for(let e of o)if(e.month&&e.category){let r=`budget${e.month}`;t.set(`${r}!budget-${e.category}`,e.amount),t.set(`${r}!carryover-${e.category}`,1===e.carryover)}if("report"!==r){let r=await e.all("SELECT * FROM zero_budget_months");for(let e of r){let r=Ot(e.id);t.set(`${r}!buffered`,e.buffered)}}t.endTransaction()}function xo(e,t){return Io.getValue(Oo(e,t))}function Bo(){Io&&Io.startTransaction()}function Fo(){Io&&Io.endTransaction()}function Uo(){return new Promise((e=>{Io?Io.onFinish(e):e(void 0)}))}async function Po(e,t){const r=await(n=e,o=t,Io._getNode(Oo(n,o)));var n,o;return Ft("number"==typeof r.value?r.value:0)}function Wo(){let{budgetType:e}=Eo()||{};return"report"===e?"reflect_budgets":"zero_budgets"}function Ho(){let{budgetType:e}=Eo();return"report"===e}function zo(e){return parseInt(e.replace("-",""))}function Vo(e){let{category:t,month:r}=e,n=za(`SELECT * FROM ${Wo()} WHERE month = ? AND category = ?`,[zo(r),t]);return n&&n.amount||0}function $o(e){let{category:t,month:r,amount:n}=e;n=Ft("number"==typeof n?n:0);const o=Wo();let i=za(`SELECT id FROM ${o} WHERE month = ? AND category = ?`,[zo(r),t]);return i?qa(o,{id:i.id,amount:n}):Ya(o,{id:`${zo(r)}-${t}`,month:zo(r),category:t,amount:n})}function qo(e,t){let r=za("SELECT id FROM zero_budget_months WHERE id = ?",[e]);return r?qa("zero_budget_months",{id:r.id,buffered:t}):Ya("zero_budget_months",{id:e,buffered:t})}function Go(e,t,r,n){let o=za(`SELECT id FROM ${e} WHERE month = ? AND category = ?`,[r,t]);return o?qa(e,{id:o.id,carryover:n?1:0}):Ya(e,{id:`${r}-${t}`,month:r,category:t,carryover:n?1:0})}function Yo(e){if("number"==typeof e)return e;if("string"==typeof e){const t=parseFloat(e);return isNaN(t)?0:t}return 0}function Zo(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return Ft(t.reduce(((e,t)=>e+Yo(t)),0))}function Ko(e){return Ot(dt(e[0]))}function Jo(e,t){if(t.length>0){let r=Ko(t);Do().createStatic(r,`carryover-${e.id}`,!1),Do().createStatic(r,`leftover-${e.id}`,0),Do().createStatic(r,`leftover-pos-${e.id}`,0)}}function Xo(){return Do().meta().budgetType||"rollover"}function Qo(e,t,r,n,o){Do().createDynamic(t,"sum-amount-"+e.id,{initialValue:0,run:()=>{let t=La(`SELECT SUM(amount) as amount FROM v_transactions_internal_alive t\n LEFT JOIN accounts a ON a.id = t.account\n WHERE t.date >= ${n} AND t.date <= ${o}\n AND category = '${e.id}' AND a.offbudget = 0`,[],!0)[0];return(t?t.amount:0)||0}}),"rollover"===Xo()?function(e,t,r){e.is_income||(Do().createStatic(t,`budget-${e.id}`,0),null==Do().getCellValue(t,`budget-${e.id}`)&&Do().set(Oo(t,`budget-${e.id}`),0),Do().createStatic(t,`carryover-${e.id}`,!1),Do().createDynamic(t,`leftover-${e.id}`,{initialValue:0,dependencies:[`budget-${e.id}`,`sum-amount-${e.id}`,`${r}!carryover-${e.id}`,`${r}!leftover-${e.id}`,`${r}!leftover-pos-${e.id}`],run:(e,t,r,n,o)=>Ft(Yo(e)+Yo(t)+Yo(r?n:o))}),Do().createDynamic(t,"leftover-pos-"+e.id,{initialValue:0,dependencies:[`leftover-${e.id}`],run:e=>e<0?0:e}))}(e,t,r):async function(e,t,r){Do().createStatic(t,`budget-${e.id}`,0),null==Do().getCellValue(t,`budget-${e.id}`)&&Do().set(Oo(t,`budget-${e.id}`),0),Do().createDynamic(t,`leftover-${e.id}`,{initialValue:0,dependencies:[`budget-${e.id}`,`sum-amount-${e.id}`,`${r}!carryover-${e.id}`,`${r}!leftover-${e.id}`],run:(t,r,n,o)=>e.is_income?Ft(Yo(t)-Yo(r)+(n?Yo(o):0)):Ft(Yo(t)+Yo(r)+(n?Yo(o):0))}),Do().createDynamic(t,`spent-with-carryover-${e.id}`,{initialValue:0,dependencies:[`budget-${e.id}`,`sum-amount-${e.id}`,`carryover-${e.id}`],refresh:!0,run:(e,t,r)=>r?Math.max(0,Ft(Yo(e)+Yo(t))):t}),Do().createStatic(t,`carryover-${e.id}`,!1)}(e,t,r)}function ei(e,t){Do().createDynamic(t,"group-sum-amount-"+e.id,{initialValue:0,dependencies:e.categories.map((e=>`sum-amount-${e.id}`)),run:Zo}),e.is_income&&"rollover"===Xo()||(Do().createDynamic(t,"group-budget-"+e.id,{initialValue:0,dependencies:e.categories.map((e=>`budget-${e.id}`)),run:Zo}),Do().createDynamic(t,"group-leftover-"+e.id,{initialValue:0,dependencies:e.categories.map((e=>`leftover-${e.id}`)),run:Zo}))}function ti(e,t){if((t.has("date")||t.has("acct")||t.has("amount")||t.has("category")||t.has("tombstone")||t.has("isParent"))&&e.date&&e.category){let t=Ot(ut(dn(e.date)));Do().recompute(Oo(t,"sum-amount-"+e.category))}}function ri(e,t){let{createdMonths:r=new Set}=Do().meta();Bo();try{t.forEach(((t,n)=>{let o=e.get(n);t.forEach((e=>{let t=o&&o.get(e.id);if("zero_budget_months"===n)!function(e){let t=Ot(e.id);Do().set(`${t}!buffered`,e.buffered)}(e);else if("zero_budgets"===n||"reflect_budgets"===n)!function(e){if(e.category){let t=Ot(e.month.toString());Do().set(`${t}!budget-${e.category}`,e.amount||0),Do().set(`${t}!carryover-${e.category}`,1===e.carryover)}}(e);else if("transactions"===n){let r=new Set(Object.keys(It(t||{},e)||{}));t&&ti(t,r),ti(e,r)}else"category_mapping"===n?function(e,t,r){e.forEach((e=>{let n=Ot(e);t&&Do().recompute(Oo(n,"sum-amount-"+t.transferId)),Do().recompute(Oo(n,"sum-amount-"+r.transferId))}))}(r,t,e):"categories"===n?function(e,t,r){function n(e,t,r){Do().addDependencies(e,`group-sum-amount-${t}`,[`sum-amount-${r}`]),Do().addDependencies(e,`group-budget-${t}`,[`budget-${r}`]),Do().addDependencies(e,`group-leftover-${t}`,[`leftover-${r}`])}function o(e,t,r){Do().removeDependencies(e,`group-sum-amount-${t}`,[`sum-amount-${r}`]),Do().removeDependencies(e,`group-budget-${t}`,[`budget-${r}`]),Do().removeDependencies(e,`group-leftover-${t}`,[`leftover-${r}`])}let i=Xo();if(t&&0===t.tombstone&&1===r.tombstone){let t=r.id,n=r.cat_group;e.forEach((e=>{o(Ot(e),n,t)}))}else if(0!==r.tombstone||t&&1!==t.tombstone){if(t&&t.cat_group!==r.cat_group){let i=r.id;e.forEach((e=>{let a=Ot(e);o(a,t.cat_group,i),n(a,r.cat_group,i)}))}}else"rollover"===i&&Jo(r,e),e.forEach((e=>{let t=Ot(dt(e)),o=Ot(e),{start:i,end:a}=wt(e);Qo(r,o,t,i,a);let s=r.id,u=r.cat_group;"rollover"===Xo()&&Do().addDependencies(o,"last-month-overspent",[`${t}!leftover-${s}`,`${t}!carryover-${s}`]),n(o,u,s)}))}(r,t,e):"category_groups"===n?function(e,t,r){let n=Xo();if(1===r.tombstone&&t&&0===t.tombstone){let t=r.id;e.forEach((e=>{var r,n;r=Ot(e),n=t,Do().removeDependencies(r,"total-budgeted",[`group-budget-${n}`]),Do().removeDependencies(r,"total-spent",[`group-sum-amount-${n}`]),Do().removeDependencies(r,"total-leftover",[`group-leftover-${n}`])}))}else if(0===r.tombstone&&(!t||1===t.tombstone)){let t=r;t.is_income&&"rollover"===n||e.forEach((e=>{let r=Ot(e),n=La("SELECT * FROM categories WHERE tombstone = 0 AND cat_group = ?",[t.id],!0);ei({...t,categories:n},r),function(e,t){Do().addDependencies(e,"total-budgeted",[`group-budget-${t}`]),Do().addDependencies(e,"total-spent",[`group-sum-amount-${t}`]),Do().addDependencies(e,"total-leftover",[`group-leftover-${t}`])}(r,t.id)}))}}(r,t,e):"accounts"===n&&function(e,t,r){if(!t||t.offbudget!==r.offbudget){let t=La("\n SELECT DISTINCT(category) as category FROM transactions\n WHERE acct = ?\n ",[r.id],!0);e.forEach((e=>{let r=Ot(e);t.forEach((e=>{Do().recompute(Oo(r,"sum-amount-"+e.category))}))}))}}(r,t,e)}))}))}finally{Fo()}}async function ni(e,t){let{createdMonths:r}=Do().meta();[...r].forEach((r=>{let n=e.map((e=>Vo({month:r,category:e}))).reduce(((e,t)=>e+t),0),o=Vo({month:r,category:t});$o({month:r,category:t,amount:n+o})}))}async function oi(e){const t=await es(),r=await ts();Bo();let n=Do().meta();n.createdMonths=n.createdMonths||new Set;let o=Xo();"rollover"===o&&function(e,t,r){let n=Ko(r);e.blankSheet!==n&&(Do().clearSheet(e.blankSheet),function(e,t,r){Do().createStatic(t,"is-blank",!0),Do().createStatic(t,"to-budget",0),Do().createStatic(t,"buffered",0),e.forEach((e=>Jo(e,r)))}(t,n,r),e.blankSheet=n)}(n,t,e),e.forEach((e=>{if(!n.createdMonths.has(e)){let i=dt(e),{start:a,end:s}=wt(e),u=Ot(e),l=Ot(i);t.forEach((e=>{Qo(e,u,l,a,s)})),r.forEach((e=>{ei(e,u)})),"rollover"===o?function(e,t,r,n){let o=e.filter((e=>e.is_income))[0],i=t.filter((e=>!e.is_income));var a;Do().createStatic(n,"buffered",0),Do().createDynamic(n,"from-last-month",{initialValue:0,dependencies:[`${r}!to-budget`,`${r}!buffered`],run:(e,t)=>Ft(Yo(e)+Yo(t))}),Do().createDynamic(n,"total-income",{initialValue:0,dependencies:[`group-sum-amount-${o.id}`],run:e=>e}),Do().createDynamic(n,"available-funds",{initialValue:0,dependencies:["total-income","from-last-month"],run:(e,t)=>Ft(Yo(e)+Yo(t))}),Do().createDynamic(n,"last-month-overspent",{initialValue:0,dependencies:(a=i.map((e=>[`${r}!leftover-${e.id}`,`${r}!carryover-${e.id}`])),Array.prototype.concat.apply([],a)),run:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t=function(e){let t=[];for(let r=0;r<e.length;r+=2)t.push([e[r],e[r+1]]);return t}(t),Ft(t.reduce(((e,t)=>{let[r,n]=t;return n?e:e+Math.min(0,Yo(r))}),0))}}),Do().createDynamic(n,"total-budgeted",{initialValue:0,dependencies:e.filter((e=>!e.is_income)).map((e=>`group-budget-${e.id}`)),run:function(){return-Zo(...arguments)}}),Do().createDynamic(n,"buffered",{initialValue:0}),Do().createDynamic(n,"to-budget",{initialValue:0,dependencies:["available-funds","last-month-overspent","total-budgeted","buffered"],run:(e,t,r,n)=>Ft(Yo(e)+Yo(t)+Yo(r)-Yo(n))}),Do().createDynamic(n,"total-spent",{initialValue:0,dependencies:e.filter((e=>!e.is_income)).map((e=>`group-sum-amount-${e.id}`)),run:Zo}),Do().createDynamic(n,"total-leftover",{initialValue:0,dependencies:e.filter((e=>!e.is_income)).map((e=>`group-leftover-${e.id}`)),run:Zo})}(r,t,l,u):function(e,t,r){let n=e.filter((e=>e.is_income))[0],o=t.filter((e=>!e.is_income));Do().createDynamic(r,"total-budgeted",{initialValue:0,dependencies:e.filter((e=>!e.is_income)).map((e=>`group-budget-${e.id}`)),run:Zo}),Do().createDynamic(r,"total-spent",{initialValue:0,refresh:!0,dependencies:o.map((e=>`${r}!spent-with-carryover-${e.id}`)),run:Zo}),Do().createDynamic(r,"total-income",{initialValue:0,dependencies:[`group-sum-amount-${n.id}`],run:e=>e}),Do().createDynamic(r,"total-leftover",{initialValue:0,dependencies:["total-budgeted","total-spent"],run:Zo}),Do().createDynamic(r,"total-budget-income",{initialValue:0,dependencies:[`group-budget-${n.id}`],run:e=>e}),Do().createDynamic(r,"total-saved",{initialValue:0,dependencies:["total-budget-income","total-budgeted"],run:(e,t)=>e-t}),Do().createDynamic(r,"real-saved",{initialValue:0,dependencies:["total-income","total-spent"],run:(e,t)=>Ft(e- -t)})}(r,t,u),n.createdMonths.add(e)}})),Do().setMeta(n),Fo(),await Uo()}async function ii(){let e=await Ha("SELECT * FROM transactions WHERE isChild=0 AND date IS NOT NULL ORDER BY date ASC LIMIT 1"),t=e&&dn(e.date),r=ct(),{start:n,end:o,range:i}=function(e,t){return(e=Tt(e))>(t=Tt(t))&&(e=t),{start:e=ht(e,3),end:t=gt(t,12),range:St(e,t)}}(t||r,r),a=Do().meta().createdMonths||new Set;return i.filter((e=>!a.has(e))).length>0&&await oi(i),{start:n,end:o}}class ai extends Error{constructor(e,t){super("PostError: "+e),this.type="PostError",this.reason=e,this.meta=t}}class si extends Error{constructor(e,t){super(`HTTPError: unsuccessful status code (${e}): ${t}`),this.statusCode=e,this.responseBody=t}}class ui extends Error{constructor(e,t){super("SyncError: "+e),this.reason=e,this.meta=t}}class li extends Error{}class ci extends Error{constructor(e,t){super("RuleError: "+t),this.type=e}}function fi(e,t){return{type:"APIError",message:e,meta:t}}function di(e,t){return{type:"FileDownloadError",reason:e,meta:t}}function gi(e,t){return{type:"FileUploadError",reason:e,meta:t}}class pi{constructor(){this.handlers={},this.services=[],this.events=vo(),this.unlistenServices=[]}method(e,t){if(null!=this.handlers[e])throw new Error("Conflicting method name, names must be globally unique: "+e);this.handlers[e]=t}service(e){this.services.push(e)}combine(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];for(let e of t){Object.keys(e.handlers).forEach((t=>{this.method(t,e.handlers[t])})),e.services.forEach((e=>{this.service(e)}));for(let[t,r]of e.events.all.entries())for(let e of r)this.events.on(t,e)}}startServices(){this.unlistenServices.length>0&&cr(new Error("App: startServices called while services are already running")),this.unlistenServices=this.services.map((e=>e()))}stopServices(){this.unlistenServices.forEach((e=>{e&&e()})),this.unlistenServices=[]}}function hi(){return new pi}const yi=hi();yi.events.on("sync",(e=>{Ar("sync-event",e)}));const mi=yi,bi=self.fetch;var _i=__webpack_require__(9033).Buffer;function wi(e,t){if(200!==e.status){if(500===e.status)throw new ai(500===e.status?"internal":t);if(-1!==e.headers.get("Content-Type").toLowerCase().indexOf("application/json")){let e=JSON.parse(t);throw new ai(e.reason)}throw new ai(t)}}async function Ei(e,t){let r,n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{n=await bi(e,{method:"POST",body:JSON.stringify(t),headers:{...o,"Content-Type":"application/json"}}),r=await n.text()}catch(e){throw new ai("network-failure")}wi(n,r);try{n=JSON.parse(r)}catch(e){throw new ai("parse-json",{meta:r})}if("ok"!==n.status)throw console.log("API call failed: "+e+"\nData: "+JSON.stringify(t,null,2)+"\nResponse: "+JSON.stringify(n,null,2)),new ai(n.description||n.reason||"unknown");return n.data}function vi(e,t){return bi(e,t).then((e=>e.text()))}let Si=null;function Ti(e){let t=new URL(e);for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return t.pathname=Br(...n),t.toString()}function Oi(e){Si=null==e?null:Ai(e)}function Ai(e){return e?{BASE_SERVER:e,SYNC_SERVER:Ti(e,"/sync"),SIGNUP_SERVER:Ti(e,"/account"),PLAID_SERVER:Ti(e,"/plaid"),NORDIGEN_SERVER:Ti(e,"/nordigen")}:Si}let Ii=[{type:"marker"}],Ri=0;function Ni(e,t){let r=Sr();if(r.undoDisabled||r.undoListening)return e();Ii=Ii.slice(0,Ri+1);let n={type:"marker",meta:t};return"marker"===Ii[Ii.length-1].type?Ii[Ii.length-1]=n:(Ii.push(n),Ri++),vr({undoListening:!0,undoTag:r.undoTag},e)}function Di(e){return function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return Ni((()=>e(...r)))}}async function ji(e,t,n){await vr({undoListening:!1},(()=>ma(e.map((e=>({...e,timestamp:r.Timestamp.send()}))))));const o=e.reduce(((e,t)=>(e.includes(t.dataset)||e.push(t.dataset),e)),[]);Ar("undo-event",{messages:e,tables:o,meta:t,undoTag:n})}var ki=__webpack_require__(9033).Buffer;let Ci="aes-256-gcm";function Mi(e){if("aes-256-gcm"===e)return"AES-GCM";throw new Error("unsupported crypto algorithm: "+e)}let Li={};class xi{constructor(e){let{id:t}=e;this.id=t||be()}async createFromPassword(e){let{password:t,salt:r}=e;this.value=await async function(e){let{secret:t,salt:r}=e,n=ki.from(t),o=ki.from(r),i=await crypto.subtle.importKey("raw",n,{name:"PBKDF2"},!1,["deriveBits","deriveKey"]),a=await crypto.subtle.deriveKey({name:"PBKDF2",hash:"SHA-512",salt:o,iterations:1e4},i,{name:"AES-GCM",length:256},!0,["encrypt","decrypt"]),s=await crypto.subtle.exportKey("raw",a);return{raw:a,base64:ki.from(s).toString("base64")}}({secret:t,salt:r})}async createFromBase64(e){this.value=await async function(e){return{raw:await crypto.subtle.importKey("raw",ki.from(e,"base64"),{name:"AES-GCM"},!1,["encrypt","decrypt"]),base64:e}}(e)}getId(){return this.id}getValue(){return this.value}serialize(){return{id:this.id,base64:this.value.base64}}}function Bi(e){if(null==e||null==Li[e])throw new Error("missing-key");return Li[e]}function Fi(e){return e in Li}function Ui(e,t){return async function(e,t){let r=crypto.getRandomValues(new Uint8Array(12)),n=await crypto.subtle.encrypt({name:Mi(Ci),iv:r,tagLength:128},e.getValue().raw,t);n=ki.from(n);let o=n.slice(-16);return n=n.slice(0,-16),{value:n,meta:{keyId:e.getId(),algorithm:Ci,iv:ki.from(r).toString("base64"),authTag:o.toString("base64")}}}(Bi(t),e)}function Pi(e,t){return async function(e,t,r){let{algorithm:n,iv:o,authTag:i}=r,a=await crypto.subtle.decrypt({name:Mi(n),iv:ki.from(o,"base64"),tagLength:128},e.getValue().raw,ki.concat([t,ki.from(i,"base64")]));return ki.from(a)}(Bi(t.keyId),e,t)}function Wi(e){return function(e){return ki.from(crypto.getRandomValues(new Uint8Array(e)))}(e)}async function Hi(e){let t;e instanceof xi?t=e:(t=new xi({id:e.id}),await t.createFromBase64(e.base64)),Li[t.getId()]=t}function zi(e){delete Li[e.getId()]}async function Vi(e){let{id:t,password:r,salt:n}=e,o=new xi({id:t});return await o.createFromPassword({password:r,salt:n}),o}var $i=__webpack_require__(9033).Buffer;function qi(e){return $i.isBuffer(e)?e:$i.from(e)}function Gi(){let e=La("SELECT timestamp FROM messages_crdt",[],!0),t=r.merkle.emptyTrie();for(let n=0;n<e.length;n++)t=r.merkle.insert(t,r.Timestamp.parse(e[n].timestamp));return{numMessages:e.length,trie:t}}async function Yi(){return(await Wi(12)).toString()}var Zi=__webpack_require__(9033).Buffer;async function Ki(e){return 200!==e.status?e.text().then((t=>{throw new si(e.status,t)})):e}async function Ji(){let e=await bi(...arguments);return e=await Ki(e),e.json()}async function Xi(){let{id:e,budgetName:t}=Eo();if(!t)return null;let r=Wr(e),n=new(m());return await Er((async()=>{let e=await on(Br(r,"db.sqlite"),"binary"),t=await Lr(e);kr(t,"\n DELETE FROM kvcache;\n DELETE FROM kvcache_key;\n ");let o=await async function(e){return e.export()}(t);xr(t);let i=JSON.parse(await on(Br(r,"metadata.json")));i.resetClock=!0;let a=Zi.from(JSON.stringify(i),"utf8");n.addFile("db.sqlite",o),n.addFile("metadata.json",a)})),Zi.from(n.toBuffer())}async function Qi(e,t){let r,n;try{r=new(m())(t),n=r.getEntries()}catch(e){throw di("not-zip-file")}let o=n.find((e=>e.entryName.includes("db.sqlite"))),i=n.find((e=>e.entryName.includes("metadata.json")));if(!o||!i)throw di("invalid-zip-file");let a,s=r.readFile(o),u=r.readFile(i);try{a=JSON.parse(u.toString("utf8"))}catch(e){throw di("invalid-meta-file")}a={...a,cloudFileId:e.fileId,groupId:e.groupId,lastUploaded:ft(),encryptKeyId:e.encryptMeta?e.encryptMeta.keyId:null};let l=Wr(a.id);if(await tn(l)){let e=Br(l,"db.sqlite"),t=Br(l,"metadata.json");await tn(e)&&await sn(e),await tn(t)&&await sn(t)}else await rn(l);return await an(Br(l,"db.sqlite"),s),await an(Br(l,"metadata.json"),JSON.stringify(a)),{id:a.id}}async function ea(){let e=await Ve("user-token");if(!e)throw gi("unauthorized");let t=await Xi();if(null==t)return;let r,{id:n,groupId:o,budgetName:i,cloudFileId:a,encryptKeyId:s}=Eo(),u=t,l=null;if(s){let e;try{e=await Ui(t,s)}catch(e){throw gi("encrypt-failure",{isMissingKey:"missing-key"===e.message})}u=e.value,l=e.meta}a||(a=be());try{r=await Ji(Ai().SYNC_SERVER+"/upload-user-file",{method:"POST",headers:{"Content-Length":u.length,"Content-Type":"application/encrypted-file","X-ACTUAL-TOKEN":e,"X-ACTUAL-FILE-ID":a,"X-ACTUAL-NAME":encodeURIComponent(i),"X-ACTUAL-FORMAT":2,...l?{"X-ACTUAL-ENCRYPT-META":JSON.stringify(l)}:null,...o?{"X-ACTUAL-GROUP-ID":o}:null},body:u})}catch(e){if(console.log("Upload failure",e),e instanceof ai)throw gi("unauthorized"===e.reason?"unauthorized":e.reason||"network");throw gi("internal")}if("ok"!==r.status)throw gi("internal");Eo()&&Eo().id===n&&await _o({lastUploaded:ft(),cloudFileId:a,groupId:r.groupId})}async function ta(e){if(!e){let{valid:e,error:t}=await async function(){let e,t=await Ve("user-token"),{cloudFileId:r,encryptKeyId:n}=Eo();try{e=await Ei(Ai().SYNC_SERVER+"/user-get-key",{token:t,fileId:r})}catch(e){return console.log(e),{valid:!1,error:{reason:"network"}}}return{valid:e.id==n&&(null==n||Fi(n))}}();if(t)return{error:t};if(!e)return{error:{reason:"file-has-new-key"}}}let{error:t}=await async function(e){let t=await Ve("user-token"),{cloudFileId:r}=Eo();try{await Ei(Ai().SYNC_SERVER+"/reset-user-file",{token:t,fileId:r})}catch(e){return e instanceof ai?{error:{reason:"unauthorized"===e.reason?"unauthorized":"network"}}:{error:{reason:"internal"}}}if(e)try{await Ei(Ai().SYNC_SERVER+"/user-create-key",{token:t,fileId:r,keyId:e.key.getId(),keySalt:e.salt,testContent:e.testContent})}catch(e){return e instanceof ai?{error:{reason:"network"}}:{error:{reason:"internal"}}}return{}}(e);if(t)return{error:t};if(await Er((async()=>{await xa("\n DELETE FROM messages_crdt;\n DELETE FROM messages_clock;\n DELETE FROM transactions WHERE tombstone = 1;\n DELETE FROM accounts WHERE tombstone = 1;\n DELETE FROM payees WHERE tombstone = 1;\n DELETE FROM categories WHERE tombstone = 1;\n DELETE FROM category_groups WHERE tombstone = 1;\n DELETE FROM schedules WHERE tombstone = 1;\n DELETE FROM rules WHERE tombstone = 1;\n ANALYZE;\n VACUUM;\n "),await Ma()})),await _o({groupId:null,lastSyncedTimestamp:null,lastUploaded:null}),e){let{key:t}=e,{cloudFileId:r}=Eo(),n=JSON.parse(await Ve("encrypt-keys")||"{}");n[r]=t.serialize(),await $e("encrypt-keys",JSON.stringify(n)),await _o({encryptKeyId:t.getId()})}try{await ea()}catch(e){return e.reason?{error:e}:(cr(e),{error:{reason:"upload-failure"}})}finally{Ar("prefs-updated")}return{}}let ra=1e3,na="enabled";function oa(e){let t=na;switch(e){case"enabled":na="enabled";break;case"offline":na="offline";break;case"disabled":na="disabled";break;case"import":na="import";break;default:throw new Error("setSyncingMode: invalid mode: "+e)}return t}function ia(e){switch(e){case"enabled":return"enabled"===na||"offline"===na;case"disabled":return"disabled"===na||"import"===na;case"offline":return"offline"===na;case"import":return"import"===na;default:throw new Error("checkSyncingMode: invalid mode: "+e)}}function aa(e,t){let{dataset:r,row:n,column:o,value:i}=e;if("prefs"===r);else{let e;try{e=t?{sql:Fa(`UPDATE ${r} SET ${o} = ? WHERE id = ?`),params:[i,n]}:{sql:Fa(`INSERT INTO ${r} (id, ${o}) VALUES (?, ?)`),params:[n,i]},La(e.sql,e.params)}catch(t){throw new ui("invalid-schema",{error:{message:t.message,stack:t.stack},query:e})}}}async function sa(e,t){let r=[];for(let n=0;n<t.length;n+=100){let o,i=t.slice(n,n+100),a=`${e}.id`;"transactions"===e?(o="\n SELECT t.*, c.transferId AS category\n FROM transactions t\n LEFT JOIN category_mapping c ON c.id = t.category\n ",a="t.id"):o=`SELECT * FROM ${e}`,o+=" WHERE ",o+=i.map((e=>`${a} = ?`)).join(" OR ");try{let e=await La(o,i,!0);r=r.concat(e)}catch(e){throw new ui("invalid-schema",{error:{message:e.message,stack:e.stack},sql:o,params:i})}}return r}function ua(e){if(null===e)return"0:";if("number"==typeof e)return"N:"+e;if("string"==typeof e)return"S:"+e;throw new Error("Unserializable value type: "+JSON.stringify(e))}function la(e){switch(e[0]){case"0":return null;case"N":return parseFloat(e.slice(2));case"S":return e.slice(2)}throw new Error("Invalid type key for value: "+e)}let ca=[];function fa(e){return ca.push(e),()=>{ca=ca.filter((t=>t!==e))}}const da=dr((async t=>{if(ia("import"))return void function(e){Ua((()=>{for(let t=0;t<e.length;t++){let r=e[t],{dataset:n}=r;if(!r.old){try{aa(r)}catch(e){aa(r,!0)}if("prefs"===n)throw new Error("Cannot set prefs while importing")}}}))}(t);ia("enabled")&&(t=await async function(e){let t=[];for(let r=0;r<e.length;r++){let n=e[r],{dataset:o,row:i,column:a,timestamp:s}=n,u=s.toString(),l=La(Fa("SELECT timestamp FROM messages_crdt WHERE dataset = ? AND row = ? AND column = ? AND timestamp >= ?"),[o,i,a,u],!0);0===l.length?t.push(n):l[0].timestamp!==u&&t.push({...n,old:!0})}return t}(t)),t=[...t].sort(((e,t)=>{let r=e.timestamp?e.timestamp.toString():"",n=t.timestamp?t.timestamp.toString():"";return r<n?-1:r>n?1:0}));let n={};async function o(){let e=new Map;for(let t of Object.keys(n)){const r=await sa(t,n[t]);for(let n=0;n<r.length;n++){let o=r[n];kt(e,[t,o.id],o)}}return e}t.forEach((e=>{"prefs"!==e.dataset&&(null==n[e.dataset]&&(n[e.dataset]=[]),n[e.dataset].push(e.row))}));let i,a,s={},u=await o();(function(e,t){let r=Sr();if(r.undoListening&&e.length>0){!function(){Ii=Ii.slice(0,Ri+1);let e=Ii.filter((e=>"marker"===e.type));if(e.length>20){let t=e.slice(-20),r=Ii.indexOf(t[0]);Ii=Ii.slice(r),Ri=Ii.length-1}}();let{undoTag:n}=r;Ii.push({type:"messages",messages:e,oldData:t,undoTag:n}),Ri++}})(t,u),ia("enabled")&&(i=(0,r.getClock)(),a=i.merkle),Do()&&Do().startCacheBarrier(),Ua((()=>{let e=new Set;for(const n of t){const{dataset:t,row:o,column:i,timestamp:l,value:c}=n;n.old||(aa(n,Ct(u,[t,o])||e.has(t+o)),"prefs"===t?s[o]=c:e.add(t+o)),ia("enabled")&&(La(Fa("INSERT INTO messages_crdt (timestamp, dataset, row, column, value)\n VALUES (?, ?, ?, ?, ?)"),[l.toString(),t,o,i,ua(c)]),a=r.merkle.insert(a,l))}ia("enabled")&&(a=r.merkle.prune(a),La(Fa("INSERT OR REPLACE INTO messages_clock (id, clock) VALUES (1, ?)"),[(0,r.serializeClock)({...i,merkle:a})]))})),ia("enabled")&&(i.merkle=a),Object.keys(s).length>0&&(_o(s,{avoidSync:!0}),s.budgetType&&async function(t){let r=Do().meta();if(t===r.budgetType)return;r.budgetType=t,r.createdMonths=new Set;let n=Do().getNodes();Ua((()=>{for(let e of n.keys()){let[t,r]=e.split("!");t.match(/^budget\d+/)&&Do().deleteCell(t,r)}})),Do().startCacheBarrier(),Lo(e);await ii();Do().endCacheBarrier()}(s.budgetType),Ar("prefs-updated"));let l=await o();Do()&&(Bo(),ri(u,l),Do().triggerDatabaseChanges(u,l),Fo(),Do().endCacheBarrier()),ca.forEach((e=>e(u,l)));let c=wa(t.filter((e=>!e.old)));return mi.events.emit("sync",{type:"applied",tables:c,data:l,prevData:u}),t}));async function ga(e){try{await da(e)}catch(e){throw e instanceof ui&&("invalid-schema"===e.reason?mi.events.emit("sync",{type:"error",subtype:"apply-failure",meta:e.meta}):mi.events.emit("sync",{type:"error",meta:e.meta})),e}await(ba(),void(ia("enabled")&&!ia("offline")&&(_a=setTimeout(Ea,ra))))}let pa=!1,ha=[];async function ya(e){if(pa)return void await e();pa=!0;let t=[];try{await e()}finally{pa=!1,t=ha,ha=[]}t.length>0&&await ga(t)}async function ma(e){if(!pa)return ga(e);ha=ha.concat(e)}function ba(){_a&&(clearTimeout(_a),_a=null)}let _a=null;function wa(e){return e.reduce(((e,t)=>{let r="schedules_next_date"===t.dataset?"schedules":t.dataset;return e.includes(r)||e.push(r),e}),[])}const Ea=function(e){let t=null;return function(){return t||(t=async function(){let e;mi.events.emit("sync",{type:"start"});try{e=await va(null,0,null)}catch(e){return console.log(e),e instanceof ui?"out-of-sync"===e.reason?(cr(e),mi.events.emit("sync",{type:"error",subtype:"out-of-sync"})):"invalid-schema"===e.reason?mi.events.emit("sync",{type:"error",subtype:"invalid-schema"}):"decrypt-failure"===e.reason||"encrypt-failure"===e.reason?mi.events.emit("sync",{type:"error",subtype:e.reason,meta:e.meta}):mi.events.emit("sync",{type:"error"}):e instanceof ai?(console.log(e),"unauthorized"===e.reason?(mi.events.emit("sync",{type:"unauthorized"}),$e("readOnly","true")):"network-failure"===e.reason?mi.events.emit("sync",{type:"error",subtype:"network"}):mi.events.emit("sync",{type:"error",subtype:e.reason})):(cr(e),mi.events.emit("sync",{type:"error"})),{error:{message:e.message,reason:e.reason,meta:e.meta}}}let t=wa(e);return mi.events.emit("sync",{type:"success",tables:t,syncDisabled:ia("disabled")}),{messages:e}}(...arguments).finally((()=>{t=null})),t)}}();async function va(e,t,n){let{cloudFileId:o,groupId:i,lastSyncedTimestamp:a}=Eo()||{};if(ba(),ia("disabled")||ia("offline"))return[];let s=(0,r.getClock)().timestamp.toString(),u=e||a||new r.Timestamp(Date.now()-3e5,0,"0").toString(),l=function(e){return La("SELECT timestamp, dataset, row, column, value FROM messages_crdt WHERE timestamp > ?",[e],!0)}(u),c=await Ve("user-token");go.info("Syncing since",u,l.length,"(attempt: "+t+")");let f=await async function(e,t,n,o){let{encryptKeyId:i}=Eo(),a=new r.SyncProtoBuf.SyncRequest;for(let e=0;e<o.length;e++){let t=o[e],n=new r.SyncProtoBuf.MessageEnvelope;n.setTimestamp(t.timestamp.toString());let s=new r.SyncProtoBuf.Message;s.setDataset(t.dataset),s.setRow(t.row),s.setColumn(t.column),s.setValue(t.value);let u=s.serializeBinary();if(i){let e,t=new r.SyncProtoBuf.EncryptedData;try{e=await Ui(u,i)}catch(e){throw new ui("encrypt-failure",{isMissingKey:"missing-key"===e.message})}t.setData(e.value),t.setIv($i.from(e.meta.iv,"base64")),t.setAuthtag($i.from(e.meta.authTag,"base64")),n.setContent(t.serializeBinary()),n.setIsencrypted(!0)}else n.setContent(u);a.addMessages(n)}return a.setGroupid(e),a.setFileid(t),a.setKeyid(i),a.setSince(n.toString()),a.serializeBinary()}(i,o,u,l),d=await async function(e,t,r){let n,o;try{n=await bi(e,{method:"POST",body:ho?t:_i.from(t),headers:{"Content-Length":t.length,"Content-Type":"application/actual-sync",...r}})}catch(e){throw new ai("network-failure")}return o=n.arrayBuffer?_i.from(await n.arrayBuffer()):await n.buffer(),wi(n,o.toString()),o}(Ai().SYNC_SERVER+"/sync",f,{"X-ACTUAL-TOKEN":c});if(!Eo()||Eo().groupId!==i)return[];let g=await async function(e){let{encryptKeyId:t}=Eo(),n=r.SyncProtoBuf.SyncResponse.deserializeBinary(e),o=JSON.parse(n.getMerkle()),i=n.getMessagesList(),a=[];for(let e=0;e<i.length;e++){let n,o=i[e],s=r.Timestamp.parse(o.getTimestamp());if(o.getIsencrypted()){let e,i=r.SyncProtoBuf.EncryptedData.deserializeBinary(o.getContent());try{e=await Pi(qi(i.getData()),{keyId:t,algorithm:"aes-256-gcm",iv:qi(i.getIv()),authTag:qi(i.getAuthtag())})}catch(e){throw console.log(e),new ui("decrypt-failure",{isMissingKey:"missing-key"===e.message})}n=r.SyncProtoBuf.Message.deserializeBinary(e)}else n=r.SyncProtoBuf.Message.deserializeBinary(o.getContent());a.push({timestamp:s,dataset:n.getDataset(),row:n.getRow(),column:n.getColumn(),value:n.getValue()})}return{messages:a,merkle:o}}(d);go.info("Got messages from server",g.messages.length);let p=(0,r.getClock)().timestamp.toString()!==s,h=[];g.messages.length>0&&(h=await function(e){return e.forEach((e=>{r.Timestamp.recv(e.timestamp)})),Er((()=>da(e)))}(g.messages.map((e=>({...e,value:la(e.value)})))));let y=r.merkle.diff(g.merkle,(0,r.getClock)().merkle);if(null!==y){if(t>=10&&y===n||t>=100){go.info("SENT -------"),go.info(JSON.stringify(l)),go.info("RECEIVED -------"),go.info(JSON.stringify(g.messages));let e=Gi();if(console.log(t,"messages:",l.length,l.length>0?l[0]:null,"res.messages:",g.messages.length,g.messages.length>0?g.messages[0]:null,"clientId",(0,r.getClock)().timestamp.node(),"groupId",i,"diffTime:",y,y===n,"local clock:",(0,r.getClock)().timestamp.toString(),(0,r.getClock)().merkle.hash,"rebuilt hash:",e.numMessages,e.trie.hash,"server hash:",g.merkle.hash,"localTimeChanged:",p),e.trie.hash===g.merkle.hash){let e=await Wa("SELECT * FROM messages_clock");1!==e.length&&console.log("Bad number of clocks:",e.length);let t=(0,r.deserializeClock)(e[0]).merkle.hash;console.log("Merkle hash in db:",t)}throw new ui("out-of-sync")}h=h.concat(await va(new r.Timestamp(y,0,"0").toString(),p?0:t+1,y))}else await _o({lastSyncedTimestamp:(0,r.getClock)().timestamp.toString()});return h}const Sa=16384;function Ta(e,t){const r=e[t-1],n=e[t];return r?n?(r.sort_order+n.sort_order)/2:r.sort_order+Sa:n.sort_order/2}function Oa(e,t){const r=e.findIndex((e=>e.id===t)),n=e[r],o=e[r-1];let i=[];if(t&&-1!==r){if(n.sort_order-(o?o.sort_order:0)<=2){let t=r,n=Math.floor(e[t].sort_order)+Sa;for(;t<e.length&&!(n<=e[t].sort_order);)i.push({id:e[t].id,sort_order:n}),t++,n+=Sa}return{updates:i,sort_order:Ta(e,r)}}{let t;return t=e.length>0?e[e.length-1].sort_order+Sa:Sa,{updates:i,sort_order:t}}}let Aa,Ia;function Ra(){return Aa}async function Na(e){Ia&&await xr(Ia),Aa=Br(Wr(e),"db.sqlite"),ka(await Lr(Aa))}async function Da(){await xr(Ia),ka(await Lr(Aa))}async function ja(){Ia&&(await xr(Ia),ka(null))}function ka(e){Ia=e,Ba=new(Jt())({max:100})}function Ca(){return Ia}async function Ma(){let e=await Ha("SELECT * FROM messages_clock");if(e){let t=(0,r.deserializeClock)(e.clock);(0,r.setClock)(t)}else{let e=new r.Timestamp(0,0,(0,r.makeClientId)()),t=(0,r.makeClock)(e);(0,r.setClock)(t),await La("INSERT INTO messages_clock (id, clock) VALUES (?, ?)",[1,(0,r.serializeClock)(t)])}}function La(e,t,r){return jr(Ia,e,t,r)}function xa(e){kr(Ia,e)}let Ba=new(Jt())({max:100});function Fa(e){let t=Ba.get(e);if(t)return t;let r=function(e,t){return e.prepare(t)}(Ia,e);return Ba.set(e,r),r}function Ua(e){return Mr(Ia,e)}function Pa(e){return async function(e,t){0===Cr&&e.exec("BEGIN TRANSACTION"),Cr++;try{await t()}finally{Cr--,0===Cr&&e.exec("COMMIT")}}(Ia,e)}async function Wa(e,t){return La(e,t,!0)}async function Ha(e,t){const r=await La(e,t,!0);return 0===r.length?null:r[0]}function za(e,t){const r=La(e,t,!0);return 0===r.length?null:r[0]}async function Va(e,t){return La(e,t)}async function $a(e,t){return(await La("SELECT * FROM "+e+" WHERE id = ?",[t],!0))[0]}async function qa(e,t){let n=Object.keys(t).filter((e=>"id"!==e));if(null==t.id)throw new Error("update: id is required");await ma(n.map((n=>({dataset:e,row:t.id,column:n,value:t[n],timestamp:r.Timestamp.send()}))))}async function Ga(e,t){return t.id||(t={...t,id:be()}),await Ya(e,t),t.id}async function Ya(e,t){let n=Object.keys(t).filter((e=>"id"!==e));if(null==t.id)throw new Error("insert: id is required");await ma(n.map((n=>({dataset:e,row:t.id,column:n,value:t[n],timestamp:r.Timestamp.send()}))))}async function Za(e,t){await ma([{dataset:e,row:t,column:"tombstone",value:1,timestamp:r.Timestamp.send()}])}async function Ka(e,t,r){return(await La(t,r,!0)).map((t=>function(e,t,r,n){let o=e[r];if(null==o)throw new Error(`Table “${r}” does not exist`);let i=Object.keys(o),a={};for(let e=0;e<i.length;e++){let t=i[e],r=o[t];a[t]=_n(n[t],r.type)}return a}(ro,0,e,t))).filter(Boolean)}async function Ja(e,t,r){let n=await Ka(e,t,r);return n.length>0?n[0]:null}function Xa(e,t){return t.id||(t={...t,id:be()}),Ga(e,function(e,t,r,n){let o={...n},i=e[r];if(null==i)throw new Error(`Error inserting: table “${r}” does not exist`);return Object.keys(i).forEach((e=>{let t=i[e];if(null==o[e])if(void 0!==t.default)o[e]="function"==typeof t.default?t.default():t.default;else if(mn(e,t))throw new Error(`“${e}” is required for table “${r}”: ${JSON.stringify(o)}`)})),wn(e,t,r,o,{skipNull:!0})}(ro,no,e,t))}function Qa(e,t){return qa(e,function(e,t,r,n){let o={...n};if(null==e[r])throw new Error(`Error updating: table “${r}” does not exist`);return wn(e,t,r,o)}(ro,no,e,t))}async function es(){return Wa("\n SELECT c.* FROM categories c\n LEFT JOIN category_groups cg ON c.cat_group = cg.id\n WHERE c.tombstone = 0\n ORDER BY cg.sort_order, cg.id, c.sort_order, c.id\n ")}async function ts(){const e=await Wa("SELECT * FROM category_groups WHERE tombstone = 0 ORDER BY is_income, sort_order, id"),t=await Wa("\n SELECT * FROM categories WHERE tombstone = 0\n ORDER BY sort_order, id\n ");return e.map((e=>({...e,categories:t.filter((t=>t.cat_group===e.id))})))}async function rs(e){const t=await Ha("\n SELECT sort_order FROM category_groups WHERE tombstone = 0 ORDER BY sort_order DESC, id DESC LIMIT 1\n "),r=(t?t.sort_order:0)+Sa;return Ga("category_groups",e={...hn.validate(e),sort_order:r})}function ns(e){return qa("category_groups",e=hn.validate(e,{update:!0}))}async function os(e,t){const r=await Wa("SELECT id, sort_order FROM category_groups WHERE tombstone = 0 ORDER BY sort_order, id"),{updates:n,sort_order:o}=Oa(r,t);for(let e of n)await qa("category_groups",e);await qa("category_groups",{id:e,sort_order:o})}async function is(e,t){const r=await Wa("SELECT * FROM categories WHERE cat_group = ?",[e.id]);await Promise.all(r.map((e=>ls(e,t)))),await Za("category_groups",e.id)}async function as(e){let t,r,{atEnd:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{atEnd:void 0};return await ya((async()=>{if(n){const e=await Ha("\n SELECT sort_order FROM categories WHERE tombstone = 0 ORDER BY sort_order DESC, id DESC LIMIT 1\n ");t=(e?e.sort_order:0)+Sa}else{const r=await Wa("SELECT id, sort_order FROM categories WHERE cat_group = ? AND tombstone = 0 ORDER BY sort_order, id",[e.cat_group]),{updates:n,sort_order:o}=Oa(r,r.length>0?r[0].id:null);for(let e of n)await qa("categories",e);t=o}e={...pn.validate(e),sort_order:t};const o=await Ga("categories",e);await Ya("category_mapping",{id:o,transferId:o}),r=o})),r}function ss(e){return qa("categories",e=pn.validate(e,{update:!0}))}async function us(e,t,r){if(!t)throw new Error("moveCategory: groupId is required");const n=await Wa("SELECT id, sort_order FROM categories WHERE cat_group = ? AND tombstone = 0 ORDER BY sort_order, id",[t]),{updates:o,sort_order:i}=Oa(n,r);for(let e of o)await qa("categories",e);await qa("categories",{id:e,sort_order:i,cat_group:t})}async function ls(e,t){if(t){const r=await Wa("SELECT * FROM category_mapping WHERE transferId = ?",[e.id]);for(let e of r)await qa("category_mapping",{id:e.id,transferId:t});await qa("category_mapping",{id:e.id,transferId:t})}return Za("categories",e.id)}async function cs(e){return Ha("SELECT * FROM payees WHERE id = ?",[e])}async function fs(e){let t;return e=yn.validate(e),await ya((async()=>{t=await Ga("payees",e),await Ya("payee_mapping",{id:t,targetId:t})})),t}async function ds(e){let{transfer_acct:t}=await Ha("SELECT * FROM payees WHERE id = ?",[e.id]);if(!t)return Za("payees",e.id)}async function gs(e){return Za("payees",e.id)}function ps(e){return qa("payees",e=yn.validate(e,{update:!0}))}async function hs(e,t){let r=function(e){let t={};for(let r=0;r<e.length;r++){let n=e[r];t[n.id]=n}return t}(await Wa("SELECT * FROM payees"));null==r[e].transfer_acct&&(t=t.filter((e=>null==r[e].transfer_acct)),await ya((async()=>{await Promise.all(t.map((async t=>{let r=await Wa("SELECT id FROM payee_mapping WHERE targetId = ?",[t]);await Promise.all(r.map((t=>qa("payee_mapping",{id:t.id,targetId:e}))))}))),await Promise.all(t.map((t=>Promise.all([qa("payee_mapping",{id:t,targetId:e}),Za("payees",t)]))))})))}function ys(){return Wa("\n SELECT p.*, COALESCE(a.name, p.name) AS name FROM payees p\n LEFT JOIN accounts a ON (p.transfer_acct = a.id AND a.tombstone = 0)\n WHERE p.tombstone = 0 AND (p.transfer_acct IS NULL OR a.id IS NOT NULL)\n ORDER BY p.transfer_acct IS NULL DESC, p.name COLLATE NOCASE\n ")}function ms(){return Wa("\n SELECT p.id FROM payees p\n LEFT JOIN payee_mapping pm ON pm.id = p.id\n LEFT JOIN v_transactions_internal_alive t ON t.payee = pm.targetId\n WHERE p.tombstone = 0 AND p.transfer_acct IS NULL AND t.id IS NULL\n")}async function bs(){return(await Wa("\n SELECT p.id FROM payees p\n LEFT JOIN payee_mapping pm ON pm.id = p.id\n LEFT JOIN v_transactions_internal_alive t ON t.payee = pm.targetId\n WHERE p.tombstone = 0 AND p.transfer_acct IS NULL AND t.id IS NULL\n ")).map((e=>e.id))}async function _s(e){return Ha("SELECT * FROM payees WHERE UNICODE_LOWER(name) = ? AND tombstone = 0",[e.toLowerCase()])}function ws(){return Wa("SELECT a.*, b.name as bankName, b.id as bankId FROM accounts a\n LEFT JOIN banks b ON a.bank = b.id\n WHERE a.tombstone = 0\n ORDER BY sort_order, name")}async function Es(e){const t=await Wa("SELECT * FROM accounts WHERE offbudget = ? ORDER BY sort_order, name",[null!=e.offbudget?e.offbudget:0]);let{sort_order:r}=Oa(t);return Ga("accounts",e=gn.validate({...e,sort_order:r}))}function vs(e){return qa("accounts",e=gn.validate(e,{update:!0}))}function Ss(e){return Za("accounts",e.id)}async function Ts(e,t){let r,n=await Ha("SELECT * FROM accounts WHERE id = ?",[e]);r=n.closed?await Wa("SELECT id, sort_order FROM accounts WHERE closed = 1 ORDER BY sort_order, name"):await Wa("SELECT id, sort_order FROM accounts WHERE tombstone = 0 AND offbudget = ? ORDER BY sort_order, name",[n.offbudget]);const{updates:o,sort_order:i}=Oa(r,t);await ya((async()=>{for(let e of o)qa("accounts",e);qa("accounts",{id:e,sort_order:i})}))}async function Os(e){return(await Ka("transactions","SELECT * FROM v_transactions WHERE id = ?",[e]))[0]}async function As(e,t,r){throw new Error("`getTransactionsByDate` is deprecated")}async function Is(e){if(arguments.length>1)throw new Error("`getTransactions` was given a second argument, it now only takes a single argument `accountId`");return Ka("transactions","SELECT * FROM v_transactions WHERE account = ?",[e])}function Rs(e){return Xa("transactions",e)}function Ns(e){return Qa("transactions",e)}async function Ds(e){return Za("transactions",e.id)}async function js(){let e=await Ha("\n SELECT * FROM categories\n WHERE is_income = 1 AND\n LOWER(name) = 'starting balances' AND\n tombstone = 0\n ");return null===e&&(e=await Ha("SELECT * FROM categories WHERE is_income = 1 AND tombstone = 0")),{id:await async function(e){let t=await Ha("SELECT id FROM payees WHERE UNICODE_LOWER(name) = ? AND tombstone = 0",[e.toLowerCase()]);return t?t.id:fs({name:e})}("Starting Balance"),category:e?e.id:null}}const ks=new Set(["for","and","nor","but","or","yet","so","a","an","the","aboard","about","above","across","after","against","along","amid","among","anti","around","as","at","before","behind","below","beneath","beside","besides","between","beyond","but","by","concerning","considering","despite","down","during","except","excepting","excluding","following","for","from","in","inside","into","like","minus","near","of","off","on","onto","opposite","over","past","per","plus","regarding","round","save","since","than","through","to","toward","towards","under","underneath","unlike","until","up","upon","versus","via","with","within","without"]),Cs=["CLI","API","HTTP","HTTPS","JSX","DNS","URL","CI","CDN","GitHub","CSS","JS","JavaScript","TypeScript","HTML","WordPress","JavaScript","Next.js","Node.js"];let Ms="[0-9A-Za-zªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶ-ͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԣԱ-Ֆՙա-ևא-תװ-ײء-يٮ-ٯٱ-ۓەۥ-ۦۮ-ۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴ-ߵߺऄ-हऽॐक़-ॡॱ-ॲॻ-ॿঅ-ঌএ-ঐও-নপ-রলশ-হঽৎড়-ঢ়য়-ৡৰ-ৱਅ-ਊਏ-ਐਓ-ਨਪ-ਰਲ-ਲ਼ਵ-ਸ਼ਸ-ਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલ-ળવ-હઽૐૠ-ૡଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଵ-ହଽଡ଼-ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கங-சஜஞ-டண-தந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘ-ౙౠ-ౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠ-ೡഅ-ഌഎ-ഐഒ-നപ-ഹഽൠ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะา-ำเ-ๆກ-ຂຄງ-ຈຊຍດ-ທນ-ຟມ-ຣລວສ-ຫອ-ະາ-ຳຽເ-ໄໆໜ-ໝༀཀ-ཇཉ-ཬྈ-ྋက-ဪဿၐ-ၕၚ-ၝၡၥ-ၦၮ-ၰၵ-ႁႎႠ-Ⴥა-ჺჼᄀ-ᅙᅟ-ᆢᆨ-ᇹሀ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙶᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦩᧁ-ᧇᨀ-ᨖᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮ-ᮯᰀ-ᰣᱍ-ᱏᱚ-ᱽᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₔℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-Ɐⱱ-ⱽⲀ-ⳤⴀ-ⴥⴰ-ⵥⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆷㇰ-ㇿ㐀䶵一鿃ꀀ-ꒌꔀ-ꘌꘐ-ꘟꘪ-ꘫꙀ-ꙟꙢ-ꙮꙿ-ꚗꜗ-ꜟꜢ-ꞈꞋ-ꞌꟻ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꤊ-ꤥꤰ-ꥆꨀ-ꨨꩀ-ꩂꩄ-ꩋ가힣豈-鶴侮-頻並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּ-סּףּ-פּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]",Ls=new RegExp(`(?:(?:(\\s?(?:^|[.\\(\\)!?;:"-])\\s*)(${Ms}))|(${Ms}))(${Ms}*[’']*${Ms}*)`,"g"),xs=e=>e.map((e=>[new RegExp(`\\b${e}\\b`,"gi"),e]));function Bs(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{special:void 0};e=e.toLowerCase().replace(Ls,(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;const i=function(e){const t=e[0];return/\s/.test(t)?e.substr(1):/[()]/.test(t)?null:e}(e);if(!i)return e;if(!r){const e=n+o;if(ks.has(e))return i}return t+(n||r).toUpperCase()+o}));const r=t.special||[],n=[...Cs,...r];return xs(n).forEach((t=>{let[r,n]=t;e=e.replace(r,n)})),e}const Fs=new Map(Object.entries({imported_payee:"string",payee:"id",date:"date",notes:"string",amount:"number",amountInflow:"number",amountOutfow:"number",category:"id",account:"id",cleared:"boolean",saved:"saved"}));function Us(e,t){return e<t?[e,t]:[t,e]}function Ps(e){return Math.round(.075*Math.abs(e))}let Ws,Hs,zs;function Vs(e,t){t.forEach(((e,t)=>{if(-1!==t.indexOf("mapping")){let r="category_mapping"===t?"transferId":"targetId";e.forEach((e=>{Ws.set(e.id,e[r])}))}}))}function $s(){return Ws}function qs(e,t,r){let n=ft();return t?"completed":r?"paid":e===n?"due":e>n&&e<=yt(n,7)?"upcoming":e<n?"missed":"scheduled"}function Gs(e){let t={start:st(e.start),frequency:e.frequency.toUpperCase(),byHourOfDay:[12]};switch(e.interval&&(t.interval=e.interval),e.frequency){case"daily":case"weekly":case"yearly":return[t];case"monthly":if(e.patterns&&e.patterns.length>0){let r=e.patterns.filter((e=>"day"===e.type)),n=e.patterns.filter((e=>"day"!==e.type));return[r.length>0&&{...t,byDayOfMonth:r.map((e=>e.value))},n.length>0&&{...t,byDayOfWeek:n.map((e=>{return[(t=e.type,t.slice(0,2).toUpperCase()),e.value];var t}))}].filter(Boolean)}return[t];default:throw new Error("Invalid recurring date config")}}function Ys(e){return{payee:e.find((e=>"is"===e.op&&"payee"===e.field))||e.find((e=>"is"===e.op&&"description"===e.field))||null,account:e.find((e=>"is"===e.op&&"account"===e.field))||e.find((e=>"is"===e.op&&"acct"===e.field))||null,amount:e.find((e=>("is"===e.op||"isapprox"===e.op||"isbetween"===e.op)&&"amount"===e.field))||null,date:e.find((e=>("is"===e.op||"isapprox"===e.op)&&"date"===e.field))||null}}function Zs(e){return e&&"number"!=typeof e?Math.round((e.num1+e.num2)/2):e}class Ks extends Error{}class Js{constructor(e,t){if(this.metadata={},this.duration=t&&t.duration||0,this.generators=t&&t.generators&&t.generators.slice()||[],!Number.isInteger(this.duration)||this.duration<0)throw new Ks("duration must be a non-negative integer")}static set adapter(e){if(zs)throw new Error(`"${zs.name}" has already been configured.`);zs=e}static get adapter(){if(!zs)throw new Error("No date adapter has been configured. See rSchedule docs.");return zs}static isDate(e){throw Xs("isDate()")}static fromDate(e,t){throw Xs("fromDate()")}static fromJSON(e){throw Xs("fromJSON()")}static fromDateTime(e){throw Xs("fromDateTime()")}toISOString(){return this.set("timezone","UTC").toDateTime().toISOString()}toDateTime(){return tu.fromJSON(Object.assign(Object.assign({},this.toJSON()),{generators:this.generators,metadata:this.metadata}))}}function Xs(e){return new Error(`You must implement the "${e}" method for this DateAdapter class`)}var Qs;Js.hasTimezoneSupport=!1,function(e){e.WEEKDAYS=["SU","MO","TU","WE","TH","FR","SA"],e.MILLISECONDS_IN_SECOND=1e3,e.MILLISECONDS_IN_MINUTE=60*e.MILLISECONDS_IN_SECOND,e.MILLISECONDS_IN_HOUR=60*e.MILLISECONDS_IN_MINUTE,e.MILLISECONDS_IN_DAY=24*e.MILLISECONDS_IN_HOUR,e.MILLISECONDS_IN_WEEK=7*e.MILLISECONDS_IN_DAY}(Qs||(Qs={}));class eu extends Error{}class tu{constructor(e,t,r,n){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};if(this.metadata={},this.date=new Date(e),this.timezone=t||null,this.duration=r||0,this.generators=n&&n.slice()||[],!Number.isInteger(this.duration)||this.duration<0)throw new eu("duration must be a non-negative integer");o.metadata&&Object.assign(this.metadata,o.metadata),this.assertIsValid()}static fromJSON(e){const t=new Date(Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond));return new tu(t,e.timezone,e.duration,e.generators,{metadata:e.metadata})}static fromDateAdapter(e){return tu.fromJSON(Object.assign(Object.assign({},e.toJSON()),{generators:e.generators,metadata:e.metadata}))}get end(){if(this.duration)return this._end||(this._end=this.add(this.duration,"millisecond")),this._end}isEqual(e){return!!e&&(ru(this,e),this.valueOf()===e.valueOf())}isBefore(e){return ru(this,e),this.valueOf()<e.valueOf()}isBeforeOrEqual(e){return ru(this,e),this.valueOf()<=e.valueOf()}isAfter(e){return ru(this,e),this.valueOf()>e.valueOf()}isAfterOrEqual(e){return ru(this,e),this.valueOf()>=e.valueOf()}isOccurring(e){if(!this.duration)throw new Error("DateTime#isOccurring() is only applicable to DateTimes with durations");return ru(this,e),e.isAfterOrEqual(this)&&e.isBeforeOrEqual(this.add(this.duration,"millisecond"))}add(e,t){switch(t){case"generator":{const t=this.generators.slice();return t.unshift(e),new tu(this.date,this.timezone,this.duration,t)}case"year":return this.forkDateTime(du(this.date,e));case"month":return this.forkDateTime(gu(this.date,e));case"week":return this.forkDateTime(pu(this.date,e));case"day":return this.forkDateTime(hu(this.date,e));case"hour":return this.forkDateTime(yu(this.date,e));case"minute":return this.forkDateTime(mu(this.date,e));case"second":return this.forkDateTime(bu(this.date,e));case"millisecond":return this.forkDateTime(_u(this.date,e));default:throw new Error("Invalid unit provided to `DateTime#add`")}}subtract(e,t){switch(t){case"year":return this.forkDateTime(function(e,t){return du(e,-t)}(this.date,e));case"month":return this.forkDateTime(function(e,t){return gu(e,-t)}(this.date,e));case"week":return this.forkDateTime(function(e,t){return pu(e,-t)}(this.date,e));case"day":return this.forkDateTime(wu(this.date,e));case"hour":return this.forkDateTime(function(e,t){return yu(e,-t)}(this.date,e));case"minute":return this.forkDateTime(function(e,t){return mu(e,-t)}(this.date,e));case"second":return this.forkDateTime(function(e,t){return bu(e,-t)}(this.date,e));case"millisecond":return this.forkDateTime(function(e,t){return _u(e,-t)}(this.date,e));default:throw new Error("Invalid unit provided to `DateTime#subtract`")}}get(e){switch(e){case"year":return this.date.getUTCFullYear();case"month":return this.date.getUTCMonth()+1;case"yearday":return function(e){const t=new Date(Date.UTC(e.getUTCFullYear(),0,1)),r=e.valueOf()-t.valueOf();return 1+Math.floor(r/Qs.MILLISECONDS_IN_DAY)}(this.date);case"weekday":return Qs.WEEKDAYS[this.date.getUTCDay()];case"day":return this.date.getUTCDate();case"hour":return this.date.getUTCHours();case"minute":return this.date.getUTCMinutes();case"second":return this.date.getUTCSeconds();case"millisecond":return this.date.getUTCMilliseconds();default:throw new Error("Invalid unit provided to `DateTime#set`")}}set(e,t){if("duration"===e)return new tu(this.date,this.timezone,t,this.generators);if("generators"===e)return new tu(this.date,this.timezone,this.duration,t);let r=new Date(this.date);switch(e){case"year":r.setUTCFullYear(t);break;case"month":{const e=uu(t,r.getUTCFullYear());r.getUTCDate()>e?(r.setUTCDate(1),r.setUTCMonth(t),r=wu(r,1)):r.setUTCMonth(t-1);break}case"day":r.setUTCDate(t);break;case"hour":r.setUTCHours(t);break;case"minute":r.setUTCMinutes(t);break;case"second":r.setUTCSeconds(t);break;case"millisecond":r.setUTCMilliseconds(t);break;default:throw new Error("Invalid unit provided to `DateTime#set`")}return this.forkDateTime(r)}granularity(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.forkDateTime(this.date);switch(e){case"year":r=r.set("month",1);case"month":r=r.set("day",1);break;case"week":r=function(e,t){const r=iu(t).indexOf(e.get("weekday"));return e.subtract(r,"day")}(r,t.weekStart)}switch(e){case"year":case"month":case"week":case"day":r=r.set("hour",0);case"hour":r=r.set("minute",0);case"minute":r=r.set("second",0);case"second":r=r.set("millisecond",0);case"millisecond":return r;default:throw new Error("Invalid granularity provided to `DateTime#granularity`: "+e)}}endGranularity(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.forkDateTime(this.date);switch(e){case"year":r=r.set("month",12);case"month":r=r.set("day",uu(r.get("month"),r.get("year")));break;case"week":r=function(e,t){const r=iu(t).indexOf(e.get("weekday"));return e.add(6-r,"day")}(r,t.weekStart)}switch(e){case"year":case"month":case"week":case"day":r=r.set("hour",23);case"hour":r=r.set("minute",59);case"minute":r=r.set("second",59);case"second":r=r.set("millisecond",999);case"millisecond":return r;default:throw new Error("Invalid granularity provided to `DateTime#granularity`: "+e)}}toISOString(){return this.date.toISOString()}toDateTime(){return this}toJSON(){const e={timezone:this.timezone,year:this.get("year"),month:this.get("month"),day:this.get("day"),hour:this.get("hour"),minute:this.get("minute"),second:this.get("second"),millisecond:this.get("millisecond")};return this.duration&&(e.duration=this.duration),e}valueOf(){return this.date.valueOf()}assertIsValid(){if(isNaN(this.valueOf()))throw new eu("DateTime has invalid date.");return!0}forkDateTime(e){return new tu(e,this.timezone,this.duration,this.generators)}}function ru(e,t){if(e.timezone!==t.timezone)throw new eu("Attempted to compare a datetime to another date in a different timezone: "+JSON.stringify(e)+" and "+JSON.stringify(t));return!0}function nu(e,t){if(e.isAfter(t))return 1;if(e.isBefore(t))return-1;if(e.duration&&t.duration){if(e.duration>t.duration)return 1;if(e.duration<t.duration)return-1}return 0}function ou(e){return Array.from(new Map(e.map((e=>[e.toISOString(),e]))).values())}function iu(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"SU";const t=Qs.WEEKDAYS.slice();let r=t.indexOf(e);for(;0!==r;)au(t),r--;return t}function au(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"first";return 0===e.length||("first"===t?e.push(e.shift()):e.unshift(e.pop())),e}function su(e,t){if(e===t)return 0;const r=Qs.WEEKDAYS.indexOf(e)-Qs.WEEKDAYS.indexOf(t);return r>0?7-r:Math.abs(r)}function uu(e,t){return{1:31,2:lu(t),3:31,4:30,5:31,6:30,7:31,8:31,9:30,10:31,11:30,12:31}[e]}function lu(e){return function(e){return e%400==0||e%4==0&&e%100!=0}(e)?29:28}function cu(e){if(null===e||!0===e||!1===e)return NaN;const t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function fu(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");const r=e.valueOf(),n=cu(t);return new Date(r+n)}function du(e,t){return gu(e,12*cu(t))}function gu(e,t){const r=cu(t),n=(e=new Date(e)).getUTCMonth()+r,o=new Date(0);o.setUTCFullYear(e.getUTCFullYear(),n,1),o.setUTCHours(0,0,0,0);const i=uu(o.getUTCMonth()+1,o.getUTCFullYear());return e.setUTCMonth(n,Math.min(i,e.getUTCDate())),e}function pu(e,t){return hu(e,7*cu(t))}function hu(e,t){return _u(e,cu(t)*Qs.MILLISECONDS_IN_DAY)}function yu(e,t){return fu(e,cu(t)*Qs.MILLISECONDS_IN_HOUR)}function mu(e,t){return fu(e,cu(t)*Qs.MILLISECONDS_IN_MINUTE)}function bu(e,t){return fu(e,cu(t)*Qs.MILLISECONDS_IN_SECOND)}function _u(e,t){const r=cu(t),n=e.getTime();return new Date(n+r)}function wu(e,t){return hu(e,-t)}class Eu extends Error{}class vu extends Error{}function Su(e,t){return e>t?1:t>e?-1:0}function Tu(e){return JSON.parse(JSON.stringify(e))}function Ou(e,t){return e instanceof tu?e.timezone!==t?Js.adapter.fromDateTime(e).set("timezone",t).toDateTime():e:e instanceof Js?e.set("timezone",t).toDateTime():Js.adapter.fromDate(e).set("timezone",t).toDateTime()}function Au(e,t){return e.timezone!==t?Js.adapter.fromDateTime(e).set("timezone",t).toDateTime():e}class Iu extends Error{}function Ru(e){const t=Tu(e);return t.start=e.start,e.end&&(t.end=e.end),t}class Nu extends Error{}class Du{constructor(e){this.date=e}}class ju{constructor(e){this.date=e}}class ku{constructor(e,t,r){this.options=t,this.args=r,this.rules=[],this.iterator=void 0===this.options.count?this.iterate():this.args.reverse?this.iterateWithReverseCount():this.iterateWithCount(),this.options=Object.assign(Object.assign({},Tu(t)),{start:t.start,end:t.end}),this.reverse=void 0===this.options.count&&r.reverse||!1;const{start:n,end:o}=this.normalizeDateTimeArgs(r);if(void 0!==t.count?this.start=t.start:n&&t.start?this.start=n.isAfterOrEqual(t.start)?n:t.start:this.start=n||t.start,o&&t.end?this.end=o.isBeforeOrEqual(t.end)?o:t.end:this.end=o||t.end,this.args.reverse&&void 0===t.count&&!this.end)throw new Error("When iterating in reverse, the rule must have an `end` or `count` property or you must provide an `end` argument.");this.isInfinite=!this.end&&void 0===this.options.count,this.hasDuration=!!this.options.duration,this.rules=Array.isArray(e)?e:e(this)}[Symbol.iterator](){return this.iterator}next(e){return this.iterator.next(e)}*iterateWithReverseCount(){let e;const t=Array.from(this.iterateWithCount()).reverse().slice();let r=t.shift();for(;r;)if(e&&e.skipToDate&&r.isAfter(e.skipToDate))r=t.shift();else{if(e=yield r,e&&e.skipToDate&&e.skipToDate.isAfterOrEqual(r))throw new Error("A provided `skipToDate` option must be greater than the last yielded date (or smaller, in the case of reverse iteration)");r=t.shift()}}*iterateWithCount(){if(0===this.options.count)return;const e=this.iterate(),t=this.args.start||this.start;let r,n=e.next().value,o=1;for(;n&&o<=this.options.count;)if(o++,n.isBefore(t))n=e.next().value;else if(r&&r.skipToDate&&n.isBefore(r.skipToDate))n=e.next().value;else{if(r=yield n,r&&r.skipToDate&&r.skipToDate.isBeforeOrEqual(n))throw new Error("A provided `skipToDate` option must be greater than the last yielded date (or smaller, in the case of reverse iteration)");n=e.next().value}}*iterate(){let e=this.start;this.reverse&&(e=this.end);let t=this.nextDate(e);for(;t;){const e=yield this.normalizeRunOutput(t);if(e&&e.skipToDate){if(this.reverse?e.skipToDate.isAfterOrEqual(t):e.skipToDate.isBeforeOrEqual(t))throw new Error("A provided `skipToDate` option must be greater than the last yielded date (or smaller, in the case of reverse iteration)");t=this.nextDate(e.skipToDate)}else t=this.nextDate(this.reverse?t.subtract(1,"millisecond"):t.add(1,"millisecond"))}}nextDate(e){let t=this.runRules(e.set("generators",[]));if(this.isDatePastEnd(t.date))return null;let r=0;for(;t instanceof ju&&r<50;){if(t=this.runRules(t.date),this.isDatePastEnd(t.date))return null;r++}if(t instanceof ju)throw new Nu(`Failed to find a matching occurrence in ${r} iterations. Last iterated date: "${t.date.toISOString()}"`);if(this.reverse?e.isBefore(t.date):e.isAfter(t.date))throw new Nu("An error occurred in a recurrence rule. If this happened using the rSchedule provided recurrence rules, you should open an issue in the rSchedule repo. The maintainer is going to want to know how to recreate the error.");return t.date}runRules(e){let t=new Du(e);for(const e of this.rules){if(t instanceof ju)return t;t=e.run(t.date)}return t}isDatePastEnd(e){return this.reverse?e.isBefore(this.start):this.end&&e.isAfter(this.end)}normalizeRunOutput(e){return this.hasDuration?e.set("duration",this.options.duration):e}normalizeDateTimeArgs(e){return{start:e.start&&Au(e.start,this.options.start.timezone),end:e.end&&Au(e.end,this.options.start.timezone)}}}class Cu{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.timezone=void 0!==e.timezone?e.timezone:null,this.maxDuration=e.maxDuration||0}get firstDate(){if(void 0!==this._firstDate)return this._firstDate;const e=this._run().next().value;return this._firstDate=e?this.dateAdapter.fromDateTime(e):null,this._firstDate}get lastDate(){if(void 0!==this._lastDate)return this._lastDate;if(this.isInfinite)return this._lastDate=null,null;const e=this._run({reverse:!0}).next().value;return this._lastDate=e?this.dateAdapter.fromDateTime(e):null,this._lastDate}pipe(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.reduce(((e,t)=>t({base:e,timezone:this.timezone})),this)}occurrences(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Mu(this,this.normalizeOccurrencesArgs(e))}collections(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new xu(this,this.normalizeCollectionsArgs(e))}occursBetween(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=this.normalizeDateInput(e),o=this.normalizeDateInput(t);if(this.hasDuration&&!r.excludeEnds){const e=this.getMaxDuration("occursBetween",r),t=this._run({start:n.subtract(e,"millisecond"),end:o,reverse:!0});for(const e of t)if(!e.end.isBefore(n))return!0;return!1}for(const e of this._run({start:n,end:o})){if(r.excludeEnds){if(e.isEqual(n))continue;if(e.isEqual(o))break}return!0}return!1}occursOn(e){const t=this.normalizeOccursOnArgs(e);if(t.weekday){if(this.isInfinite&&!t.before)throw new Eu("When calling `occursOn()` with a `weekday` argument and an occurrence object that has infinite occurrences, you must include a `before` argument as well.");const e=t.after&&(t.excludeEnds?t.after.add(1,"day"):t.after),r=t.before&&(t.excludeEnds?t.before.subtract(1,"day"):t.before),n=this._run({start:e,end:r});let o=n.next().value;if(!o)return!1;for(;o;){if(o.get("weekday")===t.weekday)return!0;o=n.next({skipToDate:o.add(su(o.get("weekday"),t.weekday),"day").granularity("day")}).value}return!1}if(!t.date)throw new Eu('"occursOn()" must be called with either a "date" or "weekday" argument');if(this.hasDuration){const e=this.getMaxDuration("occursOn",t),r=this._run({start:t.date.subtract(e,"millisecond"),end:t.date});for(const e of r)if(!e.end.isBefore(t.date))return!e.isAfter(t.date);return!1}for(const e of this._run({start:t.date,end:t.date}))return!!e;return!1}occursAfter(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=this.normalizeDateInput(e);if(this.hasDuration&&!t.excludeStart){const e=this.getMaxDuration("occursAfter",t),n=this._run({start:r.subtract(e,"millisecond")});for(const e of n)if(!e.end.isBefore(r))return!0;return!1}for(const e of this._run({start:r}))if(!t.excludeStart||!e.isEqual(r))return!0;return!1}occursBefore(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=this.normalizeDateInput(e);if(this.hasDuration&&t.excludeStart){for(const e of this._run({end:r,reverse:!0}))if(!e.end.isAfterOrEqual(r))return!0;return!1}for(const e of this._run({end:r,reverse:!0}))if(!t.excludeStart||!e.isEqual(r))return!0;return!1}get dateAdapter(){return Js.adapter}normalizeOccurrencesArgs(e){return Object.assign(Object.assign({},e),{start:this.normalizeDateInput(e.start),end:this.normalizeDateInput(e.end)})}normalizeCollectionsArgs(e){if(void 0!==e.reverse)throw new Eu("`collections()` does not support the `reverse` option at this time.");return Object.assign(Object.assign({},e),{start:this.normalizeDateInput(e.start),end:this.normalizeDateInput(e.end)})}normalizeOccursOnArgs(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.assign(Object.assign({},e),{date:this.normalizeDateInput(e.date),after:this.normalizeDateInput(e.after),before:this.normalizeDateInput(e.before),excludeDates:e.excludeDates&&e.excludeDates.map((e=>this.normalizeDateInput(e)))})}normalizeRunArgs(e){return Object.assign(Object.assign({},e),{start:this.normalizeDateInput(e.start),end:this.normalizeDateInput(e.end)})}normalizeDateInput(e){return e?Ou(e,this.timezone):void 0}normalizeDateInputToAdapter(e){if(e)return function(e){return e instanceof tu?Js.adapter.fromDateTime(e):e instanceof Js?e:Js.adapter.fromDate(e)}(e)}normalizeRunOutput(e){return Au(e,this.timezone)}getMaxDuration(e,t){const r=t.maxDuration||this.maxDuration;if(!Number.isInteger(r))throw new Eu(`When an occurrence generator has a duration, a 'maxDuration' argument must be supplied to ${e}().`);return r}}class Mu{constructor(e,t){this.iterable=e,this.args=t,this[Symbol.iterator]=()=>this.occurrenceIterator(),this.iterator=e._run(t),this.isInfinite=e.isInfinite}next(e){return this.occurrenceIterator(e).next()}toArray(){if(this.args.end||this.args.take||!this.isInfinite)return Array.from(this.occurrenceIterator());throw new vu("OccurrenceIterator#toArray() can only be called if the iterator is not infinite, or you provide and `end` argument, or you provide a `take` argument.")}*occurrenceIterator(e){let t=this.normalizeRunArgs(e),r=this.iterator.next(t).value;for(;r;){const e=yield this.normalizeDateOutput(r);t=this.normalizeRunArgs(e),r=this.iterator.next(t).value}}normalizeRunArgs(e){return{skipToDate:this.normalizeDateInput(e&&e.skipToDate)}}normalizeDateInput(e){return e?Ou(e,this.iterable.timezone):void 0}normalizeDateOutput(e){if(e)return e?Js.adapter.fromDateTime(e):void 0}}class Lu{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0;this.dates=e,this.granularity=t,this.periodStart=r,this.periodEnd=n}}class xu{constructor(e,t){if(this.iterable=e,this.args=t,this.granularity="year",this[Symbol.iterator]=()=>this.iterator,t.granularity&&(this.granularity=t.granularity,"week"===this.granularity&&!t.weekStart))throw new Error('"week" granularity requires `weekStart` arg');if(t.weekStart&&(this.weekStart=t.weekStart),t.reverse)throw new Error("`OccurrenceGenerator#collections()` does not support iterating in reverse. Though `OccurrenceGenerator#occurrences()` does support iterating in reverse.");this.args=Object.assign(Object.assign({},t),{start:t.start||e._run().next().value,end:t.end&&this.getPeriod(t.end).end}),this.startDate=this.args.start&&this.normalizeDateOutput(this.getPeriod(this.args.start).start)||null,this.iterator=this.collectionIterator()}next(){return this.iterator.next()}toArray(){if(this.args.end||this.args.take||!this.iterable.isInfinite){const e=[];for(const t of this.collectionIterator())e.push(t);return e}throw new vu("CollectionIterator#toArray() can only be called if the iterator is not infinite, or you provide and `end` argument, or you provide a `take` argument.")}normalizeDateOutput(e){if(e)return Js.adapter.fromDateTime(e)}*collectionIterator(){if(!this.startDate)return;let e=this.occurrenceIterator(),t=e.next().value;if(!t)return;let r=this.getPeriod(this.args.start),n=[],o=0;for(;t&&(void 0===this.args.take||this.args.take>o);){for(;t&&t.isBeforeOrEqual(r.end);)n.push(t),t=e.next().value;if(yield new Lu(n.map((e=>this.normalizeDateOutput(e))),this.granularity,this.normalizeDateOutput(r.start),this.normalizeDateOutput(r.end)),!t)return;n=[],r=this.args.skipEmptyPeriods?this.getPeriod(t):this.getPeriod(this.incrementPeriod(r.period)),"month"===this.granularity&&this.weekStart&&(e=this.iterable._run({start:r.start,end:this.args.end}),t=e.next().value),o++}}getPeriod(e){let t,r,n;return"month"===this.granularity&&this.weekStart?(t=e.granularity("month").granularity("week",{weekStart:this.weekStart}),r=e.endGranularity("month").endGranularity("week",{weekStart:this.weekStart}),n=e.granularity("month")):(t=e.granularity(this.granularity,{weekStart:this.weekStart}),r=e.endGranularity(this.granularity,{weekStart:this.weekStart}),n=t),{start:t,end:r,period:n}}incrementPeriod(e){return e.add(1,this.granularity)}occurrenceIterator(){let e=this.args.start||this.iterable._run().next().value;return e?(e=this.getPeriod(e).start,this.iterable._run({start:e,end:this.args.end})):this.iterable._run(this.args)}}class Bu extends Cu{constructor(e,t){super(t),this.streams=e,this.config=t,this.timezone=t.timezone,this.streams=e.map((e=>e instanceof Bu?e:e.set("timezone",this.timezone))),this.isInfinite=this.calculateIsInfinite(),this.hasDuration=this.calculateHasDuration()}normalizeDateInput(e){if(e)return Ou(e,this.timezone)}normalizeRunOutput(e){return Au(e,this.timezone)}}class Fu{constructor(e,t){this.runArgs=t,this.stream=e._run(this.runArgs),this.next()}next(e){const{done:t,value:r}=this.stream.next(e);return this.done="boolean"!=typeof t||t,this.value=r,{done:t,value:r}}}function Uu(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(r.skipToDate&&0!==e.length){if(t.reverse?e.every((e=>e.value.isBeforeOrEqual(r.skipToDate))):e.every((e=>e.value.isAfterOrEqual(r.skipToDate))))throw new Error("A provided `skipToDate` option must be greater than the last yielded date (or smaller, in the case of reverse iteration)");for(const n of e)n.done||(t.reverse?n.value.isBeforeOrEqual(r.skipToDate):n.value.isAfterOrEqual(r.skipToDate))||n.next(r)}}function Pu(e,t){return e.done&&t.done?0:e.done?1:t.done?-1:e.value.isAfter(t.value)?1:-1}function Wu(e,t){return e.done&&t.done?0:e.done?-1:t.done?1:e.value.isAfter(t.value)?-1:1}function Hu(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Uu(e,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}),e.sort(t.reverse?Wu:Pu).filter((e=>!e.done)).shift()}function zu(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return e=>new Vu(t,e)}class Vu extends Bu{set(e,t){return new Vu(this.streams.map((e=>e.set("timezone",t))),Object.assign(Object.assign({},this.config),{base:this.config.base&&this.config.base.set("timezone",t),timezone:t}))}_run(){var e=this;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function*(){const r=e.streams.map((e=>new Fu(e,t)));if(e.config.base&&r.push(new Fu(e.config.base,t)),0===r.length)return;let n=Hu(r,t);for(;n&&!n.done;){const o=yield e.normalizeRunOutput(n.value);o&&o.skipToDate||n.next(),n=Hu(r,t,o)}}()}calculateIsInfinite(){return this.config.base&&this.config.base.isInfinite||this.streams.some((e=>e.isInfinite))}calculateHasDuration(){const e=this.streams.every((e=>e.hasDuration));return this.config.base?this.config.base.hasDuration&&e:e}}class $u extends Cu{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(e),this.adapters=[],this.isInfinite=!1,this.maxDuration=0,this.datetimes=[],this.data=e.data,e.dates&&(this.adapters=e.dates.map((t=>{let r=this.normalizeDateInputToAdapter(t);return e.duration&&!r.duration&&(r=r.set("duration",e.duration)),r.set("timezone",this.timezone)})),this.datetimes=this.adapters.map((e=>e.toDateTime()))),this.hasDuration=this.datetimes.every((e=>!!e.duration)),this.hasDuration&&(this.maxDuration=this.adapters.reduce(((e,t)=>t.duration>e?t.duration:e),0))}get length(){return this.adapters.length}get firstDate(){return this.adapters[0]||null}get lastDate(){return this.adapters[this.length-1]||null}occurrences(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Mu(this,this.normalizeOccurrencesArgs(e))}collections(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new xu(this,this.normalizeCollectionsArgs(e))}add(e){return new $u({dates:[...this.adapters,e],timezone:this.timezone,data:this.data})}remove(e){const t=this.adapters.slice(),r=this.normalizeDateInputToAdapter(e),n=t.findIndex((e=>e.valueOf()===r.valueOf()));return n>=0&&t.splice(n,1),new $u({dates:t,timezone:this.timezone,data:this.data})}set(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=this.timezone,o=this.adapters.slice();if("timezone"===e){if(t===this.timezone)return this;r.keepLocalTime&&(o=this.adapters.map((e=>{const r=e.toJSON();return r.timezone=t,this.dateAdapter.fromJSON(r)}))),n=t}else if("dates"===e)o=t;else{if("duration"!==e)throw new Eu(`Unexpected prop argument "${e}". Accepted values are "timezone" or "dates"`);o=o.map((e=>e.set("duration",t||0)))}return new $u({dates:o,data:this.data,timezone:n})}filter(e){return new $u({dates:this.adapters.filter(e),data:this.data,timezone:this.timezone})}_run(){var e=this;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function*(){let r=e.datetimes.sort(nu);t.start&&(r=r.filter((e=>e.isAfterOrEqual(t.start)))),t.end&&(r=r.filter((e=>e.isBeforeOrEqual(t.end)))),t.reverse&&(r=r.slice().reverse()),t.take&&(r=r.slice(0,t.take));const n=r.slice();let o,i=n.shift();for(;i;)if(o&&o.skipToDate&&(t.reverse?o.skipToDate.isBefore(i):o.skipToDate.isAfter(i)))i=n.shift();else{if(i=i.add(e,"generator"),o=yield e.normalizeRunOutput(i),o&&o.skipToDate&&(t.reverse?o.skipToDate.isAfterOrEqual(i):o.skipToDate.isBeforeOrEqual(i)))throw new Error("A provided `skipToDate` option must be greater than the last yielded date (or smaller, in the case of reverse iteration)");i=n.shift()}}()}}class qu extends Error{}let Gu;class Yu{constructor(e,t){if(this.metadata={},this.duration=t&&t.duration||0,this.generators=t&&t.generators&&t.generators.slice()||[],!Number.isInteger(this.duration)||this.duration<0)throw new qu("duration must be a non-negative integer")}static set adapter(e){if(Gu)throw new Error(`"${Gu.name}" has already been configured.`);Gu=e}static get adapter(){if(!Gu)throw new Error("No date adapter has been configured. See rSchedule docs.");return Gu}static isDate(e){throw Zu("isDate()")}static fromDate(e,t){throw Zu("fromDate()")}static fromJSON(e){throw Zu("fromJSON()")}static fromDateTime(e){throw Zu("fromDateTime()")}toISOString(){return this.set("timezone","UTC").toDateTime().toISOString()}toDateTime(){return Xu.fromJSON(Object.assign(Object.assign({},this.toJSON()),{generators:this.generators,metadata:this.metadata}))}}function Zu(e){return new Error(`You must implement the "${e}" method for this DateAdapter class`)}var Ku;Yu.hasTimezoneSupport=!1,function(e){e.WEEKDAYS=["SU","MO","TU","WE","TH","FR","SA"],e.MILLISECONDS_IN_SECOND=1e3,e.MILLISECONDS_IN_MINUTE=60*e.MILLISECONDS_IN_SECOND,e.MILLISECONDS_IN_HOUR=60*e.MILLISECONDS_IN_MINUTE,e.MILLISECONDS_IN_DAY=24*e.MILLISECONDS_IN_HOUR,e.MILLISECONDS_IN_WEEK=7*e.MILLISECONDS_IN_DAY}(Ku||(Ku={}));class Ju extends Error{}class Xu{constructor(e,t,r,n){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};if(this.metadata={},this.date=new Date(e),this.timezone=t||null,this.duration=r||0,this.generators=n&&n.slice()||[],!Number.isInteger(this.duration)||this.duration<0)throw new Ju("duration must be a non-negative integer");o.metadata&&Object.assign(this.metadata,o.metadata),this.assertIsValid()}static fromJSON(e){const t=new Date(Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond));return new Xu(t,e.timezone,e.duration,e.generators,{metadata:e.metadata})}static fromDateAdapter(e){return Xu.fromJSON(Object.assign(Object.assign({},e.toJSON()),{generators:e.generators,metadata:e.metadata}))}get end(){if(this.duration)return this._end||(this._end=this.add(this.duration,"millisecond")),this._end}isEqual(e){return!!e&&(Qu(this,e),this.valueOf()===e.valueOf())}isBefore(e){return Qu(this,e),this.valueOf()<e.valueOf()}isBeforeOrEqual(e){return Qu(this,e),this.valueOf()<=e.valueOf()}isAfter(e){return Qu(this,e),this.valueOf()>e.valueOf()}isAfterOrEqual(e){return Qu(this,e),this.valueOf()>=e.valueOf()}isOccurring(e){if(!this.duration)throw new Error("DateTime#isOccurring() is only applicable to DateTimes with durations");return Qu(this,e),e.isAfterOrEqual(this)&&e.isBeforeOrEqual(this.add(this.duration,"millisecond"))}add(e,t){switch(t){case"generator":{const t=this.generators.slice();return t.unshift(e),new Xu(this.date,this.timezone,this.duration,t)}case"year":return this.forkDateTime(al(this.date,e));case"month":return this.forkDateTime(sl(this.date,e));case"week":return this.forkDateTime(ul(this.date,e));case"day":return this.forkDateTime(ll(this.date,e));case"hour":return this.forkDateTime(cl(this.date,e));case"minute":return this.forkDateTime(fl(this.date,e));case"second":return this.forkDateTime(dl(this.date,e));case"millisecond":return this.forkDateTime(gl(this.date,e));default:throw new Error("Invalid unit provided to `DateTime#add`")}}subtract(e,t){switch(t){case"year":return this.forkDateTime(function(e,t){return al(e,-t)}(this.date,e));case"month":return this.forkDateTime(function(e,t){return sl(e,-t)}(this.date,e));case"week":return this.forkDateTime(function(e,t){return ul(e,-t)}(this.date,e));case"day":return this.forkDateTime(pl(this.date,e));case"hour":return this.forkDateTime(function(e,t){return cl(e,-t)}(this.date,e));case"minute":return this.forkDateTime(function(e,t){return fl(e,-t)}(this.date,e));case"second":return this.forkDateTime(function(e,t){return dl(e,-t)}(this.date,e));case"millisecond":return this.forkDateTime(function(e,t){return gl(e,-t)}(this.date,e));default:throw new Error("Invalid unit provided to `DateTime#subtract`")}}get(e){switch(e){case"year":return this.date.getUTCFullYear();case"month":return this.date.getUTCMonth()+1;case"yearday":return function(e){const t=new Date(Date.UTC(e.getUTCFullYear(),0,1)),r=e.valueOf()-t.valueOf();return 1+Math.floor(r/Ku.MILLISECONDS_IN_DAY)}(this.date);case"weekday":return Ku.WEEKDAYS[this.date.getUTCDay()];case"day":return this.date.getUTCDate();case"hour":return this.date.getUTCHours();case"minute":return this.date.getUTCMinutes();case"second":return this.date.getUTCSeconds();case"millisecond":return this.date.getUTCMilliseconds();default:throw new Error("Invalid unit provided to `DateTime#set`")}}set(e,t){if("duration"===e)return new Xu(this.date,this.timezone,t,this.generators);if("generators"===e)return new Xu(this.date,this.timezone,this.duration,t);let r=new Date(this.date);switch(e){case"year":r.setUTCFullYear(t);break;case"month":{const e=rl(t,r.getUTCFullYear());r.getUTCDate()>e?(r.setUTCDate(1),r.setUTCMonth(t),r=pl(r,1)):r.setUTCMonth(t-1);break}case"day":r.setUTCDate(t);break;case"hour":r.setUTCHours(t);break;case"minute":r.setUTCMinutes(t);break;case"second":r.setUTCSeconds(t);break;case"millisecond":r.setUTCMilliseconds(t);break;default:throw new Error("Invalid unit provided to `DateTime#set`")}return this.forkDateTime(r)}granularity(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.forkDateTime(this.date);switch(e){case"year":r=r.set("month",1);case"month":r=r.set("day",1);break;case"week":r=function(e,t){const r=el(t).indexOf(e.get("weekday"));return e.subtract(r,"day")}(r,t.weekStart)}switch(e){case"year":case"month":case"week":case"day":r=r.set("hour",0);case"hour":r=r.set("minute",0);case"minute":r=r.set("second",0);case"second":r=r.set("millisecond",0);case"millisecond":return r;default:throw new Error("Invalid granularity provided to `DateTime#granularity`: "+e)}}endGranularity(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.forkDateTime(this.date);switch(e){case"year":r=r.set("month",12);case"month":r=r.set("day",rl(r.get("month"),r.get("year")));break;case"week":r=function(e,t){const r=el(t).indexOf(e.get("weekday"));return e.add(6-r,"day")}(r,t.weekStart)}switch(e){case"year":case"month":case"week":case"day":r=r.set("hour",23);case"hour":r=r.set("minute",59);case"minute":r=r.set("second",59);case"second":r=r.set("millisecond",999);case"millisecond":return r;default:throw new Error("Invalid granularity provided to `DateTime#granularity`: "+e)}}toISOString(){return this.date.toISOString()}toDateTime(){return this}toJSON(){const e={timezone:this.timezone,year:this.get("year"),month:this.get("month"),day:this.get("day"),hour:this.get("hour"),minute:this.get("minute"),second:this.get("second"),millisecond:this.get("millisecond")};return this.duration&&(e.duration=this.duration),e}valueOf(){return this.date.valueOf()}assertIsValid(){if(isNaN(this.valueOf()))throw new Ju("DateTime has invalid date.");return!0}forkDateTime(e){return new Xu(e,this.timezone,this.duration,this.generators)}}function Qu(e,t){if(e.timezone!==t.timezone)throw new Ju("Attempted to compare a datetime to another date in a different timezone: "+JSON.stringify(e)+" and "+JSON.stringify(t));return!0}function el(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"SU";const t=Ku.WEEKDAYS.slice();let r=t.indexOf(e);for(;0!==r;)tl(t),r--;return t}function tl(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"first";return 0===e.length||("first"===t?e.push(e.shift()):e.unshift(e.pop())),e}function rl(e,t){return{1:31,2:nl(t),3:31,4:30,5:31,6:30,7:31,8:31,9:30,10:31,11:30,12:31}[e]}function nl(e){return function(e){return e%400==0||e%4==0&&e%100!=0}(e)?29:28}function ol(e){if(null===e||!0===e||!1===e)return NaN;const t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function il(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");const r=e.valueOf(),n=ol(t);return new Date(r+n)}function al(e,t){return sl(e,12*ol(t))}function sl(e,t){const r=ol(t),n=(e=new Date(e)).getUTCMonth()+r,o=new Date(0);o.setUTCFullYear(e.getUTCFullYear(),n,1),o.setUTCHours(0,0,0,0);const i=rl(o.getUTCMonth()+1,o.getUTCFullYear());return e.setUTCMonth(n,Math.min(i,e.getUTCDate())),e}function ul(e,t){return ll(e,7*ol(t))}function ll(e,t){return gl(e,ol(t)*Ku.MILLISECONDS_IN_DAY)}function cl(e,t){return il(e,ol(t)*Ku.MILLISECONDS_IN_HOUR)}function fl(e,t){return il(e,ol(t)*Ku.MILLISECONDS_IN_MINUTE)}function dl(e,t){return il(e,ol(t)*Ku.MILLISECONDS_IN_SECOND)}function gl(e,t){const r=ol(t),n=e.getTime();return new Date(n+r)}function pl(e,t){return ll(e,-t)}function hl(e,t){return e.timezone!==t?Yu.adapter.fromDateTime(e).set("timezone",t).toDateTime():e}class yl extends Cu{constructor(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};super(r),this.recurrenceRules=e,this.options=Ru(t),this.normOptions=function(e,t){const r=function(e){let t,r;if(e.start instanceof tu)t=e.start;else if(e.start instanceof Js)t=e.start.toDateTime();else{if(!Js.adapter.isDate(e.start))throw new Iu('"start" must be either a `DateAdapter` instance or an instance of the date a DateAdapter is wrapping (e.g. `StandardDateAdapter` wraps a `Date`)');t=Js.adapter.fromDate(e.start).toDateTime()}if(e.end)if(e.end instanceof tu)r=e.end;else if(e.end instanceof Js)r=e.end.toDateTime();else{if(!Js.adapter.isDate(e.end))throw new Iu('"end" must be either be `undefined`, a `DateAdapter` instance, or an instance of the date a DateAdapter is wrapping (e.g. `StandardDateAdapter` wraps a `Date`)');r=Js.adapter.fromDate(e.end).toDateTime()}if(void 0!==e.duration){if(!Number.isInteger(e.duration))throw new Iu('"duration" expects a whole number');if(e.duration<=0)throw new Iu('"duration" must be greater than 0')}if(void 0!==e.count){if(!Number.isInteger(e.count))throw new Iu('"count" must be a whole number');if(e.count<0)throw new Iu('"count" must be greater than 0')}if(void 0!==e.end&&void 0!==e.count)throw new Iu('"end" and "count" cannot both be present');return{start:t,end:r,count:e.count,duration:e.duration}}(t),n=Tu(t);return e.forEach((e=>{e.normalizeOptions(n,r)})),Object.keys(r).forEach((e=>{void 0===r[e]&&delete r[e]})),r}(this.recurrenceRules,this.options),this.timezone=void 0!==r.timezone?r.timezone:this.normOptions.start.timezone,this.data=r.data,this.hasDuration=!!t.duration,this.hasDuration&&(this.duration=t.duration),this.isInfinite=void 0===this.normOptions.end&&void 0===this.normOptions.count}occurrences(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Mu(this,this.normalizeOccurrencesArgs(e))}collections(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new xu(this,this.normalizeCollectionsArgs(e))}_run(){var e=this;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function*(){const r=e.normalizeRunArgs(t),n=new ku((o=e.recurrenceRules,e=>o.reduce(((t,r)=>{const n=r.get(e);return n&&t.push(n),t}),[])),e.normOptions,r);var o;let i=n.next().value,a=0;for(;i&&(void 0===r.take||a<r.take);){a++,i=i.add(e,"generator");const t=yield e.normalizeRunOutput(i);i=(null==t?void 0:t.skipToDate)?n.next(Object.assign(Object.assign({},t),{skipToDate:hl(t.skipToDate,n.start.timezone)})).value:n.next(t).value}}()}}class ml extends yl{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(ml.recurrenceRules,e,t)}set(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=Ru(this.options),o=this.timezone;if("timezone"===e){if(t===this.timezone&&!r.keepLocalTime)return this;if(r.keepLocalTime){const e=this.normalizeDateInput(n.start).toJSON();e.timezone=t;const r=this.dateAdapter.fromJSON(e);n.start=n.start instanceof this.dateAdapter?r:n.start instanceof tu?r.toDateTime():r.date}o=t}else"options"===e?n=t:n[e]=t;return new ml(n,{data:this.data,maxDuration:this.maxDuration,timezone:o})}}ml.recurrenceRules=[];class bl extends Cu{constructor(e){super(e),this.data=e.data}occurrences(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Mu(this,this.normalizeOccurrencesArgs(e))}collections(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new xu(this,this.normalizeCollectionsArgs(e))}_run(){var e=this;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function*(){const r=t.take;delete t.take;const n=e.occurrenceStream._run(t);let o=n.next().value,i=0;for(;o&&(void 0===r||r>i);){o=o.add(e,"generator");const t=yield e.normalizeRunOutput(o);o=n.next(t).value,i++}}()}}function _l(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return e=>new wl(t,e)}class wl extends Bu{set(e,t){return new wl(this.streams.map((e=>e.set("timezone",t))),Object.assign(Object.assign({},this.config),{base:this.config.base&&this.config.base.set("timezone",t),timezone:t}))}_run(){var e=this;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function*(){if(!e.config.base)return;const r=new Fu(e.config.base,t),n=new Fu(new Vu(e.streams,{timezone:e.config.timezone}),t);for(El(r,n,t);!r.done;){const o=yield e.normalizeRunOutput(r.value);o&&o.skipToDate||r.next(),El(r,n,t,o)}}()}calculateIsInfinite(){return!(!this.config.base||!this.config.base.isInfinite)}calculateHasDuration(){return!(!this.config.base||!this.config.base.hasDuration)}}function El(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};for(Uu([e,t],r,arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}),vl(e,t,r);!e.done&&!t.done&&e.value.isEqual(t.value);)e.next(),vl(e,t,r)}function vl(e,t){if((arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).reverse)for(;!t.done&&!e.done&&t.value.isAfter(e.value);)t.next();else for(;!t.done&&!e.done&&t.value.isBefore(e.value);)t.next()}class Sl extends Bu{set(e,t){return new Sl([],Object.assign(Object.assign({},this.config),{base:this.config.base&&this.config.base.set("timezone",t),timezone:t}))}_run(){var e=this;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function*(){if(!e.config.base)return;const r=new Fu(e.config.base,t);for(;!r.done;){const t=yield e.normalizeRunOutput(r.value),n=r.value;for(r.next(t);(!t||!t.skipToDate)&&!r.done&&r.value.isEqual(n);)r.next()}}()}calculateIsInfinite(){return!(!this.config.base||!this.config.base.isInfinite)}calculateHasDuration(){return!(!this.config.base||!this.config.base.hasDuration)}}class Tl extends bl{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(e),this.rrules=[],this.exrules=[];for(const t of["rrules","exrules"]){const r=e[t];r&&(this[t]=r.map((e=>e instanceof ml?e.set("timezone",this.timezone):new ml(e,{timezone:this.timezone}))))}for(const t of["rdates","exdates"]){const r=e[t];this[t]=r?r instanceof $u?r.set("timezone",this.timezone):new $u({dates:r,timezone:this.timezone}):new $u({timezone:this.timezone})}this.hasDuration=this.rrules.every((e=>e.hasDuration))&&this.exrules.every((e=>e.hasDuration))&&this.rdates.hasDuration&&this.exdates.hasDuration,this.isInfinite=this.rrules.some((e=>e.isInfinite)),this.occurrenceStream=[zu(...this.rrules),_l(...this.exrules),zu(this.rdates),_l(this.exdates),e=>new Sl([],e)].reduce(((e,t)=>t({base:e,timezone:this.timezone})),void 0)}add(e,t){const r=this.rrules.slice(),n=this.exrules.slice();let o=this.rdates,i=this.exdates;switch(e){case"rrule":r.push(t);break;case"exrule":n.push(t);break;case"rdate":o=this.rdates.add(t);break;case"exdate":i=this.exdates.add(t)}return new Tl({timezone:this.timezone,data:this.data,rrules:r,exrules:n,rdates:o,exdates:i})}remove(e,t){let r=this.rrules,n=this.exrules,o=this.rdates,i=this.exdates;switch(e){case"rrule":r=r.filter((e=>e!==t));break;case"exrule":n=n.filter((e=>e!==t));break;case"rdate":o=this.rdates.remove(t);break;case"exdate":i=this.exdates.remove(t)}return new Tl({timezone:this.timezone,data:this.data,rrules:r,exrules:n,rdates:o,exdates:i})}set(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=this.timezone,o=this.rrules,i=this.exrules,a=this.rdates,s=this.exdates;switch(e){case"timezone":if(t===this.timezone&&!r.keepLocalTime)return this;r.keepLocalTime&&(o=o.map((e=>e.set("timezone",t,r))),i=i.map((e=>e.set("timezone",t,r))),a=a.set("timezone",t,r),s=s.set("timezone",t,r)),n=t;break;case"rrules":o=t;break;case"exrules":i=t;break;case"rdates":a=t;break;case"exdates":s=t}return new Tl({timezone:n,data:this.data,rrules:o,exrules:i,rdates:a,exdates:s})}}class Ol{constructor(e){this.processor=e,this.start=e.start,this.end=e.end,this.options=e.options}}class Al extends Ol{constructor(e,t){super(e),this.initDate=t,this.intervalUnit=function(e){switch(e){case"YEARLY":return"year";case"MONTHLY":return"month";case"WEEKLY":return"week";case"DAILY":return"day";case"HOURLY":return"hour";case"MINUTELY":return"minute";case"SECONDLY":return"second";case"MILLISECONDLY":return"millisecond";default:throw new Error("unknown freq passed to freqToGranularity()")}}(this.options.frequency),this.firstIntervalStartDate=this.normalizedStartDate(this.options.start),this.intervalStartDate=this.firstIntervalStartDate,this.intervalEndDate=this.normalizedEndDate(this.firstIntervalStartDate),this.skipToInterval(this.initDate)}run(e){return this.validateDate(new Du(e))}validateDate(e){const{date:t}=e;return e instanceof Du&&this.dateIsWithinInterval(t)?e:(this.skipToInterval(t),new ju(this.dateIsWithinInterval(t)?t:this.setToCurrentInterval()))}setToCurrentInterval(){return this.intervalStartDate}normalizedStartDate(e){return"WEEKLY"===this.options.frequency?e.granularity("week",{weekStart:this.options.weekStart}):e.granularity(this.intervalUnit)}normalizedEndDate(e){switch(this.options.frequency){case"YEARLY":return e.add(1,"year");case"MONTHLY":return e.add(1,"month");case"WEEKLY":return e.add(1,"week");case"DAILY":return e.add(1,"day");case"HOURLY":return e.add(1,"hour");case"MINUTELY":return e.add(1,"minute");case"SECONDLY":return e.add(1,"second");case"MILLISECONDLY":return e.add(1,"millisecond");default:throw new Error(`Unknown frequency ${this.options.frequency}`)}}skipToInterval(e){const t=this.intervalDifference(e);this.intervalStartDate=this.firstIntervalStartDate.add(t,this.intervalUnit),this.intervalEndDate=this.normalizedEndDate(this.intervalStartDate)}dateIsWithinInterval(e){return this.intervalStartDate.isBeforeOrEqual(e)&&this.intervalEndDate.isAfter(e)}intervalDifference(e){return Il({first:this.firstIntervalStartDate,second:e,unit:this.intervalUnit,interval:this.options.interval,weekStart:this.options.weekStart,direction:"after"})}}function Il(e){let{first:t,second:r,unit:n,interval:o,weekStart:i,direction:a}=e,s=(()=>{let e,o;switch(n){case"year":return o=12*(r.get("year")-t.get("year")),o=o+r.get("month")-t.get("month"),Math.floor(o/12);case"month":return o=12*(r.get("year")-t.get("year")),o=o+r.get("month")-t.get("month"),o;case"week":t=t.granularity("week",{weekStart:i}),e=Qs.MILLISECONDS_IN_WEEK;break;case"day":e=Qs.MILLISECONDS_IN_DAY;break;case"hour":e=Qs.MILLISECONDS_IN_HOUR;break;case"minute":e=Qs.MILLISECONDS_IN_MINUTE;break;case"second":e=Qs.MILLISECONDS_IN_SECOND;break;case"millisecond":e=1;break;default:throw new Error("Unexpected `unit` value")}const a=r.valueOf()-t.valueOf();return Math.floor(a/e)})();return s=("after"===a?Math.ceil:Math.floor)(s/o)*o,s}class Rl extends Al{setToCurrentInterval(){return this.intervalEndDate.subtract(1,"millisecond")}intervalDifference(e){return Il({first:this.firstIntervalStartDate,second:e,unit:this.intervalUnit,interval:this.options.interval,weekStart:this.options.weekStart,direction:"before"})}}const Nl=["MILLISECONDLY","SECONDLY","MINUTELY","HOURLY","DAILY","WEEKLY","MONTHLY","YEARLY"],Dl={name:"FrequencyRule",get:e=>void 0!==e.options.byMillisecondOfSecond||"MILLISECONDLY"!==e.options.frequency?null:e.reverse?new Rl(e,e.end):new Al(e,e.start),normalizeOptions:(e,t)=>{if(!Nl.includes(e.frequency))throw new Iu(`"frequency" must be one of ${JSON.stringify(Nl)}`);if(void 0!==e.interval){if(!Number.isInteger(e.interval))throw new Iu('"interval" expects a whole number');if(e.interval<1)throw new Iu('"interval" cannot be less than 1')}if(void 0!==e.weekStart&&!Qs.WEEKDAYS.includes(e.weekStart))throw new Iu(`"weekStart" must be one of ${JSON.stringify(Qs.WEEKDAYS)}`);t.frequency=e.frequency,t.interval=e.interval||1,t.weekStart=e.weekStart||"MO"},deps:()=>[Dl]};function jl(e){return Array.isArray(e)&&e.length>0}const kl=new WeakMap;class Cl extends Ol{constructor(e){super(e),kl.has(this.processor)||kl.set(this.processor,new Al(e,e.start)),this.frequency=kl.get(this.processor)}validateDate(e){return this.frequency.validateDate(e)}}class Ml extends Ol{constructor(e){super(e),kl.has(this.processor)||kl.set(this.processor,new Rl(e,e.end)),this.frequency=kl.get(this.processor)}validateDate(e){return this.frequency.validateDate(e)}}class Ll extends Ml{run(e){const t=e.get(this.granularity);for(const r of this.option)if(!(t<r))return t===r?this.validateDate(new Du(e)):this.validateDate(new ju(e.endGranularity(this.baseGranularity).set(this.granularity,r)));return this.validateDate(new ju(e.endGranularity(this.baseGranularity).subtract(1,this.baseGranularity).set(this.granularity,this.option[0])))}}class xl extends Ll{constructor(){super(...arguments),this.baseGranularity="second",this.granularity="millisecond",this.option=this.options.byMillisecondOfSecond.slice().reverse()}}class Bl extends Cl{run(e){const t=e.get(this.granularity);for(const r of this.option)if(!(t>r))return t===r?this.validateDate(new Du(e)):this.validateDate(new ju(e.granularity(this.baseGranularity).set(this.granularity,r)));return this.validateDate(new ju(e.granularity(this.baseGranularity).add(1,this.baseGranularity).set(this.granularity,this.option[0])))}}class Fl extends Bl{constructor(){super(...arguments),this.baseGranularity="second",this.granularity="millisecond",this.option=this.options.byMillisecondOfSecond}}const Ul={name:"ByMillisecondOfSecond",get:e=>void 0===e.options.byMillisecondOfSecond?null:e.reverse?new xl(e):new Fl(e),normalizeOptions:(e,t)=>{if(void 0!==e.byMillisecondOfSecond){if(!jl(e.byMillisecondOfSecond))throw new Iu('"byMillisecondOfSecond" expects a non-empty array');if(e.byMillisecondOfSecond.some((e=>e<0||e>999)))throw new Iu('"byMillisecondOfSecond" values must be >= 0 && <= 999');t.byMillisecondOfSecond=e.byMillisecondOfSecond,t.byMillisecondOfSecond.sort(Su)}else"MILLISECONDLY"!==e.frequency&&(t.byMillisecondOfSecond=[t.start.get("millisecond")])},deps:()=>[Dl,Ul]};class Pl extends Ll{constructor(){super(...arguments),this.baseGranularity="minute",this.granularity="second",this.option=this.options.bySecondOfMinute.slice().reverse()}}class Wl extends Bl{constructor(){super(...arguments),this.baseGranularity="minute",this.granularity="second",this.option=this.options.bySecondOfMinute}}const Hl={name:"BySecondOfMinute",get:e=>void 0===e.options.bySecondOfMinute?null:e.reverse?new Pl(e):new Wl(e),normalizeOptions:(e,t)=>{if(void 0!==e.bySecondOfMinute){if(!jl(e.bySecondOfMinute))throw new Iu('"bySecondOfMinute" expects a non-empty array');if(e.bySecondOfMinute.some((e=>e<0||e>60)))throw new Iu('"bySecondOfMinute" values must be >= 0 && <= 60');t.bySecondOfMinute=e.bySecondOfMinute,t.bySecondOfMinute.sort(Su)}else["SECONDLY","MILLISECONDLY"].includes(e.frequency)||(t.bySecondOfMinute=[t.start.get("second")])},deps:()=>[Dl,Hl,Ul]};class zl extends Ll{constructor(){super(...arguments),this.baseGranularity="hour",this.granularity="minute",this.option=this.options.byMinuteOfHour.slice().reverse()}}class Vl extends Bl{constructor(){super(...arguments),this.baseGranularity="hour",this.granularity="minute",this.option=this.options.byMinuteOfHour}}const $l={name:"ByMinuteOfHour",get:e=>void 0===e.options.byMinuteOfHour?null:e.reverse?new zl(e):new Vl(e),normalizeOptions:(e,t)=>{if(void 0!==e.byMinuteOfHour){if(!jl(e.byMinuteOfHour))throw new Iu('"byMinuteOfHour" expects a non-empty array');if(e.byMinuteOfHour.some((e=>e<0||e>59)))throw new Iu('"byMinuteOfHour" values must be >= 0 && <= 59');t.byMinuteOfHour=e.byMinuteOfHour,t.byMinuteOfHour.sort(Su)}else["MINUTELY","SECONDLY","MILLISECONDLY"].includes(e.frequency)||(t.byMinuteOfHour=[t.start.get("minute")])},deps:()=>[Dl,$l,Hl,Ul]};class ql extends Ll{constructor(){super(...arguments),this.baseGranularity="day",this.granularity="hour",this.option=this.options.byHourOfDay.slice().reverse()}}class Gl extends Bl{constructor(){super(...arguments),this.baseGranularity="day",this.granularity="hour",this.option=this.options.byHourOfDay}}const Yl={name:"ByHourOfDay",get:e=>void 0===e.options.byHourOfDay?null:e.reverse?new ql(e):new Gl(e),normalizeOptions:(e,t)=>{if(void 0!==e.byHourOfDay){if(!jl(e.byHourOfDay))throw new Iu('"byHourOfDay" expects a non-empty array');if(e.byHourOfDay.some((e=>e<0||e>23)))throw new Iu('"byHourOfDay" values must be >= 0 && <= 23');t.byHourOfDay=e.byHourOfDay,t.byHourOfDay.sort(Su)}else["YEARLY","MONTHLY","WEEKLY","DAILY"].includes(e.frequency)&&(t.byHourOfDay=[t.start.get("hour")])},deps:()=>[Dl,Yl,$l,Hl,Ul]};function Zl(e,t){return e.add(su(e.get("weekday"),t),"day")}function Kl(e,t,r){let n=e.set("day",1);return r<0&&(n=n.add(1,"month")),n=Zl(n,t),r<0?n.add(r,"week"):n.add(r-1,"week")}class Jl extends Cl{run(e){const t=Xl(e,this.options.byDayOfMonth,this.options.byDayOfWeek),r=e.get("day");for(const n of t)if(!(r>n))return r===n?this.validateDate(new Du(e)):this.validateDate(new ju(e.granularity("month").set("day",n)));let n,o=e,i=0;for(;!n&&i<30;)o=o.granularity("month").add(1,"month"),n=Xl(o,this.options.byDayOfMonth,this.options.byDayOfWeek)[0],i++;if(i>=13)throw new Nu("byDayOfMonth Infinite while loop");return this.validateDate(new ju(o.set("day",n)))}}function Xl(e,t,r){const n=e.endGranularity("month").get("day");let o=t.filter((e=>n>=Math.abs(e))).map((e=>e>0?e:n+e+1));if(r){const t=e.granularity("month"),n=[];r.forEach((r=>{if("string"==typeof r)return void n.push(...o.filter((e=>t.set("day",e).get("weekday")===r)));const i=Kl(e,...r).get("day");o.includes(i)&&n.push(i)})),o=Array.from(new Set(n))}return o.sort(((e,t)=>e>t?1:e<t?-1:0))}class Ql extends Ml{run(e){const t=Xl(e,this.options.byDayOfMonth,this.options.byDayOfWeek).reverse(),r=e.get("day");for(const n of t)if(!(r<n))return r===n?this.validateDate(new Du(e)):this.validateDate(new ju(e.endGranularity("month").set("day",n)));let n,o=e,i=0;for(;!n&&i<30;)o=o.endGranularity("month").subtract(1,"month"),n=Xl(o,this.options.byDayOfMonth,this.options.byDayOfWeek).pop(),i++;if(i>=13)throw new Nu("byDayOfMonth Infinite while loop");return this.validateDate(new ju(o.set("day",n)))}}const ec={name:"ByDayOfMonth",get:e=>void 0===e.options.byDayOfMonth?null:e.reverse?new Ql(e):new Jl(e),normalizeOptions:(e,t)=>{if(void 0!==e.byDayOfMonth){if("WEEKLY"===e.frequency)throw new Iu('when "frequency" is "WEEKLY", "byDayOfMonth" cannot be present');if(!jl(e.byDayOfMonth))throw new Iu('"byDayOfMonth" expects a non-empty array');if(e.byDayOfMonth.some((e=>0===e||e<-31||e>31)))throw new Iu('"byDayOfMonth" values must be `num !== 0 && num <= 31 && num >= -31`');t.byDayOfMonth=e.byDayOfMonth.slice()}else jl(e.byDayOfWeek)||jl(e.byDayOfYear)||!["YEARLY","MONTHLY"].includes(e.frequency)||(t.byDayOfMonth=[t.start.get("day")])},deps:()=>[Dl,ec,Yl,$l,Hl,Ul]};function tc(e,t,r){let n=e.set("month",1).set("day",1);return r<0&&(n=n.add(1,"year")),n=Zl(n,t),r<0?n.add(r,"week"):n.add(r-1,"week")}function rc(e,t){const r=su(e.get("weekday"),t);return e.subtract(0===r?0:7-r,"day")}class nc extends Ml{run(e){return"YEARLY"===this.options.frequency?void 0===this.options.byMonthOfYear?this.expandYearly(e):this.expandMonthly(e):"MONTHLY"===this.options.frequency?this.expandMonthly(e):this.expand(e)}expandYearly(e){let t=oc(e,this.options.byDayOfWeek)[0],r=0,n=e;for(;!t&&r<28;)r++,n=n.granularity("year").subtract(1,"millisecond"),t=oc(n,this.options.byDayOfWeek)[0];if(!t)throw new Nu("The byDayOfWeek rule appears to contain an impossible combination");return this.result(e,t)}expandMonthly(e){let t=ic(e,this.options.byDayOfWeek)[0],r=0,n=e;for(;!t&&r<50;)r++,n=n.granularity("month").subtract(1,"millisecond"),t=ic(n,this.options.byDayOfWeek)[0];if(!t)throw new Nu("The byDayOfWeek rule appears to contain an impossible combination");return this.result(e,t)}expand(e){const t=this.options.byDayOfWeek.map((t=>rc(e,t))).sort(nu).pop();return this.result(e,t)}result(e,t){return t.isEqual(e)?this.validateDate(new Du(e)):this.validateDate(new ju(t.endGranularity("day")))}}function oc(e,t){return ou([...t.filter((e=>Array.isArray(e))).map((t=>tc(e,...t))),...t.filter((e=>"string"==typeof e)).map((t=>rc(e,t))).filter((t=>t.get("year")===e.get("year")))]).filter((t=>t.isBeforeOrEqual(e))).sort(nu).reverse()}function ic(e,t){return ou([...t.filter((e=>Array.isArray(e))).map((t=>Kl(e,...t))),...t.filter((e=>"string"==typeof e)).map((t=>rc(e,t))).filter((t=>t.get("year")===e.get("year")&&t.get("month")===e.get("month")))]).filter((t=>t.isBeforeOrEqual(e))).sort(nu).reverse()}class ac extends Cl{run(e){return"YEARLY"===this.options.frequency?void 0===this.options.byMonthOfYear?this.expandYearly(e):this.expandMonthly(e):"MONTHLY"===this.options.frequency?this.expandMonthly(e):this.expand(e)}expandYearly(e){let t=sc(e,this.options.byDayOfWeek)[0],r=0,n=e;for(;!t&&r<28;)r++,n=n.granularity("year").add(1,"year"),t=sc(n,this.options.byDayOfWeek)[0];if(!t)throw new Nu("The byDayOfWeek rule appears to contain an impossible combination");return this.result(e,t)}expandMonthly(e){let t=uc(e,this.options.byDayOfWeek)[0],r=0,n=e;for(;!t&&r<50;)r++,n=n.granularity("month").add(1,"month"),t=uc(n,this.options.byDayOfWeek)[0];if(!t)throw new Nu("The byDayOfWeek rule appears to contain an impossible combination");return this.result(e,t)}expand(e){const t=this.options.byDayOfWeek.map((t=>Zl(e,t))).sort(nu)[0];return this.result(e,t)}result(e,t){return t.isEqual(e)?this.validateDate(new Du(e)):this.validateDate(new ju(t.granularity("day")))}}function sc(e,t){return ou([...t.filter((e=>Array.isArray(e))).map((t=>tc(e,...t))),...t.filter((e=>"string"==typeof e)).map((t=>Zl(e,t))).filter((t=>t.get("year")===e.get("year")))]).filter((t=>t.isAfterOrEqual(e))).sort(nu)}function uc(e,t){return ou([...t.filter((e=>Array.isArray(e))).map((t=>Kl(e,...t))),...t.filter((e=>"string"==typeof e)).map((t=>Zl(e,t))).filter((t=>t.get("year")===e.get("year")&&t.get("month")===e.get("month")))]).filter((t=>t.isAfterOrEqual(e))).sort(nu)}const lc={name:"ByDayOfWeek",get:e=>void 0===e.options.byDayOfWeek?null:e.reverse?new nc(e):new ac(e),normalizeOptions:(e,t)=>{if(void 0!==e.byDayOfWeek){if(!jl(e.byDayOfWeek))throw new Iu('"byDayOfWeek" expects a non-empty array');const r=e.byDayOfWeek.find((e=>Array.isArray(e)?!Qs.WEEKDAYS.includes(e[0]):!Qs.WEEKDAYS.includes(e)));if(r)throw new Iu(`"byDayOfWeek" expects weedays in the form ${JSON.stringify(Qs.WEEKDAYS)} but "${r}" was provided`);if(!["YEARLY","MONTHLY"].includes(e.frequency)&&e.byDayOfWeek.some((e=>Array.isArray(e))))throw new Iu('"byDayOfWeek" can only include a numeric value (i.e. `[string, number]`) when the "frequency" is either "MONTHLY" or "YEARLY"');if("MONTHLY"===e.frequency&&e.byDayOfWeek.some((e=>Array.isArray(e)&&(e[1]<-31||0===e[1]||e[1]>31))))throw new Iu('when "frequency" is "MONTHLY", each "byDayOfWeek" can optionally only have a numeric value >= -31 and <= 31 and !== 0');if("YEARLY"===e.frequency&&e.byDayOfWeek.some((e=>Array.isArray(e)&&(e[1]<-366||0===e[1]||e[1]>366))))throw new Iu('when "frequency" is "YEARLY", each "byDayOfWeek" can optionally only have a numeric value >= -366 and <= 366 and !== 0');t.byDayOfWeek=e.byDayOfWeek}else jl(e.byDayOfMonth)||"WEEKLY"!==e.frequency||(t.byDayOfWeek=[t.start.get("weekday")])},deps:()=>[Dl,lc,Yl,$l,Hl,Ul]};class cc extends Ml{constructor(){super(...arguments),this.option=this.processor.options.byMonthOfYear.slice().reverse()}run(e){const t=e.get("month");for(const r of this.option)if(!(t<r))return t===r?this.validateDate(new Du(e)):this.validateDate(new ju(e.endGranularity("year").set("month",r)));return this.validateDate(new ju(e.endGranularity("year").subtract(1,"year").set("month",this.option[0])))}}class fc extends Cl{run(e){const t=e.get("month");for(const r of this.options.byMonthOfYear)if(!(t>r))return t===r?this.validateDate(new Du(e)):this.validateDate(new ju(e.granularity("year").set("month",r)));return this.validateDate(new ju(e.granularity("year").add(1,"year").set("month",this.options.byMonthOfYear[0])))}}const dc={name:"ByMonthOfYear",get:e=>void 0===e.options.byMonthOfYear?null:e.reverse?new cc(e):new fc(e),normalizeOptions:(e,t)=>{if(void 0!==e.byMonthOfYear){if(!jl(e.byMonthOfYear))throw new Iu('"byMonthOfYear" expects a non-empty array');if(e.byMonthOfYear.some((e=>e<1||e>12)))throw new Iu('"byMonthOfYear" values must be `num >= 1 && num >= 12`');t.byMonthOfYear=e.byMonthOfYear.slice(),t.byMonthOfYear.sort(Su)}else jl(e.byDayOfMonth)||jl(e.byDayOfWeek)||jl(e.byDayOfYear)||"YEARLY"!==e.frequency||(t.byMonthOfYear=[t.start.get("month")])},deps:()=>[Dl,dc,ec,Yl,$l,Hl,Ul]},gc=[Dl,dc,ec,lc,Yl,$l,Hl,Ul];class pc extends Js{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(super(void 0,t),!["UTC",null,void 0].includes(t.timezone))throw new Ks(`StandardDateAdapter only supports "UTC" and local time zones but "${t.timezone}" was provided.`);this._date=new Date(e),this.timezone=void 0!==t.timezone?t.timezone:null,t.metadata&&Object.assign(this.metadata,t.metadata),this.assertIsValid()}static isDate(e){return"[object Date]"===Object.prototype.toString.call(e)}static fromDate(e,t){return new pc(e,t)}static fromJSON(e){const t=[e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond];let r;switch(e.timezone){case"UTC":r=new pc(new Date(Date.UTC(...t)),{timezone:"UTC",duration:e.duration});break;case null:r=new pc(new Date(...t),{timezone:null,duration:e.duration});break;default:throw new Ks(`The \`StandardDateAdapter\` only supports datetimes in UTC or LOCAL (null) time. You provided a JSON object with timezone "${e.timezone}".`)}return e.metadata&&Object.assign(r.metadata,e.metadata),r}static fromDateTime(e){const t=pc.fromJSON(e.toJSON());return t.generators.push(...e.generators),e.metadata&&Object.assign(t.metadata,e.metadata),t}get date(){return new Date(this._date)}get end(){if(this.duration)return this._end||(this._end=pc.fromDateTime(this.toDateTime().add(this.duration,"millisecond")).date),this._end}set(e,t){if("timezone"===e)return this.timezone===t?this:new pc(this._date,{timezone:t,duration:this.duration,generators:this.generators});if("duration"===e)return this.duration===t?this:new pc(this._date,{timezone:this.timezone,duration:t,generators:this.generators});throw new Eu(`Unknown prop "${e}" for StandardDateAdapter#set()`)}valueOf(){return this._date.valueOf()}toJSON(){let e;return e="UTC"===this.timezone?{timezone:this.timezone,year:this._date.getUTCFullYear(),month:this._date.getUTCMonth()+1,day:this._date.getUTCDate(),hour:this._date.getUTCHours(),minute:this._date.getUTCMinutes(),second:this._date.getUTCSeconds(),millisecond:this._date.getUTCMilliseconds()}:{timezone:this.timezone,year:this._date.getFullYear(),month:this._date.getMonth()+1,day:this._date.getDate(),hour:this._date.getHours(),minute:this._date.getMinutes(),second:this._date.getSeconds(),millisecond:this._date.getMilliseconds()},this.duration&&(e.duration=this.duration),e}assertIsValid(){if(!pc.isDate(this._date)||isNaN(this._date.valueOf()))throw new Ks("StandardDateAdapter has invalid date.");if(![null,"UTC"].includes(this.timezone))throw new Ks(`StandardDateAdapter only supports local (null) and UTC timezones but "${this.timezone}" was specified.`);if(this.duration&&this.duration<=0)throw new Ks("If provided, duration must be greater than 0.");return!0}}pc.hasTimezoneSupport=!1,Js.adapter=pc,ml.recurrenceRules=gc;class hc extends Error{}class yc extends Error{}function mc(e,t,r){r.data&&(!0===r.data?t.data=e.data:t.data=r.data(e),void 0===t.data&&delete t.data)}function bc(e,t){Cu.JSON_FN_MAP.set(e,t)}function _c(e,t,r){if(!e)throw new ci(t,r)}Cu.JSON_FN_MAP=new Map,Cu.prototype.toJSON=function(e){throw new yc(`To support smaller bundles, ${this.constructor.name}#toJSON() must be manually added. See "@rschedule/json-tools" in the rSchedule docs.`)},Cu.fromJSON=function(e,t){if("object"!=typeof e||null===e)throw new hc(`Invalid json "${e}"`);const r=Cu.JSON_FN_MAP.get(e.type);if(!r)throw new hc(`Unknown rSchedule object type "${e.type}". Have you added a json serializer for "${e.type}"? See "@rschedule/json-tools" in the rSchedule docs.`);return r(e,t)},$u.prototype.toJSON=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t={type:"Dates",dates:this.adapters.map((e=>e.toJSON()))};return e.nested||(t.timezone=this.timezone),mc(this,t,e),t},$u.fromJSON=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("Dates"!==e.type)throw new hc("Invalid Dates JSON");return new $u({dates:e.dates.map((e=>Js.adapter.fromJSON(e))),data:"function"==typeof t.data?t.data(e):e.data,timezone:t.timezone||e.timezone})},bc("Dates",$u.fromJSON),ml.prototype.toJSON=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t={type:"Rule",config:Object.assign(Object.assign({},Tu(this.options)),{start:this.normalizeDateInput(this.options.start).toJSON()})};return this.options.end&&(t.config.end=this.normalizeDateInput(this.options.end).toJSON()),e.nested||(t.timezone=this.timezone),mc(this,t,e),t},ml.fromJSON=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=Object.assign(Object.assign({},e.config),{start:Js.adapter.fromJSON(e.config.start),end:e.config.end&&Js.adapter.fromJSON(e.config.end)});return new ml(r,{data:"function"==typeof t.data?t.data(e):e.data,timezone:t.timezone||e.timezone})},bc("Rule",ml.fromJSON),Tl.prototype.toJSON=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t={type:"Schedule",rrules:this.rrules.map((t=>t.toJSON(Object.assign(Object.assign({},e),{nested:!0})))),exrules:this.exrules.map((t=>t.toJSON(Object.assign(Object.assign({},e),{nested:!0})))),rdates:this.rdates.toJSON(Object.assign(Object.assign({},e),{nested:!0})),exdates:this.exdates.toJSON(Object.assign(Object.assign({},e),{nested:!0}))};return e.nested||(t.timezone=this.timezone),mc(this,t,e),t},Tl.fromJSON=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("Schedule"!==e.type)throw new hc("Invalid Schedule JSON");return new Tl({rrules:e.rrules.map((r=>ml.fromJSON(r,Object.assign({timezone:e.timezone},t)))),exrules:e.exrules.map((r=>ml.fromJSON(r,Object.assign({timezone:e.timezone},t)))),rdates:$u.fromJSON(e.rdates,Object.assign({timezone:e.timezone},t)),exdates:$u.fromJSON(e.exdates,Object.assign({timezone:e.timezone},t)),data:"function"==typeof t.data?t.data(e):e.data,timezone:t.timezone||e.timezone})},bc("Schedule",Tl.fromJSON);let wc={date:{ops:["is","isapprox","gt","gte","lt","lte"],nullable:!1,parse(e,t,r){let n="string"==typeof t?"string"!=typeof(o=t)?null:10===o.length?E(Ne(o))?{type:"date",date:o}:null:7===o.length?E(Ne(o+"-01"))?{type:"month",date:o}:null:4===o.length&&E(Ne(o+"-01-01"))?{type:"year",date:o}:null:null!=t.frequency?function(e){try{let t=Gs(e);return{type:"recur",schedule:new Tl({rrules:t})}}catch(e){throw new ci("parse-recur-date",e.message)}}(t):null;var o;return _c(n,"date-format",`Invalid date format (field: ${r})`),"isapprox"===e?_c("date"===n.type||"recur"===n.type,"date-format",`Invalid date value for “isapprox” (field: ${r})`):"gt"!==e&&"gte"!==e&&"lt"!==e&&"lte"!==e||_c("date"===n.type,"date-format",`Invalid date value for “${e}” (field: ${r})`),n}},id:{ops:["is","contains","oneOf"],nullable:!0,parse:(e,t,r)=>"oneOf"===e?(_c(Array.isArray(t),"no-empty-array",`oneOf must have an array value (field: ${r})`),t):t},string:{ops:["is","contains","oneOf"],nullable:!1,parse:(e,t,r)=>"oneOf"===e?(_c(Array.isArray(t),"no-empty-array",`oneOf must have an array value (field: ${r}): ${JSON.stringify(t)}`),t.filter(Boolean).map((e=>e.toLowerCase()))):("contains"===e&&_c("string"==typeof t&&t.length>0,"no-empty-string",`contains must have non-empty string (field: ${r})`),t.toLowerCase())},number:{ops:["is","isapprox","isbetween","gt","gte","lt","lte"],nullable:!1,parse(e,t,r){let n="number"==typeof t?{type:"literal",value:t}:function(e){let{num1:t,num2:r}=e;return"number"!=typeof t||"number"!=typeof r?null:{type:"between",num1:t,num2:r}}(t);return _c(null!=n,"not-number",`Value must be a number or between amount: ${JSON.stringify(t)} (field: ${r})`),"isbetween"===e?_c("between"===n.type,"number-format",`Invalid between value for “${e}” (field: ${r})`):_c("literal"===n.type,"number-format",`Invalid number value for “${e}” (field: ${r})`),n}},boolean:{ops:["is"],nullable:!1,parse:(e,t,r)=>(_c("boolean"==typeof t,"not-boolean",`Value must be a boolean: ${t} (field: ${r})`),t)}};class Ec{constructor(e,t,r,n,o){let i=o.get(t);_c(i,"internal","Invalid condition field: "+t);let a=wc[i];_c(a,"internal",`Invalid condition type: ${i} (field: ${t})`),_c(a.ops.includes(e),"internal",`Invalid condition operator: ${e} (type: ${i}, field: ${t})`),!0!==a.nullable&&_c(null!=r,"no-null",`Field cannot be empty: ${t}`),"string"===i&&!0!==a.nullable&&_c(""!==r,"no-null",`Field cannot be empty: ${t}`),this.rawValue=r,this.unparsedValue=r,this.op=e,this.field=t,this.value=a.parse?a.parse(e,r,t):r,this.options=n,this.type=i}eval(e){let t=e[this.field];if(void 0===t)return!1;"string"==typeof t&&(t=t.toLowerCase());let r=this.type;if("number"===r&&this.options)if(this.options.outflow){if(t>0)return!1;t=-t}else if(this.options.inflow&&t<0)return!1;let n=e=>"number"===r?e.value:e;switch(this.op){case"isapprox":case"is":if("date"===r){if(null==t)return!1;if("recur"===this.value.type){let{schedule:e}=this.value;if("isapprox"===this.op){let r=st(t);return e.occursBetween(Xe(r,2),Ke(r,2))}return e.occursOn({date:st(t)})}{let{date:e}=this.value;if("isapprox"===this.op){let r=st(e),n=yt(r,2);return t>=mt(r,2)&&t<=n}switch(this.value.type){case"date":return t===e;case"month":return ut(t)===e;case"year":return function(e){return ce(at(e),"yyyy")}(t)===e}}}else if("number"===r){let e=this.value.value;if("isapprox"===this.op){let r=Ps(e);return t>=e-r&&t<=e+r}return t===e}return t===this.value;case"isbetween":{let[e,r]=Us(this.value.num1,this.value.num2);return t>=e&&t<=r}case"contains":return null!==t&&-1!==t.indexOf(this.value);case"oneOf":return null!==t&&-1!==this.value.indexOf(t);case"gt":return null!==t&&("date"===r?_t(t,this.value.date):t>n(this.value));case"gte":return null!==t&&("date"===r?t===this.value.date||_t(t,this.value.date):t>=n(this.value));case"lt":return null!==t&&("date"===r?bt(t,this.value.date):t<n(this.value));case"lte":return null!==t&&("date"===r?t===this.value.date||bt(t,this.value.date):t<=n(this.value))}return!1}getValue(){return this.value}serialize(){return{op:this.op,field:this.field,value:this.unparsedValue,type:this.type,...this.options?{options:this.options}:null}}}let vc=["set","link-schedule"];class Sc{constructor(e,t,r,n,o){if(_c(vc.includes(e),"internal",`Invalid action operation: ${e}`),"set"===e){let e=o.get(t);_c(e,"internal",`Invalid field for action: ${t}`),this.field=t,this.type=e}else"link-schedule"===e&&(this.field=null,this.type="id");this.op=e,this.rawValue=r,this.value=r,this.options=n}exec(e){switch(this.op){case"set":e[this.field]=this.value;break;case"link-schedule":e.schedule=this.value}}serialize(){return{op:this.op,field:this.field,value:this.value,type:this.type,...this.options?{options:this.options}:null}}}class Tc{constructor(e){let{id:t,stage:r,conditionsOp:n,conditions:o,actions:i,fieldTypes:a}=e;this.id=t,this.stage=r,this.conditionsOp=n,this.conditions=o.map((e=>new Ec(e.op,e.field,e.value,e.options,a))),this.actions=i.map((e=>new Sc(e.op,e.field,e.value,e.options,a)))}evalConditions(e){if(0===this.conditions.length)return!1;const t="or"===this.conditionsOp?"some":"every";return this.conditions[t]((t=>t.eval(e)))}execActions(e){let t={};return this.actions.forEach((e=>e.exec(t))),t}exec(e){return this.evalConditions(e)?this.execActions(e):null}apply(e){let t=this.exec(e);return Object.assign({},e,t)}getId(){return this.id}serialize(){return{id:this.id,stage:this.stage,conditionsOp:this.conditionsOp,conditions:this.conditions.map((e=>e.serialize())),actions:this.actions.map((e=>e.serialize()))}}}class Oc{constructor(e){let{field:t,method:r}=e;this.field=t,this.method=r,this.rules=new Map}getIndex(e){return this.rules.has(e)||this.rules.set(e,new Set),this.rules.get(e)}getIndexForValue(e){return this.getIndex(this.getKey(e)||"*")}getKey(e){return"string"==typeof e&&""!==e?"firstchar"===this.method?e[0].toLowerCase():e.toLowerCase():null}getIndexes(e){let t=e.conditions.find((e=>e.field===this.field)),r=[];return!t||"oneOf"!==t.op&&"is"!==t.op?r.push(this.getIndex("*")):"oneOf"===t.op?t.value.forEach((e=>r.push(this.getIndexForValue(e)))):r.push(this.getIndexForValue(t.value)),r}index(e){this.getIndexes(e).forEach((t=>{t.add(e)}))}remove(e){this.getIndexes(e).forEach((t=>{t.delete(e)}))}getApplicableRules(e){let t;if(this.field in e){let r=this.getKey(e[this.field]);r&&(t=this.rules.get(r))}return Mt(t||new Set,this.rules.get("*")||new Set)}}const Ac={is:10,oneOf:9,isapprox:5,isbetween:5,gt:1,gte:1,lt:1,lte:1,contains:0};function Ic(e){let t=new Map;return e.forEach((e=>{t.set(e,function(e){let t=e.conditions.reduce(((e,t)=>null==Ac[t.op]?(console.log(`Found invalid operation while ranking: ${t.op}`),0):e+Ac[t.op]),0);return e.conditions.every((e=>"is"===e.op||"isapprox"===e.op||"oneOf"===e.op))?2*t:t}(e))})),[...e].sort(((e,r)=>{let n=t.get(e),o=t.get(r);if(n<o)return-1;if(n>o)return 1;{let t=e.getId(),n=r.getId();return t<n?-1:t>n?1:0}}))}function Rc(e){let t=[],r=[],n=[];for(let o of e)switch(o.stage){case"pre":t.push(o);break;case"post":n.push(o);break;default:r.push(o)}return t=Ic(t),r=Ic(r),n=Ic(n),t.concat(r).concat(n)}function Nc(e,t){for(let r=0;r<e.conditions.length;r++){let n=e.conditions[r];if("id"===n.type)switch(n.op){case"is":n.value=t.get(n.rawValue)||n.rawValue,n.unparsedValue=n.value;break;case"oneOf":n.value=n.rawValue.map((e=>t.get(e)||e)),n.unparsedValue=[...n.value]}}for(let r=0;r<e.actions.length;r++){let n=e.actions[r];"id"===n.type&&"set"===n.op&&(n.value=t.get(n.rawValue)||n.rawValue)}}function Dc(e,t,r){let n;e:for(n=0;n<e.length;n++){let o=e[n];for(let e=0;e<o.conditions.length;e++){let n=o.conditions[e];if("id"===n.type&&n.field===t)switch(n.op){case"is":if(r(o,n.value))continue e;break;case"oneOf":for(let e=0;e<n.value.length;e++)if(r(o,n.value[e]))continue e}}for(let e=0;e<o.actions.length;e++){let n=o.actions[e];if("id"===n.type&&n.field===t&&"set"===n.op&&r(o,n.value))break}}}let jc,kc,Cc,Mc,Lc=no.views.transactions.fields,xc=(Bc=no.views.transactions.fields,Object.fromEntries(Object.entries(Bc).map((e=>[e[1],e[0]]))));var Bc;function Fc(e){return e?function(e){let t;try{t="string"==typeof e?JSON.parse(e):e}catch(e){throw new ci("internal","Cannot parse rule json")}if(!Array.isArray(t))throw new ci("internal","Rule json must be an array");return t}(e).map((e=>function(e){return{...e,field:xc[e.field]||e.field}}(e))):[]}function Uc(e){return JSON.stringify(e.map((e=>function(e){return{...e,field:Lc[e.field]||e.field}}(e))))}const Pc={validate(e){let{update:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(cn("rules",e,["conditions","actions"],t),(!t||"stage"in e)&&"pre"!==e.stage&&"post"!==e.stage&&null!==e.stage)throw new Error("Invalid rule stage: "+e.stage);if((!t||"conditionsOp"in e)&&!["and","or"].includes(e.conditionsOp))throw new Error("Invalid rule conditionsOp: "+e.conditionsOp);return e},toJS(e){let{conditions:t,conditions_op:r,actions:n,...o}=e;return{...o,conditionsOp:r,conditions:Fc(t),actions:Fc(n)}},fromJS(e){let{conditions:t,conditionsOp:r,actions:n,...o}=e;return r&&(o.conditions_op=r),Array.isArray(t)&&(o.conditions=Uc(t)),Array.isArray(n)&&(o.actions=Uc(n)),o}};function Wc(e){let t;try{t=new Tc({...Pc.toJS(e),fieldTypes:Fs})}catch(e){if(console.warn("Invalid rule",e),e instanceof ci)return null;throw e}return Nc(t,$s()),t}function Hc(){return[...jc.values()]}async function zc(e){return e=Pc.validate(e),Ga("rules",Pc.fromJS(e))}async function Vc(e){return e=Pc.validate(e,{update:!0}),qa("rules",Pc.fromJS(e))}async function $c(e){return!await Ha("SELECT id FROM schedules WHERE rule = ?",[e.id])&&Za("rules",e.id)}function qc(e,t){t.forEach(((e,t)=>{"rules"===t&&e.forEach((e=>{let t=jc.get(e.id);if(1===e.tombstone){let t=jc.get(e.id);t&&(jc.delete(t.getId()),Cc.remove(t),Mc.remove(t))}else{let r=Wc(e);r&&(t&&(Cc.remove(t),Mc.remove(t)),jc.set(e.id,r),Cc.index(r),Mc.index(r))}}))})),[...t.keys()].find((e=>-1!==e.indexOf("mapping")))&&Hc().forEach((e=>{Nc(e,$s())}))}function Gc(e){let t={...e},r=Rc(Mt(Cc.getApplicableRules(e),Mc.getApplicableRules(e)));for(let e=0;e<r.length;e++)t=r[e].apply(t);return t}function Yc(e){let{recurDateBounds:t=100}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=[],n=(e=e.map((e=>{if(e instanceof Ec)return e;try{return new Ec(e.op,e.field,e.value,e.options,Fs)}catch(e){return r.push(e.type||"internal"),console.log("conditionsToAQL: invalid condition: "+e.message),null}})).filter(Boolean)).map((e=>{let{type:r,field:n,op:o,value:i,options:a}=e,s=e=>"number"===r?e.value:e,u=(e,t,n)=>{if("number"===r){if(a){if(a.outflow)return{$and:[{amount:{$lt:0}},{[e]:{$transform:"$neg",[t]:n}}]};if(a.inflow)return{$and:[{amount:{$gt:0}},{[e]:{[t]:n}}]}}return{amount:{[t]:n}}}return"string"===r?{[e]:{$transform:"$lower",[t]:n}}:"date"===r?{[e]:{[t]:n.date}}:{[e]:{[t]:n}}};switch(o){case"isapprox":case"is":if("date"===r){if("recur"===i.type)return{$or:i.schedule.occurrences({take:t}).toArray().map((e=>lt(e.date))).map((e=>"isapprox"===o?{$and:[{date:{$gte:mt(e,2)}},{date:{$lte:yt(e,2)}}]}:{date:e}))};if("isapprox"===o){let e=st(i.date),t=yt(e,2);return{$and:[{date:{$gte:mt(e,2)}},{date:{$lte:t}}]}}switch(i.type){case"date":return{date:i.date};case"month":return{$and:[{date:{$gte:i.date+"-00"}},{date:{$lte:i.date+"-99"}}]};case"year":return{$and:[{date:{$gte:i.date+"-00-00"}},{date:{$lte:i.date+"-99-99"}}]}}}else if("number"===r){let e=i.value;if("isapprox"===o){let t=Ps(e);return{$and:[u(n,"$gte",e-t),u(n,"$lte",e+t)]}}return u(n,"$eq",e)}return u(n,"$eq",i);case"isbetween":let[e,a]=Us(i.num1,i.num2);return{[n]:[{$gte:e},{$lte:a}]};case"contains":return u("id"===r?n+".name":n,"$like","%"+i+"%");case"oneOf":let l=i;return 0===l.length?{id:null}:{$or:l.map((e=>u(n,"$eq",e)))};case"gt":return u(n,"$gt",s(i));case"gte":return u(n,"$gte",s(i));case"lt":return u(n,"$lt",s(i));case"lte":return u(n,"$lte",s(i));case"true":return u(n,"$eq",!0);case"false":return u(n,"$eq",!1);default:throw new Error("Unhandled operator: "+o)}}));return{filters:n,errors:r}}function Zc(e,t,r,n){let{condValue:o,actionValue:i}=n;return function*(){let n=Hc();for(let a=0;a<n.length;a++){let s=n[a];s.stage!==e||1!==s.actions.length||"set"!==s.actions[0].op||s.actions[0].field!==r||void 0!==i&&s.actions[0].value!==i||1!==s.conditions.length||"is"!==s.conditions[0].op||s.conditions[0].field!==t||void 0!==o&&s.conditions[0].value!==o||(yield s.serialize())}return null}()}function Kc(e){let t=new Map;e.forEach((e=>{e.category&&t.set(e.category,(t.get(e.category)||0)+1)}));let r=e.reduce(((e,r)=>{let n=t.get(r.category);return!e||n>e.score?{score:n,category:r.category}:e}),null);return r.score>=3?r.category:null}async function Jc(e){if(e.payee){let{transfer_acct:t}=await Ha("SELECT id, transfer_acct FROM v_payees WHERE id = ?",[e.payee]);return t}return null}async function Xc(e,t){const{offbudget:r}=await Ha("SELECT offbudget FROM accounts WHERE id = ?",[e.account]),{offbudget:n}=await Ha("SELECT offbudget FROM accounts WHERE id = ?",[t]);return r===n&&(await Ns({id:e.id,category:null}),!0)}async function Qc(e,t){let{id:r}=await Ha("SELECT id FROM payees WHERE transfer_acct = ?",[e.account]);if(e.parent_id){let t=await Ha("\n SELECT p.id, p.transfer_acct FROM v_transactions t\n LEFT JOIN payees p ON p.id = t.payee\n WHERE t.id = ?\n ",[e.parent_id]);if(t.transfer_acct)return t.id!==e.payee?(await Ns({id:e.id,payee:null}),{id:e.id,payee:null}):null}const n=await Rs({account:t,amount:-e.amount,payee:r,date:e.date,transfer_id:e.id,notes:e.notes||null,cleared:!1});await Ns({id:e.id,transfer_id:n});const o=await Xc(e,t);return{id:e.id,transfer_id:n,...o?{category:null}:{}}}async function ef(e){let t=await Os(e.transfer_id);return t&&(t.is_child?await Ns({id:e.transfer_id,transfer_id:null,payee:null}):await Ds({id:e.transfer_id})),await Ns({id:e.id,transfer_id:null}),{id:e.id,transfer_id:null}}async function tf(e){return async function(e,t,r,n){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],i=[],a=new Set;for(let s=0;s<t.length;s+=500){let u=t.slice(s,s+500).filter((e=>!a.has(e)));if(u.length>0){let t=n("("+u.map((e=>r(e))).join(" OR ")+")"),s=await e(t,o,!0);a=new Set([...a,...u]),i=i.concat(s)}}return i}(((e,t)=>Ka("transactions",e,t)),e,(e=>`id = '${e}'`),(e=>`SELECT * FROM v_transactions_internal WHERE ${e}`))}async function rf(e){let{added:t,deleted:r,updated:n,learnCategories:o=!1,detectOrphanPayees:i=!0}=e,a=[],s=n?n.map((e=>e.id)):[],u=r?await async function(e){let t=uo(e,"parent_id"),r=await Wa(`SELECT id FROM v_transactions_internal WHERE ${t}`),n=new Set(e);for(let e of r)n.add(e.id);return[...n]}(r.map((e=>e.id))):[],l=new Set,c=await Wa("SELECT * FROM accounts WHERE tombstone = 0");if(n){let e=n.filter((e=>e.payee)).map((e=>e.id)),t=await tf(e);for(let e=0;e<t.length;e++)l.add(t[e].payee)}await ya((async()=>{t&&(a=await Promise.all(t.map((async e=>Rs(e))))),r&&await Promise.all(u.map((async e=>{await Ds({id:e})}))),n&&await Promise.all(n.map((async e=>{e.account&&1===c.find((t=>t.id===e.account)).offbudget&&(e.category=null),await Ns(e)})))}));let f,d=await tf(a),g=await tf(s),p=await tf(u),h=d;if(await ya((async()=>{await Promise.all(d.map((e=>async function(e){let t=await Jc(e);if(t)return Qc(e,t)}(e)))),f=(await Promise.all(g.map((e=>async function(e){const t=await Jc(e);return t&&!e.transfer_id?Qc(e,t):!t&&e.transfer_id?ef(e):t&&e.transfer_id?async function(e,t){let r=await async function(e){return Ha("SELECT * FROM payees WHERE transfer_acct = ?",[e])}(e.account);if(await Ns({id:e.transfer_id,account:t,payee:r.id,date:e.date,notes:e.notes,amount:-e.amount}),await Xc(e,t))return{id:e.id,category:null}}(e,t):void 0}(e))))).filter(Boolean),await Promise.all(p.map((e=>async function(e){e.transfer_id&&await ef(e)}(e))))})),o){let e=new Set([...t?t.filter((e=>e.category)).map((e=>e.id)):[],...n?n.filter((e=>e.category)).map((e=>e.id)):[]]);await async function(e){if(0===e.length)return;let t=new Set(e.map((e=>e.payee))),r=new Set(e.map((e=>e.id))),n=null;for(let t=0;t<e.length;t++)(null===n||e[t].date<n)&&(n=e[t].date);n=mt(n,180);let o=function(e,t){let r=new Map;for(let t=0;t<e.length;t++){let n=e[t],o=n.payee,i=r.get(o)||[];i.push(n),r.set(o,i)}return r}(await Wa("SELECT t.* FROM v_transactions t\n LEFT JOIN accounts a ON a.id = t.account\n WHERE date >= ? AND date <= ? AND is_parent = 0 AND a.closed = 0\n ORDER BY date DESC",[fn(n),fn(yt(ft(),180))])),i=new Map;for(let e of t)if(e){let t=(o.get(e)||[]).slice(0,5);if(t.find((e=>r.has(e.id)))){let r=Kc(t);r&&i.set(e,r)}}await ya((async()=>{for(let[e,t]of i.entries()){let r=[...Zc(null,"payee","category",{condValue:e})];if(r.length>0)for(let e of r){let r=e.actions[0];r.value!==t&&await Vc({...e,actions:[{...r,value:t}]})}else{let r=new Tc({stage:null,conditionsOp:"and",conditions:[{op:"is",field:"payee",value:e}],actions:[{op:"set",field:"category",value:t}],fieldTypes:Fs});await zc(r.serialize())}}}))}(d.concat(g).filter((t=>e.has(t.id))))}if(i&&n){let e=n.map((e=>e.payee)).filter(Boolean);if(e.length>0){let t=new Set(await bs()),r=[...l].filter((e=>t.has(e)));r.length>0&&Ar("orphaned-payees",{orphanedIds:r,updatedPayeeIds:e})}}return{added:h,updated:f}}function nf(e,t){return{type:"BankSyncError",category:e,code:t}}function of(e,t){let{subtransactions:r,...n}=qt({...e,is_parent:!0,subtransactions:t.map(((t,r)=>$t(e,{...t,sort_order:0-r})))});return[n,...r]}function af(e){switch(e.type){case"credit":case"loan":return-e.balances.current;default:return e.balances.current}}async function sf(e,t){await La("UPDATE accounts SET balance_current = ? WHERE id = ?",[Pt(t),e])}async function uf(e,t,r){const n=await Ve("user-token");if(!n)return;let o=await Ei(Ai().NORDIGEN_SERVER+"/accounts",{userId:e,key:t,item_id:r},{"X-ACTUAL-TOKEN":n}),{accounts:i}=o;return i.forEach((e=>{e.balances.current=af(e)})),i}function lf(e){return{imported_id:e.transaction_id,payee_name:e.name,imported_payee:e.name,amount:-Pt(e.amount),date:e.date}}async function cf(e,t,r,n,o,i){let a=[],s=null,u=0,l=0;for(;;){const c=ft(),f=await Ei(Ai().PLAID_SERVER+"/transactions",{userId:e,key:t,item_id:""+n,account_id:r,start_date:o,end_date:c,count:100,offset:u});if(f.error_code)throw nf(f.error_type,f.error_code);if(0===f.transactions.length)break;if(l+=f.transactions.length,a=a.concat(f.transactions.filter((e=>!e.pending))),s=af(f.accounts[0]),l===f.total_transactions||null!=i&&a.length>=i)break;u+=100}return a=null!=i?a.slice(0,i):a,{transactions:a.map(lf),accountBalance:s}}async function ff(e,t,r,n,o){let i=await Ve("user-token");if(!i)return;const a=(new Date).toISOString().split("T")[0],s=await Ei(Ai().NORDIGEN_SERVER+"/transactions",{userId:e,key:t,requisitionId:n,accountId:r,startDate:o,endDate:a},{"X-ACTUAL-TOKEN":i});if(s.error_code)throw nf(s.error_type,s.error_code);const{transactions:{all:u},balances:l,startingBalance:c}=s;return{transactions:u,accountBalance:l,startingBalance:c}}async function df(e,t,r){if(null==e.payee&&t){let e=r.get(t.toLowerCase());if(e=e||await _s(t),null!=e)return e.id;{let e={id:be(),name:t};return r.set(t.toLowerCase(),e),e.id}}return e.payee}async function gf(e,t){let{rawPayeeName:r=!1}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=new Map,o=[];for(let i of e){if(null==i.date)throw new Error("`date` is required when adding a transaction");let{payee_name:e,subtransactions:a,...s}=i;if(i=s,e){let t=e.trim();e=""===t?null:r?t:Bs(t)}i.imported_payee=i.imported_payee||e,i.imported_payee&&(i.imported_payee=i.imported_payee.trim()),i.account=t,i.payee=await df(i,e,n),o.push({payee_name:e,subtransactions:a?a.map((e=>({...e,account:t}))):null,trans:i})}return{normalized:o,payeesToCreate:n}}async function pf(e,t){let r=new Set(t.map((e=>e.payee)));await ya((async()=>{for(let t of e.values())r.has(t.id)&&await fs(t)}))}async function hf(e,t){const r=new Set,n=[],o=[];let{normalized:i,payeesToCreate:a}=await async function(e,t){let r=new Map,n=[];for(let o of e){if(o.date||(o.date=o.valueDate||o.bookingDate),o.amount||(o.amount=o.transactionAmount.amount),null==o.date)throw new Error("`date` is required when adding a transaction");let e;if(o.amount>0||Object.is(Number(o.amount),0)){const t=[];t.push(Bs(o.debtorName||o.remittanceInformationUnstructured||(o.remittanceInformationUnstructuredArray||[]).join(", "))),o.debtorAccount&&o.debtorAccount.iban&&t.push("("+o.debtorAccount.iban.slice(0,4)+" XXX "+o.debtorAccount.iban.slice(-4)+")"),e=t.join(" ")}else{const t=[];t.push(Bs(o.creditorName||o.remittanceInformationUnstructured||(o.remittanceInformationUnstructuredArray||[]).join(", "))),o.creditorAccount&&o.creditorAccount.iban&&t.push("("+o.creditorAccount.iban.slice(0,4)+" XXX "+o.creditorAccount.iban.slice(-4)+")"),e=t.join(" ")}o.imported_payee=o.imported_payee||e,o.imported_payee&&(o.imported_payee=o.imported_payee.trim()),o.account=t,o.payee=await df(o,e,r),o.cleared=Boolean(o.booked),n.push({payee_name:e,trans:{amount:Pt(o.amount),payee:o.payee,account:o.account,date:o.date,notes:o.remittanceInformationUnstructured||(o.remittanceInformationUnstructuredArray||[]).join(", "),imported_id:o.transactionId,imported_payee:o.imported_payee,cleared:o.cleared}})}return{normalized:n,payeesToCreate:r}}(t,e),s=[];for(let{payee_name:t,trans:n,subtransactions:o}of i){n=Gc(n);let i=null,a=null;n.imported_id&&(i=await Ha("SELECT * FROM v_transactions WHERE imported_id = ? AND account = ?",[n.imported_id,e]),i&&r.add(i.id)),i||(a=await Wa("SELECT id, date, imported_id, payee, category, notes FROM v_transactions\n WHERE date >= ? AND date <= ? AND amount = ? AND account = ? AND is_child = 0",[fn(mt(n.date,4)),fn(yt(n.date,1)),n.amount||0,e])),s.push({payee_name:t,trans:n,subtransactions:o,match:i,fuzzyDataset:a})}let u=s.map((e=>{if(!e.match&&e.fuzzyDataset){let t=e.fuzzyDataset.find((t=>!r.has(t.id)&&e.trans.payee===t.payee));if(t)return r.add(t.id),{...e,match:t}}return e})).map((e=>{if(!e.match&&e.fuzzyDataset){let t=e.fuzzyDataset.find((e=>!r.has(e.id)));if(t)return r.add(t.id),{...e,match:t}}return e}));for(let{trans:e,subtransactions:t,match:r}of u)if(r){let t={...r,cleared:1===r.cleared,date:dn(r.date)};const o={date:e.date,imported_id:e.imported_id||null,payee:t.payee||e.payee||null,category:t.category||e.category||null,imported_payee:e.imported_payee||null,notes:t.notes||e.notes||null,cleared:null==e.cleared||e.cleared};Rt(t,o,Object.keys(o))&&n.push({id:t.id,...o})}else{let r={...e,id:be(),category:e.category||null,cleared:null==e.cleared||e.cleared};t&&t.length>0?o.push(...of(r,t)):o.push(r)}return await pf(a,[...o,...n]),await rf({added:o,updated:n}),{added:o.map((e=>e.id)),updated:n.map((e=>e.id))}}async function yf(e,t){const r=new Set,n=[],o=[];let{normalized:i,payeesToCreate:a}=await gf(t,e),s=[];for(let{payee_name:t,trans:n,subtransactions:o}of i){n=Gc(n);let i=null,a=null;n.imported_id&&(i=await Ha("SELECT * FROM v_transactions WHERE imported_id = ? AND account = ?",[n.imported_id,e]),i&&r.add(i.id)),i||(a=await Wa("SELECT id, date, imported_id, payee, category, notes FROM v_transactions\n WHERE date >= ? AND date <= ? AND amount = ? AND account = ? AND is_child = 0",[fn(mt(n.date,4)),fn(yt(n.date,1)),n.amount||0,e])),s.push({payee_name:t,trans:n,subtransactions:o,match:i,fuzzyDataset:a})}let u=s.map((e=>{if(!e.match&&e.fuzzyDataset){let t=e.fuzzyDataset.find((t=>!r.has(t.id)&&e.trans.payee===t.payee));if(t)return r.add(t.id),{...e,match:t}}return e})).map((e=>{if(!e.match&&e.fuzzyDataset){let t=e.fuzzyDataset.find((e=>!r.has(e.id)));if(t)return r.add(t.id),{...e,match:t}}return e}));for(let{trans:e,subtransactions:t,match:r}of u)if(r){let t={...r,cleared:1===r.cleared,date:dn(r.date)};const o={date:e.date,imported_id:e.imported_id||null,payee:t.payee||e.payee||null,category:t.category||e.category||null,imported_payee:e.imported_payee||null,notes:t.notes||e.notes||null,cleared:null==e.cleared||e.cleared};Rt(t,o,Object.keys(o))&&n.push({id:t.id,...o})}else{let r={...e,id:be(),category:e.category||null,cleared:null==e.cleared||e.cleared};t&&t.length>0?o.push(...of(r,t)):o.push(r)}return await pf(a,[...o,...n]),await rf({added:o,updated:n}),{added:o.map((e=>e.id)),updated:n.map((e=>e.id))}}async function mf(e,t){let{runTransfers:r=!0}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=[];let o,{normalized:i,payeesToCreate:a}=await gf(t,e,{rawPayeeName:!0});for(let{trans:t,subtransactions:r}of i){t=Gc(t);let o={id:be(),...t,account:e,cleared:null==t.cleared||t.cleared};r&&r.length>0?n.push(...of(o,r)):n.push(o)}if(await pf(a,n),r){let e=await rf({added:n});o=e.added.map((e=>e.id))}else await ya((async()=>{o=await Promise.all(n.map((async e=>Rs(e))))}));return o}async function bf(e,t,r,n,o){const i=await Ha("SELECT * FROM v_transactions WHERE account = ? ORDER BY date DESC LIMIT 1",[r]),a=await $a("accounts",r);if(i){const a=dn((await Ha("SELECT date FROM v_transactions WHERE account = ? ORDER BY date ASC LIMIT 1",[r])).date);let s=mt(dn(i.date),31);s<a&&(s=a);let{transactions:u,accountBalance:l}=await ff(e,t,n,o,s);return 0===u.length?{added:[],updated:[]}:(u=u.map((e=>({...e,account:r}))),Er((async()=>{const e=await hf(r,u);return await sf(r,l),e})))}{const i=mt(ft(),30),{transactions:s,startingBalance:u}=await ff(e,t,n,o,ce(Ne(i),"yyyy-MM-dd")),l=s[s.length-1],c=s.length>0?l.valueDate||l.bookingDate:ft(),f=await js();return Er((async()=>{let e=await Rs({account:r,amount:u,category:0===a.offbudget?f.category:null,payee:f.id,date:c,cleared:!0,starting_balance_flag:!0}),t=await hf(r,s);return{...t,added:[e,...t.added]}}))}}async function _f(e,t,r,n,o){const i=await Ha("SELECT * FROM v_transactions WHERE account = ? ORDER BY date DESC LIMIT 1",[r]);if(i){const a=dn((await Ha("SELECT date FROM v_transactions WHERE account = ? ORDER BY date ASC LIMIT 1",[r])).date);let s=mt(dn(i.date),31);s<a&&(s=a);let{transactions:u,accountBalance:l}=await cf(e,t,n,o,s);return 0===u.length?{added:[],updated:[]}:(u=u.map((e=>({...e,account:r}))),Er((async()=>{const e=await yf(r,u);return await sf(r,l),e})))}{const i=await $a("accounts",r),a=mt(ft(),0===i.offbudget?1:30),{transactions:s}=await cf(e,t,n,o,ce(Ne(a),"yyyy-MM-dd"));let u=i.balance_current;const l=s.reduce(((e,t)=>e-t.amount),u),c=s.length>0?s[s.length-1].date:ft();let f=await js();return Er((async()=>{let e=await Rs({account:r,amount:l,category:0===i.offbudget?f.category:null,payee:f.id,date:c,cleared:!0,starting_balance_flag:!0}),t=await yf(r,s);return{...t,added:[e,...t.added]}}))}}function wf(e){return e[Math.floor(Math.random()*e.length)%e.length]}function Ef(e,t){return Math.round(function(e,t){return e+(t-e)*Math.random()}(e,t))}function vf(e,t){let r=e[0];for(let n=0;n<e.length;n++)e[n][t]<r[t]&&(r=e[n]);return r}function Sf(e){return e.find((e=>"Starting Balances"===e.name)).id}function Tf(e,t){let r=e.find((e=>"Deposit"===e.name)),n=e.filter((e=>"Deposit"!==e.name&&"Starting Balance"!==e.name)),o=t.find((e=>0===e.is_income)),i=t.find((e=>1===e.is_income)),a=o.categories.filter((e=>-1!==["Food","Restaurants","Entertainment","Clothing","General","Gift","Medical"].indexOf(e.name)));return{incomePayee:r,expensePayees:n.filter((e=>!e.bill)),incomeGroup:i,expenseCategories:a,billCategories:t.find((e=>"Bills"===e.name)).categories,billPayees:n.filter((e=>e.bill))}}async function Of(e,t,r,n){let{incomePayee:o,expensePayees:i,incomeGroup:a,expenseCategories:s,billCategories:u,billPayees:l}=Tf(r,n),c=Ef(100,200),f=[];for(let e=0;e<c;e++){let r,n,u;r=Math.random()<.09?o:wf(i),n="Deposit"===r.name?a.categories.find((e=>"Income"===e.name)):wf(s),u="Deposit"===r.name?Ef(5e4,7e4):Ef(0,Math.random()<.05?-8e3:-700);let l={amount:u,payee:r.id,account:t.id,date:mt(ft(),Math.floor(e/3)),category:n.id};if(f.push(l),Math.random()<.2){let e=Math.round(l.amount/3),t=()=>r===o?a.categories.find((e=>"Income"===e.name)).id:wf(s).id;l.subtransactions=[{amount:e,category:t()},{amount:e,category:t()},{amount:l.amount-2*e,category:t()}]}}let d=St(ut(f[f.length-1].date),ct()),g=ft();for(let e of d){let r=yt(e,12);bt(r,g)&&f.push({amount:-1e4,payee:l.find((e=>e.name.toLowerCase().includes("power"))).id,account:t.id,date:r,category:u.find((e=>"Power"===e.name)).id}),r=yt(e,18),bt(r,g)&&f.push({amount:-9e3,payee:l.find((e=>e.name.toLowerCase().includes("water"))).id,account:t.id,date:r,category:u.find((e=>"Water"===e.name)).id}),r=yt(e,2),bt(r,g)&&f.push({amount:-12e4,payee:l.find((e=>e.name.toLowerCase().includes("housy"))).id,account:t.id,date:r,category:u.find((e=>"Mortgage"===e.name)).id}),r=yt(e,20),bt(r,g)&&f.push({amount:-6e3,payee:l.find((e=>e.name.toLowerCase().includes("internet"))).id,account:t.id,date:r,category:u.find((e=>"Internet"===e.name)).id}),r=yt(e,23),bt(r,g)&&f.push({amount:-7500,payee:l.find((e=>e.name.toLowerCase().includes("t-mobile"))).id,account:t.id,date:r,category:u.find((e=>"Cell"===e.name)).id})}let p=null;return f.forEach((e=>{(null==p||e.date<p)&&(p=e.date)})),f.unshift({amount:1e5,payee:r.find((e=>"Starting Balance"===e.name)).id,account:t.id,date:p,category:Sf(a.categories),starting_balance_flag:!0}),mf(t.id,f)}async function Af(e,t,r,n){let{incomePayee:o,expensePayees:i,incomeGroup:a,expenseCategories:s}=Tf(r,n),u=Ef(20,40),l=[];for(let e=0;e<u;e++){let r,n;r=Math.random()<.04?o:wf(i),n="Deposit"===r.name?a.categories.find((e=>"Income"===e.name)):wf(s);let u="Deposit"===r.name?Ef(5e4,7e4):Ef(0,-1e4);l.push({amount:u,payee:r.id,account:t.id,date:mt(ft(),2*e),category:n.id})}l.unshift({amount:Ef(9e4,12e4),payee:r.find((e=>"Starting Balance"===e.name)).id,account:t.id,date:l[l.length-1].date,category:Sf(a.categories),starting_balance_flag:!0}),await e["transactions-batch-update"]({added:l,fastMode:!0})}async function If(e,t,r,n){let{incomePayee:o,incomeGroup:i}=Tf(r,n),a=Ef(10,30),s=[];for(let e=0;e<a;e++){let e=o,r=i.categories.find((e=>"Income"===e.name)),n=Ef(1e4,2e4);s.push({amount:n,payee:e.id,account:t.id,date:mt(ft(),Ef(10,360)),category:r.id})}s.unshift({amount:Ef(1e4,2e4),payee:r.find((e=>"Starting Balance"===e.name)).id,account:t.id,date:vf(s,"date").date,category:Sf(i.categories),starting_balance_flag:!0}),await e["transactions-batch-update"]({added:s,fastMode:!0})}async function Rf(e,t,r,n){let{incomePayee:o,expensePayees:i,incomeGroup:a,expenseCategories:s}=Tf(r,n),u=Ef(15,40),l=[];for(let e=0;e<u;e++){let r;r=Math.random()<.3?o:wf(i);let n=r===o?a.categories.find((e=>"Income"===e.name)):wf(s),u=r===o?Ef(1e4,8e4):Ef(-1e4,-2e3);l.push({amount:u,payee:r.id,account:t.id,date:mt(ft(),5*e),category:n.id})}l.unshift({amount:3e4,payee:r.find((e=>"Starting Balance"===e.name)).id,account:t.id,date:l[l.length-1].date,category:Sf(a.categories),starting_balance_flag:!0}),await e["transactions-batch-update"]({added:l,fastMode:!0})}async function Nf(e,t,r,n){let{incomePayee:o,incomeGroup:i}=Tf(r,n),a=Ef(7,10),s=Ef(1e5,2e5),u=i.categories.find((e=>"Income"===e.name)),l=[{amount:100*Ef(-3e3,-3500)*100,payee:r.find((e=>"Starting Balance"===e.name)).id,account:t.id,date:ht(ft(),a)+"-02",category:Sf(i.categories),starting_balance_flag:!0}];for(let e=0;e<a;e++){let r=o;l.push({amount:s,payee:r.id,account:t.id,date:ht(ft(),e)+"-02",category:u.id,starting_balance_flag:!0})}await e["transactions-batch-update"]({added:l,fastMode:!0})}async function Df(e,t,r,n){let{incomePayee:o,incomeGroup:i}=Tf(r,n),a=Ef(3,6),s=i.categories.find((e=>"Income"===e.name)),u=[{amount:100*Ef(3250,3700)*100,payee:r.find((e=>"Starting Balance"===e.name)).id,account:t.id,date:ht(ft(),a)+"-02",category:Sf(i.categories),starting_balance_flag:!0}];for(let e=0;e<a;e++){let r=o,n=100*Ef(4,9)*100;u.push({amount:n,payee:r.id,account:t.id,date:ht(ft(),e)+"-02",category:s.id})}await e["transactions-batch-update"]({added:u,fastMode:!0})}var jf=__webpack_require__(275),kf=__webpack_require__.n(jf);async function Cf(e,t){let[[,r],[,n]]=await Ge(["user-id","user-key"]);if(null==e||!e.institution_id||!e.name)throw new Error("Invalid institution object");let o=be();return await Ei(Ai().PLAID_SERVER+"/handoff_public_token",{userId:r,key:n,item_id:o,public_token:t}),await Er((()=>Ga("banks",{id:o,bank_id:e.institution_id,name:e.name}))),o}var Mf=__webpack_require__(2616),Lf=__webpack_require__.n(Mf);function xf(e,t){return"out-of-sync-migrations"===e||"out-of-sync-data"===e?"This budget cannot be loaded with this version of the app.":"budget-not-found"===e?`Budget “${t}” not found. Check the id of your budget in the Advanced section of the settings page.`:`We had an unknown problem opening “${t}”.`}const Bf={...gn,toExternal:e=>({id:e.id,name:e.name,offbudget:!!e.offbudget,closed:!!e.closed}),fromExternal(e){let t={...e};return"offbudget"in e&&(t.offbudget=e.offbudget?1:0),"closed"in e&&(t.closed=e.closed?1:0),t}},Ff={...pn,toExternal:e=>({id:e.id,name:e.name,is_income:!!e.is_income,group_id:e.cat_group}),fromExternal(e){let{group_id:t,...r}=e;return"is_income"in e&&(r.is_income=e.is_income?1:0),"group_id"in e&&(r.cat_group=e.group_id),r}},Uf={...hn,toExternal:e=>({id:e.id,name:e.name,is_income:!!e.is_income,categories:e.categories.map(Ff.toExternal)}),fromExternal(e){let t={...e};return"is_income"in e&&(t.is_income=e.is_income?1:0),"categories"in e&&(t.categories=e.categories.map(Ff.fromExternal)),t}},Pf={...yn,toExternal:e=>({id:e.id,name:e.name,category:e.category,transfer_acct:e.transfer_acct}),fromExternal:e=>e};let Wf=!1;function Hf(e,t){return{type:"APIError",message:e,meta:t}}function zf(e){return t=>Er((async()=>{let n=(0,r.getClock)().timestamp.toString(),o=await e(t);return await Wa("SELECT DISTINCT dataset FROM messages_crdt WHERE timestamp > ?",[n]),o}),{undoDisabled:!0})}let Vf={};async function $f(e){if(!e.match(/^\d{4}-\d{2}$/))throw Hf("Invalid month format, use YYYY-MM: "+e);if(!Wf){let{start:t,end:r}=await Vf["get-budget-bounds"]();if(!vt(t,r).includes(e))throw Hf("No budget exists for month: "+e)}}function qf(){if(!(Eo()||{}).id)throw Hf("No budget file is open")}let Gf=null;Vf["api/batch-budget-start"]=async function(){if(Gf)throw Hf("Cannot start a batch process: batch already started");Wf?Pa((()=>new Promise(((e,t)=>{Gf={resolve:e,reject:t}})))):ya((()=>new Promise(((e,t)=>{Gf={resolve:e,reject:t}}))))},Vf["api/batch-budget-end"]=async function(){if(!Gf)throw Hf("Cannot end a batch process: no batch started");Gf.resolve(),Gf=null},Vf["api/load-budget"]=async function(e){let{id:t}=e,{id:r}=Eo()||{};if(r!==t){Ar("start-load");let{error:e}=await Vf["load-budget"]({id:t});if(e)throw Ar("show-budgets"),new Error(xf(e,t));Ar("finish-load")}},Vf["api/download-budget"]=async function(e){let{syncId:t,password:r}=e,{id:n}=Eo()||{};n&&await Vf["close-budget"]();let o=(await Vf["get-budgets"]()).find((e=>e.groupId===t));if(o){await Vf["load-budget"]({id:o.id});let e=await Vf["sync-budget"]();if(e.error)throw new Error(xf(e.error,o.id))}else{let e=await Vf["get-remote-files"]();if(!e)throw new Error("Could not get remote files");let n=e.find((e=>e.groupId===t));if(!n)throw new Error(`Budget “${t}” not found. Check the sync id of your budget in the Advanced section of the settings page.`);if(n.encryptKeyId&&!r)throw new Error(`File ${n.name} is encrypted. Please provide a password.`);if(r){let e=await Vf["key-test"]({fileId:n.fileId,password:r});if(e.error)throw new Error(function(e){let{reason:t}=e;switch(t){case"network":return"Unable to connect to the server. We need to access the server to get some information about your keys.";case"old-key-style":return"This file is encrypted with an old unsupported key style. Recreate the key on a device where the file is available, or use an older version of Actual to download it.";case"decrypt-failure":return"Unable to decrypt file with this password. Please try again.";default:return"Something went wrong trying to create a key, sorry! Visit https://actualbudget.org/contact/ for support."}}(e.error))}let o=await Vf["download-budget"]({fileId:n.fileId});if(o.error)throw new Error(function(e){let{reason:t,meta:r,fileName:n}=e;switch(t){case"network":case"download-failure":return"Downloading the file failed. Check your network connection.";case"not-zip-file":case"invalid-zip-file":case"invalid-meta-file":return"Downloaded file is invalid, sorry! Visit https://actualbudget.org/contact/ for support.";case"decrypt-failure":return"Unable to decrypt file "+(n||"(unknown)")+". To change your key, first download this file with the proper password.";case"out-of-sync-migrations":return"This budget cannot be loaded with this version of the app. Make sure the app is up-to-date.";default:return"Something went wrong trying to download that file, sorry! Visit https://actualbudget.org/contact/ for support. "+(r&&r.fileId?`(fileId: ${r.fileId})`:"")}}(o.error));await Vf["load-budget"]({id:o.id})}},Vf["api/sync"]=async function(){let{id:e}=Eo(),t=await Vf["sync-budget"]();if(t.error)throw new Error(xf(t.error,e))},Vf["api/start-import"]=async function(e){let{budgetName:t}=e;await Vf["close-budget"](),await Vf["create-budget"]({budgetName:t,avoidUpload:!0}),await La("DELETE FROM categories WHERE is_income = 0"),await La("DELETE FROM category_groups WHERE is_income = 0"),oa("import"),Ar("start-import"),Wf=!0},Vf["api/finish-import"]=async function(){qf(),Do().markCacheDirty();let{id:e}=Eo();await Vf["close-budget"](),await Vf["load-budget"]({id:e}),await Vf["get-budget-bounds"](),await Uo(),await ea().catch((e=>{})),Ar("finish-import"),Wf=!1},Vf["api/abort-import"]=async function(){if(Wf){qf();let{id:e}=Eo();await Vf["close-budget"](),await Vf["delete-budget"]({id:e}),Ar("show-budgets")}Wf=!1},Vf["api/query"]=async function(e){let{query:t}=e;return qf(),fo(t)},Vf["api/budget-months"]=async function(){qf();let{start:e,end:t}=await Vf["get-budget-bounds"]();return vt(e,t)},Vf["api/budget-month"]=async function(e){let{month:t}=e;qf(),await $f(t);let r=await ts(),n=Ot(t);function o(e){let t=Do().getCellValue(n,e);return""===t?0:t}return{month:t,incomeAvailable:o("available-funds"),lastMonthOverspent:o("last-month-overspent"),forNextMonth:o("buffered"),totalBudgeted:o("total-budgeted"),toBudget:o("to-budget"),fromLastMonth:o("from-last-month"),totalIncome:o("total-income"),totalSpent:o("total-spent"),totalBalance:o("total-leftover"),categoryGroups:r.map((e=>e.is_income?{...Uf.toExternal(e),received:o("total-income"),categories:e.categories.map((e=>({...Ff.toExternal(e),received:o(`sum-amount-${e.id}`)})))}:{...Uf.toExternal(e),budgeted:o(`group-budget-${e.id}`),spent:o(`group-sum-amount-${e.id}`),balance:o(`group-leftover-${e.id}`),categories:e.categories.map((e=>({...Ff.toExternal(e),budgeted:o(`budget-${e.id}`),spent:o(`sum-amount-${e.id}`),balance:o(`leftover-${e.id}`),carryover:o(`carryover-${e.id}`)})))}))}},Vf["api/budget-set-amount"]=zf((async function(e){let{month:t,categoryId:r,amount:n}=e;return qf(),Vf["budget/budget-amount"]({month:t,category:r,amount:n})})),Vf["api/budget-set-carryover"]=zf((async function(e){let{month:t,categoryId:r,flag:n}=e;return qf(),await $f(t),await async function(e,t){if(null==t)throw Hf(`${e}: category id is required`);let r=await Ha("SELECT is_income FROM categories WHERE id = ?",[t]);if(!r)throw Hf(`${e}: category “${t}” does not exist`);if(0!==r.is_income)throw Hf(`${e}: category “${t}” is not an expense category`)}("budget-set-carryover",r),Vf["budget/set-carryover"]({startMonth:t,category:r,flag:n})})),Vf["api/transactions-export"]=async function(e){let{transactions:t,categoryGroups:r,payees:n}=e;return qf(),Vf["transactions-export"]({transactions:t,categoryGroups:r,payees:n})},Vf["api/transactions-import"]=zf((async function(e){let{accountId:t,transactions:r}=e;return qf(),Vf["transactions-import"]({accountId:t,transactions:r})})),Vf["api/transactions-add"]=zf((async function(e){let{accountId:t,transactions:r}=e;return qf(),await mf(t,r,{runTransfers:!1}),"ok"})),Vf["api/transactions-get"]=async function(e){let{accountId:t,startDate:r,endDate:n}=e;qf();let{data:o}=await fo(io("transactions").filter({$and:[t&&{account:t},r&&{date:{$gte:r}},n&&{date:{$lte:n}}].filter(Boolean)}).select("*").options({splits:"grouped"}));return o},Vf["api/transactions-filter"]=async function(e){let{text:t,accountId:r}=e;throw new Error("`filterTransactions` is deprecated, use `runQuery` instead")},Vf["api/transaction-update"]=zf((async function(e){let{id:t,fields:r}=e;qf();let{data:n}=await fo(io("transactions").filter({id:t}).select("*").options({splits:"grouped"})),o=Gt(n);if(0===o.length)return[];let{diff:i}=function(e,t){return Zt(e,t.id,(e=>{if(e.is_parent){let r=e.id===t.id?t:e,n=e.subtransactions.map((n=>{let o=n;return e.id===t.id?o={...n,payee:n.payee===e.payee?t.payee:n.payee}:n.id===t.id&&(o=t),$t(r,o)}));return qt({...r,subtransactions:n})}return t}))}(o,r);return Vf["transactions-batch-update"](i)})),Vf["api/transaction-delete"]=zf((async function(e){let{id:t}=e;qf();let{data:r}=await fo(io("transactions").filter({id:t}).select("*").options({splits:"grouped"})),n=Gt(r);if(0===n.length)return[];let{diff:o}=function(e,t){return Zt(e,t,(e=>{if(e.is_parent){if(e.id===t)return null;if(1===e.subtransactions.length)return{...e,subtransactions:null,is_parent:!1,error:null};{let r=e.subtransactions.filter((e=>e.id!==t));return qt({...e,subtransactions:r})}}return null}))}(n,t);return Vf["transactions-batch-update"](o)})),Vf["api/accounts-get"]=async function(){return qf(),(await ws()).map((e=>Bf.toExternal(e)))},Vf["api/account-create"]=zf((async function(e){let{account:t,initialBalance:r=null}=e;return qf(),Vf["account-create"]({name:t.name,offBudget:t.offbudget,closed:t.closed,balance:null!=r?Wt(r):null})})),Vf["api/account-update"]=zf((async function(e){let{id:t,fields:r}=e;return qf(),vs({id:t,...Bf.fromExternal(r)})})),Vf["api/account-close"]=zf((async function(e){let{id:t,transferAccountId:r,transferCategoryId:n}=e;return qf(),Vf["account-close"]({id:t,transferAccountId:r,categoryId:n})})),Vf["api/account-reopen"]=zf((async function(e){let{id:t}=e;return qf(),Vf["account-reopen"]({id:t})})),Vf["api/account-delete"]=zf((async function(e){let{id:t}=e;return qf(),Vf["account-close"]({id:t,forced:!0})})),Vf["api/categories-get"]=async function(){let{grouped:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};qf();let t=await Vf["get-categories"]();return e?t.grouped.map(Uf.toExternal):t.list.map(Ff.toExternal)},Vf["api/category-group-create"]=zf((async function(e){let{group:t}=e;return qf(),Vf["category-group-create"]({name:t.name})})),Vf["api/category-group-update"]=zf((async function(e){let{id:t,fields:r}=e;return qf(),Vf["category-group-update"]({id:t,...Uf.fromExternal(r)})})),Vf["api/category-group-delete"]=zf((async function(e){let{id:t,transferCategoryId:r}=e;return qf(),Vf["category-group-delete"]({id:t,transferId:r})})),Vf["api/category-create"]=zf((async function(e){let{category:t}=e;return qf(),Vf["category-create"]({name:t.name,groupId:t.group_id,isIncome:t.is_income})})),Vf["api/category-update"]=zf((async function(e){let{id:t,fields:r}=e;return qf(),Vf["category-update"]({id:t,...Ff.fromExternal(r)})})),Vf["api/category-delete"]=zf((async function(e){let{id:t,transferCategoryId:r}=e;return qf(),Vf["category-delete"]({id:t,transferId:r})})),Vf["api/payees-get"]=async function(){return qf(),(await Vf["payees-get"]()).map(Pf.toExternal)},Vf["api/payee-create"]=zf((async function(e){let{payee:t}=e;return qf(),Vf["payee-create"]({name:t.name})})),Vf["api/payee-update"]=zf((async function(e){let{id:t,fields:r}=e;return qf(),Vf["payees-batch-change"]({updated:[{id:t,...Pf.fromExternal(r)}]})})),Vf["api/payee-delete"]=zf((async function(e){let{id:t}=e;return qf(),Vf["payees-batch-change"]({deleted:[{id:t}]})}));const Yf="db.latest.sqlite";let Zf=null;async function Kf(e){const t=Wr(e),r=Br(t,"backups");let n=[];await tn(r)&&(n=await en(r),n=n.filter((e=>e.match(/\.sqlite$/))));const o=await Promise.all(n.map((async e=>{const t=await ln(Br(r,e));return{id:e,date:new Date(t)}})));return o.sort(((e,t)=>e.date<t.date?1:e.date>t.date?-1:0)),o}async function Jf(e){let t=await Kf(e),r=await async function(e){const t=Wr(e);return await tn(Br(t,Yf))?{id:Yf,date:null,isLatest:!0}:null}(e);return r&&t.unshift(r),t.map((e=>({...e,date:e.date?ce(e.date,"yyyy-MM-dd h:mm"):null})))}async function Xf(e){const t=Wr(e);await tn(Br(t,Yf))&&await sn(Br(Wr(e),Yf));let r=`${be()}.sqlite`,n=Br(t,"backups",r);await tn(Br(t,"backups"))||await rn(Br(t,"backups")),await nn(Br(t,"db.sqlite"),n);const o=Lr(n);await jr(o,"DELETE FROM messages_crdt"),await jr(o,"DELETE FROM messages_clock"),xr(o);const i=await async function(e){const t=e.reduce(((e,t)=>{const r=ce(t.date,"yyyy-MM-dd");return e[r]=e[r]||[],e[r].push(t),e}),{}),r=[];for(let e of Object.keys(t)){const n=t[e],o=e===ft();for(let e of n.slice(o?3:1))r.push(e.id)}const n=e.filter((e=>!r.includes(e.id)));return r.concat(n.slice(10).map((e=>e.id)))}(await Kf(e));for(let e of i)await sn(Br(t,"backups",e));Ar("backups-updated",await Jf(e))}function Qf(e){Zf&&clearInterval(Zf),Zf=setInterval((async()=>{console.log("Making backup"),await Xf(e)}),9e5)}function ed(){clearInterval(Zf),Zf=null}var td=__webpack_require__(5070);const rd="#cleanup ";function nd(e){_(1,arguments);var t=w(e);return t.setHours(0,0,0,0),t}var od=__webpack_require__(6613),id=__webpack_require__.n(od),ad=864e5;function sd(e,t){var r=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return r<0?-1:r>0?1:r}function ud(e,t){return _(2,arguments),Je(e,-v(t))}function ld(e,t){return _(2,arguments),function(e,t){return _(2,arguments),Ye(e,12*v(t))}(e,-v(t))}function cd(e){return new Tl({rrules:Gs(e)}).occurrences({take:3}).toArray().map((e=>e.date))}async function fd(e,t){let{data:r}=await fo(io("transactions").filter({account:t,schedule:null,"payee.transfer_acct":null,$and:[{date:{$gte:Xe(e,2)}},{date:{$lte:Ke(e,2)}}]}).select("*").options({splits:"none"}));return r}function dd(e,t){return 1/(Math.abs(function(e,t){_(2,arguments);var r=w(e),n=w(t),o=sd(r,n),i=Math.abs(function(e,t){_(2,arguments);var r=nd(e),n=nd(t),o=r.getTime()-q(r),i=n.getTime()-q(n);return Math.round((o-i)/ad)}(r,n));r.setDate(r.getDate()-o*i);var a=o*(i-Number(sd(r,n)===-o));return 0===a?0:a}(st(e),st(t)))+1)}function gd(e,t){let r=(e=[...e].reverse())[0],n=e.slice(1),o=[];for(let i of r.transactions){let a=Ps(i.amount),s=i.payee,u=n.map((e=>{let t=e.transactions.find((e=>e.amount>=i.amount-a&&e.amount<=i.amount+a));return t=t&&t.payee===s?t:null,t?{trans:t,rank:dd(e.date,t.date)}:null}));if(-1!==u.indexOf(null))continue;let l=u.reduce(((e,t)=>e+t.rank),dd(r.date,i.date)),c=u.reduce(((e,t)=>e&&t.trans.amount===i.amount),!0);o.push({rank:l,amount:i.amount,account:i.account,payee:i.payee,date:t,exactDate:l===e.length,exactAmount:c})}return o}async function pd(e,t,r,n,o){let i=[];for(let o=0;o<t;o++){let t,a=Ke(e,o);if("function"==typeof r){if(t=r(a),!1===t)continue}else t={...r,start:a};t.start=lt(t.start);let s=[],u=cd(t);for(let e of u)s.push({date:lt(e),transactions:await fd(e,n)});i=i.concat(gd(s,t))}return i}async function hd(e,t){return pd(ud(st(e),4),14,{frequency:"weekly"},t)}async function yd(e,t){return pd(ud(st(e),7),14,{frequency:"weekly",interval:2},t)}async function md(e,t){return pd(Ze(st(e),4),62,(e=>!(function(e){return _(1,arguments),w(e).getDate()}(e)>28)&&{start:e,frequency:"monthly"}),t)}async function bd(e,t){let r=await pd(Ze(st(e),3),1,{frequency:"monthly",patterns:[{type:"day",value:-1}]},t),n=await pd(Ze(st(e),4),1,{frequency:"monthly",patterns:[{type:"day",value:-1}]},t);return r.concat(n)}async function _d(e,t){return pd(ud(st(e),8),14,(e=>{let t=ce(new Date,"iiii").slice(0,2).toUpperCase();return{start:e,frequency:"monthly",patterns:[{type:t,value:1},{type:t,value:3}]}}),t)}async function wd(e,t){return pd(Ze(st(e),8),14,(e=>{let t=ce(new Date,"iiii").slice(0,2).toUpperCase();return{start:e,frequency:"monthly",patterns:[{type:t,value:2},{type:t,value:4}]}}),t)}async function Ed(e){let t=e._conditions,r=t.find((e=>"date"===e.field)).value;for(;;){let e=r;switch(r={...e},r.frequency){case"weekly":r.start=lt(ud(st(r.start),r.interval||1));break;case"monthly":r.start=lt(Ze(st(r.start),r.interval||1));break;case"yearly":r.start=lt(ld(st(r.start),r.interval||1));break;default:throw new Error("findStartDate: invalid frequency")}let n=t.map((e=>"date"===e.field?{...e,value:r}:e)),{filters:o,errors:i}=Yc(n,{recurDateBounds:1});if(i.length>0){r=null;break}let{data:a}=await fo(io("transactions").filter({$and:o}).select("*"));if(0===a.length){r=e;break}}return r?{...e,date:r,_conditions:t.map((e=>"date"===e.field?{...e,value:r}:e))}:e}function vd(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Date;t=nd(t);let r=new Ec(e.op,"date",e.value,null,new Map(Object.entries({date:"date"}))).getValue();if("date"===r.type)return r.date;if("recur"===r.type){let e=r.schedule.occurrences({start:t,take:1}).toArray();if(e.length>0)return lt(e[0].date)}return null}async function Sd(e){if(null==e)throw new Error("Schedule not attached to a rule");let{data:t}=await fo(io("schedules").filter({id:e}).calculate("rule"));return Hc().find((e=>e.id===t))}async function Td(e){let{id:t,start:r,conditions:n,reset:o}=e;if(null==n){let e=await Sd(t);if(null==e)throw new Error("No rule found for schedule");n=e.serialize().conditions}let{date:i}=Ys(n),{data:a}=await fo(io("schedules").filter({id:t}).calculate("next_date"));if(i){let e=vd(i,r?r(a):new Date);if(e!==a){let r=await Ha("SELECT id, base_next_date_ts FROM schedules_next_date WHERE schedule_id = ?",[t]);await qa("schedules_next_date",o?{id:r.id,base_next_date:fn(e),base_next_date_ts:Date.now()}:{id:r.id,local_next_date:fn(e),local_next_date_ts:r.base_next_date_ts})}}}async function Od(e,t){let r=await Ha("SELECT id from schedules WHERE name = ?",[e]);return null!=r&&(!t||r.id!==t)}async function Ad(e){let t,{schedule:r,conditions:n,resetNextDate:o}=e;if(r.rule)throw new Error("You cannot change the rule of a schedule");if(r.name){if(await Od(r.name,r.id))throw new Error("There is already a schedule with this name")}else r.name=null;if(n){let{date:e}=Ys(n);if(e&&null==e.value)throw new Error("Date is required");t=await Sd(r.id),null==t&&(t=await async function(e){let{data:t}=await fo(io("schedules").filter({id:e}).calculate("rule"));t&&await Za("rules",t);let r=await zc({stage:null,conditionsOp:"and",conditions:[{op:"isapprox",field:"date",value:ft()},{op:"isapprox",field:"amount",value:0}],actions:[{op:"link-schedule",value:e}]});return await Qa("schedules",{id:e,rule:r}),Hc().find((e=>e.id===r))}(r.id))}await ya((async()=>{if(n){let e=t.serialize().conditions,i=function(e,t){let r=Ys(e),n=Ys(t),o=function(e,t){let r=[];for(let n=0;n<e.length;n++)r.push([e[n],t[n]]);return r}(Object.values(r),Object.values(n)),i=e.map((e=>{let t=o.find((t=>e===t[0]));return t&&t[1]?t[1]:e})),a=o.filter((e=>null==e[0]&&null!=e[1])).map((e=>e[1]));return i.concat(a)}(e,n);await Vc({id:t.id,conditions:i});let a=e=>{let{type:t,...r}=e;return r};!o&&id()(e.find((e=>"account"===e.field)),e.find((e=>"account"===e.field)))&&id()(a(e.find((e=>"date"===e.field))||{}),a(i.find((e=>"date"===e.field))||{}))||await Td({id:r.id,conditions:i,reset:!0})}else o&&await Td({id:r.id,reset:!0});await Qa("schedules",r)}))}function Id(e){let{actions:t,conditions:r}=e instanceof Tc?e.serialize():Pc.toJS(e);if(t&&t.find((e=>"link-schedule"===e.op))){let e=t.find((e=>"link-schedule"===e.op)).value;if(e){let t=Ys(r),n=r.findIndex((e=>e===t.payee)),o=r.findIndex((e=>e===t.account)),i=r.findIndex((e=>e===t.amount)),a=r.findIndex((e=>e===t.date));La("INSERT OR REPLACE INTO schedules_json_paths (schedule_id, payee, account, amount, date) VALUES (?, ?, ?, ?, ?)",[e,-1===n?null:`$[${n}]`,-1===o?null:`$[${o}]`,-1===i?null:`$[${i}]`,-1===a?null:`$[${a}]`])}}}function Rd(e,t){t.forEach(((e,t)=>{"rules"===t&&e.forEach((e=>{Id(e)}))}))}async function Nd(e){let{id:t}=e,{data:r}=await fo(io("schedules").filter({id:t}).select("*")),n=r[0];if(null==n||null==n._account)return;let o={payee:n._payee,account:n._account,amount:Zs(n._amount),date:n.next_date,schedule:n.id,cleared:!1};o.account&&await mf(o.account,[o])}async function Dd(e){let{data:t}=await fo(io("schedules").filter({completed:!1,"_account.closed":!1}).select("*")),{data:r}=await fo(function(e){let t=e.map((e=>{let t=e._conditions.find((e=>"date"===e.field));return{$and:{schedule:e.id,date:{$gte:t&&"is"===t.op?e.next_date:mt(e.next_date,2)}}}}));return io("transactions").filter({$or:t}).orderBy({date:"desc"}).groupBy("schedule").select(["schedule","date"])}(t)),n=new Set(r.filter(Boolean).map((e=>e.schedule))),o=[],i=!1;for(let r of t){let t=qs(r.next_date,r.completed,n.has(r.id));if("paid"===t){if(r._date)if(r._date.frequency)try{await Td({id:r.id})}catch(e){}else r._date<ft()&&await Ad({schedule:{id:r.id,completed:!0}})}else("due"===t||"missed"===t)&&r.posts_transaction&&r._account&&(e?(await Nd({id:r.id}),i=!0):o.push(r._payee))}o.length>0?Ar("schedules-offline",{payees:o}):i&&Ar("sync-event",{type:"success",tables:["transactions"],syncDisabled:"false"})}let jd=hi();jd.method("schedule/create",br(Di((async function(){let{schedule:e=null,conditions:t=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e&&e.id||be(),{date:n}=Ys(t);if(null==n)throw new Error("A date condition is required to create a schedule");if(null==n.value)throw new Error("Date is required");let o,i=vd(n),a=i?fn(i):null;if(e)if(e.name){if(await Od(e.name,r))throw new Error("Cannot create schedules with the same name")}else e.name=null;o=await zc({stage:null,conditionsOp:"and",conditions:t,actions:[{op:"link-schedule",value:r}]});let s=Date.now();return await Ga("schedules_next_date",{schedule_id:r,local_next_date:a,local_next_date_ts:s,base_next_date:a,base_next_date_ts:s}),await Xa("schedules",{...e,id:r,rule:o}),r})))),jd.method("schedule/update",br(Di(Ad))),jd.method("schedule/delete",br(Di((async function(e){let{id:t}=e,{data:r}=await fo(io("schedules").filter({id:t}).calculate("rule"));await ya((async()=>{await Za("rules",r),await Za("schedules",t)}))})))),jd.method("schedule/skip-next-date",br(Di((async function(e){let{id:t}=e;return Td({id:t,start:e=>Ke(st(e),1)})})))),jd.method("schedule/post-transaction",br(Di(Nd))),jd.method("schedule/force-run-service",br((()=>Dd(!0)))),jd.method("schedule/discover",(function(){return async function(){let{data:e}=await fo(io("accounts").filter({closed:!1}).select("*")),t=[];for(let r of e){let e=await Ha("SELECT * FROM v_transactions WHERE account = ? AND parent_id IS NULL ORDER BY date DESC LIMIT 1",[r.id]);if(e){let n=dn(e.date);t=t.concat(await hd(n,r.id),await yd(n,r.id),await md(n,r.id),await bd(n,r.id),await _d(n,r.id),await wd(n,r.id))}}let r=[...Nt(t,"payee").entries()].map((e=>{let[t,r]=e;r.sort(((e,t)=>t.rank-e.rank));let n=r[0];return{id:be(),account:n.account,payee:n.payee,date:n.date,amount:n.amount,_conditions:[{op:"is",field:"account",value:n.account},{op:"is",field:"payee",value:n.payee},{op:n.exactDate?"is":"isapprox",field:"date",value:n.date},{op:n.exactAmount?"is":"isapprox",field:"amount",value:n.amount}]}})),n=[];for(let e of r)n.push(await Ed(e));return n}()})),jd.method("schedule/get-upcoming-dates",(async function(e){let{config:t,count:r}=e,n=Gs(t);try{return new Tl({rrules:n}).occurrences({start:nd(new Date),take:r}).toArray().map((e=>lt(e.date)))}catch(e){throw fr(t),e}})),jd.service((function(){return Ua((()=>{Hc().forEach((e=>{Id(e)}))})),fa(Rd)})),jd.events.on("sync",(e=>{let{type:t,subtype:r}=e;if(("success"===t||"error"===t||"unauthorized"===t)&&Eo()){let{lastScheduleRun:e}=Eo();e!==ft()&&(Er((()=>Dd("success"===t))),_o({lastScheduleRun:ft()}))}}));const kd=jd;var Cd=__webpack_require__(4939);function Md(e){let t=e[0].priority,r=!1;for(let n=1;n<e.length;n++)e[n].priority!==t&&(t=Math.min(t,e[n].priority),r=!0);return{lowPriority:t,errorNotice:r}}async function Ld(e,t){let r,n=0,o=[],i=await Bd(),a=0,s=[],u=await Wa("SELECT * FROM v_categories WHERE tombstone = 0");for(let t=0;t<u.length;t++){let r=u[t],n=await Po(Ot(e),`budget-${r.id}`);n&&s.push({cat:r,amount:n});let o=i[r.id];if(o){for(let e=0;e<o.length;e++)a=o[e].priority>a?o[e].priority:a;await $o({category:r.id,month:e,amount:0})}}let l=a+1,c=0;for(let e=0;e<u.length;e++){let t=i[u[e].id];if(t)for(let e=0;e<t.length;e++)"remainder"===t[e].type&&(t[e].priority=l,c+=t[e].weight,r=!0)}r&&(a=l);let f=Ot(e),d=await Po(f,"to-budget");for(let r=0;r<=a;r++){let s=1;if(r===a){let e=await Po(f,"to-budget");s=Math.round(e/c)}for(let a=0;a<u.length;a++){let l=u[a],c=i[l.id];if(c){let i=!1,a=!1,u=0;if(c.filter((e=>"schedule"===e.type||"by"===e.type)).length>0){let{lowPriority:e,errorNotice:t}=await Md(c);u=e,i=u!==r,a=!0,!i&&t&&o.push(l.name+": Schedules and By templates should all have the same priority. Using priority "+u)}if(!i&&(a||(c=c.filter((e=>e.priority===r))),c.length>0)){o=o.concat(c.filter((e=>"error"===e.type)).map((e=>{let{line:t,error:r}=e;return[l.name+": "+r.message,t," ".repeat(xd.length+r.location.start.offset)+"^"].join("\n")})));let{amount:i,errors:a}=await Fd(l,c,e,r,s,d,t);null!=i&&(n++,await $o({category:l.id,month:e,amount:i})),null!=a&&(o=o.concat(a.map((e=>`${l.name}: ${e}`))))}}}}if(!t)for(let t=0;t<s.length;t++){await $o({category:s[t].cat.id,month:e,amount:s[t].amount});let r=o.length;for(let e=0;e<r;e++)o[e].includes(s[t].cat.name)&&(o.splice(e,1),r--)}if(0===n)return o.length?{type:"error",sticky:!0,message:"There were errors interpreting some templates:",pre:o.join("\n\n")}:{type:"message",message:"All categories were up to date."};{let e=`Successfully applied ${n} templates.`;return o.length?{sticky:!0,message:`${e} There were errors interpreting some templates:`,pre:o.join("\n\n")}:{type:"message",message:e}}}const xd="#template";async function Bd(){let e={},t=await Wa(`SELECT * FROM notes WHERE lower(note) like '%${xd}%'`);for(let r=0;r<t.length;r++){let n=t[r].note.split("\n"),o=[];for(let e=0;e<n.length;e++){let t=n[e].trim();if(!t.toLowerCase().startsWith(xd))continue;let r=t.slice(xd.length);try{let e=(0,Cd.parse)(r);o.push(e)}catch(e){o.push({type:"error",line:t,error:e})}}o.length&&(e[t[r].id]=o)}return e}async function Fd(e,t,r,n,o,i,a){let s=`${r}-01`,u=[],l=await Wa("SELECT name from schedules WHERE name NOT NULL AND tombstone = 0");l=l.map((e=>e.name)),(t=t.filter((e=>{switch(e.type){case"by":case"spend":let t,r=`${e.month}-01`,n=pt(r,s),o=e.annual?12*(e.repeat||1):e.repeat;for("spend"===e.type&&(t=`${e.from}-01`);n<0&&o;)r=gt(r,o),t&&(t=gt(t,o)),n=pt(r,s);if(n<0)return u.push(`${e.month} is in the past.`),!1;e.month=At(r,"yyyy-MM"),t&&(e.from=At(t,"yyyy-MM"));break;case"schedule":if(!l.includes(e.name))return u.push(`Schedule ${e.name} does not exist`),null}return!0}))).length>1&&(t=t.sort(((e,t)=>"by"!==e.type||e.annual?e.type.localeCompare(t.type):pt(`${e.month}-01`,`${t.month}-01`))));let c,f,d=Ot(r),g=await Po(d,`budget-${e.id}`),p=await Po(d,`sum-amount-${e.id}`),h=await Po(d,`leftover-${e.id}`),y=await Po(d,"to-budget"),m=g,b=h-p-g,_=0;for(let r=0;r<t.length;r++){let a=t[r];switch(a.type){case"simple":{if(null!=a.limit){if(null!=c)return u.push("More than one “up to” limit found."),{errors:u};c=Pt(a.limit.amount),f=a.limit.hold}let e=0;e=null!=a.monthly?Pt(a.monthly):c,m+e<y||!n?m+=e:(y>0&&(m+=y),u.push("Insufficient funds."));break}case"by":{let e=0,o=`${t[r].month}-01`,i=pt(o,s),l="by"===a.type?a.repeat:12*(a.repeat||1);for(;i<0&&l;)o=gt(o,l),i=pt(t[r].month,s);0===r&&(_=b),_=Pt(t[r].amount)-_,_>=0?(e=_,_=0):(e=0,_=Math.abs(_));let c=i>=0?Math.round(e/(i+1)):0;c>=0&&(m+c<y||!n?m+=c:(y>0&&(m+=y),u.push("Insufficient funds.")));break}case"week":{let e=Pt(a.amount),t=null!=a.weeks?Math.round(a.weeks):1;if(null!=a.limit){if(null!=c)return u.push("More than one “up to” limit found."),{errors:u};c=Pt(a.limit.amount),f=a.limit.hold}let r=a.starting,o=gt(s,1);for(;r<o;)r>=s&&(m+e<y||!n?m+=e:(y>0&&(m+=y),u.push("Insufficient funds."))),w=t,r=ce(Je(at(r),w),"yyyy-MM-dd");break}case"spend":{let t=`${a.from}-01`,r=`${a.month}-01`,o=b,i=!0;for(let r=t;pt(s,r)>0;r=gt(r,1)){let t=Ot(At(r,"yyyy-MM"));if(i){let r=await Po(t,`sum-amount-${e.id}`);o=await Po(t,`leftover-${e.id}`)-r,i=!1}else o+=await Po(t,`budget-${e.id}`)}let l=pt(r,at(s)),c=Pt(a.amount),f=0;if(l<0)return u.push(`${a.month} is in the past.`),{errors:u};f=0===l?c-o:Math.round((c-o)/(l+1)),f<y||!n?m=f:(y>0&&(m=y),u.push("Insufficient funds."));break}case"percentage":{let e=a.percent,t=0;if("all income"===a.category.toLowerCase())t=await Po(d,"total-income");else if("available funds"===a.category.toLowerCase())t=i;else{let e=(await es()).find((e=>e.is_income&&e.name.toLowerCase()===a.category.toLowerCase()));if(!e)return u.push(`Could not find category “${a.category}”`),{errors:u};t=await Po(d,`sum-amount-${e.id}`)}let r=Math.max(0,Math.round(t*(e/100)));r<y||!n?m=r:(y>0&&(m=y),u.push("Insufficient funds."));break}case"schedule":{let{id:e}=await Ha("SELECT id FROM schedules WHERE name = ?",[a.name]),o=(await Sd(e)).serialize().conditions,{date:i,amount:l}=Ys(o),c=vd(i,at(s)),f=Object(i.value)===i.value&&"frequency"in i.value,d=pt(c,s);if(f){let e=0,t=gt(s,d+1),r=vd(i,at(s));for(;r<t;)e+=l.value,r=yt(r,1),r=vd(i,at(r));l.value=e}if(!0===a.full){1===d&&(m=-Zs(l.value));break}0===r&&(_=b),_=-Zs(l.value)-_;let g=0;_>=0?(g=_,_=0):(g=0,_=Math.abs(_));let h=d>=0?Math.round(g/(d+1)):0;if(d<0)return u.push(`Non-repeating schedule ${a.name} was due on ${c}, which is in the past.`),{errors:u};d>=0&&(h>=0&&d>=0&&m+h<y||!n?(m+=h,r===t.length-1&&(m-=p)):(y>0&&(m=y),u.push("Insufficient funds.")));break}case"remainder":m=Math.round(o*a.weight),m>y&&(m=y);break;case"error":return{errors:u}}}var w;if(null!=c&&(f&&h>c?m=0:m+b>c&&(m=c-b)),(null==e.budgeted||0===e.budgeted)&&0!==m||a){if(e.budgeted===m)return null;{let r=e.name+": "+Wt(b);return r+=" + "+Wt(m)+" = "+Wt(b+m),r+=" "+t.map((e=>e.line)).join("\n"),console.log(r),{amount:m,errors:u}}}return{errors:u}}let Ud=hi();Ud.method("budget/budget-amount",br(Di($o))),Ud.method("budget/copy-previous-month",br(Di((async function(e){let{month:t}=e,r=zo(dt(t)),n=Wo(),o=await function(e,t){return Wa(`\n SELECT b.*, c.is_income FROM v_categories c\n LEFT JOIN ${e} b ON b.category = c.id\n WHERE c.tombstone = 0 AND b.month = ?\n `,[t])}(n,r);await ya((async()=>{o.forEach((e=>{(1!==e.is_income||Ho())&&$o({category:e.category,month:t,amount:e.amount})}))}))})))),Ud.method("budget/set-zero",br(Di((async function(e){let{month:t}=e,r=await Wa("SELECT * FROM v_categories WHERE tombstone = 0");await ya((async()=>{r.forEach((e=>{(1!==e.is_income||Ho())&&$o({category:e.id,month:t,amount:0})}))}))})))),Ud.method("budget/set-3month-avg",br(Di((async function(e){let{month:t}=e,r=await Wa("SELECT * FROM v_categories WHERE tombstone = 0"),n=dt(t),o=dt(n),i=dt(o);await ya((async()=>{for(let e of r){if(1===e.is_income&&!Ho())continue;let r=await Po(Ot(n),"sum-amount-"+e.id),a=await Po(Ot(o),"sum-amount-"+e.id),s=await Po(Ot(i),"sum-amount-"+e.id);const u=Math.round((r+a+s)/3);$o({category:e.id,month:t,amount:-u})}}))})))),Ud.method("budget/check-templates",br(Di((function(){return async function(){let e=await Bd(),t=[],r=await Wa("SELECT * FROM v_categories WHERE tombstone = 0");for(let n=0;n<r.length;n++){let o=r[n],i=e[o.id];if(i)for(let e=0;e<i.length;e++)"error"===i[e].type&&t.push(o.name+": "+i[e].line)}return t.length?{sticky:!0,message:"There were errors interpreting some templates:",pre:t.join("\n\n")}:{type:"message",message:"All templates passed! 🎉"}}()})))),Ud.method("budget/apply-goal-template",br(Di((function(e){let{month:t}=e;return Ld(t,!1)})))),Ud.method("budget/overwrite-goal-template",br(Di((function(e){let{month:t}=e;return Ld(t,!0)})))),Ud.method("budget/cleanup-goal-template",br(Di((function(e){let{month:t}=e;return async function(e){let t=0,r=0,n=0,o=[],i=[],a=await async function(){let e={},t=await Wa(`SELECT * FROM notes WHERE lower(note) like '%${rd}%'`);for(let r=0;r<t.length;r++){let n=t[r].note.split("\n"),o=[];for(let e=0;e<n.length;e++){let t=n[e].trim();if(!t.toLowerCase().startsWith(rd))continue;let r=t.slice(9);try{let e=(0,td.parse)(r);o.push(e)}catch(e){o.push({type:"error",line:t,error:e})}}o.length&&(e[t[r].id]=o)}return e}(),s=await Wa("SELECT * FROM v_categories WHERE tombstone = 0"),u=Ot(e);for(let o=0;o<s.length;o++){let l=s[o],c=a[l.id];if(c){if(c.filter((e=>"source"===e.type)).length>0){let r=await Po(u,`leftover-${l.id}`),n=await Po(u,`budget-${l.id}`);await $o({category:l.id,month:e,amount:n-r}),t+=1}c.filter((e=>"sink"===e.type)).length>0&&(i.push({cat:l,temp:c}),r+=1,n+=c.filter((e=>"sink"===e.type))[0].weight)}}let l=parseInt(e.replace("-",""));for(let t=0;t<s.length;t++){let r=s[t],n=await Po(u,"to-budget"),o=await Po(u,`leftover-${r.id}`),i=await Po(u,`budget-${r.id}`)+Math.abs(o),a=r.id,c=await Ha("SELECT carryover FROM zero_budgets WHERE month = ? and category = ?",[l,a]);o<0&&Math.abs(o)<=n&&!r.is_income&&0===c.carryover&&await $o({category:r.id,month:e,amount:i})}let c=await Po(u,"to-budget");c<=0&&o.push("No funds are available to reallocate.");for(let t=0;t<i.length;t++){let r=await Po(u,`budget-${i[t].cat.id}`),o=i[t].cat.id,a=i[t].temp.filter((e=>"sink"===e.type))[0].weight,s=r+Math.round(a/n*c);if(t===i.length-1){let e=await Po(u,"to-budget");s>e&&(s=r+e)}await $o({category:o,month:e,amount:s})}if(0===t)return o.length?{type:"error",sticky:!0,message:"There were errors interpreting some templates:",pre:o.join("\n\n")}:{type:"message",message:"All categories were up to date."};{let e=`Successfully returned funds from ${t} ${1===t?"source":"sources"} and funded ${r} sinking ${1===r?"fund":"funds"}.`;return o.length?{sticky:!0,message:`${e} There were errors interpreting some templates:`,pre:o.join("\n\n")}:{type:"message",message:e}}}(t)})))),Ud.method("budget/hold-for-next-month",br(Di((async function(e){let{month:t,amount:r}=e,n=await Ha("SELECT buffered FROM zero_budget_months WHERE id = ?",[t]),o=Ot(t),i=await Po(o,"to-budget");if(i>0){let e=function(e,t,r){return t+Math.min(Math.max(r,-t),Math.max(e,0))}(i,n&&n.buffered||0,r);return await qo(t,e),!0}return!1})))),Ud.method("budget/reset-hold",br(Di((async function(e){let{month:t}=e;await qo(t,0)})))),Ud.method("budget/cover-overspending",br(Di((async function(e){let{month:t,to:r,from:n}=e,o=Ot(t),i=await Po(o,"budget-"+r),a=await Po(o,"leftover-"+r),s=await Po(o,"to-be-budgeted"===n?"to-budget":"leftover-"+n);if(a>=0||s<=0)return;let u=Math.min(-a,s);if("to-be-budgeted"!==n){const e=await Po(o,"budget-"+n);await $o({category:n,month:t,amount:e-u})}await $o({category:r,month:t,amount:i+u})})))),Ud.method("budget/transfer-available",br(Di((async function(e){let{month:t,amount:r,category:n}=e,o=Ot(t),i=await Po(o,"to-budget");r=Math.max(Math.min(r,i),0);let a=await Po(o,"budget-"+n);await $o({category:n,month:t,amount:a+r})})))),Ud.method("budget/transfer-category",br(Di((async function(e){let{month:t,amount:r,from:n,to:o}=e;const i=Ot(t),a=await Po(i,"budget-"+n);if(await $o({category:n,month:t,amount:a-r}),"to-be-budgeted"!==o){const e=await Po(i,"budget-"+o);await $o({category:o,month:t,amount:e+r})}})))),Ud.method("budget/set-carryover",br(Di((async function(e){let{startMonth:t,category:r,flag:n}=e,o=Wo(),i=function(e){let{createdMonths:t}=Do().meta(),r=null;for(let e of t)(null==r||e>r)&&(r=e);return St(e,r)}(t);await ya((async()=>{for(let e of i)Go(o,r,zo(e),n)}))}))));const Pd=Ud,Wd={validate(e){let{update:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(cn("transaction_filters",e,["conditions"],t),(!t||"conditionsOp"in e)&&!["and","or"].includes(e.conditionsOp))throw new Error("Invalid filter conditionsOp: "+e.conditionsOp);return e},toJS(e){let{conditions:t,conditions_op:r,...n}=e;return{...n,conditionsOp:r,conditions:Fc(t)}},fromJS(e){let{conditionsOp:t,...r}=e;return t&&(r.conditions_op=t),r}};async function Hd(e,t,r){let n=await Ha("SELECT id from transaction_filters WHERE tombstone = 0 AND name = ?",[e]);return null!==n&&(!!r||n.id!==t)}function zd(e,t,r){let n,{conditions:o,conditionsOp:i}=e,a=[],s=!1;return t.map((e=>(s||1!==o.length&&e.conditionsOp!==i||e.tombstone||e.conditions.length!==o.length||(s=!1,o.map(((t,r)=>(a[r]=e.conditions.filter((e=>t.value===e.value&&t.op===e.op&&t.field===e.field)).length>0,s=(0===r||s)&&a[r],!0))),n=s&&a[o.length-1]&&e),!0))),a=[],r?!!n&&n.name:!!n&&n.id!==e.id&&n.name}let Vd=hi();Vd.method("filter-create",br((async function(e){let t=be(),r={id:t,conditions:e.state.conditions,conditionsOp:e.state.conditionsOp,name:e.state.name};if(!r.name)throw new Error("Filter name is required");if(await Hd(r.name,r.id,!0))throw new Error("There is already a filter named "+r.name);if(!(r.conditions.length>0))throw new Error("Conditions are required");{let t=zd(r,e.filters,!0);if(t)throw new Error("Duplicate filter warning: conditions already exist. Filter name: "+t)}return await Xa("transaction_filters",Wd.fromJS(r)),t}))),Vd.method("filter-update",br((async function(e){let t={id:e.state.id,conditions:e.state.conditions,conditionsOp:e.state.conditionsOp,name:e.state.name};if(!t.name)throw new Error("Filter name is required");if(await Hd(t.name,t.id,!1))throw new Error("There is already a filter named "+t.name);if(!(t.conditions.length>0))throw new Error("Conditions are required");{let r=zd(t,e.filters,!1);if(r)throw new Error("Duplicate filter warning: conditions already exist. Filter name: "+r)}await Qa("transaction_filters",Wd.fromJS(t))}))),Vd.method("filter-delete",br(Di((async function(e){await Za("transaction_filters",e)}))));const $d=Vd;let qd=hi();qd.method("notes-save",(async e=>{let{id:t,note:r}=e;await qa("notes",{id:t,note:r})}));const Gd=qd;function Yd(e,t){t.forEach(((e,t)=>{if("transactions"===t){let t=[];e.forEach((e=>{if(1===e.isChild&&null==e.parent_id&&e.id.includes("/")){let n=e.id.split("/")[0];t.push({dataset:"transactions",row:e.id,column:"parent_id",value:n,timestamp:r.Timestamp.send()})}})),t.length>0&&da(t)}}))}let Zd=null;let Kd=hi();Kd.method("tools/fix-split-transactions",(async()=>{let e=await Wa("\n SELECT t.*, p.payee AS parentPayee FROM v_transactions_internal t\n LEFT JOIN v_transactions_internal p ON t.parent_id = p.id\n WHERE t.is_child = 1 AND t.payee IS NULL AND p.payee IS NOT NULL\n ");await Er((async()=>{let t=e.map((e=>({id:e.id,payee:e.parentPayee})));await rf({updated:t})}));let t=await Wa("\n SELECT t.id, p.cleared FROM v_transactions_internal t\n LEFT JOIN v_transactions_internal p ON t.parent_id = p.id\n WHERE t.is_child = 1 AND t.cleared != p.cleared\n ");await Er((async()=>{let e=t.map((e=>({id:e.id,cleared:1===e.cleared})));await rf({updated:e})}));let r=await Wa("\n SELECT t.* FROM v_transactions_internal t\n LEFT JOIN v_transactions_internal p ON t.parent_id = p.id\n WHERE t.is_child = 1 AND t.tombstone = 0 AND (p.tombstone = 1 OR p.id IS NULL)\n ");return await Er((async()=>{let e=r.map((e=>({id:e.id,tombstone:1})));await rf({updated:e})})),{numBlankPayees:e.length,numCleared:t.length,numDeleted:r.length}}));const Jd=Kd;var Xd=__webpack_require__(3650),Qd=__webpack_require__.n(Xd);let eg="/migrations",tg={1632571489012:async function(e,t){function r(e){return null!=e.expr?e.expr:e.cachedValue}e.execQuery("\nCREATE TABLE zero_budget_months\n (id TEXT PRIMARY KEY,\n buffered INTEGER DEFAULT 0);\n\nCREATE TABLE zero_budgets\n (id TEXT PRIMARY KEY,\n month INTEGER,\n category TEXT,\n amount INTEGER DEFAULT 0,\n carryover INTEGER DEFAULT 0);\n\nCREATE TABLE reflect_budgets\n (id TEXT PRIMARY KEY,\n month INTEGER,\n category TEXT,\n amount INTEGER DEFAULT 0,\n carryover INTEGER DEFAULT 0);\n\nCREATE TABLE notes\n (id TEXT PRIMARY KEY,\n note TEXT);\n\nCREATE TABLE kvcache (key TEXT PRIMARY KEY, value TEXT);\nCREATE TABLE kvcache_key (id INTEGER PRIMARY KEY, key REAL);\n");let n=e.runQuery("SELECT * FROM spreadsheet_cells WHERE name LIKE 'budget%!budget-%'",[],!0);e.transaction((()=>{n.forEach((t=>{let n=t.name.match(/^(budget-report|budget)(\d+)!budget-(.+)$/);if(null==n)return void console.log("Warning: invalid budget month name",t.name);let o=n[1],i=n[2].slice(0,4)+"-"+n[2].slice(4),a=parseInt(n[2]),s=n[3],u=parseInt(r(t));isNaN(u)&&(u=0);let l=t.name.split("!")[0],c=e.runQuery("SELECT * FROM spreadsheet_cells WHERE name = ?",[`${l}!carryover-${s}`],!0),f="budget-report"===o?"reflect_budgets":"zero_budgets";e.runQuery(`INSERT INTO ${f} (id, month, category, amount, carryover) VALUES (?, ?, ?, ?, ?)`,[`${i}-${s}`,a,s,u,c.length>0&&"true"===r(c[0])?1:0])}))}));let o=e.runQuery("SELECT * FROM spreadsheet_cells WHERE name LIKE 'budget%!buffered'",[],!0);e.transaction((()=>{o.forEach((t=>{let n=t.name.match(/^budget(\d+)!buffered$/);if(n){let o=n[1].slice(0,4)+"-"+n[1].slice(4),i=parseInt(r(t));isNaN(i)&&(i=0),e.runQuery("INSERT INTO zero_budget_months (id, buffered) VALUES (?, ?)",[o,i])}}))}));let i=e.runQuery("SELECT * FROM spreadsheet_cells WHERE name LIKE 'notes!%'",[],!0);e.transaction((()=>{i.forEach((t=>{let n=(e=>{try{let t=JSON.parse(e);return t&&""!==t?t:null}catch(e){return null}})(r(t));if(n){let[,r]=t.name.split("!");e.runQuery("INSERT INTO notes (id, note) VALUES (?, ?)",[r,n])}}))})),e.execQuery("\n DROP TABLE spreadsheet_cells;\n ANALYZE;\n VACUUM;\n ")}};function rg(e){return parseInt(e.match(/^(\d)+/)[0])}async function ng(e,t,r){const n=await on(Br(r,t));t.match(/\.js$/)?await async function(e,t){const r={runQuery:(t,r,n)=>jr(e,t,r,n),execQuery:t=>kr(e,t),transaction:t=>Mr(e,t)};if(null==tg[t])throw new Error("Could not find JS migration code to run for "+t);return(0,tg[t])(r,(()=>be()))}(e,rg(t)):await async function(e,t){try{await kr(e,t)}catch(e){throw console.log("Error applying sql:",t),e}}(e,n),await jr(e,"INSERT INTO __migrations__ (id) VALUES (?)",[rg(t)])}async function og(){await async function(){await async function(e){let t=await async function(e){return(await jr(e,"SELECT * FROM __migrations__ ORDER BY id ASC",[],!0)).map((e=>e.id))}(e),r=await async function(e){return(await en(e)).filter((e=>e.match(/(\.sql|\.js)$/))).sort(((e,t)=>{const r=rg(e),n=rg(t);return r<n?-1:r>n?1:0}))}(eg);!function(e,t){for(let r=0;r<e.length;r++)if(r>=t.length||e[r]!==rg(t[r]))throw console.error("Database is out of sync with migrations:",{appliedIds:e,available:t}),new Error("out-of-sync-migrations")}(t,r);const n=function(e,t){return t.filter((t=>{const r=rg(t);return-1===e.indexOf(r)}))}(t,r);for(let t of n)await ng(e,t,eg);return n}(Ca())}(),await async function(){let e="view-hash",t=await Ha("SELECT value FROM __meta__ WHERE key = ?",[e]),{value:r}=t||{},n=function(e,t){let r=t.views,n=[];return Object.keys(r).forEach((t=>{let{fields:o={},...i}=r[t],a=Object.fromEntries(Object.keys(e[t]).map((e=>[e,e]))),s={...a,...o};Object.keys(i).forEach((e=>{let t;t="function"==typeof i[e]?i[e]((e=>eo({...s,...e})),(e=>eo({...a,...e}))):i[e],t=t.trim().replace(/;$/,""),n.push(`\n DROP VIEW IF EXISTS ${e};\n CREATE VIEW ${e} AS ${t};\n `)}))})),n.join("\n")}(ro,no),o=Qd()(n);r!==o&&(await xa(n),await La("INSERT OR REPLACE INTO __meta__ (key, value) VALUES (?, ?)",[e,o]))}()}var ig=__webpack_require__(9142),ag=__webpack_require__(9033).Buffer;let sg="_demo-budget";function ug(e){let{names:t}=e;const r=t.map((e=>{let t=Do()._getNode(e);return{name:t.name,value:t.value}}));Ar("cells-changed",r)}let lg={};function cg(e){function t(e,t){let r=e.map((e=>{try{t(e)}catch(e){if(e instanceof ci)return console.warn("Invalid rule",e),e.type;throw e}return null}));return r.some(Boolean)?r:null}let r=t(e.conditions,(e=>new Ec(e.op,e.field,e.value,e.options,Fs))),n=t(e.actions,(e=>new Sc(e.op,e.field,e.value,e.options,Fs)));return r||n?{conditionErrors:r,actionErrors:n}:null}lg.undo=br((async function(){return async function(){let e=Ri;for(Ri=Math.max(Ri-1,0);Ri>0&&"marker"!==Ii[Ri].type;)Ri--;let t=Ii[Ri].meta,r=Math.max(Ri,0),n=Ii.slice(r,e+1).filter((e=>"messages"===e.type));if(n.length>0){let e=n.reduce(((e,t)=>e.concat(t.messages.map((e=>function(e,t){let r=Ct(t,[e.dataset,e.row]);if(r){let t=e.column;return"spreadsheet_cells"===e.dataset&&(t="cachedValue"),{...e,value:r[t]}}return"spreadsheet_cells"===e.dataset?"expr"===e.column?{...e,value:null}:e:"category_mapping"!==e.dataset&&"payee_mapping"!==e.dataset?"zero_budget_months"===e.dataset||"zero_budgets"===e.dataset||"reflect_budgets"===e.dataset?["buffered","amount","carryover"].includes(e.column)?{...e,value:0}:null:"notes"===e.dataset?{...e,value:null}:{...e,column:"tombstone",value:1}:null}(e,t.oldData))).filter((e=>e)))),[]).reverse();await ji(e,t,n[0].undoTag)}}()})),lg.redo=br((function(){return async function(){let e="marker"===Ii[Ri].type?Ii[Ri].meta:null,t=Ri;for(Ri=Math.min(Ri+1,Ii.length-1);Ri<Ii.length-1&&"marker"!==Ii[Ri].type;)Ri++;let n=Ri,o=Ii.slice(t+1,n+1).filter((e=>"messages"===e.type));if(o.length>0){let t=o.reduce(((e,t)=>e.concat(t.messages).concat(function(e,t){let n=new Set;return e.forEach((e=>{Ct(t,[e.dataset,e.row])||["zero_budget_months","zero_budgets","reflect_budgets","notes","category_mapping","payee_mapping"].includes(e.dataset)||n.add(e.dataset+"."+e.row)})),[...n].map((e=>{let[t,n]=e.split(".");return{dataset:t,row:n,column:"tombstone",value:0,timestamp:r.Timestamp.send()}}))}(t.messages,t.oldData))),[]);await ji(t,e,o[o.length-1].undoTag)}}()})),lg["transactions-batch-update"]=br((async function(e){let{added:t,deleted:r,updated:n,learnCategories:o}=e;return Ni((async()=>(await rf({added:t,updated:n,deleted:r,learnCategories:o})).updated))})),lg["transaction-add"]=br((async function(e){return await lg["transactions-batch-update"]({added:[e]}),{}})),lg["transaction-update"]=br((async function(e){return await lg["transactions-batch-update"]({updated:[e]}),{}})),lg["transaction-delete"]=br((async function(e){return await lg["transactions-batch-update"]({deleted:[e]}),{}})),lg["transactions-parse-file"]=async function(e){let{filepath:t,options:r}=e;return async function(e,t){let r=Array(),n=e.match(/\.[^.]*$/);if(n)switch(n[0].toLowerCase()){case".qif":return async function(e){let t,r=Array(),n=await on(e);try{t=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.split("\n"),n=r.shift(),o=/!Type:([^$]*)$/.exec(n.trim()),i={dateFormat:t.dateFormat,transactions:[]},a=i.transactions,s={};if(!o||!o.length)throw new Error("File does not appear to be a valid qif file: "+n);i.type=o[1];let u={};for(;n=r.shift();)if(n=n.trim(),"^"!==n)switch(n[0]){case"D":s.date=n.substring(1);break;case"T":s.amount=n.substring(1);break;case"N":s.number=n.substring(1);break;case"M":s.memo=n.substring(1);break;case"A":s.address=(s.address||[]).concat(n.substring(1));break;case"P":s.payee=n.substring(1).replace(/&/g,"&");break;case"L":let e=n.substring(1).split(":");s.category=e[0],void 0!==e[1]&&(s.subcategory=e[1]);break;case"C":s.clearedStatus=n.substring(1);break;case"S":let t=n.substring(1).split(":");u.category=t[0],void 0!==t[1]&&(u.subcategory=t[1]);break;case"E":u.description=n.substring(1);break;case"$":u.amount=parseFloat(n.substring(1)),s.division instanceof Array||(s.division=[]),s.division.push(u),u={};break;default:throw new Error("Unknown Detail Code: "+n[0])}else a.push(s),s={};return Object.keys(s).length&&a.push(s),i}(n)}catch(e){return r.push({message:"Failed parsing: doesn’t look like a valid QIF file.",internal:e.stack}),{errors:r,transactions:[]}}return{errors:[],transactions:t.transactions.map((e=>({amount:null!=e.amount?Ht(e.amount):null,date:e.date,payee_name:e.payee,imported_payee:e.payee,notes:e.memo||null})))}}(e);case".csv":return async function(e){let t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Array(),o=await on(e);try{t=Lf()(o,{columns:!0,bom:!0,delimiter:r.delimiter||",",quote:'"',trim:!0,relax_column_count:!0,skip_empty_lines:!0})}catch(e){return n.push({message:"Failed parsing: "+e.message,internal:e.message}),{errors:n,transactions:[]}}return{errors:n,transactions:t}}(e,t);case".ofx":case".qfx":return async function(e){let{getOFXTransactions:t,initModule:r}=await __webpack_require__.e("xfo").then(__webpack_require__.bind(__webpack_require__,1378));await r();let n,o=Array(),i=await on(e,"binary");try{n=t(i)}catch(e){return o.push({message:"Failed importing file",internal:e.stack}),{errors:o}}let a=n.some((e=>null!=e.name&&""!==e.name));return{errors:o,transactions:n.map((e=>({amount:e.amount,imported_id:e.fi_id,date:e.date?lt(1e3*e.date):null,payee_name:a?e.name:e.memo,imported_payee:a?e.name:e.memo,notes:a&&e.memo||null})))}}(e)}return r.push({message:"Invalid file type",internal:""}),{errors:r,transactions:void 0}}(t,r)},lg["transactions-export"]=async function(e){let{transactions:t,accounts:r,categoryGroups:n,payees:o}=e;return async function(e,t,r,n){const o=t.reduce(((e,t)=>{let{id:r,name:n}=t;return e[r]=n,e}),{}),i=r.reduce(((e,t)=>{let{name:r,categories:n}=t;return n.forEach((t=>e[t.id]=`${r}: ${t.name}`)),e}),{}),a=n.reduce(((e,t)=>{let{id:r,name:n}=t;return e[r]=n,e}),{}),s=e.map((e=>{let{account:t,date:r,payee:n,notes:s,category:u,amount:l}=e;return{Account:o[t],Date:r,Payee:a[n],Notes:s,Category:i[u],Amount:null==l?0:Wt(l)}}));return kf()(s,{header:!0})}(t,r,n,o)},lg["transactions-export-query"]=async function(e){let{query:t}=e;return async function(e){let{data:t}=await fo(e.select([{Id:"id"},{Account:"account.name"},{Date:"date"},{Payee:"payee.name"},{ParentId:"parent_id"},{IsParent:"is_parent"},{Notes:"notes"},{Category:"category.name"},{Amount:"amount"}]).options({splits:"all"})),r=new Map;for(let e of t)e.IsParent&&r.set(e.Id,e.Payee);let n=t.filter((e=>!e.IsParent)).map((e=>({Account:e.Account,Date:e.Date,Payee:e.ParentId?r.get(e.ParentId):e.Payee,Notes:e.Notes,Category:e.Category,Amount:null==e.Amount?0:Wt(e.Amount)})));return kf()(n,{header:!0})}(new oo(t))},lg["get-categories"]=async function(){return{grouped:await ts(),list:await es()}},lg["get-earliest-transaction"]=async function(){let{data:e}=await fo(io("transactions").options({splits:"none"}).orderBy({date:"asc"}).select("*").limit(1));return e[0]||null},lg["get-budget-bounds"]=async function(){return ii()},lg["rollover-budget-month"]=async function(e){let{month:t}=e,r=await ts(),n=Ot(t);function o(e){let t=xo(n,e);return{value:""===t?0:t,name:Oo(n,e)}}let i=[o("available-funds"),o("last-month-overspent"),o("buffered"),o("total-budgeted"),o("to-budget"),o("from-last-month"),o("total-income"),o("total-spent"),o("total-leftover")];for(let e of r)if(e.is_income){i.push(o("total-income"));for(let t of e.categories)i.push(o(`sum-amount-${t.id}`))}else{i=i.concat([o(`group-budget-${e.id}`),o(`group-sum-amount-${e.id}`),o(`group-leftover-${e.id}`)]);for(let t of e.categories)i=i.concat([o(`budget-${t.id}`),o(`sum-amount-${t.id}`),o(`leftover-${t.id}`),o(`carryover-${t.id}`)])}return i},lg["report-budget-month"]=async function(e){let{month:t}=e,r=await ts(),n=Ot(t);function o(e){let t=xo(n,e);return{value:""===t?0:t,name:Oo(n,e)}}let i=[o("total-budgeted"),o("total-budget-income"),o("total-saved"),o("total-income"),o("total-spent"),o("real-saved"),o("total-leftover")];for(let e of r){i=i.concat([o(`group-budget-${e.id}`),o(`group-sum-amount-${e.id}`),o(`group-leftover-${e.id}`)]);for(let t of e.categories)i=i.concat([o(`budget-${t.id}`),o(`sum-amount-${t.id}`),o(`leftover-${t.id}`)]),e.is_income||i.push(o(`carryover-${t.id}`))}return i},lg["budget-set-type"]=async function(e){let{type:t}=e;if("rollover"!==t&&"report"!==t)throw new Error("Invalid budget type: "+t);if(t!==Eo().budgetType)return _o({budgetType:t})},lg["category-create"]=br((async function(e){let{name:t,groupId:r,isIncome:n}=e;return Ni((async()=>{if(!r)throw fi("Creating a category: groupId is required");return as({name:t,cat_group:r,is_income:n?1:0})}))})),lg["category-update"]=br((async function(e){return Ni((async()=>{try{await ss(e)}catch(e){if(e.message.toLowerCase().includes("unique constraint"))return{error:{type:"category-exists"}};throw e}return{}}))})),lg["category-move"]=br((async function(e){let{id:t,groupId:r,targetId:n}=e;return Ni((async()=>(await ya((async()=>{await us(t,r,n)})),"ok")))})),lg["category-delete"]=br((async function(e){let{id:t,transferId:r}=e;return Ni((async()=>{let e={};return await ya((async()=>{let n=await Ha("SELECT is_income FROM categories WHERE id = ?",[t]);if(!n)return void(e={error:"no-categories"});let o=r&&await Ha("SELECT is_income FROM categories WHERE id = ?",[r]);!n||r&&!o?e={error:"no-categories"}:r&&n.is_income!==o.is_income?e={error:"category-type"}:(0===n.is_income&&r&&await ni([t],r),await ls({id:t},r))})),e}))})),lg["category-group-create"]=br((async function(e){let{name:t,isIncome:r}=e;return Ni((async()=>rs({name:t,is_income:r?1:0})))})),lg["category-group-update"]=br((async function(e){return Ni((async()=>ns(e)))})),lg["category-group-move"]=br((async function(e){let{id:t,targetId:r}=e;return Ni((async()=>(await ya((async()=>{await os(t,r)})),"ok")))})),lg["category-group-delete"]=br((async function(e){let{id:t,transferId:r}=e;return Ni((async()=>{const e=await Wa("SELECT id FROM categories WHERE cat_group = ? AND tombstone = 0",[t]);return ya((async()=>{r&&await ni(e.map((e=>e.id)),r),await is({id:t},r)}))}))})),lg["must-category-transfer"]=async function(e){let{id:t}=e;return 0!==(await La("SELECT count(t.id) as count FROM transactions t\n LEFT JOIN category_mapping cm ON cm.id = t.category\n WHERE cm.transferId = ? AND t.tombstone = 0",[t],!0))[0].count||[...Do().meta().createdMonths].some((e=>{const r=Ot(e);return 0!==Do().getCellValue(r,"budget-"+t)}))},lg["payee-create"]=br((async function(e){let{name:t}=e;return Ni((async()=>fs({name:t})))})),lg["payees-get"]=async function(){return ys()},lg["payees-get-orphaned"]=async function(){return ms()},lg["payees-get-rule-counts"]=async function(){let e={};return Dc(Hc(),"payee",((t,r)=>{null==e[r]&&(e[r]=0),e[r]++})),e},lg["payees-merge"]=br((async function(e){let{targetId:t,mergeIds:r}=e;return Ni((async()=>hs(t,r)),{targetId:t,mergeIds:r})})),lg["payees-batch-change"]=br((async function(e){let{added:t,deleted:r,updated:n}=e;return Ni((async()=>ya((async()=>{r&&await Promise.all(r.map((e=>ds(e)))),t&&await Promise.all(t.map((e=>fs(e)))),n&&await Promise.all(n.map((e=>ps(e))))}))))})),lg["payees-check-orphaned"]=async function(e){let{ids:t}=e,r=new Set(await bs());return t.filter((e=>r.has(e)))},lg["payees-get-rules"]=async function(e){let{id:t}=e;return function(e){let t=new Set;return Dc(Hc(),"payee",((r,n)=>{n===e&&t.add(r)})),Rc([...t])}(t).map((e=>e.serialize()))},lg["rule-validate"]=async function(e){return{error:cg(e)}},lg["rule-add"]=br((async function(e){let t=cg(e);return t?{error:t}:{id:await zc(e)}})),lg["rule-update"]=br((async function(e){let t=cg(e);return t?{error:t}:(await Vc(e),{})})),lg["rule-delete"]=br((async function(e){return $c(e)})),lg["rule-delete-all"]=br((async function(e){let t=!1;return await ya((async()=>{for(let r of e)!1===await $c({id:r})&&(t=!0)})),{someDeletionsFailed:t}})),lg["rule-apply-actions"]=br((async function(e){let{transactionIds:t,actions:r}=e;return function(e,t,r){let n=t.map((e=>{if(e instanceof Sc)return e;try{return new Sc(e.op,e.field,e.value,e.options,Fs)}catch(e){return console.log("Action error",e),null}})).filter(Boolean);if(n.length!==t.length)return null;let o=e.map((e=>{let t={id:e};for(let e of n)e.exec(t);return t}));return r["transactions-batch-update"]({updated:o})}(t,r,lg)})),lg["rule-add-payee-rename"]=br((async function(e){let{fromNames:t,to:r}=e;return async function(e,t){let r=function(e,t,r,n){let{condValue:o,actionValue:i}=n;return function*(){let e=Hc();for(let t=0;t<e.length;t++){let r=e[t];"pre"!==r.stage||1!==r.actions.length||"set"!==r.actions[0].op||"payee"!==r.actions[0].field||null!=i&&r.actions[0].value!==i||1!==r.conditions.length||"oneOf"!==r.conditions[0].op||"imported_payee"!==r.conditions[0].field||null!=o&&-1===r.conditions[0].value.indexOf(o)||(yield r.serialize())}return null}()}(0,0,0,{actionValue:t}).next().value;if(r){let t=r.conditions[0],n=[...Mt(new Set(t.value),new Set(e.filter((e=>""!==e))))],o={...r,conditions:[{...t,value:n}]};return await Vc(o),r.id}return zc(new Tc({stage:"pre",conditionsOp:"and",conditions:[{op:"oneOf",field:"imported_payee",value:e}],actions:[{op:"set",field:"payee",value:t}],fieldTypes:Fs}).serialize())}(t,r)})),lg["rules-get"]=async function(){return Rc(Hc()).map((e=>e.serialize()))},lg["rule-get"]=async function(e){let{id:t}=e,r=Hc().find((e=>e.id===t));return r?r.serialize():null},lg["rules-run"]=async function(e){let{transaction:t}=e;return Gc(t)},lg["make-filters-from-conditions"]=async function(e){let{conditions:t}=e;return Yc(t)},lg.getCell=async function(e){let{sheetName:t,name:r}=e,n=["name","value"],o=Do()._getNode(Oo(t,r));if(n){let e={};return n.forEach((t=>{e[t]="run"===t?o._run?o._run.toString():null:o[t]})),e}return o},lg.getCells=async function(e){let{names:t}=e;return t.map((e=>({value:Do()._getNode(e).value})))},lg.getCellNamesInSheet=async function(e){let{sheetName:t}=e,r=[];for(let e of Do().getNodes().keys()){let{sheet:n,name:o}=To(e);n===t&&r.push(o)}return r},lg.debugCell=async function(e){let{sheetName:t,name:r}=e,n=Do().getNode(Oo(t,r));return{...n,_run:n._run&&n._run.toString()}},lg["create-query"]=async function(e){let{sheetName:t,name:r,query:n}=e;return Do().createQuery(t,r,n),"ok"},lg.query=async function(e){if(null==e.table)throw new Error("query has no table, did you forgot to call `.serialize`?");return fo(e)},lg["bank-delete"]=async function(e){let{id:t}=e;const r=await La("SELECT * FROM accounts WHERE bank = ?",[t],!0);return await Za("banks",t),await Promise.all(r.map((async e=>{await La("DELETE FROM transactions WHERE acct = ?",[e.id]),await Za("accounts",e.id)}))),"ok"},lg["account-update"]=br((async function(e){let{id:t,name:r}=e;return Ni((async()=>(await qa("accounts",{id:t,name:r}),{})))})),lg["accounts-get"]=async function(){return ws()},lg["account-properties"]=async function(e){let{id:t}=e;const{balance:r}=await Ha("SELECT sum(amount) as balance FROM transactions WHERE acct = ? AND isParent = 0 AND tombstone = 0",[t]),{count:n}=await Ha("SELECT count(id) as count FROM transactions WHERE acct = ? AND tombstone = 0",[t]);return{balance:r||0,numTransactions:n}},lg["accounts-link"]=async function(e){let{institution:t,publicToken:r,accountId:n,upgradingId:o}=e,i=await Cf(t,r),[[,a],[,s]]=await Ge(["user-id","user-key"]),u=(await uf(a,s,i)).find((e=>e.account_id===n));return await qa("accounts",{id:o,account_id:u.account_id,official_name:u.official_name,balance_current:Pt(u.balances.current),balance_available:Pt(u.balances.available),balance_limit:Pt(u.balances.limit),mask:u.mask,bank:i}),await _f(a,s,o,u.account_id,i),Ar("sync-event",{type:"success",tables:["transactions"]}),"ok"},lg["nordigen-accounts-link"]=async function(e){let t,{requisitionId:r,account:n,upgradingId:o}=e,i=await async function(e,t){let r=await Ha("SELECT id, bank_id, name FROM banks WHERE bank_id = ?",[t]);if(r)return r;const n={id:be(),bank_id:t,name:e.name};return await Ga("banks",n),n}(n.institution,r);return o?(t=(await Ha("SELECT * FROM accounts WHERE id = ?",[o])).id,await qa("accounts",{id:t,account_id:n.account_id,bank:i.id})):(t=be(),await Ga("accounts",{id:t,account_id:n.account_id,mask:n.mask,name:n.name,official_name:n.official_name,bank:i.id}),await fs({name:"",transfer_acct:t})),await bf(void 0,void 0,t,n.account_id,i.bank_id),Ar("sync-event",{type:"success",tables:["transactions"]}),"ok"},lg["accounts-connect"]=async function(e){let{institution:t,publicToken:r,accountIds:n,offbudgetIds:o}=e,i=await Cf(t,r);return await async function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],[[,n],[,o]]=await Ge(["user-id","user-key"]),i=await async function(e,t,r){let n=await Ei(Ai().PLAID_SERVER+"/accounts",{userId:e,key:t,item_id:r}),{accounts:o}=n;return o.forEach((e=>{e.balances.current=af(e)})),o}(n,o,e);return i=i.filter((e=>t.includes(e.account_id))),Promise.all(i.map((async t=>{let i=await Er((async()=>{let n=await Es({account_id:t.account_id,name:t.name,official_name:t.official_name,balance_current:Pt(t.balances.current),mask:t.mask,bank:e,offbudget:r.includes(t.account_id)?1:0});return await fs({name:"",transfer_acct:n}),n}));return await _f(n,o,i,t.account_id,e),i})))}(i,n,o)},lg["nordigen-accounts-connect"]=async function(e){let{institution:t,publicToken:r,accountIds:n,offbudgetIds:o}=e,i=await Cf(t,r),a=await async function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],[[,n],[,o]]=await Ge(["user-id","user-key"]),i=await uf(n,o,e);return i=i.filter((e=>t.includes(e.account_id))),Promise.all(i.map((async t=>{let i=await Er((async()=>{let n=await Es({account_id:t.account_id,name:t.name,official_name:t.official_name,balance_current:Pt(t.balances.current),mask:t.mask,bank:e,offbudget:r.includes(t.account_id)?1:0});return await fs({name:"",transfer_acct:n}),n}));return await bf(n,o,i,t.account_id,e),i})))}(i,n,o);return a},lg["account-create"]=br((async function(e){let{name:t,balance:r,offBudget:n,closed:o}=e;return Ni((async()=>{const e=await Es({name:t,offbudget:n?1:0,closed:o?1:0});if(await fs({name:"",transfer_acct:e}),null!=r&&0!==r){let t=await js();await Rs({account:e,amount:Pt(r),category:n?null:t.category,payee:t.id,date:ft(),cleared:!0,starting_balance_flag:!0})}return e}))})),lg["account-close"]=br((async function(e){let{id:t,transferAccountId:r,categoryId:n,forced:o}=e;return await lg["account-unlink"]({id:t}),Ni((async()=>{let e=await Ha("SELECT * FROM accounts WHERE id = ? AND tombstone = 0",[t]);if(!e||1===e.closed)return;const{balance:i,numTransactions:a}=await lg["account-properties"]({id:t});if(0===a)await Ss({id:t});else if(o){let e=await La("SELECT id, transfer_id FROM v_transactions WHERE account = ?",[t],!0),{id:r}=await Ha("SELECT id FROM payees WHERE transfer_acct = ?",[t]);await ya((async()=>{e.forEach((e=>{e.transfer_id&&Ns({id:e.transfer_id,payee:null,transfer_id:null}),Ds({id:e.id})})),Ss({id:t}),gs({id:r})}))}else{if(0!==i&&null==r)throw fi("balance is non-zero: transferAccountId is required");if(await qa("accounts",{id:t,closed:1}),0!==i){let{id:e}=await Ha("SELECT id FROM payees WHERE transfer_acct = ?",[r]);await lg["transaction-add"]({id:be(),payee:e,amount:-i,account:t,date:ft(),notes:"Closing account",category:n||null})}}}))})),lg["account-reopen"]=br((async function(e){let{id:t}=e;return Ni((async()=>{await qa("accounts",{id:t,closed:0})}))})),lg["account-move"]=br((async function(e){let{id:t,targetId:r}=e;return Ni((async()=>{await Ts(t,r)}))}));let fg=!1;async function dg(t){let n;try{n=Wr(t)}catch(e){return cr(new Error("`getBudgetDir` failed in `loadBudget`: "+e.message)),{error:"budget-not-found"}}if(fr({message:"Loading budget "+n}),!await tn(n))return cr(new Error("budget directory does not exist")),{error:"budget-not-found"};try{await bo(t),await Na(t)}catch(e){return fr({message:"Error loading budget "+t}),cr(e),await lg["close-budget"](),{error:"opening-budget"}}Eo().userId||_o({userId:await Ve("user-token")});try{await og()}catch(e){let r;return console.warn("Error updating",e),e.message.includes("out-of-sync-migrations")?r={error:"out-of-sync-migrations"}:e.message.includes("out-of-sync-data")?r={error:"out-of-sync-data"}:(cr(e),go.info("Error updating budget "+t,e),console.log("Error updating budget",e),r={error:"loading-budget"}),await lg["close-budget"](),r}await Ma(),Eo().resetClock&&(r.getClock().timestamp.setNode(r.makeClientId()),await La("INSERT OR REPLACE INTO messages_clock (id, clock) VALUES (1, ?)",[r.serializeClock(r.getClock())]),await _o({resetClock:!1})),ho||po||Qf(t);try{await Co(e,ug)}catch(e){return cr(e),await lg["close-budget"](),{error:"opening-budget"}}return Do().meta().budgetType=Eo().budgetType,await ii(),await async function(){let e=(await Wa("SELECT * FROM category_mapping")).map((e=>[e.id,e.transferId])),t=(await Wa("SELECT * FROM payee_mapping")).map((e=>[e.id,e.targetId]));Ws=new Map(e.concat(t)),Hs&&Hs(),Hs=fa(Vs)}(),await async function(){jc=new Map,Cc=new Oc({field:"imported_payee",method:"firstchar"}),Mc=new Oc({field:"payee"});let e=await Wa("\n SELECT * FROM rules\n WHERE conditions IS NOT NULL AND actions IS NOT NULL AND tombstone = 0\n ");for(let t=0;t<e.length;t++){let r=e[t];"cleanup"!==r.stage&&"modify"!==r.stage||(r.stage="pre");let n=Wc(r);n&&(jc.set(n.id,n),Cc.index(n),Mc.index(n))}kc&&kc(),kc=fa(qc)}(),await(Zd&&(Zd(),Zd=null),void(Zd=fa(Yd))),await mi.startServices(),Ii=[{type:"marker"}],Ri=0,t===sg?oa("disabled"):(Ai()?oa("enabled"):oa("disabled"),await $e("lastBudget",t),po||await async function(){let{cloudFileId:e,groupId:t,lastUploaded:r}=Eo(),n=r&&yt(r,7),o=ft();r&&o<n||e&&t&&ea().catch((e=>{}))}()),mi.events.emit("load-budget",{id:t}),{}}var gg;function pg(){return po?"/documents":Br("/documents","Actual")}async function hg(t,r){await Dr(),await Promise.all([He(),Xr()]),await async function(){async function e(e){await tn(e)||await rn(e)}let t=await Ve("document-dir");if(t)try{await e(t)}catch(e){t=null}t||(t=pg()),await e(t),Ur(t)}();let n=await Ve("encrypt-keys");if(n)try{let e=JSON.parse(n);await Promise.all(Object.keys(e).map((t=>Hi(e[t]))))}catch(e){throw console.log("Error loading key",e),new Error("load-key-error")}let o=await Ve("server-url");if("https://not-configured/"===o&&(o=null,await $e("server-url",null),await $e("did-bootstrap",!0)),o||await qe("user-token"),Oi(o),Or(r,mi.handlers),!t&&!po&&!ho){let e=await Ve("auto-update");ig.send({type:"shouldAutoUpdate",flag:null==e||"true"===e})}t&&(__webpack_require__.g.$send=(e,t)=>wr(mi.handlers[e],t),__webpack_require__.g.$query=fo,__webpack_require__.g.$q=io,__webpack_require__.g.$db=e,__webpack_require__.g.$setSyncingMode=oa)}async function yg(e){let t,r;return e?(t=e.dataDir,r=e.serverURL):(t="/",r={}.ACTUAL_SERVER_URL),await Dr(),await Promise.all([He({persist:!1}),Xr()]),Ur(t||ig.cwd()),r?(Oi(r),e.password&&await wr(lg["subscribe-sign-in"],{password:e.password})):(Oi(null),mi.events.on("load-budget",(()=>{oa("offline")}))),mg}lg["poll-web-token"]=async function(e){let{token:t}=e,[[,r],[,n]]=await Ge(["user-id","user-key"]),o=Date.now();async function i(e){if(fg)return;if(Date.now()-o>=6e5)return void e("timeout");let a=await Ei(Ai().PLAID_SERVER+"/get-web-token-contents",{userId:r,key:n,token:t});a?a.error?e("unknown"):e(null,a):setTimeout((()=>i(e)),3e3)}return fg=!1,new Promise((e=>{i(((t,r)=>{e(t?{error:t}:{data:r})}))}))},lg["poll-web-token-stop"]=async function(){return fg=!0,"ok"},lg["accounts-sync"]=async function(e){let{id:t}=e,[[,r],[,n]]=await Ge(["user-id","user-key"]),o=await La("SELECT a.*, b.id as bankId FROM accounts a\n LEFT JOIN banks b ON a.bank = b.id\n WHERE a.tombstone = 0 AND a.closed = 0",[],!0);t&&(o=o.filter((e=>e.id===t)));let i=[],a=[],s=[],u=[];for(let e=0;e<o.length;e++){const t=o[e];if(t.bankId)try{const e=await _f(r,n,t.id,t.account_id,t.bankId);let{added:o,updated:i}=e;a=a.concat(o),s=s.concat(i),(o.length>0||i.length>0)&&(u=u.concat(t.id))}catch(e){"BankSyncError"===e.type?i.push({type:"SyncError",accountId:t.id,message:"Failed syncing account “"+t.name+".”",category:e.category,code:e.code}):e instanceof ai&&"internal"!==e.reason?i.push({accountId:t.id,message:`Account “${t.name}” is not linked properly. Please link it again`}):(i.push({accountId:t.id,message:"There was an internal error. Please get in touch https://actualbudget.org/contact for support.",internal:e.stack}),e.message="Failed syncing account: "+e.message,cr(e))}}return u.length>0&&Ar("sync-event",{type:"success",tables:["transactions"]}),{errors:i,newTransactions:a,matchedTransactions:s,updatedAccounts:u}},lg["secret-set"]=async function(e){let{name:t,value:r}=e,n=await Ve("user-token");if(!n)return{error:"unauthorized"};try{return await Ei(Ai().BASE_SERVER+"/secret",{name:t,value:r},{"X-ACTUAL-TOKEN":n})}catch(e){return console.error(e),{error:"failed"}}},lg["secret-check"]=async function(e){let t=await Ve("user-token");if(!t)return{error:"unauthorized"};try{return await vi(Ai().BASE_SERVER+"/secret/"+e,{"X-ACTUAL-TOKEN":t})}catch(e){return console.error(e),{error:"failed"}}},lg["nordigen-poll-web-token"]=async function(e){let{upgradingAccountId:t,requisitionId:r}=e,n=await Ve("user-token");if(!n)return null;let o=Date.now();async function i(e){if(fg)return;if(Date.now()-o>=6e5)return void e("timeout");let a=await Ei(Ai().NORDIGEN_SERVER+"/get-accounts",{upgradingAccountId:t,requisitionId:r},{"X-ACTUAL-TOKEN":n});a?a.error?e("unknown"):e(null,a):setTimeout((()=>i(e)),3e3)}return fg=!1,new Promise((e=>{i(((t,r)=>{e(t?{error:t}:{data:r})}))}))},lg["nordigen-status"]=async function(){const e=await Ve("user-token");return e?Ei(Ai().NORDIGEN_SERVER+"/status",{},{"X-ACTUAL-TOKEN":e}):{error:"unauthorized"}},lg["nordigen-get-banks"]=async function(e){const t=await Ve("user-token");return t?Ei(Ai().NORDIGEN_SERVER+"/get-banks",{country:e,showDemo:"true"===String({}.REACT_APP_NETLIFY)||!1},{"X-ACTUAL-TOKEN":t}):{error:"unauthorized"}},lg["nordigen-poll-web-token-stop"]=async function(){return fg=!0,"ok"},lg["nordigen-create-web-token"]=async function(e){let{upgradingAccountId:t,institutionId:r,accessValidForDays:n}=e,o=await Ve("user-token");if(!o)return{error:"unauthorized"};try{return await Ei(Ai().NORDIGEN_SERVER+"/create-web-token",{upgradingAccountId:t,institutionId:r,accessValidForDays:n},{"X-ACTUAL-TOKEN":o})}catch(e){return console.error(e),{error:"failed"}}},lg["nordigen-accounts-sync"]=async function(e){let{id:t}=e,[[,r],[,n]]=await Ge(["user-id","user-key"]),o=await La("SELECT a.*, b.bank_id as bankId FROM accounts a\n LEFT JOIN banks b ON a.bank = b.id\n WHERE a.tombstone = 0 AND a.closed = 0",[],!0);t&&(o=o.filter((e=>e.id===t)));let i=[],a=[],s=[],u=[];for(let e=0;e<o.length;e++){const t=o[e];if(t.bankId)try{const e=await bf(r,n,t.id,t.account_id,t.bankId);let{added:o,updated:i}=e;a=a.concat(o),s=s.concat(i),(o.length>0||i.length>0)&&(u=u.concat(t.id))}catch(e){"BankSyncError"===e.type?i.push({type:"SyncError",accountId:t.id,message:"Failed syncing account “"+t.name+".”",category:e.category,code:e.code}):e instanceof ai&&"internal"!==e.reason?i.push({accountId:t.id,message:`Account “${t.name}” is not linked properly. Please link it again`}):(i.push({accountId:t.id,message:"There was an internal error. Please get in touch https://actualbudget.org/contact for support.",internal:e.stack}),e.message="Failed syncing account: "+e.message,cr(e))}}return u.length>0&&Ar("sync-event",{type:"success",tables:["transactions"]}),{errors:i,newTransactions:a,matchedTransactions:s,updatedAccounts:u}},lg["transactions-import"]=br((function(e){let{accountId:t,transactions:r}=e;return Ni((async()=>{if("string"!=typeof t)throw fi("transactions-import: accountId must be an id");try{return await yf(t,r)}catch(e){if(e instanceof li)return{errors:[{message:e.message}],added:[],updated:[]};throw e}}))})),lg["account-unlink"]=br((async function(e){let{id:t}=e,{bank:r}=await Ha("SELECT bank FROM accounts WHERE id = ?",[t]);if(!r)return"ok";await vs({id:t,account_id:null,bank:null,balance_current:null,balance_available:null,balance_limit:null});let{count:n}=await Ha("SELECT COUNT(*) as count FROM accounts WHERE bank = ?",[r]),o=await Ve("user-token");if(!o)return"ok";if(0===n){let{bank_id:e}=await Ha("SELECT bank_id FROM banks WHERE id = ?",[r]);try{await Ei(Ai().NORDIGEN_SERVER+"/remove-account",{requisitionId:e},{"X-ACTUAL-TOKEN":o})}catch(e){console.log({error:e})}}return"ok"})),lg["make-plaid-public-token"]=async function(e){let{bankId:t}=e,[[,r],[,n]]=await Ge(["user-id","user-key"]),o=await Ei(Ai().PLAID_SERVER+"/make-public-token",{userId:r,key:n,item_id:""+t});return o.error_code?{error:"",code:o.error_code,type:o.error_type}:{linkToken:o.link_token}},lg["save-global-prefs"]=async function(e){return"maxMonths"in e&&await $e("max-months",""+e.maxMonths),"autoUpdate"in e&&(await $e("auto-update",""+e.autoUpdate),ig.send({type:"shouldAutoUpdate",flag:e.autoUpdate})),"documentDir"in e&&await tn(e.documentDir)&&await $e("document-dir",e.documentDir),"floatingSidebar"in e&&await $e("floating-sidebar",""+e.floatingSidebar),"ok"},lg["load-global-prefs"]=async function(){let[[,e],[,t],[,r],[,n],[,o]]=await Ge(["floating-sidebar","max-months","auto-update","document-dir","encrypt-key"]);return{floatingSidebar:"true"===e,maxMonths:Ut(t||""),autoUpdate:null==r||"true"===r,documentDir:n||pg(),keyId:o&&JSON.parse(o).id}},lg["save-prefs"]=async function(e){let{cloudFileId:t}=Eo();if(e.budgetName&&t){let r=await Ve("user-token");await Ei(Ai().SYNC_SERVER+"/update-user-filename",{token:r,fileId:t,name:e.budgetName})}return await _o(e),"ok"},lg["load-prefs"]=async function(){return Eo()},lg["sync-reset"]=async function(){return await ta()},lg["sync-repair"]=async function(){await async function(){let e=Gi(),t=(0,r.getClock)();t.merkle=e.trie,La(Fa("INSERT OR REPLACE INTO messages_clock (id, clock) VALUES (1, ?)"),[(0,r.serializeClock)(t)])}()},lg["key-make"]=async function(e){let{password:t}=e;if(!Eo())throw new Error("user-set-key must be called with file loaded");let n=Wi(32).toString("base64"),o=be(),i=await Vi({id:o,password:t,salt:n});await Hi(i);let a=await async function(e){let t=new r.SyncProtoBuf.Message;t.setDataset(await Yi()),t.setRow(await Yi()),t.setColumn(await Yi()),t.setValue(await Yi());let n=t.serializeBinary();return await Ui(n,e)}(i.getId());return await ta({key:i,salt:n,testContent:JSON.stringify({...a,value:a.value.toString("base64")})})},lg["key-test"]=async function(e){let t,{fileId:r,password:n}=e,o=await Ve("user-token");null==r&&(r=Eo().cloudFileId);try{t=await Ei(Ai().SYNC_SERVER+"/user-get-key",{token:o,fileId:r})}catch(e){return console.log(e),{error:{reason:"network"}}}let{id:i,salt:a,test:s}=t;if(null==s)return{error:{reason:"old-key-style"}};s=JSON.parse(s);let u=await Vi({id:i,password:n,salt:a});Hi(u);try{await Pi(ag.from(s.value,"base64"),s.meta)}catch(e){return console.log(e),zi(u),{error:{reason:"decrypt-failure"}}}let l=JSON.parse(await Ve("encrypt-keys")||"{}");return l[r]=u.serialize(),await $e("encrypt-keys",JSON.stringify(l)),Eo()&&await _o({encryptKeyId:u.getId()}),{}},lg["get-did-bootstrap"]=async function(){return Boolean(await Ve("did-bootstrap"))},lg["subscribe-needs-bootstrap"]=async function(){let e,{url:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Ai(t))return{bootstrapped:!0,hasServer:!1};try{e=await vi(Ai(t).SIGNUP_SERVER+"/needs-bootstrap")}catch(e){return{error:"network-failure"}}try{e=JSON.parse(e)}catch(e){return{error:"parse-failure"}}return"error"===e.status?{error:e.reason}:{bootstrapped:e.data.bootstrapped,hasServer:!0}},lg["subscribe-bootstrap"]=async function(e){let t,{password:r}=e;try{t=await Ei(Ai().SIGNUP_SERVER+"/bootstrap",{password:r})}catch(e){return{error:e.reason||"network-failure"}}return t.token?(await $e("user-token",t.token),{}):{error:"internal"}},lg["subscribe-get-user"]=async function(){if(!Ai())return await Ve("did-bootstrap")?{offline:!1}:null;let e=await Ve("user-token");if(!e)return null;try{const t=await vi(Ai().SIGNUP_SERVER+"/validate",{headers:{"X-ACTUAL-TOKEN":e}}),{status:r,reason:n}=JSON.parse(t);return"error"===r?"unauthorized"===n?null:{offline:!0}:{offline:!1}}catch(e){return console.log(e),{offline:!0}}},lg["subscribe-change-password"]=async function(e){let{password:t}=e,r=await Ve("user-token");if(!r)return{error:"not-logged-in"};try{await Ei(Ai().SIGNUP_SERVER+"/change-password",{token:r,password:t})}catch(e){return{error:e.reason||"network-failure"}}return{}},lg["subscribe-sign-in"]=async function(e){let{password:t}=e,r=await Ei(Ai().SIGNUP_SERVER+"/login",{password:t});return r.token?(await $e("user-token",r.token),{}):{error:"invalid-password"}},lg["subscribe-sign-out"]=async function(){return Li={},await async function(e){let t=(await We()).transaction(["asyncStorage"],"readwrite"),r=t.objectStore("asyncStorage"),n=Promise.all(["user-token","encrypt-keys","lastBudget","readOnly"].map((e=>new Promise(((t,n)=>{let o=r.delete(e);o.onerror=e=>n(e),o.onsuccess=e=>t(void 0)})))));return ze(t),n}(),"ok"},lg["get-server-version"]=async function(){if(!Ai())return{error:"no-server"};let e;try{const t=await vi(Ai().BASE_SERVER+"/info");e=JSON.parse(t).build.version}catch(e){return{error:"network-failure"}}return{version:e}},lg["get-server-url"]=async function(){return Ai()&&Ai().BASE_SERVER},lg["set-server-url"]=async function(e){let{url:t,validate:r=!0}=e;if(null==t)await qe("user-token");else if(t=t.replace(/\/+$/,""),r){let{error:e}=await wr(lg["subscribe-needs-bootstrap"],{url:t});if(e)return{error:e}}return await $e("server-url",t),await $e("did-bootstrap",!0),Oi(t),{}},lg.sync=async function(){return Ea()},lg["get-budgets"]=async function(){const e=await en(Pr()),t=(await Promise.all(e.map((async e=>{const t=Br(Pr(),e,"metadata.json");if(await tn(t)){let r;try{r=JSON.parse(await on(t))}catch(e){return void console.log("Error parsing metadata:",e.stack)}if(e!==sg)return{id:e,cloudFileId:r.cloudFileId,groupId:r.groupId,name:r.budgetName||"(no name)"}}return null})))).filter((e=>e));return t},lg["get-remote-files"]=async function(){return async function(){let e,t=await Ve("user-token");if(!t)return null;try{e=await Ji(Ai().SYNC_SERVER+"/list-user-files",{headers:{"X-ACTUAL-TOKEN":t}})}catch(e){return console.log("Unexpected error fetching file list from server",e),null}return"error"===e.status?(console.log("Error fetching file list from server",e),null):e.data.map((e=>({...e,hasKey:Fi(e.encryptKeyId)})))}()},lg["reset-budget-cache"]=br((async function(){await Lo(e),Do().recomputeAll(),await Uo()})),lg["upload-budget"]=async function(){let{id:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e){if(Eo())throw new Error("upload-budget: id given but prefs already loaded");await bo(e)}try{await ea()}catch(e){return console.log(e),"FileUploadError"===e.type?{error:e}:(cr(e),{error:{reason:"internal"}})}finally{e&&wo()}return{}},lg["download-budget"]=async function(e){let t,{fileId:r}=e;try{t=await async function(e){let t,r,n=await Ve("user-token");try{t=await bi(Ai().SYNC_SERVER+"/download-user-file",{headers:{"X-ACTUAL-TOKEN":n,"X-ACTUAL-FILE-ID":e}}).then(Ki).then((e=>e.arrayBuffer?e.arrayBuffer().then((e=>Zi.from(e))):e.buffer()))}catch(e){throw console.log("Download failure",e),di("download-failure")}try{r=await Ji(Ai().SYNC_SERVER+"/get-user-file-info",{headers:{"X-ACTUAL-TOKEN":n,"X-ACTUAL-FILE-ID":e}})}catch(t){throw di("internal",{fileId:e})}if("ok"!==r.status)throw di("internal",{fileId:e});let o=r.data;if(o.encryptMeta)try{t=await Pi(t,o.encryptMeta)}catch(e){throw di("decrypt-failure",{isMissingKey:"missing-key"===e.message})}return Qi(o,t)}(r)}catch(e){if("FileDownloadError"===e.type){if("file-exists"===e.reason&&e.meta.id){await bo(e.meta.id);let t=Eo().budgetName;wo(),e.meta={...e.meta,name:t}}return{error:e}}return cr(e),{error:{reason:"internal"}}}let n=t.id;return await lg["load-budget"]({id:n}),t=await lg["sync-budget"](),await lg["close-budget"](),t.error?t:{id:n}},lg["sync-budget"]=async function(){return oa("enabled"),await async function(){void 0!==(await Ea()).error&&await Uo()}(),{}},lg["load-budget"]=async function(e){let{id:t}=e,r=Eo();if(r){if(r.id===t)return{};await lg["close-budget"]()}return await dg(t)},lg["create-demo-budget"]=async function(){return await $e("readOnly",""),lg["create-budget"]({budgetName:"Demo Budget",testMode:!0,testBudgetId:sg})},lg["close-budget"]=async function(){fr({message:"Closing budget"}),await Uo(),Mo(),ba(),await mi.stopServices(),await ja();try{await $e("lastBudget","")}catch(e){}return wo(),ed(),"ok"},lg["delete-budget"]=async function(e){let{id:t,cloudFileId:r}=e;if(r&&await async function(e){let t=await Ve("user-token");await Ei(Ai().SYNC_SERVER+"/delete-user-file",{token:t,fileId:e})}(r).catch((e=>{})),t){let e=Wr(t);await un(e)}return"ok"},lg["create-budget"]=async function(){let t,{budgetName:r,avoidUpload:n,testMode:o,testBudgetId:i}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(o)r=r||"Test Budget",t=i||"_test-budget",await tn(Wr(t))&&await un(Wr(t));else{if(!r){let e=await lg["get-budgets"]();r=await async function(e){let t="My Finances",r=1,n=t;for(;e.find((e=>e.name===n));)n=`${t} ${r}`,r++;return n}(e)}t=await async function(e){let t=e.replace(/( |[^A-Za-z0-9])/g,"-")+"-"+be().slice(0,7),r=0,n=Wr(t);for(;await tn(n);)r++,n=Wr(t+r.toString());return r>0&&(t+=r.toString()),t}(r)}let a=Wr(t);await rn(a),await nn("/default-db.sqlite",Br(a,"db.sqlite")),await an(Br(a,"metadata.json"),JSON.stringify(function(e,t){return{id:e,budgetName:t}}(t,r)));let{error:s}=await dg(t);if(s)return console.log("Error creating budget: "+s),{error:s};if(!n&&!o)try{await ea()}catch(e){}return o&&await async function(t){oa("import"),await xa("PRAGMA journal_mode = OFF"),await La("DELETE FROM categories;"),await La("DELETE FROM category_groups");let r=[{name:"Bank of America"},{name:"Ally Savings"},{name:"Capital One Checking"},{name:"HSBC"},{name:"Vanguard 401k",offBudget:1},{name:"Mortgage",offBudget:1},{name:"House Asset",offBudget:1},{name:"Roth IRA",offBudget:1}];await Er((()=>ya((async()=>{for(let e of r)e.id=await t["account-create"](e)}))));let n=[{name:"Starting Balance"},{name:"Kroger"},{name:"Publix"},{name:"Home Depot"},{name:"Movies"},{name:"Online store"},{name:"Deposit"},{name:"Dominion Power",bill:!0},{name:"Extra Watery",bill:!0},{name:"Housy House",bill:!0},{name:"Fast Internet",bill:!0},{name:"T-mobile",bill:!0}];await Er((()=>ya((async()=>{for(let e of n)e.id=await t["payee-create"]({name:e.name})}))));let o=[{name:"Usual Expenses",categories:[{name:"Savings"},{name:"Medical"},{name:"Gift"},{name:"General"},{name:"Clothing"},{name:"Entertainment"},{name:"Restaurants"},{name:"Food"}]},{name:"Bills",categories:[{name:"Power"},{name:"Water"},{name:"Mortgage"},{name:"Internet"},{name:"Cell"}]},{name:"Income",is_income:!0,categories:[{name:"Income",is_income:!0},{name:"Misc",is_income:!0},{name:"Starting Balances",is_income:!0}]}];await Er((async()=>{for(let e of o){e.id=await t["category-group-create"]({name:e.name,isIncome:e.is_income?1:0});for(let r of e.categories)r.id=await t["category-create"]({...r,isIncome:r.is_income?1:0,groupId:e.id})}}));let i=(await wr(t["get-categories"])).grouped;oa("import"),await Er((()=>ya((async()=>{for(let e of r)"Bank of America"===e.name?await Of(0,e,n,i):"Capital One Checking"===e.name||"HSBC"===e.name?await Af(t,e,n,i):"Ally Savings"===e.name?await Rf(t,e,n,i):"Vanguard 401k"===e.name||"Roth IRA"===e.name?await If(t,e,n,i):"Mortgage"===e.name?await Nf(t,e,n,i):"House Asset"===e.name?await Df(t,e,n,i):(console.error("Unknown account name for test budget: ",e.name),await Af(t,e,n,i))})))),oa("import");let a=r.find((e=>e.name="Bank of America")),{data:s}=await fo(io("transactions").filter({account:a.id}).calculate({$sum:"$amount"}).serialize());if(s<0){let{data:e}=await fo(io("transactions").filter({account:a.id,amount:{$gt:0}}).limit(1).select(["id","amount"]).serialize()),r=e[0];await wr(t["transaction-update"],{...r,amount:r.amount+-s+Ef(1e4,2e4)})}oa("disabled"),await _o({isCached:!1}),await async function(e){if(Io)return Mo(),Co(e,Ro)}(e),await ii(),await Uo(),await async function(e,t,r){let n=e.find((e=>e.name="Bank of America")),o=(await Ha("SELECT * FROM v_transactions t LEFT JOIN accounts a ON t.account = a.id\n WHERE a.offbudget = 0 AND t.is_child = 0 ORDER BY date ASC LIMIT 1")).date,i=(await Ha("SELECT * FROM v_transactions t LEFT JOIN accounts a ON t.account = a.id\n WHERE a.id = ? AND a.offbudget = 0 AND t.is_child = 0 ORDER BY date ASC LIMIT 1",[n.id])).date,a=St(ut(dn(o)),ct());function s(e){for(let t of r){let r=t.categories.find((t=>t.name===e));if(r)return r}}function u(e,t,r){return $o({month:e,category:t.id,amount:r})}function l(e,t){let r=xo(Ot(e),`sum-amount-${t.id}`);r<0&&u(e,t,-r)}await Er((()=>ya((async()=>{for(let e of a)e>=ut(dn(i))?(u(e,s("Food"),4e4),u(e,s("Restaurants"),3e4),u(e,s("Entertainment"),1e4),u(e,s("Clothing"),3e3),u(e,s("General"),5e4),u(e,s("Gift"),7500),u(e,s("Medical"),1e4),u(e,s("Cell"),7500),u(e,s("Internet"),6e3),u(e,s("Mortgage"),12e4),u(e,s("Water"),9e3),u(e,s("Power"),1e4)):(l(e,s("Food")),l(e,s("Restaurants")),l(e,s("Entertainment")),l(e,s("Clothing")),l(e,s("General")),l(e,s("Gift")),l(e,s("Medical")),l(e,s("Cell")),l(e,s("Internet")),l(e,s("Mortgage")),l(e,s("Water")),l(e,s("Power")))})))),await Uo(),await Er((()=>ya((async()=>{let e=0;for(let t of a)if(t>=ut(dn(i))&&t<=ct()){let r=xo(Ot(t),"to-budget")-e;r-403e3>0?(u(t,s("Savings"),r-403e3),qo(t,403e3),e+=r-403e3):r>0&&qo(t,r)}})))),await Uo();let c=xo(Ot(ct()),"to-budget");c<0&&await mf(n.id,[{amount:-c,category:s("Income").id,date:ct()+"-01"}]),await Uo()}(r,0,i)}(lg),{}},lg["import-budget"]=async function(e){let{filepath:t,type:r}=e;try{if(!await tn(t))throw new Error(`File not found at the provided path: ${t}`);let e=ag.from(await on(t,"binary"));switch(r){case"ynab4":try{await async function(e,t){let r=function(e){let t=de()(e);if(!/\.zip/.test(t))return null;t=t.replace(/\.zip$/,"").replace(/.ynab4$/,"");let r=t.match(/([^/~]+)[^/]*$/);return r?r[1]:null}(e);if(!r)throw new Error("Not a YNAB4 file: "+e);let n=new(m())(t),i=n.getEntries(),a="",s=i[0].entryName.match(/([^/]*\.ynab4)/);s&&(a=s[1]+"/");let u=n.readFile(ve(i,a+"Budget.ymeta")),l=Se(a,JSON.parse(u.toString("utf8")).relativeDataFolderName),c=function(e,t){let r=t.map((t=>{const r=e.readFile(t).toString("utf8");let n;try{n=JSON.parse(r)}catch(e){return null}return n.hasFullKnowledge?{deviceGUID:n.deviceGUID,shortName:n.shortDeviceId,recentness:(o=n.knowledge,o.split(",").reduce(((e,t)=>{const[r,n]=t.split("-");return e+parseInt(n)}),0))}:null;var o})).filter((e=>e));return r=_e(r,"recentness"),r[r.length-1].deviceGUID}(n,i.filter((e=>e.entryName.startsWith(Se(l,"devices")))));const f=Se(l,c,"Budget.yfull");let d,g;try{d=n.readFile(ve(i,f)).toString("utf8")}catch(e){throw console.log(e),new Error("Error reading Budget.yfull file")}try{g=JSON.parse(d)}catch(e){throw new Error("Error parsing Budget.yull file")}return o(r,(()=>Ee(g)))}(t,e)}catch(e){let t=e.message.toLowerCase();if(t.includes("not a ynab4")||t.includes("could not find file"))return{error:"not-ynab4"}}break;case"ynab5":let r;try{r=JSON.parse(e.toString())}catch(e){return{error:"parse-error"}}try{await async function(e){return e.data&&(e=e.data),o(e.budget.name,(()=>async function(e){const t=new Map;console.log("Importing Accounts..."),await function(e,t){return Promise.all(e.accounts.map((async e=>{if(!e.deleted){let r=await l({name:e.name,offbudget:!e.on_budget,closed:e.closed});t.set(e.id,r)}})))}(e,t),console.log("Importing Categories..."),await async function(e,t){const r=(await f()).find((e=>"Income"===e.name)).id,n=["To be Budgeted","Inflow: Ready to Assign"];function o(t){return t.category_group_id===e.category_groups.find((e=>"Internal Master Category"===e.name)).id?n.includes(t.name)?"income":"internal":t.category_group_id===e.category_groups.find((e=>"Credit Card Payments"===e.name)).id?"creditCard":void 0}for(let n of e.category_groups)if(!n.deleted){if("Internal Master Category"!==n.name&&"Credit Card Payments"!==n.name){var i=await c({name:n.name,is_income:!1});t.set(n.id,i)}let a=e.categories.filter((e=>e.category_group_id===n.id));for(let e of a.reverse())if(!e.deleted){let n={};switch(n.name=e.name,o(e)){case"income":{let n=r;t.set(e.id,n);break}case"creditCard":case"internal":break;default:{n.group_id=i;let r=await d(n);t.set(e.id,r);break}}}}}(e,t),console.log("Importing Payees..."),await function(e,t){return Promise.all(e.payees.map((async e=>{if(!e.deleted){let r=await p({name:e.name});t.set(e.id,r)}})))}(e,t),console.log("Importing Transactions..."),await async function(e,t){const r=await g(),n=await f(),o=n.find((e=>"Income"===e.name)).id,i=n.find((e=>"Starting Balances"===e.name)).id,a=e.payees.find((e=>"Starting Balance"===e.name)).id;let s=Ae(e.transactions,"account_id"),l=Ae(e.subtransactions,"transaction_id");for(let r of e.transactions)t.set(r.id,be());for(let r of e.subtransactions)t.set(r.id,be());await Promise.all(Object.keys(s).map((async n=>{let c=s[n].map((n=>{if(n.deleted)return null;let s=l[n.id];s&&(s=s.map((e=>({id:t.get(e.id),amount:Te(e.amount),category:t.get(e.category_id)||null,notes:e.memo}))));let u={id:t.get(n.id),account:t.get(n.account_id),date:n.date,amount:Te(n.amount),category:t.get(n.category_id)||null,cleared:["cleared","reconciled"].includes(n.cleared),notes:n.memo||null,imported_id:n.import_id||null,transfer_id:t.get(n.transfer_transaction_id)||null,subtransactions:s};return n.transfer_account_id?u.payee=r.find((e=>e.transfer_acct===t.get(n.transfer_account_id))).id:(u.payee=t.get(n.payee_id),u.imported_payee=e.payees.find((e=>!e.deleted&&e.id===n.payee_id))?.name),n.payee_id===a&&t.get(n.category_id)===o&&(u.category=i,u.payee=null),u})).filter((e=>e));await u(t.get(n),c)})))}(e,t),console.log("Importing Budgets..."),await async function(e,t){let r=(n=e.months,o="month",[...n].sort(((e,t)=>e[o]<t[o]?-1:e[o]>t[o]?1:0)));var n,o;const s=e.category_groups.find((e=>"Internal Master Category"===e.name)).id,u=e.category_groups.find((e=>"Credit Card Payments"===e.name)).id;await i((async()=>{for(let e of r){let r=Oe(e.month);await Promise.all(e.categories.map((async e=>{let n=t.get(e.id),o=e.budgeted/10;n&&e.category_group_id!==s&&e.category_group_id!==u&&await a(r,n,o)})))}}))}(e,t),console.log("Setting up...")}(e.budget)))}(r)}catch(e){return{error:"not-ynab5"}}break;case"actual":let n;await lg["close-budget"]();try{({id:n}=await Qi({cloudFileId:null,groupId:null},e))}catch(e){if("FileDownloadError"===e.type)return{error:e.reason};throw e}let s=await Lr(Br(Wr(n),"db.sqlite"));kr(s,"\n DELETE FROM kvcache;\n DELETE FROM kvcache_key;\n "),xr(s),await lg["load-budget"]({id:n}),await lg["get-budget-bounds"](),await Uo(),await ea().catch((e=>{}))}}catch(e){return e.message="Error importing budget: "+e.message,cr(e),{error:"internal-error"}}return{}},lg["export-budget"]=async function(){return await Xi()},lg["upload-file-web"]=async function(e){let{filename:t,contents:r}=e;return ho?(await an("/uploads/"+t,r),{}):null},lg["backups-get"]=async function(e){let{id:t}=e;return Jf(t)},lg["backup-load"]=async function(e){let{id:t,backupId:r}=e;await async function(e,t){const r=Wr(e);if(await tn(Br(r,Yf))||(await nn(Br(r,"db.sqlite"),Br(r,Yf)),await nn(Br(r,"metadata.json"),Br(r,"metadata.latest.json")),ed(),Qf(e),await bo(e)),t===Yf){console.log("Reverting backup"),await nn(Br(r,Yf),Br(r,"db.sqlite")),await nn(Br(r,"metadata.latest.json"),Br(r,"metadata.json")),await sn(Br(r,Yf)),await sn(Br(r,"metadata.latest.json"));try{await ea()}catch(e){}wo()}else{console.log("Loading backup",t),await bo(e),await _o({groupId:null,lastSyncedTimestamp:null,lastUploaded:null});try{await ea()}catch(e){}wo(),await nn(Br(r,"backups",t),Br(r,"db.sqlite"))}}(t,r)},lg["backup-make"]=async function(e){let{id:t}=e;await Xf(t)},lg["get-last-opened-backup"]=async function(){const e=await Ve("lastBudget");if(e&&""!==e){const t=Wr(e);if(await tn(t))return e}return null},lg["app-focused"]=async function(){Eo()&&Eo().id&&Ea()},lg=function(e){let t=Object.assign({},e,Vf);return Vf=t,t}(lg),gg=(e,t)=>wr(mi.handlers[e],t),t=gg,mi.handlers=lg,mi.combine(kd,Pd,Gd,Jd,$d);const mg={getDataDir:()=>"/",sendMessage:(e,t)=>Ar(e,t),send:async(e,t)=>await wr(mi.handlers[e],t),on:(e,t)=>mi.events.on(e,t),q:io,db:e}})(),backend=__webpack_exports__})();
|
|
3
|
-
//# sourceMappingURL=kcab.worker.da48d4e200de78e1dbd9.js.map
|