actual/packages/browser/build/kcab/kcab.worker.b16816d5632f095a8a84.js
2022-04-28 22:44:38 -04:00

42 lines
No EOL
1.5 MiB
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

var backend=function(e){self.webpackChunkbackend=function(t,n){for(var i in n)e[i]=n[i];for(;t.length;)r[t.pop()]=1};var t={},r={main:1};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.e=function(e){var t=[];return t.push(Promise.resolve().then((function(){r[e]||importScripts(n.p+""+e+".kcab.worker.b16816d5632f095a8a84.js")}))),Promise.all(t)},n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/kcab/",n(n.s=285)}([function(e,t,r){"use strict";function n(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof 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 arguments. Please use `parseISO` to parse strings. See: https://git.io/fpAk2"),console.warn((new Error).stack)),new Date(NaN))}r.d(t,"a",(function(){return n}))},function(e,t,r){"use strict";r.r(t),r.d(t,"toDateRepr",(function(){return l.h})),r.d(t,"fromDateRepr",(function(){return l.d})),r.d(t,"getDatabasePath",(function(){return E})),r.d(t,"openDatabase",(function(){return S})),r.d(t,"reopenDatabase",(function(){return O})),r.d(t,"closeDatabase",(function(){return T})),r.d(t,"setDatabase",(function(){return A})),r.d(t,"getDatabase",(function(){return M})),r.d(t,"loadClock",(function(){return D})),r.d(t,"runQuery",(function(){return I})),r.d(t,"execQuery",(function(){return j})),r.d(t,"cache",(function(){return N})),r.d(t,"transaction",(function(){return k})),r.d(t,"asyncTransaction",(function(){return C})),r.d(t,"all",(function(){return L})),r.d(t,"first",(function(){return x})),r.d(t,"firstSync",(function(){return P})),r.d(t,"run",(function(){return B})),r.d(t,"select",(function(){return U})),r.d(t,"update",(function(){return F})),r.d(t,"insertWithUUID",(function(){return W})),r.d(t,"insert",(function(){return H})),r.d(t,"delete_",(function(){return z})),r.d(t,"selectWithSchema",(function(){return q})),r.d(t,"selectFirstWithSchema",(function(){return V})),r.d(t,"insertWithSchema",(function(){return G})),r.d(t,"updateWithSchema",(function(){return Y})),r.d(t,"getCategories",(function(){return $})),r.d(t,"getCategoriesGrouped",(function(){return K})),r.d(t,"insertCategoryGroup",(function(){return Z})),r.d(t,"updateCategoryGroup",(function(){return X})),r.d(t,"moveCategoryGroup",(function(){return J})),r.d(t,"deleteCategoryGroup",(function(){return Q})),r.d(t,"insertCategory",(function(){return ee})),r.d(t,"updateCategory",(function(){return te})),r.d(t,"moveCategory",(function(){return re})),r.d(t,"deleteCategory",(function(){return ne})),r.d(t,"getPayee",(function(){return ie})),r.d(t,"insertPayee",(function(){return oe})),r.d(t,"deletePayee",(function(){return ae})),r.d(t,"deleteTransferPayee",(function(){return se})),r.d(t,"updatePayee",(function(){return ue})),r.d(t,"mergePayees",(function(){return ce})),r.d(t,"getPayees",(function(){return le})),r.d(t,"getOrphanedPayees",(function(){return fe})),r.d(t,"getPayeeByName",(function(){return de})),r.d(t,"insertPayeeRule",(function(){return he})),r.d(t,"deletePayeeRule",(function(){return pe})),r.d(t,"updatePayeeRule",(function(){return ge})),r.d(t,"getPayeeRules",(function(){return me})),r.d(t,"getAccounts",(function(){return ye})),r.d(t,"insertAccount",(function(){return be})),r.d(t,"updateAccount",(function(){return _e})),r.d(t,"deleteAccount",(function(){return we})),r.d(t,"moveAccount",(function(){return ve})),r.d(t,"getTransaction",(function(){return Ee})),r.d(t,"getTransactionsByDate",(function(){return Se})),r.d(t,"getTransactions",(function(){return Oe})),r.d(t,"insertTransaction",(function(){return Te})),r.d(t,"updateTransaction",(function(){return Ae})),r.d(t,"deleteTransaction",(function(){return Me}));var n=r(171),i=r.n(n),o=r(15),a=r(4),s=r.n(a),u=r(7),c=r(33),l=r(17),f=r(12),d=r(13),h=r(67);function p(e,t){const r=e[t-1],n=e[t];return r?n?(r.sort_order+n.sort_order)/2:r.sort_order+16384:n.sort_order/2}function g(e,t){const r=e.findIndex(e=>e.id===t),n=e[r],i=e[r-1];let o=[];if(t&&-1!==r){if(n.sort_order-(i?i.sort_order:0)<=2){let t=r,n=16384+(0|e[t].sort_order);for(;t<e.length&&!(n<=e[t].sort_order);)o.push({id:e[t].id,sort_order:n}),t++,n+=16384}return{updates:o,sort_order:p(e,r)}}{let t;return t=e.length>0?e[e.length-1].sort_order+16384:16384,{updates:o,sort_order:t}}}function m(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 y(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?m(Object(r),!0).forEach((function(t){b(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function b(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const _=r(42);let w,v;function E(){return w}async function S(e){v&&await o.closeDatabase(v),w=s.a.join(s.a.getBudgetDir(e),"db.sqlite"),A(await o.openDatabase(w))}async function O(){await o.closeDatabase(v),A(await o.openDatabase(w))}async function T(){v&&(await o.closeDatabase(v),A(null))}function A(e){v=e,R=new i.a({max:100})}function M(){return v}async function D(){let e=await x("SELECT * FROM messages_clock");if(e){let t=Object(d.deserializeClock)(e.clock);Object(d.setClock)(t)}else{let e=new d.default(0,0,Object(d.makeClientId)()),t=Object(d.makeClock)(e);Object(d.setClock)(t),await I("INSERT INTO messages_clock (id, clock) VALUES (?, ?)",[1,Object(d.serializeClock)(t)])}}function I(e,t,r){return o.runQuery(v,e,t,r)}function j(e){o.execQuery(v,e)}let R=new i.a({max:100});function N(e){let t=R.get(e);if(t)return t;let r=o.prepare(v,e);return R.set(e,r),r}function k(e){return o.transaction(v,e)}function C(e){return o.asyncTransaction(v,e)}async function L(e,t){return I(e,t,!0)}async function x(e,t){const r=await I(e,t,!0);return 0===r.length?null:r[0]}function P(e,t){const r=I(e,t,!0);return 0===r.length?null:r[0]}async function B(e,t){return I(e,t)}async function U(e,t){return(await I("SELECT * FROM "+e+" WHERE id = ?",[t],!0))[0]}async function F(e,t){let r=Object.keys(t).filter(e=>"id"!==e);if(null==t.id)throw new Error("update: id is required");await Object(u.j)(r.map(r=>({dataset:e,row:t.id,column:r,value:t[r],timestamp:d.default.send()})))}async function W(e,t){return t.id||(t=y(y({},t),{},{id:_.v4Sync()})),await H(e,t),t.id}async function H(e,t){let r=Object.keys(t).filter(e=>"id"!==e);if(null==t.id)throw new Error("insert: id is required");await Object(u.j)(r.map(r=>({dataset:e,row:t.id,column:r,value:t[r],timestamp:d.default.send()})))}async function z(e,t){await Object(u.j)([{dataset:e,row:t,column:"tombstone",value:1,timestamp:d.default.send()}])}async function q(e,t,r){return(await I(t,r,!0)).map(t=>Object(h.c)(c.a,c.b,e,t)).filter(Boolean)}async function V(e,t,r){let n=await q(e,t,r);return n.length>0?n[0]:null}function G(e,t){return t.id||(t=y(y({},t),{},{id:_.v4Sync()})),W(e,Object(h.a)(c.a,c.b,e,t))}function Y(e,t){return F(e,Object(h.b)(c.a,c.b,e,t))}async function $(){return L("\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 K(){const e=await L("SELECT * FROM category_groups WHERE tombstone = 0 ORDER BY is_income, sort_order, id"),t=await L("\n SELECT * FROM categories WHERE tombstone = 0\n ORDER BY sort_order, id\n ");return e.map(e=>y(y({},e),{},{categories:t.filter(t=>t.cat_group===e.id)}))}async function Z(e){const t=await x("\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)+16384;return W("category_groups",e=y(y({},l.b.validate(e)),{},{sort_order:r}))}function X(e){return F("category_groups",e=l.b.validate(e,{update:!0}))}async function J(e,t){const r=g(await L("SELECT id, sort_order FROM category_groups WHERE tombstone = 0 ORDER BY sort_order, id"),t),n=r.updates,i=r.sort_order;for(let e of n)await F("category_groups",e);await F("category_groups",{id:e,sort_order:i})}async function Q(e,t){const r=await L("SELECT * FROM categories WHERE cat_group = ?",[e.id]);await Promise.all(r.map(e=>ne(e,t))),await z("category_groups",e.id)}async function ee(e,{atEnd:t}={}){let r,n;return await Object(u.c)(async()=>{if(t){const e=await x("\n SELECT sort_order FROM categories WHERE tombstone = 0 ORDER BY sort_order DESC, id DESC LIMIT 1\n ");r=(e?e.sort_order:0)+16384}else{const t=await L("SELECT id, sort_order FROM categories WHERE cat_group = ? AND tombstone = 0 ORDER BY sort_order, id",[e.cat_group]),n=g(t,t.length>0?t[0].id:null),i=n.updates,o=n.sort_order;for(let e of i)await F("categories",e);r=o}e=y(y({},l.c.validate(e)),{},{sort_order:r});const i=await W("categories",e);await H("category_mapping",{id:i,transferId:i}),n=i}),n}function te(e){return F("categories",e=l.c.validate(e,{update:!0}))}async function re(e,t,r){if(!t)throw new Error("moveCategory: groupId is required");const n=g(await L("SELECT id, sort_order FROM categories WHERE cat_group = ? AND tombstone = 0 ORDER BY sort_order, id",[t]),r),i=n.updates,o=n.sort_order;for(let e of i)await F("categories",e);await F("categories",{id:e,sort_order:o,cat_group:t})}async function ne(e,t){if(t){const r=await L("SELECT * FROM category_mapping WHERE transferId = ?",[e.id]);for(let e of r)await F("category_mapping",{id:e.id,transferId:t});await F("category_mapping",{id:e.id,transferId:t})}return z("categories",e.id)}async function ie(e){return x("SELECT * FROM payees WHERE id = ?",[e])}async function oe(e){let t;return e=l.e.validate(e),await Object(u.c)(async()=>{t=await W("payees",e),await H("payee_mapping",{id:t,targetId:t})}),t}async function ae(e){if((await x("SELECT * FROM payees WHERE id = ?",[e.id])).transfer_acct)return;let t=await L("SELECT * FROM payee_rules WHERE payee_id = ?",[e.id]);return await Promise.all(t.map(e=>pe({id:e.id}))),z("payees",e.id)}async function se(e){return z("payees",e.id)}function ue(e){return F("payees",e=l.e.validate(e,{update:!0}))}async function ce(e,t){let r=Object(f.i)(await L("SELECT * FROM payees"));null==r[e].transfer_acct&&(t=t.filter(e=>null==r[e].transfer_acct),await Object(u.c)(async()=>(await Promise.all(t.map(async t=>{let r=await L("SELECT id FROM payee_mapping WHERE targetId = ?",[t]);await Promise.all(r.map(t=>F("payee_mapping",{id:t.id,targetId:e})))})),Promise.all(t.map(t=>Promise.all([F("payee_mapping",{id:t,targetId:e}),z("payees",t)]))))))}function le(){return L("\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 ")}async function fe(){return(await L("\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 de(e){return x("SELECT * FROM payees WHERE LOWER(name) = ? AND tombstone = 0",[e.toLowerCase()])}function he(e){return W("payee_rules",e=l.f.validate(e))}function pe(e){return z("payee_rules",e.id)}function ge(e){return F("payee_rules",e=l.e.validate(e,{update:!0}))}function me(e){return L("SELECT pr.* FROM payee_rules pr\n LEFT JOIN payee_mapping pm ON pm.id = pr.payee_id\n WHERE pm.targetId = ? AND pr.tombstone = 0",[e])}function ye(){return L("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 be(e){void 0===e.type&&(e=y(y({},e),{},{type:"checking"}));let t=g(await L("SELECT * FROM accounts WHERE offbudget = ? ORDER BY sort_order, name",[null!=e.offbudget?e.offbudget:0])).sort_order;return W("accounts",e=l.a.validate(y(y({},e),{},{sort_order:t})))}function _e(e){return F("accounts",e=l.a.validate(e,{update:!0}))}function we(e){return z("accounts",e.id)}async function ve(e,t){let r,n=await x("SELECT * FROM accounts WHERE id = ?",[e]);r=n.closed?await L("SELECT id, sort_order FROM accounts WHERE closed = 1 ORDER BY sort_order, name"):await L("SELECT id, sort_order FROM accounts WHERE tombstone = 0 AND offbudget = ? ORDER BY sort_order, name",[n.offbudget]);const i=g(r,t),o=i.updates,a=i.sort_order;await Object(u.c)(()=>{for(let e of o)F("accounts",e);F("accounts",{id:e,sort_order:a})})}async function Ee(e){return(await q("transactions","SELECT * FROM v_transactions WHERE id = ?",[e]))[0]}async function Se(e,t,r,n={}){throw new Error("`getTransactionsByDate` is deprecated")}async function Oe(e,t){if(void 0!==t)throw new Error("`getTransactions` was given a second argument, it now only takes a single argument `accountId`");return q("transactions","SELECT * FROM v_transactions WHERE account = ?",[e])}function Te(e){return G("transactions",e)}function Ae(e){return Y("transactions",e)}async function Me(e){return z("transactions",e.id)}},function(e,t,r){"use strict";(function(e){r.d(t,"l",(function(){return m})),r.d(t,"s",(function(){return y})),r.d(t,"k",(function(){return b})),r.d(t,"f",(function(){return _})),r.d(t,"e",(function(){return w})),r.d(t,"d",(function(){return v})),r.d(t,"m",(function(){return E})),r.d(t,"b",(function(){return S})),r.d(t,"r",(function(){return O})),r.d(t,"a",(function(){return T})),r.d(t,"q",(function(){return A})),r.d(t,"j",(function(){return M})),r.d(t,"i",(function(){return D})),r.d(t,"c",(function(){return I})),r.d(t,"n",(function(){return R})),r.d(t,"o",(function(){return N})),r.d(t,"h",(function(){return k})),r.d(t,"p",(function(){return C})),r.d(t,"g",(function(){return L}));var n=r(34),i=r(57),o=r(132),a=r(47),s=r(133),u=r(107),c=r(168),l=r(65),f=r(82),d=r(78);function h(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,i,o=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==r.return||r.return()}finally{if(s)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return p(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return p(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function g(e){if("string"==typeof e){let t=h(e.split("-"),3),r=t[0],n=t[1],i=t[2];return null!=i?new Date(parseInt(r),parseInt(n)-1,parseInt(i),12):null!=n?new Date(parseInt(r),parseInt(n)-1,1,12):new Date(parseInt(r),0,1,12)}return e}const m=g;function y(e){return n.a(g(e),"yyyy")}function b(e){return n.a(g(e),"yyyy-MM")}function _(e){return n.a(g(e),"yyyy-MM-dd")}function w(){return e.IS_TESTING?"2017-01":n.a(new Date,"yyyy-MM")}function v(){return e.IS_TESTING?"2017-01-01":n.a(new Date,"yyyy-MM-dd")}function E(e){return n.a(o.a(g(e),1),"yyyy-MM")}function S(e,t){return n.a(i.a(g(e),t),"yyyy-MM")}function O(e,t){return n.a(o.a(g(e),t),"yyyy-MM")}function T(e,t){return n.a(a.a(g(e),t),"yyyy-MM-dd")}function A(e,t){return n.a(s.a(g(e),t),"yyyy-MM-dd")}function M(e,t){return u.a(g(e),g(t))}function D(e,t){return c.a(g(e),g(t))}function I(e){return{start:parseInt(n.a(l.a(g(e)),"yyyyMMdd")),end:parseInt(n.a(f.a(g(e)),"yyyyMMdd"))}}function j(e,t,r){const n=[];let i=b(e);for(;u.a(g(i),g(t));)n.push(i),i=S(i,1);return r&&n.push(i),n}function R(e,t){return j(e,t)}function N(e,t){return j(e,t,!0)}function k(e){return e.slice(0,7)}function C(e){return"budget"+e.replace("-","")}function L(e,t){return n.a(g(e),t)}Object(d.a)(e=>new RegExp(e.replace(/d+/g,"\\d{1,2}").replace(/M+/g,"\\d{1,2}").replace(/y+/g,"\\d{4}"))),Object(d.a)(e=>e.replace(/y+/g,"").replace(/[^\w]$/,"").replace(/^[^\w]/,"")),Object(d.a)(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+"$")}),Object(d.a)(e=>e.replace(/d+/g,"").replace(/[^\w]$/,"").replace(/^[^\w]/,"").replace(/\/\//,"/").replace(/\.\./,".").replace(/--/,"-")),Object(d.a)(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+"$")}),Object(d.a)(e=>e.replace(/y+/g,"yy")),Object(d.a)(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+"$")})}).call(this,r(23))},function(e,t,r){"use strict";function n(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)}r.d(t,"a",(function(){return n}))},function(e,t,r){(function(t){let n=r(397).SQLiteFS,i=r(398).default,o=r(52),a=r(15)._getModule,s=r(179),u=r(399),c=r(400),l=null,f=null;function d(e){return e.replace(/^\//,"").replace(/\//g,"-")}function h(e){try{l.stat(e)}catch(e){return!1}return!0}function p(e){let t=e.split("/").filter(e=>""!==e),r="";for(let e of t)r+="/"+e,h(r)||l.mkdir(r)}function g(e){return e.startsWith("/documents")&&(e.endsWith(".sqlite")?h(e)||l.symlink("/blocked/"+d(e),e):l.writeFile(e,"!$@) this should never read !$@)")),e}async function m(e,t){if(e.startsWith("/documents")&&!e.endsWith(".sqlite")){if(!h(e))throw new Error("File does not exist: "+e);let r=s.getStore(await s.getDatabase(),"files").store,n=await s.get(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}return l.readFile(y(e),t)}function y(e){try{return l.lookupPath(e,{follow:!1}).node.link?l.readlink(e):e}catch(t){return e}}async function b(e,t){if(t instanceof ArrayBuffer?t=new Uint8Array(t):ArrayBuffer.isView(t)&&(t=new Uint8Array(t.buffer)),g(e),e.startsWith("/documents")){let r=e.endsWith(".sqlite"),n=s.getStore(await s.getDatabase(),"files").store;r?(await s.set(n,{filepath:e,contents:""}),await Promise.resolve(),l.writeFile(y(e),t)):await s.set(n,{filepath:e,contents:t})}else l.writeFile(y(e),t)}async function _(){let e=(await(await fetch("/data-file-index.txt")).text()).split("\n").map(e=>e.trim()).filter(e=>""!==e);await O("/migrations"),await O("/demo-budget"),await Promise.all(e.map(async e=>{var t;b("/"+e,await(t="/data/"+e,fetch(t).then(e=>e.arrayBuffer())))}))}async function w(){let e=s.getStore(await s.getDatabase(),"files").store.getAllKeys(),t=await new Promise((t,r)=>{e.onsuccess=e=>t(e.target.result),e.onerror=e=>r(e)});for(let e of t)p(v(e)),g(e)}function v(e){return e.split("/").slice(0,-1).join("/")}async function E(e){return l.readdir(e).filter(e=>"."!==e&&".."!==e)}async function S(e){return h(e)}async function O(e){l.mkdir(e)}async function T(e){return async function(e){if(e.startsWith("/documents")){let t=e.endsWith(".sqlite"),r=s.getStore(await s.getDatabase(),"files").store;if(await s.del(r,e),t){let t=y(e);h(t)&&l.unlink(t)}}l.unlink(e)}(e)}async function A(e){l.rmdir(e)}e.exports={pathToId:d,populateFileHeirarchy:w,init:async function(){let e=a();if(l=e.FS,l.mkdir("/uploads"),l.mkdir("/documents"),l.mkdir("/blocked"),!t.__TESTING__){let t=new i(()=>{o.send("fallback-write-error")});f=new n(l,t),e.register_for_idb(f),l.mount(f,{},"/blocked"),await _()}await w()},shutdown:function(){f.backend.shutdown()},bundledDatabasePath:"/default-db.sqlite",migrationsPath:"/migrations",demoBudgetPath:"/demo-budget",getDataDir:u.getDataDir,getDocumentDir:u.getDocumentDir,getBudgetDir:u.getBudgetDir,_setDocumentDir:u._setDocumentDir,join:c,basename:v,listDir:E,exists:S,mkdir:O,size:async function(e){return l.stat(y(e)).size},copyFile:async function(e,t){return b(t,await m(e))},readFile:async function(e,t="utf8"){return m(e,{encoding:t})},writeFile:async function(e,t){return b(e,t)},removeFile:T,removeDir:A,removeDirRecursively:async function e(t){if(await S(t)){for(let r of await E(t)){let n=c(t,r),i=l.stat(n,!0);l.isDir(i.mode)?await e(n):await T(n)}await A(t)}},getModifiedTime:async function(e){throw new Error("getModifiedTime not supported on the web (only used for backups)")}}}).call(this,r(23))},function(e,t,r){"use strict";(function(e){r.d(t,"b",(function(){return h})),r.d(t,"e",(function(){return m})),r.d(t,"i",(function(){return y})),r.d(t,"g",(function(){return b})),r.d(t,"f",(function(){return _})),r.d(t,"c",(function(){return w})),r.d(t,"d",(function(){return v})),r.d(t,"h",(function(){return E})),r.d(t,"a",(function(){return S})),r.d(t,"j",(function(){return O}));var n=r(172),i=r(8),o=r(24),a=r(15),s=r(2),u=r(43);const c=r(49).resolveName;let l,f,d;function h(){return l}async function p(e,t){await a.transaction(e,()=>{t.forEach(t=>{const r=l._getNode(t);null==r.sql&&a.runQuery(e,"INSERT OR REPLACE INTO kvcache (key, value) VALUES (?, ?)",[t,JSON.stringify(r.value)])})})}function g(e,t,{clean:r}){if(r){let r=1e7*Math.random();a.runQuery(t,"INSERT OR REPLACE INTO kvcache_key (id, key) VALUES (1, ?)",[r]),e&&a.runQuery(e,"INSERT OR REPLACE INTO kvcache_key (id, key) VALUES (1, ?)",[r])}else a.runQuery(t,"DELETE FROM kvcache_key")}async function m(t,r){let i,s,c=!e.__TESTING__,h=t.getDatabase();if(u.a.isDesktop&&c){let e=t.getDatabasePath().replace(/db\.sqlite$/,"cache.sqlite");d=i=a.openDatabase(e),a.execQuery(i,"\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 i=h;if(s=c?new n.a(p.bind(null,i),g.bind(null,h,i)):new n.a,Object(o.captureBreadcrumb)({message:"loading spreaadsheet",category:"server"}),l=s,f=r,r&&s.addEventListener("change",r),c&&!function(e,t){let r=a.runQuery(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=a.runQuery(e,"SELECT key FROM kvcache_key WHERE id = 1",[],!0);if(0===t.length||t[0].key!==n)return!0}return r=a.runQuery(t,"SELECT * FROM kvcache LIMIT 1",[],!0),0===r.length}(h,i)){let e=await a.runQuery(i,"SELECT * FROM kvcache",[],!0);console.log(`Loaded spreadsheet from cache (${e.length} items)`);for(let t of e){let e=JSON.parse(t.value);s.load(t.key,e)}}else console.log("Loading fresh spreadsheet"),await _(t);return Object(o.captureBreadcrumb)({message:"loaded spreaadsheet",category:"server"}),s}function y(){l&&(l.unload(),l=null),d&&(a.closeDatabase(d),d=null)}async function b(e){if(l)return y(),m(e,f)}async function _(e){let t=l,r=(i.b()||{}).budgetType,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=Object(s.p)(e.id);t.set(r+"!buffered",e.buffered)}}t.endTransaction()}function w(e,t){return l._getNode(c(e,t))}function v(e,t){return l.getValue(c(e,t))}function E(){l&&l.startTransaction()}function S(){l&&l.endTransaction()}function O(){return new Promise(e=>{l?l.onFinish(e):e()})}}).call(this,r(23))},function(e,t,r){"use strict";r.r(t),function(e){r.d(t,"mutator",(function(){return h})),r.d(t,"isMutating",(function(){return p})),r.d(t,"runHandler",(function(){return m})),r.d(t,"enableGlobalMutations",(function(){return y})),r.d(t,"disableGlobalMutations",(function(){return b})),r.d(t,"runMutator",(function(){return _})),r.d(t,"withMutatorContext",(function(){return w})),r.d(t,"getMutatorContext",(function(){return v}));var n=r(91),i=r(24);function o(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 a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach((function(t){s(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}let u=new Set,c=null,l=new WeakMap,f=!1,d=[];function h(e){return l.set(e,!0),e}function p(e){return l.has(e)}function g(e){return new Promise(t=>setTimeout(t,e))}async function m(e,t,{undoTag:r,name:n}={}){if(d.push(n),d.length>5&&(d=d.slice(-5)),l.has(e))return _(()=>e(t),{undoTag:r});"close-budget"===n&&await async function(){for(await g(200);u.size>0;)await Promise.all([...u.values()]),await g(100)}();let i=e(t);return u.add(i),i.then(()=>{u.delete(i)}),i}function y(){e.__TESTING__&&(f=!0)}function b(){e.__TESTING__&&(f=!1)}const _=Object(n.sequential)(async(e,t={})=>(c=t,e().finally(()=>{c=null})));function w(e,t){if(null==c&&!f)return Object(i.captureBreadcrumb)("Recent methods: "+d.join(", ")),Object(i.captureException)(new Error("withMutatorContext: mutator not running")),t();let r=c;return c=a(a({},c),e),t().finally(()=>{c=r})}function v(){return null==c?(Object(i.captureBreadcrumb)({category:"server",message:"Recent methods: "+d.join(", ")}),{}):null==c&&f?{}:c}}.call(this,r(23))},function(e,t,r){"use strict";(function(e){r.d(t,"k",(function(){return N})),r.d(t,"a",(function(){return U})),r.d(t,"b",(function(){return F})),r.d(t,"c",(function(){return V})),r.d(t,"j",(function(){return G})),r.d(t,"l",(function(){return $})),r.d(t,"d",(function(){return K})),r.d(t,"f",(function(){return J})),r.d(t,"e",(function(){return Q}));var n=r(91),i=(r(289),r(8)),o=r(28),a=r(9),s=r.n(a),u=r(24),c=r(69),l=r(30),f=r(1),d=r(5),h=r(61),p=r(14),g=r(6),m=r(12),y=r(13),b=r(75),_=r(173),w=r(20),v=r(125),E=r(240);r.d(t,"g",(function(){return E.a}));var S=r(241);function O(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 T(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?O(Object(r),!0).forEach((function(t){A(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function A(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}r.d(t,"i",(function(){return S.a})),r.d(t,"h",(function(){return v.a}));const M=r(18),D=M.PostError,I=M.SyncError,j=r(52);let R="enabled";function N(e){let t=R;switch(e){case"enabled":R="enabled";break;case"offline":R="offline";break;case"disabled":R="disabled";break;case"import":R="import";break;default:throw new Error("setSyncingMode: invalid mode: "+e)}return t}function k(e){switch(e){case"enabled":return"enabled"===R||"offline"===R;case"disabled":return"disabled"===R||"import"===R;case"offline":return"offline"===R;case"import":return"import"===R;default:throw new Error("checkSyncingMode: invalid mode: "+e)}}function C(e,t){let r=e.dataset,n=e.row,i=e.column,o=e.value;if("prefs"===r);else try{let e;e=t?{sql:f.cache(`UPDATE ${r} SET ${i} = ? WHERE id = ?`),params:[o,n]}:{sql:f.cache(`INSERT INTO ${r} (id, ${i}) VALUES (?, ?)`),params:[n,o]},f.runQuery(e.sql,e.params)}catch(e){throw new I("invalid-schema")}}async function L(e,t){let r=[];for(let n=0;n<t.length;n+=500){let i,o=t.slice(n,n+500),a=e+".id";"transactions"===e?(i="\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"):i="SELECT * FROM "+e,i+=" WHERE ",i+=o.map(e=>a+" = ?").join(" OR ");try{let e=await f.runQuery(i,o,!0);r=r.concat(e)}catch(e){throw new I("invalid-schema")}}return r}function x(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 P(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 B=[];function U(e){return B.push(e),()=>{B=B.filter(t=>t!==e)}}const F=Object(n.sequential)(async e=>{if(k("import"))return function(e){f.transaction(()=>{for(let t=0;t<e.length;t++){let r=e[t],n=r.dataset;r.row,r.column,r.timestamp,r.value;if(!r.old){try{C(r)}catch(e){C(r,!0)}if("prefs"===n)throw new Error("Cannot set prefs while importing")}}})}(e);k("enabled")&&(e=await async function(e){let t=[];for(let r=0;r<e.length;r++){let n=e[r],i=n.dataset,o=n.row,a=n.column,s=n.timestamp.toString(),u=f.runQuery(f.cache("SELECT timestamp FROM messages_crdt WHERE dataset = ? AND row = ? AND column = ? AND timestamp >= ?"),[i,o,a,s],!0);0===u.length?t.push(n):u[0].timestamp!==s&&t.push(T(T({},n),{},{old:!0}))}return t}(e)),e=[...e].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 t={};async function r(){let e=new Map;for(let r of Object.keys(t)){const n=await L(r,t[r]);for(let t=0;t<n.length;t++){let i=n[t];Object(m.o)(e,[r,i.id],i)}}return e}e.forEach(e=>{"prefs"!==e.dataset&&(null==t[e.dataset]&&(t[e.dataset]=[]),t[e.dataset].push(e.row))});let n,a,s={},u=await r();p.a(e,u),k("enabled")&&(n=Object(y.getClock)(),a=n.merkle),d.b()&&d.b().startCacheBarrier(),f.transaction(()=>{let t=new Set;for(let r=0;r<e.length;r++){let n=e[r],i=n.dataset,o=n.row,c=n.column,l=n.timestamp,d=n.value;n.old||(C(n,Object(m.g)(u,[i,o])||t.has(i+o)),"prefs"===i?s[o]=d:t.add(i+o)),k("enabled")&&(f.runQuery(f.cache("INSERT INTO messages_crdt (timestamp, dataset, row, column, value)\n VALUES (?, ?, ?, ?, ?)"),[l.toString(),i,o,c,x(d)]),a=b.insert(a,n.timestamp))}k("enabled")&&(a=b.prune(a),f.runQuery(f.cache("INSERT OR REPLACE INTO messages_clock (id, clock) VALUES (1, ?)"),[Object(y.serializeClock)(T(T({},n),{},{merkle:a}))]))}),k("enabled")&&(n.merkle=a),Object.keys(s).length>0&&(i.d(s,{avoidSync:!0}),s.budgetType&&Object(h.c)(s.budgetType),j.send("prefs-updated"));let c=await r();d.b()&&(d.h(),Object(h.d)(u,c),d.b().triggerDatabaseChanges(u,c),d.a(),d.b().endCacheBarrier()),B.forEach(e=>e(u,c));let l=X(e.filter(e=>!e.old));return o.a.events.emit("sync",{type:"applied",tables:l,data:c,prevData:u}),e});function W(e){return e.forEach(e=>{y.default.recv(e.timestamp)}),Object(g.runMutator)(()=>F(e))}async function H(t){try{await F(t)}catch(e){throw e instanceof I&&("invalid-schema"===e.reason?o.a.events.emit("sync",{type:"error",subtype:"apply-failure"}):o.a.events.emit("sync",{type:"error"})),e}await function(){if(K(),k("enabled")&&!k("offline")){if(e.__TESTING__)return Q().then(e=>{if(e.error)throw e.error;return e});Z=setTimeout(Q,1e3)}}()}let z=!1,q=[];async function V(e){if(z)return void await e();z=!0;let t=[];try{await e()}finally{z=!1,t=q,q=[]}t.length>0&&await H(t)}async function G(e){if(!z)return H(e);q=q.concat(e)}function Y(e){return f.runQuery("SELECT timestamp, dataset, row, column, value FROM messages_crdt WHERE timestamp > ?",[e],!0)}async function $(e,t){let r=await Y(t);return await W(e.map(e=>T(T({},e),{},{value:P(e.value),timestamp:y.default.parse(e.timestamp)}))),r}function K(){Z&&(clearTimeout(Z),Z=null)}let Z=null;function X(e){return e.reduce((e,t)=>{let r="schedules_next_date"===t.dataset?"schedules":t.dataset;return e.includes(r)||e.push(r),e},[])}async function J(){(await Q()).error||await d.j()}const Q=Object(n.once)((async function(){let e;o.a.events.emit("sync",{type:"start"});try{e=await async function e(t,r,n){let o=i.b()||{},a=o.cloudFileId,u=o.groupId,d=o.lastSyncedTimestamp;if(K(),k("disabled")||k("offline"))return[];let h=Object(y.getClock)().timestamp.toString(),p=t||d||new y.default(Date.now()-3e5,0,"0").toString(),g=Y(p),m=await s.a.getItem("user-token");c.a.info("Syncing since",p,g.length,"(attempt: "+r+")");let E=await _.b(u,a,p,g),S=await Object(l.postBinary)(Object(w.a)().SYNC_SERVER+"/sync",E,{"X-ACTUAL-TOKEN":m});if(!i.b()||i.b().groupId!==u)return[];let O=await _.a(S);c.a.info("Got messages from server",O.messages.length);let A=Object(y.getClock)().timestamp.toString()!==h,M=[];O.messages.length>0&&(M=await W(O.messages.map(e=>T(T({},e),{},{value:P(e.value),timestamp:y.default.parse(e.timestamp)}))));let D=b.diff(O.merkle,Object(y.getClock)().merkle);O.messages;if(null!==D){if(r>=10&&D===n||r>=100){c.a.info("SENT -------"),c.a.info(JSON.stringify(g)),c.a.info("RECEIVED -------"),c.a.info(JSON.stringify(O.messages));let e=Object(v.b)();if(console.log(r,"messages:",g.length,g.length>0?g[0]:null,"res.messages:",O.messages.length,O.messages.length>0?O.messages[0]:null,"clientId",Object(y.getClock)().timestamp.node(),"groupId",u,"diffTime:",D,D===n,"local clock:",Object(y.getClock)().timestamp.toString(),Object(y.getClock)().merkle.hash,"rebuilt hash:",e.numMessages,e.trie.hash,"server hash:",O.merkle.hash,"localTimeChanged:",A),e.trie.hash===O.merkle.hash){let e=await f.all("SELECT * FROM messages_clock");1!==e.length&&console.log("Bad number of clocks:",e.length);let t=Object(y.deserializeClock)(e[0]).merkle.hash;console.log("Merkle hash in db:",t)}throw new I("out-of-sync")}M=M.concat(await e(new y.default(D,0,"0").toString(),A?0:r+1,D))}else await i.d({lastSyncedTimestamp:Object(y.getClock)().timestamp.toString()});return M}(null,0,null)}catch(e){return console.log(e),e instanceof I?"out-of-sync"===e.reason?(Object(u.captureException)(e),o.a.events.emit("sync",{type:"error",subtype:"out-of-sync"})):"invalid-schema"===e.reason?o.a.events.emit("sync",{type:"error",subtype:"invalid-schema"}):"decrypt-failure"===e.reason||"encrypt-failure"===e.reason?o.a.events.emit("sync",{type:"error",subtype:e.reason,meta:e.meta}):"beta-version"===e.reason?o.a.events.emit("sync",{type:"error",subtype:e.reason}):o.a.events.emit("sync",{type:"error"}):e instanceof D?(console.log(e),"unauthorized"===e.reason?(o.a.events.emit("sync",{type:"unauthorized"}),s.a.setItem("readOnly","true")):"network-failure"===e.reason?o.a.events.emit("sync",{type:"error",subtype:"network"}):o.a.events.emit("sync",{type:"error",subtype:e.reason})):(Object(u.captureException)(e),o.a.events.emit("sync",{type:"error"})),{error:{message:e.message,reason:e.reason,meta:e.meta}}}let t=X(e);return o.a.events.emit("sync",{type:"success",tables:t,syncDisabled:k("disabled")}),{messages:e}}))}).call(this,r(23))},function(e,t,r){"use strict";(function(e){r.d(t,"c",(function(){return s})),r.d(t,"d",(function(){return u})),r.d(t,"e",(function(){return c})),r.d(t,"b",(function(){return l})),r.d(t,"a",(function(){return f}));var n=r(7),i=r(13);const o=r(4);let a=null;async function s(t){if(e.__TESTING__&&!t)return a={dummyTestPrefs:!0},a;const r=o.join(o.getBudgetDir(t),"metadata.json");try{a=JSON.parse(await o.readFile(r))}catch(e){a={id:t,budgetName:t}}return a.id=t,a}async function u(e,{avoidSync:t=!1}={}){if(Object.assign(a,e),!t){let t=Object.keys(e).map(t=>"budgetType"===t||"budgetName"===t?{dataset:"prefs",row:t,column:"value",value:e[t],timestamp:i.default.send()}:null).filter(e=>e);t.length>0&&await Object(n.j)(t)}if(!a.dummyTestPrefs){let e=o.join(o.getBudgetDir(a.id),"metadata.json");await o.writeFile(e,JSON.stringify(a))}}function c(){a=null}function l(){return a}function f(e,t){return{id:e,budgetName:t,"notifications.schedules":!0,"notifications.repair-splits":!0}}}).call(this,r(23))},function(e,t,r){let n=r(179),i=n.getDatabase,o=n.closeDatabase;function a(e){e.commit&&e.commit()}e.exports={init:function(){},shutdown:function(){o()},getItem:async function(e){let t=(await i()).transaction(["asyncStorage"],"readonly"),r=t.objectStore("asyncStorage");return new Promise((n,i)=>{let o=r.get(e);o.onerror=e=>i(e),o.onsuccess=e=>n(e.target.result),a(t)})},setItem:async function(e,t){let r=(await i()).transaction(["asyncStorage"],"readwrite"),n=r.objectStore("asyncStorage");new Promise((i,o)=>{let s=n.put(t,e);s.onerror=e=>o(e),s.onsuccess=e=>i(),a(r)})},removeItem:async function(e){let t=(await i()).transaction(["asyncStorage"],"readwrite"),r=t.objectStore("asyncStorage");return new Promise((n,i)=>{let o=r.delete(e);o.onerror=e=>i(e),o.onsuccess=e=>n(),a(t)})},multiGet:async function(e){let t=(await i()).transaction(["asyncStorage"],"readonly"),r=t.objectStore("asyncStorage"),n=Promise.all(e.map(e=>new Promise((t,n)=>{let i=r.get(e);i.onerror=e=>n(e),i.onsuccess=r=>t([e,r.target.result])})));return a(t),n},multiSet:async function(e){let t=(await i()).transaction(["asyncStorage"],"readwrite"),r=t.objectStore("asyncStorage"),n=Promise.all(e.map(([e,t])=>new Promise((n,i)=>{let o=r.put(t,e);o.onerror=e=>i(e),o.onsuccess=e=>n()})));return a(t),n},multiRemove:async function(e){let t=(await i()).transaction(["asyncStorage"],"readwrite"),r=t.objectStore("asyncStorage"),n=Promise.all(e.map(e=>new Promise((t,n)=>{let i=r.delete(e);i.onerror=e=>n(e),i.onsuccess=e=>t()})));return a(t),n}}},function(e,t,r){"use strict";(function(e){
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <http://feross.org>
* @license MIT
*/
var n=r(286),i=r(287),o=r(178);function a(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(a()<t)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=u.prototype:(null===e&&(e=new u(t)),e.length=t),e}function u(e,t,r){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(e,t,r);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return f(this,e)}return c(this,e,t,r)}function c(e,t,r,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");t=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n);u.TYPED_ARRAY_SUPPORT?(e=t).__proto__=u.prototype:e=d(e,t);return e}(e,t,r,n):"string"==typeof t?function(e,t,r){"string"==typeof r&&""!==r||(r="utf8");if(!u.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|p(t,r),i=(e=s(e,n)).write(t,r);i!==n&&(e=e.slice(0,i));return e}(e,t,r):function(e,t){if(u.isBuffer(t)){var r=0|h(t.length);return 0===(e=s(e,r)).length||t.copy(e,0,0,r),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(n=t.length)!=n?s(e,0):d(e,t);if("Buffer"===t.type&&o(t.data))return d(e,t.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function f(e,t){if(l(t),e=s(e,t<0?0:0|h(t)),!u.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function d(e,t){var r=t.length<0?0:0|h(t.length);e=s(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function h(e){if(e>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function p(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return F(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return W(e).length;default:if(n)return F(e).length;t=(""+t).toLowerCase(),n=!0}}function g(e,t,r){var 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 I(this,t,r);case"utf8":case"utf-8":return A(this,t,r);case"ascii":return M(this,t,r);case"latin1":case"binary":return D(this,t,r);case"base64":return T(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){var n=e[t];e[t]=e[r],e[r]=n}function y(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:b(e,t,r,n,i);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):b(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function b(e,t,r,n,i){var o,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 c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var l=-1;for(o=r;o<s;o++)if(c(e,o)===c(t,-1===l?0:o-l)){if(-1===l&&(l=o),o-l+1===u)return l*a}else-1!==l&&(o-=o-l),l=-1}else for(r+u>s&&(r=s-u),o=r;o>=0;o--){for(var f=!0,d=0;d<u;d++)if(c(e,o+d)!==c(t,d)){f=!1;break}if(f)return o}return-1}function _(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a<n;++a){var s=parseInt(t.substr(2*a,2),16);if(isNaN(s))return a;e[r+a]=s}return a}function w(e,t,r,n){return H(F(t,e.length-r),e,r,n)}function v(e,t,r,n){return H(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function E(e,t,r,n){return v(e,t,r,n)}function S(e,t,r,n){return H(W(t),e,r,n)}function O(e,t,r,n){return H(function(e,t){for(var r,n,i,o=[],a=0;a<e.length&&!((t-=2)<0);++a)r=e.charCodeAt(a),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function T(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);for(var n=[],i=t;i<r;){var o,a,s,u,c=e[i],l=null,f=c>239?4:c>223?3:c>191?2:1;if(i+f<=r)switch(f){case 1:c<128&&(l=c);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&c)<<6|63&o)>127&&(l=u);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(u=(15&c)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,f=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),i+=f}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=4096));return r}(n)}t.Buffer=u,t.SlowBuffer=function(e){+e!=e&&(e=0);return u.alloc(+e)},t.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=a(),u.poolSize=8192,u._augment=function(e){return e.__proto__=u.prototype,e},u.from=function(e,t,r){return c(null,e,t,r)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(e,t,r){return function(e,t,r,n){return l(t),t<=0?s(e,t):void 0!==r?"string"==typeof n?s(e,t).fill(r,n):s(e,t).fill(r):s(e,t)}(null,e,t,r)},u.allocUnsafe=function(e){return f(null,e)},u.allocUnsafeSlow=function(e){return f(null,e)},u.isBuffer=function(e){return!(null==e||!e._isBuffer)},u.compare=function(e,t){if(!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];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(!o(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=u.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var a=e[r];if(!u.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,i),i+=a.length}return n},u.byteLength=p,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)m(this,t,t+1);return this},u.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},u.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var 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(){var e=0|this.length;return 0===e?"":0===arguments.length?A(this,0,e):g.apply(this,arguments)},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(){var e="",r=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),"<Buffer "+e+">"},u.prototype.compare=function(e,t,r,n,i){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),c=this.slice(n,i),l=e.slice(t,r),f=0;f<s;++f)if(c[f]!==l[f]){o=c[f],a=l[f];break}return o<a?-1:a<o?1:0},u.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},u.prototype.indexOf=function(e,t,r){return y(this,e,t,r,!0)},u.prototype.lastIndexOf=function(e,t,r){return y(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)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return _(this,e,t,r);case"utf8":case"utf-8":return w(this,e,t,r);case"ascii":return v(this,e,t,r);case"latin1":case"binary":return E(this,e,t,r);case"base64":return S(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function M(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function D(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function I(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=t;o<r;++o)i+=U(e[o]);return i}function j(e,t,r){for(var n=e.slice(t,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function R(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 N(e,t,r,n,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function k(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i<o;++i)e[r+i]=(t&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function C(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-r,4);i<o;++i)e[r+i]=t>>>8*(n?i:3-i)&255}function L(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function x(e,t,r,n,o){return o||L(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function P(e,t,r,n,o){return o||L(e,0,r,8),i.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e),u.TYPED_ARRAY_SUPPORT)(r=this.subarray(e,t)).__proto__=u.prototype;else{var i=t-e;r=new u(i,void 0);for(var o=0;o<i;++o)r[o]=this[o+e]}return r},u.prototype.readUIntLE=function(e,t,r){e|=0,t|=0,r||R(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n},u.prototype.readUIntBE=function(e,t,r){e|=0,t|=0,r||R(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},u.prototype.readUInt8=function(e,t){return t||R(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||R(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||R(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||R(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||R(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||R(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||R(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){t||R(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return t||R(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 t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||R(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||R(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||R(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||R(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||N(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},u.prototype.writeUIntBE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||N(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},u.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):k(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):k(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):C(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):C(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);N(this,e,t,r,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o<r&&(a*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);N(this,e,t,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),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||N(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):k(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):k(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):C(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):C(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,r){return x(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return x(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return P(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return P(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){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("sourceStart out of bounds");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);var i,o=n-r;if(this===e&&r<t&&t<n)for(i=o-1;i>=0;--i)e[i+t]=this[i+r];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)e[i+t]=this[i+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+o),t);return 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),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(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)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var 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{var a=u.isBuffer(e)?e:F(new u(e,n).toString()),s=a.length;for(o=0;o<r-t;++o)this[o+t]=a[o%s]}return this};var B=/[^+\/0-9A-Za-z-_]/g;function U(e){return e<16?"0"+e.toString(16):e.toString(16)}function F(e,t){var r;t=t||1/0;for(var n=e.length,i=null,o=[],a=0;a<n;++a){if((r=e.charCodeAt(a))>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.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;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function W(e){return n.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(B,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function H(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}}).call(this,r(23))},function(e,t){"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}}},function(e,t,r){"use strict";r.d(t,"l",(function(){return c})),r.d(t,"f",(function(){return l})),r.d(t,"j",(function(){return f})),r.d(t,"b",(function(){return d})),r.d(t,"n",(function(){return h})),r.d(t,"h",(function(){return p})),r.d(t,"d",(function(){return m})),r.d(t,"i",(function(){return y})),r.d(t,"o",(function(){return b})),r.d(t,"g",(function(){return _})),r.d(t,"e",(function(){return w})),r.d(t,"c",(function(){return E})),r.d(t,"p",(function(){return S})),r.d(t,"a",(function(){return O})),r.d(t,"k",(function(){return T})),r.d(t,"m",(function(){return A}));const n=["id"];function i(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function o(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 a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach((function(t){s(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}let u=r(401);function c(e){return e[e.length-1]}function l(e,t){const r=e.id?{id:e.id}:{},n=Object.keys(t);let i=!1;for(let o=0;o<n.length;o++){let a=n[o];e[a]!==t[a]&&(r[a]=t[a],i=!0)}return i?r:null}function f(e,t,r){let n=!1;for(var i=0;i<r.length;i++){let o=r[i];if(e[o]!==t[o]){n=!0;break}}return n}function d(e,t){return t=[...t],e.added&&e.added.forEach(e=>{t.push(e)}),e.updated&&e.updated.forEach(e=>{let r=e.id,o=i(e,n);const s=t.findIndex(e=>e.id===r);t[s]=a(a({},t[s]),o)}),e.deleted&&e.deleted.forEach(e=>{const r=t.findIndex(t=>e.id===t.id);-1!==r&&t.splice(r,1)}),t}function h(e,t){let r=new Map;for(let n=0;n<e.length;n++){let i=e[n],o=i[t],a=r.get(o)||[];a.push(i),r.set(o,a)}return r}function p(e,t,r){let n=new Map;for(let i=0;i<e.length;i++){let o=e[i],a=o[t],s=n.get(a)||[];n.set(a,s.concat([r?r(o):e[i]]))}return n}function g(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 m(e,t){let r=g(e),n=g(t),i=[],o=[],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=l(t,e);r&&o.push(r)}else i.push(e)}),{added:i,updated:o,deleted:a}}function y(e){let t={};for(let r=0;r<e.length;r++){let n=e[r];t[n.id]=n}return t}function b(e,t,r){for(let n=0;n<t.length;n++){let i=t[n];n===t.length-1?e.set(i,r):(e.has(i)||e.set(i,new Map),e=e.get(i))}}function _(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 w(e,t){let r=new Set(e),n=t.values(),i=n.next();for(;!i.done;)r.add(i.value),i=n.next();return r}let v={value:null,formatter:null,regex:null};function E(e){let t=parseFloat(e.replace(v.regex,"").replace(v.separator,"."));return isNaN(t)?null:t}function S(e){let t=parseInt(e.replace(/[^-0-9.,]/g,""));return isNaN(t)?null:t}function O(e){return Math.round(100*e)}function T(e){return parseFloat((e/100).toFixed(2))}function A(e){function t(e){return isNaN(e)?null:e}let r=e.match(/[.,][^.,]*$/);if(!r||0===r.index)return t(parseFloat(e));let n=e.slice(0,r.index),i=e.slice(r.index+1);return t(parseFloat(n.replace(/[^0-9-]/g,"")+"."+i))}!function(e){let t,r,n;switch(e){case"space-comma":t="za-ZA",r=/[^-0-9,]/g,n=",";break;case"dot-comma":t="de-DE",r=/[^-0-9,]/g,n=",";break;case"comma-dot":default:t="en-US",r=/[^-0-9.]/g,n="."}v={value:e,separator:n,formatter:{format:e=>u.format(e,{locale:t,format:"%v"})},regex:r}}("1,000.33")},function(e,t,r){"use strict";r.r(t),r.d(t,"setClock",(function(){return s})),r.d(t,"getClock",(function(){return u})),r.d(t,"makeClock",(function(){return c})),r.d(t,"serializeClock",(function(){return l})),r.d(t,"deserializeClock",(function(){return f})),r.d(t,"makeClientId",(function(){return d})),r.d(t,"default",(function(){return p})),r.d(t,"MutableTimestamp",(function(){return g}));var n=r(273),i=r.n(n);const o=r(42);let a=null;function s(e){a=e}function u(){return a}function c(e,t={}){return{timestamp:g.from(e),merkle:t}}function l(e){return JSON.stringify({timestamp:e.timestamp.toString(),merkle:e.merkle})}function f(e){let t;try{t=JSON.parse(e)}catch(e){t={timestamp:"1970-01-01T00:00:00.000Z-0000-"+d(),merkle:{}}}return{timestamp:g.from(p.parse(t.timestamp)),merkle:t.merkle}}function d(){return o.v4Sync().replace(/-/g,"").slice(-16)}var h={maxDrift:3e5};class p{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 i.a.v3(this.toString())}}class g extends p{setMillis(e){this._state.millis=e}setCounter(e){this._state.counter=e}setNode(e){this._state.node=e}}g.from=e=>new g(e.millis(),e.counter(),e.node()),p.init=function(e={}){e.maxDrift&&(h.maxDrift=e.maxDrift),s(c(new p(0,0,e.node?("0000000000000000"+e.node).toString().slice(-16):"")))},p.send=function(){if(!a)return null;var e=Date.now(),t=a.timestamp.millis(),r=a.timestamp.counter(),n=Math.max(t,e),i=t===n?r+1:0;if(n-e>h.maxDrift)throw new p.ClockDriftError(n,e,h.maxDrift);if(i>65535)throw new p.OverflowError;return a.timestamp.setMillis(n),a.timestamp.setCounter(i),new p(a.timestamp.millis(),a.timestamp.counter(),a.timestamp.node())},p.recv=function(e){if(!a)return null;var t=Date.now(),r=e.millis(),n=e.counter();if(r-t>h.maxDrift)throw new p.ClockDriftError;var i=a.timestamp.millis(),o=a.timestamp.counter(),s=Math.max(Math.max(i,t),r),u=s===i&&s===r?Math.max(o,n)+1:s===i?o+1:s===r?n+1:0;if(s-t>h.maxDrift)throw new p.ClockDriftError;if(u>65535)throw new p.OverflowError;return a.timestamp.setMillis(s),a.timestamp.setCounter(u),new p(a.timestamp.millis(),a.timestamp.counter(),a.timestamp.node())},p.parse=function(e){if("string"==typeof e){var t=e.split("-");if(t&&5===t.length){var r=Date.parse(t.slice(0,3).join("-")).valueOf(),n=parseInt(t[3],16),i=t[4];if(!isNaN(r)&&!isNaN(n))return new p(r,n,i)}}return null};var m=p.parse("1970-01-01T00:00:00.000Z-0000-0000000000000000");p.zero=function(){return m};var y=p.parse("9999-12-31T23:59:59.999Z-FFFF-FFFFFFFFFFFFFFFF");p.max=function(){return y},p.since=e=>e+"-0000-0000000000000000",p.DuplicateNodeError=class extends Error{constructor(e){super(),this.type="DuplicateNodeError",this.message="duplicate node identifier "+e}},p.ClockDriftError=class extends Error{constructor(...e){super(),this.type="ClockDriftError",this.message=["maximum clock drift exceeded"].concat(e).join(" ")}},p.OverflowError=class extends Error{constructor(){super(),this.type="OverflowError",this.message="timestamp counter overflow"}}},function(e,t,r){"use strict";r.d(t,"a",(function(){return g})),r.d(t,"b",(function(){return m})),r.d(t,"f",(function(){return y})),r.d(t,"e",(function(){return b})),r.d(t,"d",(function(){return w})),r.d(t,"c",(function(){return v}));var n=r(7),i=r(12),o=r(13),a=r(6);function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,i,o=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==r.return||r.return()}finally{if(s)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return u(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return u(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function c(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 l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?c(Object(r),!0).forEach((function(t){f(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function f(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const d=r(52);let h=[{type:"marker"}],p=0;function g(e,t){let r=Object(a.getMutatorContext)();if(r.undoListening&&e.length>0){!function(){h=h.slice(0,p+1);let e=h.filter(e=>"marker"===e.type);if(e.length>20){let t=e.slice(-20),r=h.indexOf(t[0]);h=h.slice(r),p=h.length-1}}();let n=r.undoTag;h.push({type:"messages",messages:e,oldData:t,undoTag:n}),p++}}function m(){h=[{type:"marker"}],p=0}function y(e,t){let r=Object(a.getMutatorContext)();if(r.undoDisabled||r.undoListening)return e();h=h.slice(0,p+1);let n={type:"marker",meta:t};return"marker"===h[h.length-1].type?h[h.length-1]=n:(h.push(n),p++),Object(a.withMutatorContext)({undoListening:!0,undoTag:r.undoTag},e)}function b(e){return(...t)=>y(()=>e(...t))}async function _(e,t,r){await Object(a.withMutatorContext)({undoListening:!1},()=>Object(n.j)(e.map(e=>l(l({},e),{},{timestamp:o.default.send()}))));const i=e.reduce((e,t)=>(e.includes(t.dataset)||e.push(t.dataset),e),[]);d.send("undo-event",{messages:e,tables:i,meta:t,undoTag:r})}async function w(){let e=p;for(p=Math.max(p-1,0);p>0&&"marker"!==h[p].type;)p--;let t=h[p].meta,r=Math.max(p,0),n=h.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=Object(i.g)(t,[e.dataset,e.row]);if(r){let t=e.column;return"spreadsheet_cells"===e.dataset&&(t="cachedValue"),l(l({},e),{},{value:r[t]})}if("spreadsheet_cells"===e.dataset)return"expr"===e.column?l(l({},e),{},{value:null}):e;if("category_mapping"!==e.dataset&&"payee_mapping"!==e.dataset)return"zero_budget_months"===e.dataset||"zero_budgets"===e.dataset||"reflect_budgets"===e.dataset?["buffered","amount","carryover"].includes(e.column)?l(l({},e),{},{value:0}):null:"notes"===e.dataset?l(l({},e),{},{value:null}):l(l({},e),{},{column:"tombstone",value:1});return null}(e,t.oldData)).filter(e=>e)),[]).reverse();await _(e,t,n[0].undoTag)}}async function v(){let e="marker"===h[p].type?h[p].meta:null,t=p;for(p=Math.min(p+1,h.length-1);p<h.length-1&&"marker"!==h[p].type;)p++;let r=p,n=h.slice(t+1,r+1).filter(e=>"messages"===e.type);if(n.length>0){let t=n.reduce((e,t)=>e.concat(t.messages).concat(function(e,t){let r=new Set;return e.forEach(e=>{Object(i.g)(t,[e.dataset,e.row])||["zero_budget_months","zero_budgets","reflect_budgets","notes","category_mapping","payee_mapping"].includes(e.dataset)||r.add(e.dataset+"."+e.row)}),[...r].map(e=>{let t=s(e.split("."),2);return{dataset:t[0],row:t[1],column:"tombstone",value:0,timestamp:o.default.send()}})}(t.messages,t.oldData)),[]);await _(t,e,n[n.length-1].undoTag)}}},function(e,t,r){"use strict";r.r(t),r.d(t,"init",(function(){return a})),r.d(t,"_getModule",(function(){return s})),r.d(t,"prepare",(function(){return u})),r.d(t,"runQuery",(function(){return c})),r.d(t,"execQuery",(function(){return l})),r.d(t,"transaction",(function(){return d})),r.d(t,"asyncTransaction",(function(){return h})),r.d(t,"openDatabase",(function(){return p})),r.d(t,"closeDatabase",(function(){return g})),r.d(t,"exportDatabase",(function(){return m}));var n=r(272),i=r.n(n);let o=null;async function a(){return new Promise((e,t)=>{i()({locateFile:e=>"/"+e}).then(t=>{o=t,e()},e=>{t(e)})})}function s(){if(null==o)throw new Error("_getModule: sql.js must be initialized first");return o}function u(e,t){return e.prepare(t)}function c(e,t,r=[],n){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 i="string"==typeof t?e.prepare(t):t;if(n)try{i.bind(r);let e=[];for(;i.step();)e.push(i.getAsObject());return"string"==typeof t?i.free():i.reset(),e}catch(e){throw console.log(t),e}else try{return i.run(r),{changes:e.getRowsModified()}}catch(e){throw e}}function l(e,t){e.exec(t)}let f=0;function d(e,t){let r,n,i;f>0?(r="SAVEPOINT __actual_sp",n="RELEASE __actual_sp",i="ROLLBACK TO __actual_sp"):(r="BEGIN",n="COMMIT",i="ROLLBACK"),l(e,r),f++;try{const r=t();return l(e,n),r}catch(t){throw l(e,i),"ROLLBACK"!==i&&l(e,n),t}finally{f--}}async function h(e,t){0===f&&e.exec("BEGIN TRANSACTION"),f++;try{await t()}finally{f--,0===f&&e.exec("COMMIT")}}async function p(e){if(e){if("string"!=typeof e)return new o.Database(e);let t=e;if(":memory:"!==t){if("undefined"==typeof SharedArrayBuffer){let e=o.FS.open(o.FS.readlink(t),"a+");await e.node.contents.readIfFallback(),o.FS.close(e)}let e=new o.Database(t.includes("/blocked")?t:o.FS.readlink(t),{filename:!0});return e.exec("\n PRAGMA journal_mode=MEMORY;\n PRAGMA cache_size=-10000;\n "),e}}return new o.Database}function g(e){e.close()}function m(e){return e.export()}},function(e,t,r){
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
var n=r(10),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=a),a.prototype=Object.create(i.prototype),o(i,a),a.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(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 i(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},function(e,t,r){"use strict";r.d(t,"g",(function(){return c})),r.d(t,"h",(function(){return l})),r.d(t,"d",(function(){return f})),r.d(t,"a",(function(){return d})),r.d(t,"c",(function(){return h})),r.d(t,"b",(function(){return p})),r.d(t,"e",(function(){return g})),r.d(t,"f",(function(){return m})),r.d(t,"i",(function(){return y}));const n=["sort_order"],i=["sort_order"];function o(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 a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach((function(t){s(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function c(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 l(e){if("string"!=typeof e)throw new Error("toDateRepr not passed a string: "+e);return parseInt(e.replace(/-/g,""))}function f(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 d={validateAccountType(e){const t=e.type;if("checking"!==t&&"savings"!==t&&"investment"!==t&&"credit"!==t&&"mortgage"!==t&&"debt"!==t&&"other"!==t)throw new Error("Invalid account type: "+t)},validate:(e,{update:t}={})=>(t&&null==e.type||d.validateAccountType(e),c("account",e,t?["name","type","offbudget","closed"]:["name","type"],t),e)},h={validate(e,{update:t}={}){c("category",e,t?["name","is_income","cat_group"]:["name","cat_group"],t);e.sort_order;return u(e,n)}},p={validate(e,{update:t}={}){c("categoryGroup",e,t?["name","is_income"]:["name"],t);e.sort_order;return u(e,i)}},g={validate:(e,{update:t}={})=>(c("payee",e,["name"],t),e)},m={validateType(e){const t=e.type;if("equals"!==t&&"contains"!==t)throw new Error("Invalid rule type: "+t)},validate:(e,{update:t}={})=>(t&&!("type"in e)||m.validateType(e),c("payee_rules",e,["payee_id","type"],t),e)},y={validate(e,{update:t}={}){if(c("transaction",e,["date","acct"],t),"date"in e&&(null==e.date.match(/^\d{4}-\d{2}-\d{2}$/)||e.date<"2000-01-01"))throw new Error("Invalid transaction date: "+e.date);return e},toJS(e){if(!("location"in e))throw new Error("A full transaction is required to be passed to `toJS`. Instead got: "+JSON.stringify(e));let t=a({},e);return t.error=e.error?JSON.parse(e.error):null,t.isParent=1===e.isParent,t.isChild=1===e.isChild,t.starting_balance_flag=1===e.starting_balance_flag,t.cleared=1===e.cleared,t.pending=1===e.pending,t.date=t.date&&f(t.date),t},fromJS(e){let t=a({},e);return"error"in t&&(t.error=e.error?JSON.stringify(e.error):null),"isParent"in t&&(t.isParent=e.isParent?1:0),"isChild"in t&&(t.isChild=e.isChild?1:0),"cleared"in t&&(t.cleared=e.cleared?1:0),"pending"in t&&(t.pending=e.pending?1:0),"starting_balance_flag"in t&&(t.starting_balance_flag=e.starting_balance_flag?1:0),"date"in t&&(t.date=l(e.date)),t}}},function(e,t,r){"use strict";r.r(t),r.d(t,"PostError",(function(){return n})),r.d(t,"HTTPError",(function(){return i})),r.d(t,"SyncError",(function(){return o})),r.d(t,"TransactionError",(function(){return a})),r.d(t,"RuleError",(function(){return s})),r.d(t,"APIError",(function(){return u})),r.d(t,"FileDownloadError",(function(){return c})),r.d(t,"FileUploadError",(function(){return l})),r.d(t,"isCodeError",(function(){return f}));class n extends Error{constructor(e,t){super("PostError: "+e),this.type="PostError",this.reason=e,this.meta=t}}class i extends Error{constructor(e,t){super(`HTTPError: unsuccessful status code (${e}): ${t}`),this.statusCode=e,this.responseBody=t}}class o extends Error{constructor(e,t){super("SyncError: "+e),this.reason=e,this.meta=t}}class a extends Error{constructor(e){super(e)}}class s extends Error{constructor(e,t){super("RuleError: "+t),this.type=e}}function u(e,t){return{type:"APIError",message:e,meta:t}}function c(e,t){return{type:"FileDownloadError",reason:e,meta:t}}function l(e,t){return{type:"FileUploadError",reason:e,meta:t}}function f(e){return e instanceof ReferenceError||e instanceof SyntaxError}},function(e,t){var r,n,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(r===setTimeout)return setTimeout(e,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch(e){r=o}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(e){n=a}}();var u,c=[],l=!1,f=-1;function d(){l&&u&&(l=!1,u.length?c=u.concat(c):f=-1,c.length&&h())}function h(){if(!l){var e=s(d);l=!0;for(var t=c.length;t;){for(u=c,c=[];++f<t;)u&&u[f].run();f=-1,t=c.length}u=null,l=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function g(){}i.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];c.push(new p(e,t)),1!==c.length||l||s(h)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=g,i.addListener=g,i.once=g,i.off=g,i.removeListener=g,i.removeAllListeners=g,i.emit=g,i.prependListener=g,i.prependOnceListener=g,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(e,t,r){"use strict";r.d(t,"b",(function(){return s})),r.d(t,"a",(function(){return u}));var n=r(4),i=r.n(n);let o=null;function a(e,...t){let r=new URL(e);return r.pathname=i.a.join(...t),r.toString()}function s(e){o=null==e?null:u(e)}function u(e){return e?{BASE_SERVER:e,SYNC_SERVER:a(e,"/sync"),SIGNUP_SERVER:a(e,"/account"),PLAID_SERVER:a(e,"/plaid")}:o}},function(e,t,r){"use strict";r.d(t,"j",(function(){return M})),r.d(t,"h",(function(){return I})),r.d(t,"d",(function(){return j})),r.d(t,"f",(function(){return R})),r.d(t,"n",(function(){return N})),r.d(t,"c",(function(){return k})),r.d(t,"k",(function(){return L})),r.d(t,"b",(function(){return x})),r.d(t,"a",(function(){return P})),r.d(t,"e",(function(){return B})),r.d(t,"m",(function(){return F})),r.d(t,"l",(function(){return H})),r.d(t,"i",(function(){return z}));var n=r(1),i=r(29),o=r(110),a=r(2),s=r(7),u=r(18),c=r(38),l=(r(25),r(17)),f=r(12),d=r(33);function h(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,i,o=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==r.return||r.return()}finally{if(s)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return p(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return p(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function g(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 m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?g(Object(r),!0).forEach((function(t){y(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):g(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function y(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}r.d(t,"g",(function(){return i.e}));r(42);let b,_,w,v;let E=d.b.views.transactions.fields,S=(O=d.b.views.transactions.fields,Object.fromEntries(Object.entries(O).map(e=>[e[1],e[0]])));var O;function T(e){return m(m({},e),{},{field:S[e.field]||e.field})}function A(e){return m(m({},e),{},{field:E[e.field]||e.field})}const M={validate(e,{update:t}={}){if(Object(l.g)("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);return e},toJS(e){function t(e){let t;try{t="string"==typeof e?JSON.parse(e):e}catch(e){throw new u.RuleError("internal","Cannot parse rule json")}if(!Array.isArray(t))throw new u.RuleError("internal","Rule json must be an array");return t}let r=m({},e);return r.conditions=r.conditions?t(r.conditions).map(e=>T(e)):[],r.actions=r.actions?t(r.actions).map(e=>T(e)):[],r},fromJS(e){let t=m({},e);if("conditions"in t){let e=t.conditions.map(e=>A(e));t.conditions=JSON.stringify(e)}if("actions"in t){let e=t.actions.map(e=>A(e));t.actions=JSON.stringify(e)}return t}};function D(e){let t;try{t=new i.c(m(m({},M.toJS(e)),{},{fieldTypes:c.a}))}catch(e){if(console.warn("Invalid rule",e),e instanceof u.RuleError)return null;throw e}return Object(i.f)(t,Object(o.a)()),t}async function I(){b=new Map,w=new i.d({field:"imported_payee",method:"firstchar"}),v=new i.d({field:"payee"});let e=await n.all("\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=D(r);n&&(b.set(n.id,n),w.index(n),v.index(n))}_&&_(),_=Object(s.a)(C)}function j(){return[...b.values()]}async function R(e){return e=M.validate(e),n.insertWithUUID("rules",M.fromJS(e))}async function N(e){return e=M.validate(e,{update:!0}),n.update("rules",M.fromJS(e))}async function k(e){return!await n.first("SELECT id FROM schedules WHERE rule = ?",[e.id])&&n.delete_("rules",e.id)}function C(e,t){t.forEach((e,t)=>{"rules"===t&&e.forEach(e=>{let t=b.get(e.id);if(1===e.tombstone){let t=b.get(e.id);t&&(b.delete(t.getId()),w.remove(t),v.remove(t))}else{let r=D(e);r&&(t&&(w.remove(t),v.remove(t)),b.set(e.id,r),w.index(r),v.index(r))}})}),[...t.keys()].find(e=>-1!==e.indexOf("mapping"))&&j().forEach(e=>{Object(i.f)(e,Object(o.a)())})}function L(e){let t=m({},e),r=Object(i.g)(Object(f.e)(w.getApplicableRules(e),v.getApplicableRules(e)));for(let e=0;e<r.length;e++)t=r[e].apply(t);return t}function x(e,{recurDateBounds:t=100}={}){let r=[];return{filters:(e=e.map(e=>{if(e instanceof i.b)return e;try{return new i.b(e.op,e.field,e.value,e.options,c.a)}catch(e){return r.push(e.type||"internal"),console.log("conditionsToAQL: invalid condition: "+e.message),null}}).filter(Boolean)).map(e=>{let r=e.type,n=e.field,i=e.op,o=e.value,s=e.options,u=e=>"number"===r?e.value:e,l=(e,t,n)=>{if("number"===r){if(s){if(s.outflow)return{$and:[{amount:{$lt:0}},{[e]:{$transform:"$neg",[t]:n}}]};if(s.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(i){case"isapprox":case"is":if("date"===r){if("recur"===o.type){return{$or:o.schedule.occurrences({take:t}).toArray().map(e=>Object(a.f)(e.date)).map(e=>"isapprox"===i?{$and:[{date:{$gte:Object(a.q)(e,2)}},{date:{$lte:Object(a.a)(e,2)}}]}:{date:e})}}o.date;if("isapprox"===i){let e=Object(a.l)(o.date),t=Object(a.a)(e,2);return{$and:[{date:{$gte:Object(a.q)(e,2)}},{date:{$lte:t}}]}}switch(o.type){case"date":return{date:o.date};case"month":return{$and:[{date:{$gte:o.date+"-00"}},{date:{$lte:o.date+"-99"}}]};case"year":return{$and:[{date:{$gte:o.date+"-00-00"}},{date:{$lte:o.date+"-99-99"}}]}}}else if("number"===r){let e=o.value;if("isapprox"===i){let t=Object(c.b)(e);return{$and:[l(n,"$gte",e-t),l(n,"$lte",e+t)]}}return l(n,"$eq",e)}return l(n,"$eq",o);case"isbetween":let e=h(Object(c.c)(o.num1,o.num2),2),s=e[0],f=e[1];return{[n]:[{$gte:s},{$lte:f}]};case"contains":return l("id"===r?n+".name":n,"$like","%"+o+"%");case"oneOf":let d=o;return 0===d.length?{id:null}:{$or:d.map(e=>l(n,"$eq",e))};case"gt":return l(n,"$gt",u(o));case"gte":return l(n,"$gte",u(o));case"lt":return l(n,"$lt",u(o));case"lte":return l(n,"$lte",u(o));case"true":return l(n,"$eq",!0);case"false":return l(n,"$eq",!1);default:throw new Error("Unhandled operator: "+i)}}),errors:r}}function P(e,t,r){let n=t.map(e=>{if(e instanceof i.a)return e;try{return new i.a(e.op,e.field,e.value,e.options,c.a)}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})}function B(e){let t=new Set;return Object(i.e)(j(),"payee",(r,n)=>{n===e&&t.add(r)}),Object(i.g)([...t])}function*U(e,t,r,{condValue:n,actionValue:i}){let o=j();for(let a=0;a<o.length;a++){let s=o[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!==n&&s.conditions[0].value!==n||(yield s.serialize())}return null}async function F(e,t){let r=function*(e,t,r,{condValue:n,actionValue:i}){let o=j();for(let a=0;a<o.length;a++){let s=o[a];s.stage!==e||1!==s.actions.length||"set"!==s.actions[0].op||s.actions[0].field!==r||null!=i&&s.actions[0].value!==i||1!==s.conditions.length||"oneOf"!==s.conditions[0].op||s.conditions[0].field!==t||null!=n&&-1===s.conditions[0].value.indexOf(n)||(yield s.serialize())}return null}("pre","imported_payee","payee",{actionValue:t}).next().value;if(r){let t=r.conditions[0],n=[...Object(f.e)(new Set(t.value),new Set(e.filter(e=>""!==e)))],i=m(m({},r),{},{conditions:[m(m({},t),{},{value:n})]});return await N(i),r.id}return R(new i.c({stage:"pre",conditions:[{op:"oneOf",field:"imported_payee",value:e}],actions:[{op:"set",field:"payee",value:t}],fieldTypes:c.a}).serialize())}function W(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 H(e){if(0===e.length)return;let t=new Set(e.map(e=>e.payee)),r=new Set(e.map(e=>e.id)),o=null;for(let t=0;t<e.length;t++)(null===o||e[t].date<o)&&(o=e[t].date);o=Object(a.q)(o,180);let u=await n.all("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",[Object(l.h)(o),Object(l.h)(Object(a.a)(Object(a.d)(),180))]),d=Object(f.n)(u,"payee"),p=new Map;for(let e of t)if(e){let t=(d.get(e)||[]).slice(0,5);if(t.find(e=>r.has(e.id))){let r=W(t);r&&p.set(e,r)}}await Object(s.c)(async()=>{for(let t of p.entries()){var e=h(t,2);let r=e[0],n=e[1],o=[...U(null,"payee","category",{condValue:r})];if(o.length>0)for(let e of o){let t=e.actions[0];t.value!==n&&await N(m(m({},e),{},{actions:[m(m({},t),{},{value:n})]}))}else{let e=new i.c({stage:null,conditions:[{op:"is",field:"payee",value:r}],actions:[{op:"set",field:"category",value:n}],fieldTypes:c.a});await R(e.serialize())}}})}async function z(){let e=await n.all("SELECT p.*, c.id as category FROM payees p\n LEFT JOIN category_mapping cm ON cm.id = p.category\n LEFT JOIN categories c ON (c.id = cm.transferId AND c.tombstone = 0)\n WHERE p.tombstone = 0 AND transfer_acct IS NULL"),t=await n.all("SELECT pr.*, pm.targetId as payee_id FROM payee_rules pr\n LEFT JOIN payee_mapping pm ON pm.id = pr.payee_id\n WHERE pr.tombstone = 0"),r=new Map;for(let t=0;t<e.length;t++)r.set(e[t].id,e[t]);let i=new Map;for(let e=0;e<t.length;e++){let r=t[e],n=i.get(r.payee_id)||[];n.push(r),i.set(r.payee_id,n)}let o=[];for(let e of i.entries()){var a=h(e,2);let t=a[0],n=a[1],i=n.filter(e=>{let t=r.get(e.payee_id);return!("equals"!==e.type&&null!=e.type||t&&e.value.toLowerCase()===t.name.toLowerCase())}),s=n.filter(e=>"contains"===e.type),u=[{op:"set",field:"payee",value:t}];i.length>0&&o.push({stage:null,conditions:[{op:"oneOf",field:"imported_payee",value:i.map(e=>e.value)}],actions:u}),s.length>0&&(o=o.concat(s.map(e=>({stage:null,conditions:[{op:"contains",field:"imported_payee",value:e.value}],actions:u}))))}let u=e.filter(e=>e.category).reduce((e,t)=>{let r=e.get(t.category)||new Set;return r.add(t.id),e.set(t.category,r),e},new Map);for(let e of u){var c=h(e,2);let t=c[0],r=c[1];o.push({stage:null,conditions:[{op:"oneOf",field:"payee",value:[...r]}],actions:[{op:"set",field:"category",value:t}]})}let l=Object(s.k)("disabled");await Object(s.c)(async()=>{for(let e of o)await R({stage:e.stage,conditions:e.conditions,actions:e.actions});await n.runQuery("DELETE FROM payee_rules",[])}),Object(s.k)(l)}},function(e,t,r){"use strict";function n(e,t){for(var r=e<0?"-":"",n=Math.abs(e).toString();n.length<t;)n="0"+n;return r+n}r.d(t,"a",(function(){return n}))},function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t,r){"use strict";function n(e){console.log("[Exception]",e),globalThis.SentryClient&&globalThis.SentryClient.captureException(e)}function i(e){globalThis.SentryClient&&globalThis.SentryClient.addBreadcrumb(e)}r.r(t),r.d(t,"captureException",(function(){return n})),r.d(t,"captureBreadcrumb",(function(){return i}))},function(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 i(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){o(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 o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}r.d(t,"a",(function(){return a})),r.d(t,"b",(function(){return s}));class a{constructor(e){this.state=i({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 a(i(i({},this.state),{},{filterExpressions:[...this.state.filterExpressions,e]}))}unfilter(e){let t=new Set(e);return new a(i(i({},this.state),{},{filterExpressions:this.state.filterExpressions.filter(e=>!t.has(Object.keys(e)[0]))}))}select(e=[]){Array.isArray(e)||(e=[e]);let t=new a(i(i({},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 a(i(i({},this.state),{},{groupExpressions:[...this.state.groupExpressions,...e]}))}orderBy(e){return Array.isArray(e)||(e=[e]),new a(i(i({},this.state),{},{orderExpressions:[...this.state.orderExpressions,...e]}))}limit(e){return new a(i(i({},this.state),{},{limit:e}))}offset(e){return new a(i(i({},this.state),{},{offset:e}))}raw(){return new a(i(i({},this.state),{},{rawMode:!0}))}withDead(){return new a(i(i({},this.state),{},{withDead:!0}))}withoutValidatedRefs(){return new a(i(i({},this.state),{},{validateRefs:!1}))}options(e){return new a(i(i({},this.state),{},{tableOptions:e}))}serialize(){return this.state}}function s(e){return new a({table:e})}},function(e,t,r){"use strict";r.d(t,"a",(function(){return m})),r.d(t,"b",(function(){return y}));var n=r(33),i=r(1),o=r(108),a=(r(12),r(58)),s=r(67);async function u(e,t,r,n,o){let u=Object(a.b)(e,t,r),c=await i.all(u,n);return function(e,t){for(let r=0;r<e.length;r++){let n=e[r];Object.keys(n).forEach(e=>{n[e]=Object(s.e)(n[e],t.get(e))})}}(c,o),c}async function c(e,t,r,{params:n={},executors:i={}}={}){let o,a=r.namedParameters.map(e=>{let t=e.paramName;if(void 0===n[t])throw new Error(`Parameter ${t} not provided to query`);return Object(s.d)(n[t],e.paramType)});if(o=i[r.implicitTableName]?await i[r.implicitTableName](r,e,t,a,r.outputTypes):await u(e,r,t,a,r.outputTypes),e.calculation)if(o.length>0){let e=o[0];o=e[Object.keys(e)[0]]||0}else o=null;return o}function l(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 f(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach((function(t){d(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function d(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function h(e){for(let t of Object.keys(e))if("$or"===t||"$and"===t){if(e[t]&&h(e[t]))return!0}else if(0!==t.indexOf("account")&&"date"!==t)return!0;return!1}var p={transactions:function(e,t,r,n,c){let l=(t.tableOptions||{}).splits||"inline";if(-1===["all","inline","none","grouped"].indexOf(l))throw new Error(`Invalid "splits" option for transactions: "${l}"`);return"all"===l||"inline"===l||"none"===l?async function(e,t,r,n,i,o){let a=f({},r);"all"!==i&&(a.where="none"===i?`${a.where} AND ${a.from}.parent_id IS NULL`:`${a.where} AND ${a.from}.is_parent = 0`);return u(t,e,a,n,o)}(e,t,r,n,l,c):"grouped"===l?async function(e,t,r,n,u,c){t.table;let l,d=t.withDead?"":`AND ${r.from}.tombstone = 0`;if(Object(a.c)(t)){let e=`\n SELECT ${r.select}\n FROM ${r.from}\n ${r.joins}\n ${r.where} AND is_parent = 0 ${d}\n ${r.groupBy}\n ${r.orderBy}\n ${null!=r.limit?"LIMIT "+r.limit:""}\n ${null!=r.offset?"OFFSET "+r.offset:""}\n `;return i.all(e)}let p=null;if(function(e){return null==e.filterExpressions.find(h)}(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 ${d}\n ${r.orderBy}\n ${null!=r.limit?"LIMIT "+r.limit:""}\n ${null!=r.offset?"OFFSET "+r.offset:""}\n `;l=await i.all(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 `;l=await i.all(e,n),p=new Set([].concat.apply([],l.map(e=>e.matched.split(","))))}let g=Object(o.b)(l.map(e=>e.group_id),`IFNULL(${r.from}.parent_id, ${r.from}.id)`),m=`\n SELECT ${r.select}, parent_id AS _parent_id FROM ${r.from}\n ${r.joins}\n WHERE ${g} ${d}\n ${r.orderBy}\n `,y=(Date.now(),(await i.all(m)).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})),b=y.parents,_=y.children;return function(e,t,r=(e=>e)){return e.reduce((e,n)=>{let i=t.get(n.id)||[];return e.push(f(f({},r(n)),{},{subtransactions:i.map(r)})),e},[])}(b,_,e=>(Object.keys(e).forEach(t=>{e[t]=Object(s.e)(e[t],c.get(t))}),p&&!p.has(e.id)&&(e._unmatched=!0),e))}(0,t,r,n,0,c):void 0}},g=r(25);function m(e,t,r,n){return c(e,t,r,{params:n,executors:p})}function y(e,t){return e instanceof g.a&&(e=e.serialize()),async function(e,t,r,n){let i=Object(a.a)(r,e,t),o=i.sqlPieces,s=i.state;return{data:await c(r,o,s,n),dependencies:s.dependencies}}(n.a,n.b,e,{params:t,executors:p})}},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));function n(e){var t=new Date(e.getTime()),r=t.getTimezoneOffset();return t.setSeconds(0,0),6e4*r+t.getTime()%6e4}},function(e,t,r){"use strict";var n=r(56);const i=r(52),o=Object(n.a)();o.events.on("sync",e=>{i.send("sync-event",e)}),t.a=o},function(e,t,r){"use strict";r.d(t,"b",(function(){return w})),r.d(t,"a",(function(){return E})),r.d(t,"c",(function(){return S})),r.d(t,"d",(function(){return O})),r.d(t,"g",(function(){return M})),r.d(t,"f",(function(){return D})),r.d(t,"e",(function(){return I}));var n=r(18),i=r(66),o=r(109),a=r(133),s=r(47),u=r(2),c=r(12),l=r(38),f=r(41),d=r(93);function h(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 p(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?h(Object(r),!0).forEach((function(t){g(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):h(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function g(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function m(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,i,o=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==r.return||r.return()}finally{if(s)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return y(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return y(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function b(e,t,r){if(!e)throw new n.RuleError(t,r)}let _={date:{ops:["is","isapprox","gt","gte","lt","lte"],nullable:!1,parse(e,t,r){let a="string"==typeof t?"string"!=typeof(s=t)?null:10===s.length?i.a(o.a(s))?{type:"date",date:s}:null:7===s.length?i.a(o.a(s+"-01"))?{type:"month",date:s}:null:4===s.length&&i.a(o.a(s+"-01-01"))?{type:"year",date:s}:null:null!=t.frequency?function(e){try{let t=Object(f.e)(e);return{type:"recur",schedule:new d.a({rrules:t})}}catch(e){throw new n.RuleError("parse-recur-date",e.message)}}(t):null;var s;return b(a,"date-format",`Invalid date format (field: ${r})`),"isapprox"===e?b("date"===a.type||"recur"===a.type,"date-format",`Invalid date value for "isapprox" (field: ${r})`):"gt"!==e&&"gte"!==e&&"lt"!==e&&"lte"!==e||b("date"===a.type,"date-format",`Invalid date value for "${e}" (field: ${r})`),a}},id:{ops:["is","contains","oneOf"],nullable:!0,parse:(e,t,r)=>"oneOf"===e?(b(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?(b(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&&b("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 t=e.num1,r=e.num2;return"number"!=typeof t||"number"!=typeof r?null:{type:"between",num1:t,num2:r}}(t);return b(null!=n,"not-number",`Value must be a number or between amount: ${JSON.stringify(t)} (field: ${r})`),"isbetween"===e?b("between"===n.type,"number-format",`Invalid between value for "${e}" (field: ${r})`):b("literal"===n.type,"number-format",`Invalid number value for "${e}" (field: ${r})`),n}},boolean:{ops:["is"],nullable:!1,parse:(e,t,r)=>(b("boolean"==typeof t,"not-boolean",`Value must be a boolean: ${t} (field: ${r})`),t)}};class w{constructor(e,t,r,n,i){let o=i.get(t);b(o,"internal","Invalid condition field: "+t);let a=_[o];b(a,"internal",`Invalid condition type: ${o} (field: ${t})`),b(a.ops.includes(e),"internal",`Invalid condition operator: ${e} (type: ${o}, field: ${t})`),!0!==a.nullable&&b(null!=r,"no-null","Field cannot be empty: "+t),"string"===o&&!0!==a.nullable&&b(""!==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=o}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 e=this.value.schedule;if("isapprox"===this.op){let r=Object(u.l)(t);return e.occursBetween(a.a(r,2),s.a(r,2))}return e.occursOn({date:Object(u.l)(t)})}{let e=this.value.date;if("isapprox"===this.op){let r=Object(u.l)(e),n=Object(u.a)(r,2);return t>=Object(u.q)(r,2)&&t<=n}switch(this.value.type){case"date":return t===e;case"month":return Object(u.k)(t)===e;case"year":return Object(u.s)(t)===e}}}else if("number"===r){let e=this.value.value;if("isapprox"===this.op){let r=Object(l.b)(e);return t>=e-r&&t<=e+r}return t===e}return t===this.value;case"isbetween":{let e=m(Object(l.c)(this.value.num1,this.value.num2),2),r=e[0],n=e[1];return t>=r&&t<=n}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?Object(u.i)(t,this.value.date):t>n(this.value));case"gte":return null!==t&&("date"===r?t===this.value.date||Object(u.i)(t,this.value.date):t>=n(this.value));case"lt":return null!==t&&("date"===r?Object(u.j)(t,this.value.date):t<n(this.value));case"lte":return null!==t&&("date"===r?t===this.value.date||Object(u.j)(t,this.value.date):t<=n(this.value))}return!1}getValue(){return this.value}serialize(){return p({op:this.op,field:this.field,value:this.unparsedValue,type:this.type},this.options?{options:this.options}:null)}}let v=["set","link-schedule"];class E{constructor(e,t,r,n,i){if(b(v.includes(e),"internal","Invalid action operation: "+e),"set"===e){let e=i.get(t);b(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 p({op:this.op,field:this.field,value:this.value,type:this.type},this.options?{options:this.options}:null)}}class S{constructor({id:e,stage:t,conditions:r,actions:n,fieldTypes:i}){this.id=e,this.stage=t,this.conditions=r.map(e=>new w(e.op,e.field,e.value,e.options,i)),this.actions=n.map(e=>new E(e.op,e.field,e.value,e.options,i))}evalConditions(e){return 0!==this.conditions.length&&this.conditions.every(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,conditions:this.conditions.map(e=>e.serialize()),actions:this.actions.map(e=>e.serialize())}}}class O{constructor({field:e,method:t}){this.field=e,this.method=t,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 Object(c.e)(t||new Set,this.rules.get("*")||new Set)}}const T={is:10,oneOf:9,isapprox:5,isbetween:5,gt:1,gte:1,lt:1,lte:1,contains:0};function A(e){let t=new Map;return e.forEach(e=>{t.set(e,function(e){let t=e.conditions.reduce((e,t)=>null==T[t.op]?(console.log("Found invalid operation while ranking: "+t.op),0):e+T[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),i=t.get(r);if(n<i)return-1;if(n>i)return 1;{let t=e.getId(),n=r.getId();return t<n?-1:t>n?1:0}})}function M(e){let t=[],r=[],n=[];for(let i of e)switch(i.stage){case"pre":t.push(i);break;case"post":n.push(i);break;default:r.push(i)}return t=A(t),r=A(r),n=A(n),t.concat(r).concat(n)}function D(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 I(e,t,r){let n;e:for(n=0;n<e.length;n++){let i=e[n];for(let e=0;e<i.conditions.length;e++){let n=i.conditions[e];if("id"===n.type&&n.field===t)switch(n.op){case"is":if(r(i,n.value))continue e;break;case"oneOf":for(let e=0;e<n.value.length;e++)if(r(i,n.value[e]))continue e}}for(let e=0;e<i.actions.length;e++){let n=i.actions[e];if("id"===n.type&&n.field===t&&"set"===n.op&&r(i,n.value))break}}}},function(e,t,r){"use strict";r.r(t),function(e){r.d(t,"post",(function(){return f})),r.d(t,"postBinary",(function(){return d})),r.d(t,"get",(function(){return h}));var n=r(43);function i(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?i(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const s=r(18),u=s.PostError,c=(s.HTTPError,r(130).fetch);function l(e,t){if(200!==e.status){if(500===e.status)throw new u(500===e.status?"internal":t);if(-1!==e.headers.get("Content-Type").toLowerCase().indexOf("application/json")){let e=JSON.parse(t);throw new u(e.reason)}throw new u(t)}}async function f(e,t){let r,n;(new Error).stack;try{n=await c(e,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json"}}),r=await n.text()}catch(e){throw new u("network-failure")}l(n,r);try{n=JSON.parse(r)}catch(e){throw new u("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 u(n.description||n.reason||"unknown");return n.data}async function d(t,r,i){let a,s;try{a=await c(t,{method:"POST",body:n.a.isWeb?r:e.from(r),headers:o({"Content-Length":r.length,"Content-Type":"application/actual-sync"},i)})}catch(e){throw new u("network-failure")}return s=a.arrayBuffer?e.from(await a.arrayBuffer()):await a.buffer(),l(a,s.toString()),s}function h(e,t){return c(e,t).then(e=>e.text())}}.call(this,r(10).Buffer)},function(e,t,r){"use strict";var n=r(76);let i=r(410),o={};class a{constructor({id:e,value:t}){this.id=e||i.v4Sync()}async createFromPassword({password:e,salt:t}){this.value=await n.a({secret:e,salt:t})}async createFromBase64(e){this.value=await n.d(e)}getId(){return this.id}getValue(){return this.value}serialize(){return{id:this.id,base64:this.value.base64}}}function s(e){if(null==e||null==o[e])throw new Error("missing-key");return o[e]}t.a={decrypt:function(e,t){return n.b(s(t.keyId),e,t)},encrypt:function(e,t){return n.c(s(t),e)},randomBytes:function(e){return n.e(e)},createKey:async function({id:e,password:t,salt:r}){let n=new a({id:e});return await n.createFromPassword({password:t,salt:r}),n},loadKey:async function(e){let t;e instanceof a?t=e:(t=new a({id:e.id}),await t.createFromBase64(e.base64)),o[t.getId()]=t},getKey:s,hasKey:function(e){return e in o},unloadKey:function(e){delete o[e.getId()]},unloadAllKeys:function(){o={}}}},function(e,t,r){"use strict";r.d(t,"c",(function(){return p})),r.d(t,"i",(function(){return g})),r.d(t,"j",(function(){return m})),r.d(t,"a",(function(){return b})),r.d(t,"l",(function(){return _})),r.d(t,"g",(function(){return w})),r.d(t,"h",(function(){return v})),r.d(t,"e",(function(){return E})),r.d(t,"d",(function(){return S})),r.d(t,"f",(function(){return O})),r.d(t,"b",(function(){return T})),r.d(t,"m",(function(){return A})),r.d(t,"n",(function(){return M})),r.d(t,"k",(function(){return D}));var n=r(2),i=r(1),o=r(7),a=(r(12),r(8)),s=r(5);async function u(e,t){const r=await s.c(e,t);return"number"==typeof r.value?r.value:0}function c(){return"report"===(a.b()||{}).budgetType?"reflect_budgets":"zero_budgets"}function l(){return"report"===a.b().budgetType}function f(e){return parseInt(e.replace("-",""))}function d(e,t){return i.all(`\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])}function h(e){let t=s.b().meta().createdMonths,r=null;for(let e of t)(null==r||e>r)&&(r=e);return n.o(e,r)}function p({category:e,month:t}){let r=c(),n=i.firstSync(`SELECT * FROM ${r} WHERE month = ? AND category = ?`,[f(t),e]);return n&&n.amount||0}function g({category:e,month:t,amount:r}){"number"!=typeof r&&(r=0);const n=c();let o=i.firstSync(`SELECT id FROM ${n} WHERE month = ? AND category = ?`,[f(t),e]);return o?i.update(n,{id:o.id,amount:r}):i.insert(n,{id:`${f(t)}-${e}`,month:f(t),category:e,amount:r})}function m(e,t){let r=i.firstSync("SELECT id FROM zero_budget_months WHERE id = ?",[e]);return r?i.update("zero_budget_months",{id:r.id,buffered:t}):i.insert("zero_budget_months",{id:e,buffered:t})}function y(e,t,r,n){let o=i.firstSync(`SELECT id FROM ${e} WHERE month = ? AND category = ?`,[r,t]);return o?i.update(e,{id:o.id,carryover:n?1:0}):i.insert(e,{id:`${r}-${t}`,month:r,category:t,carryover:n?1:0})}async function b({month:e}){let t=f(n.m(e)),r=c(),i=await d(r,t);await Object(o.c)(()=>{i.forEach(t=>{(1!==t.is_income||l())&&g({category:t.category,month:e,amount:t.amount})})})}async function _({month:e}){let t=await i.all("SELECT * FROM v_categories WHERE tombstone = 0");await Object(o.c)(()=>{t.forEach(t=>{(1!==t.is_income||l())&&g({category:t.id,month:e,amount:0})})})}async function w({month:e}){let t=await i.all("SELECT * FROM v_categories WHERE tombstone = 0"),r=n.m(e),a=n.m(r),s=n.m(a);await Object(o.c)(async()=>{for(let i of t){if(1===i.is_income&&!l())continue;const t=(await u(n.p(r),"sum-amount-"+i.id)+await u(n.p(a),"sum-amount-"+i.id)+await u(n.p(s),"sum-amount-"+i.id))/3|0;g({category:i.id,month:e,amount:-t})}})}async function v({startMonth:e}){if(!l())throw new Error("setAllFuture only applies to report budget type");let t=c(),r=await d(t,f(e)),i=h(n.b(e,1));Object(o.c)(()=>{for(let e of i)r.forEach(t=>{(1!==t.is_income||l())&&g({category:t.category,month:e,amount:t.amount})})})}async function E({month:e,amount:t}){let r=await i.first("SELECT buffered FROM zero_budget_months WHERE id = ?",[e]),o=n.p(e),a=await u(o,"to-budget");if(a>0){let n=function(e,t,r){return t+(r=Math.min(Math.max(r,-t),Math.max(e,0)))}(a,r&&r.buffered||0,t);return await m(e,n),!0}return!1}async function S({startMonth:e,amount:t}){let r=h(e);await Object(o.c)(async()=>{for(let e of r)if(!await E({month:e,amount:t}))break})}async function O({month:e}){await m(e,0)}async function T({month:e,to:t,from:r}){let i=n.p(e),o=await u(i,"budget-"+t),a=await u(i,"leftover-"+t),s=await u(i,"to-be-budgeted"===r?"to-budget":"leftover-"+r);if(a>=0||s<=0)return;let c=Math.min(-a,s);if("to-be-budgeted"!==r){const t=await u(i,"budget-"+r);await g({category:r,month:e,amount:t-c})}await g({category:t,month:e,amount:o+c})}async function A({month:e,amount:t,category:r}){let i=n.p(e),o=await u(i,"to-budget");t=Math.max(Math.min(t,o),0);let a=await u(i,"budget-"+r);await g({category:r,month:e,amount:a+t})}async function M({month:e,amount:t,from:r,to:i}){const o=n.p(e),a=await u(o,"budget-"+r);if(await g({category:r,month:e,amount:a-t}),"to-be-budgeted"!==i){const r=await u(o,"budget-"+i);await g({category:i,month:e,amount:r+t})}}async function D({startMonth:e,category:t,flag:r}){let n=c(),i=h(e);await Object(o.c)(()=>{for(let e of i)y(n,t,f(e),r)})}},function(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 i(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){o(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 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 a(e,t){return i({type:e},t)}r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return u}));const s={transactions:{id:a("id"),is_parent:a("boolean"),is_child:a("boolean"),parent_id:a("id"),account:a("id",{ref:"accounts",required:!0}),category:a("id",{ref:"categories"}),amount:a("integer",{default:0,required:!0}),payee:a("id",{ref:"payees"}),notes:a("string"),date:a("date",{required:!0}),imported_id:a("string"),error:a("json"),imported_payee:a("string"),starting_balance_flag:a("boolean"),transfer_id:a("id"),sort_order:a("float",{default:()=>Date.now()}),cleared:a("boolean",{default:!0}),tombstone:a("boolean"),schedule:a("id",{ref:"schedules"})},payees:{id:a("id"),name:a("string",{required:!0}),transfer_acct:a("id",{ref:"accounts"}),tombstone:a("boolean")},accounts:{id:a("id"),name:a("string",{required:!0}),type:a("string"),offbudget:a("boolean"),closed:a("boolean"),sort_order:a("float"),tombstone:a("boolean")},categories:{id:a("id"),name:a("string"),is_income:a("boolean"),group:a("id",{ref:"category_groups"}),sort_order:a("float"),tombstone:a("boolean")},category_groups:{id:a("id"),name:a("string"),is_income:a("boolean"),sort_order:a("float"),tombstone:a("boolean")},schedules:{id:a("id"),rule:a("id",{ref:"rules",required:!0}),next_date:a("date"),completed:a("boolean"),posts_transaction:a("boolean"),tombstone:a("boolean"),_payee:a("id",{ref:"payees"}),_account:a("id",{ref:"accounts"}),_amount:a("json/fallback"),_amountOp:a("string"),_date:a("json/fallback"),_conditions:a("json"),_actions:a("json")},rules:{id:a("id"),stage:a("string"),conditions:a("json"),actions:a("json"),tombstone:a("boolean")},notes:{id:a("id"),note:a("string")}},u={tableViews(e,{isJoin:t,withDead:r,tableOptions:n={}}){switch(e){case"transactions":{if(t)return"v_transactions_internal_alive";let e=n.splits||"inline";return r||"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 t=e.table;e.tableOptions;return i(i({},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 isn't 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 `}}}},function(e,t,r){"use strict";r.d(t,"a",(function(){return k}));var n=r(3),i=r(27),o=r(0),a=r(66),s=r(59),u=r(62);var c=r(137),l=r(131),f=r(136),d=r(92),h=r(22),p="midnight",g="noon",m="morning",y="afternoon",b="evening",_="night";function w(e,t){var r=e>0?"-":"+",n=Math.abs(e),i=Math.floor(n/60),o=n%60;if(0===o)return r+String(i);var a=t||"";return r+String(i)+a+Object(h.a)(o,2)}function v(e,t){return e%60==0?(e>0?"-":"+")+Object(h.a)(Math.abs(e)/60,2):E(e,t)}function E(e,t){var r=t||"",n=e>0?"-":"+",i=Math.abs(e);return n+Object(h.a)(Math.floor(i/60),2)+r+Object(h.a)(i%60,2)}var S={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"});case"GGGG":default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if("yo"===t){var n=e.getUTCFullYear(),i=n>0?n:1-n;return r.ordinalNumber(i,{unit:"year"})}return u.a.y(e,t)},Y:function(e,t,r,n){var i=Object(d.a)(e,n),o=i>0?i:1-i;if("YY"===t){var a=o%100;return Object(h.a)(a,2)}return"Yo"===t?r.ordinalNumber(o,{unit:"year"}):Object(h.a)(o,t.length)},R:function(e,t){var r=Object(l.a)(e);return Object(h.a)(r,t.length)},u:function(e,t){var r=e.getUTCFullYear();return Object(h.a)(r,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 Object(h.a)(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"});case"QQQQ":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 Object(h.a)(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"});case"qqqq":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 u.a.M(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"});case"MMMM":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 Object(h.a)(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"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){var i=Object(f.a)(e,n);return"wo"===t?r.ordinalNumber(i,{unit:"week"}):Object(h.a)(i,t.length)},I:function(e,t,r){var n=Object(c.a)(e);return"Io"===t?r.ordinalNumber(n,{unit:"week"}):Object(h.a)(n,t.length)},d:function(e,t,r){return"do"===t?r.ordinalNumber(e.getUTCDate(),{unit:"date"}):u.a.d(e,t)},D:function(e,t,r){var n=function(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=Object(o.a)(e),r=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var n=t.getTime(),i=r-n;return Math.floor(i/864e5)+1}(e);return"Do"===t?r.ordinalNumber(n,{unit:"dayOfYear"}):Object(h.a)(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"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){var i=e.getUTCDay(),o=(i-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return Object(h.a)(o,2);case"eo":return r.ordinalNumber(o,{unit:"day"});case"eee":return r.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(i,{width:"short",context:"formatting"});case"eeee":default:return r.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){var i=e.getUTCDay(),o=(i-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return Object(h.a)(o,t.length);case"co":return r.ordinalNumber(o,{unit:"day"});case"ccc":return r.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(i,{width:"narrow",context:"standalone"});case"cccccc":return r.day(i,{width:"short",context:"standalone"});case"cccc":default:return r.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,r){var n=e.getUTCDay(),i=0===n?7:n;switch(t){case"i":return String(i);case"ii":return Object(h.a)(i,t.length);case"io":return r.ordinalNumber(i,{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"});case"iiii":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":case"aaa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaaaa":return r.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(e,t,r){var n,i=e.getUTCHours();switch(n=12===i?g:0===i?p:i/12>=1?"pm":"am",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"});case"bbbb":default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(e,t,r){var n,i=e.getUTCHours();switch(n=i>=17?b:i>=12?y:i>=4?m:_,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"});case"BBBB":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 u.a.h(e,t)},H:function(e,t,r){return"Ho"===t?r.ordinalNumber(e.getUTCHours(),{unit:"hour"}):u.a.H(e,t)},K:function(e,t,r){var n=e.getUTCHours()%12;return"Ko"===t?r.ordinalNumber(n,{unit:"hour"}):Object(h.a)(n,t.length)},k:function(e,t,r){var n=e.getUTCHours();return 0===n&&(n=24),"ko"===t?r.ordinalNumber(n,{unit:"hour"}):Object(h.a)(n,t.length)},m:function(e,t,r){return"mo"===t?r.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):u.a.m(e,t)},s:function(e,t,r){return"so"===t?r.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):u.a.s(e,t)},S:function(e,t){var r=t.length,n=e.getUTCMilliseconds(),i=Math.floor(n*Math.pow(10,r-3));return Object(h.a)(i,r)},X:function(e,t,r,n){var i=(n._originalDate||e).getTimezoneOffset();if(0===i)return"Z";switch(t){case"X":return v(i);case"XXXX":case"XX":return E(i);case"XXXXX":case"XXX":default:return E(i,":")}},x:function(e,t,r,n){var i=(n._originalDate||e).getTimezoneOffset();switch(t){case"x":return v(i);case"xxxx":case"xx":return E(i);case"xxxxx":case"xxx":default:return E(i,":")}},O:function(e,t,r,n){var i=(n._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+w(i,":");case"OOOO":default:return"GMT"+E(i,":")}},z:function(e,t,r,n){var i=(n._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+w(i,":");case"zzzz":default:return"GMT"+E(i,":")}},t:function(e,t,r,n){var i=n._originalDate||e,o=Math.floor(i.getTime()/1e3);return Object(h.a)(o,t.length)},T:function(e,t,r,n){var i=(n._originalDate||e).getTime();return Object(h.a)(i,t.length)}};function O(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"});case"PPPP":default:return t.date({width:"full"})}}function T(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"});case"pppp":default:return t.time({width:"full"})}}var A={p:T,P:function(e,t){var r,n=e.match(/(P+)(p+)?/),i=n[1],o=n[2];if(!o)return O(e,t);switch(i){case"P":r=t.dateTime({width:"short"});break;case"PP":r=t.dateTime({width:"medium"});break;case"PPP":r=t.dateTime({width:"long"});break;case"PPPP":default:r=t.dateTime({width:"full"})}return r.replace("{{date}}",O(i,t)).replace("{{time}}",T(o,t))}},M=r(50),D=r(94),I=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,j=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,R=/^'(.*?)'?$/,N=/''/g;function k(e,t,r){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var u=String(t),c=r||{},l=c.locale||s.a,f=l.options&&l.options.firstWeekContainsDate,d=null==f?1:Object(n.a)(f),h=null==c.firstWeekContainsDate?d:Object(n.a)(c.firstWeekContainsDate);if(!(h>=1&&h<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var p=l.options&&l.options.weekStartsOn,g=null==p?0:Object(n.a)(p),m=null==c.weekStartsOn?g:Object(n.a)(c.weekStartsOn);if(!(m>=0&&m<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!l.localize)throw new RangeError("locale must contain localize property");if(!l.formatLong)throw new RangeError("locale must contain formatLong property");var y=Object(o.a)(e);if(!Object(a.a)(y))throw new RangeError("Invalid time value");var b=Object(i.a)(y),_=Object(M.a)(y,b),w={firstWeekContainsDate:h,weekStartsOn:m,locale:l,_originalDate:y},v=u.match(j).map((function(e){var t=e[0];return"p"===t||"P"===t?(0,A[t])(e,l.formatLong,w):e})).join("").match(I).map((function(e){if("''"===e)return"'";var t=e[0];if("'"===t)return C(e);var r=S[t];return r?(!c.awareOfUnicodeTokens&&Object(D.a)(e)&&Object(D.b)(e),r(_,e,l.localize,w)):e})).join("");return v}function C(e){return e.match(R)[1].replace(N,"'")}},function(e,t,r){(function(e){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var a;"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{a="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(347).Buffer}catch(e){}function s(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(e,t,r){var n=s(e,r);return r-1>=t&&(n|=s(e,r-1)<<4),n}function c(e,t,r,n){for(var i=0,o=Math.min(e.length,r),a=t;a<o;a++){var s=e.charCodeAt(a)-48;i*=n,i+=s>=49?s-49+10:s>=17?s-17+10:s}return i}o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,r):(this._parseBase(e,t,i),"le"===r&&this._initArray(this.toArray(),t,r)))},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,a,s=0;if("be"===r)for(i=e.length-1,o=0;i>=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i<e.length;i+=3)a=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,a=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=u(e,t,n)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)i=u(e,t,n)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,a=o%n,s=Math.min(o,o-a)+r,u=0,l=r;l<s;l+=n)u=c(e,l,l+n,t),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==a){var f=1;for(u=c(e,l,e.length,t),l=0;l<a;l++)f*=t;this.imuln(f),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},o.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function h(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var c=1;c<n;c++){for(var l=u>>>26,f=67108863&u,d=Math.min(c,t.length-1),h=Math.max(0,c-e.length+1);h<=d;h++){var p=c-h|0;l+=(a=(i=0|e.words[p])*(o=0|t.words[h])+f)/67108864|0,f=67108863&a}r.words[c]=0|f,u=0|l}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,a=0;a<this.length;a++){var s=this.words[a],u=(16777215&(s<<i|o)).toString(16);r=0!==(o=s>>>24-i&16777215)||a!==this.length-1?l[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=f[e],h=d[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var g=p.modn(h).toString(e);r=(p=p.idivn(h)).isZero()?g+r:l[c-g.length]+g+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return n(void 0!==a),this.toArrayLike(a,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var a,s,u="le"===t,c=new e(o),l=this.clone();if(u){for(s=0;!l.isZero();s++)a=l.andln(255),l.iushrn(8),c[s]=a;for(;s<o;s++)c[s]=0}else{for(s=0;s<o-i;s++)c[s]=0;for(s=0;!l.isZero();s++)a=l.andln(255),l.iushrn(8),c[o-s-1]=a}return c},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},o.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},o.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this.strip()},o.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},o.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o<n.length;o++)t=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&t,i=t>>>26;for(;0!==i&&o<r.length;o++)t=(0|r.words[o])+i,this.words[o]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,a=0;a<n.length;a++)o=(t=(0|r.words[a])-(0|n.words[a])+o)>>26,this.words[a]=67108863&t;for(;0!==o&&a<r.length;a++)o=(t=(0|r.words[a])+o)>>26,this.words[a]=67108863&t;if(0===o&&a<r.length&&r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=Math.max(this.length,a),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(e){return this.clone().isub(e)};var p=function(e,t,r){var n,i,o,a=e.words,s=t.words,u=r.words,c=0,l=0|a[0],f=8191&l,d=l>>>13,h=0|a[1],p=8191&h,g=h>>>13,m=0|a[2],y=8191&m,b=m>>>13,_=0|a[3],w=8191&_,v=_>>>13,E=0|a[4],S=8191&E,O=E>>>13,T=0|a[5],A=8191&T,M=T>>>13,D=0|a[6],I=8191&D,j=D>>>13,R=0|a[7],N=8191&R,k=R>>>13,C=0|a[8],L=8191&C,x=C>>>13,P=0|a[9],B=8191&P,U=P>>>13,F=0|s[0],W=8191&F,H=F>>>13,z=0|s[1],q=8191&z,V=z>>>13,G=0|s[2],Y=8191&G,$=G>>>13,K=0|s[3],Z=8191&K,X=K>>>13,J=0|s[4],Q=8191&J,ee=J>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,le=0|s[8],fe=8191&le,de=le>>>13,he=0|s[9],pe=8191&he,ge=he>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(c+(n=Math.imul(f,W))|0)+((8191&(i=(i=Math.imul(f,H))+Math.imul(d,W)|0))<<13)|0;c=((o=Math.imul(d,H))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(p,W),i=(i=Math.imul(p,H))+Math.imul(g,W)|0,o=Math.imul(g,H);var ye=(c+(n=n+Math.imul(f,q)|0)|0)+((8191&(i=(i=i+Math.imul(f,V)|0)+Math.imul(d,q)|0))<<13)|0;c=((o=o+Math.imul(d,V)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,W),i=(i=Math.imul(y,H))+Math.imul(b,W)|0,o=Math.imul(b,H),n=n+Math.imul(p,q)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(g,q)|0,o=o+Math.imul(g,V)|0;var be=(c+(n=n+Math.imul(f,Y)|0)|0)+((8191&(i=(i=i+Math.imul(f,$)|0)+Math.imul(d,Y)|0))<<13)|0;c=((o=o+Math.imul(d,$)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(w,W),i=(i=Math.imul(w,H))+Math.imul(v,W)|0,o=Math.imul(v,H),n=n+Math.imul(y,q)|0,i=(i=i+Math.imul(y,V)|0)+Math.imul(b,q)|0,o=o+Math.imul(b,V)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(g,Y)|0,o=o+Math.imul(g,$)|0;var _e=(c+(n=n+Math.imul(f,Z)|0)|0)+((8191&(i=(i=i+Math.imul(f,X)|0)+Math.imul(d,Z)|0))<<13)|0;c=((o=o+Math.imul(d,X)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(S,W),i=(i=Math.imul(S,H))+Math.imul(O,W)|0,o=Math.imul(O,H),n=n+Math.imul(w,q)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(v,q)|0,o=o+Math.imul(v,V)|0,n=n+Math.imul(y,Y)|0,i=(i=i+Math.imul(y,$)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,$)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(g,Z)|0,o=o+Math.imul(g,X)|0;var we=(c+(n=n+Math.imul(f,Q)|0)|0)+((8191&(i=(i=i+Math.imul(f,ee)|0)+Math.imul(d,Q)|0))<<13)|0;c=((o=o+Math.imul(d,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(A,W),i=(i=Math.imul(A,H))+Math.imul(M,W)|0,o=Math.imul(M,H),n=n+Math.imul(S,q)|0,i=(i=i+Math.imul(S,V)|0)+Math.imul(O,q)|0,o=o+Math.imul(O,V)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,$)|0)+Math.imul(v,Y)|0,o=o+Math.imul(v,$)|0,n=n+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,X)|0)+Math.imul(b,Z)|0,o=o+Math.imul(b,X)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,ee)|0;var ve=(c+(n=n+Math.imul(f,re)|0)|0)+((8191&(i=(i=i+Math.imul(f,ne)|0)+Math.imul(d,re)|0))<<13)|0;c=((o=o+Math.imul(d,ne)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(I,W),i=(i=Math.imul(I,H))+Math.imul(j,W)|0,o=Math.imul(j,H),n=n+Math.imul(A,q)|0,i=(i=i+Math.imul(A,V)|0)+Math.imul(M,q)|0,o=o+Math.imul(M,V)|0,n=n+Math.imul(S,Y)|0,i=(i=i+Math.imul(S,$)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,$)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,X)|0,n=n+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(g,re)|0,o=o+Math.imul(g,ne)|0;var Ee=(c+(n=n+Math.imul(f,oe)|0)|0)+((8191&(i=(i=i+Math.imul(f,ae)|0)+Math.imul(d,oe)|0))<<13)|0;c=((o=o+Math.imul(d,ae)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(N,W),i=(i=Math.imul(N,H))+Math.imul(k,W)|0,o=Math.imul(k,H),n=n+Math.imul(I,q)|0,i=(i=i+Math.imul(I,V)|0)+Math.imul(j,q)|0,o=o+Math.imul(j,V)|0,n=n+Math.imul(A,Y)|0,i=(i=i+Math.imul(A,$)|0)+Math.imul(M,Y)|0,o=o+Math.imul(M,$)|0,n=n+Math.imul(S,Z)|0,i=(i=i+Math.imul(S,X)|0)+Math.imul(O,Z)|0,o=o+Math.imul(O,X)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,ee)|0,n=n+Math.imul(y,re)|0,i=(i=i+Math.imul(y,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(g,oe)|0,o=o+Math.imul(g,ae)|0;var Se=(c+(n=n+Math.imul(f,ue)|0)|0)+((8191&(i=(i=i+Math.imul(f,ce)|0)+Math.imul(d,ue)|0))<<13)|0;c=((o=o+Math.imul(d,ce)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(L,W),i=(i=Math.imul(L,H))+Math.imul(x,W)|0,o=Math.imul(x,H),n=n+Math.imul(N,q)|0,i=(i=i+Math.imul(N,V)|0)+Math.imul(k,q)|0,o=o+Math.imul(k,V)|0,n=n+Math.imul(I,Y)|0,i=(i=i+Math.imul(I,$)|0)+Math.imul(j,Y)|0,o=o+Math.imul(j,$)|0,n=n+Math.imul(A,Z)|0,i=(i=i+Math.imul(A,X)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,X)|0,n=n+Math.imul(S,Q)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(v,re)|0,o=o+Math.imul(v,ne)|0,n=n+Math.imul(y,oe)|0,i=(i=i+Math.imul(y,ae)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,ae)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(g,ue)|0,o=o+Math.imul(g,ce)|0;var Oe=(c+(n=n+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,de)|0)+Math.imul(d,fe)|0))<<13)|0;c=((o=o+Math.imul(d,de)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(B,W),i=(i=Math.imul(B,H))+Math.imul(U,W)|0,o=Math.imul(U,H),n=n+Math.imul(L,q)|0,i=(i=i+Math.imul(L,V)|0)+Math.imul(x,q)|0,o=o+Math.imul(x,V)|0,n=n+Math.imul(N,Y)|0,i=(i=i+Math.imul(N,$)|0)+Math.imul(k,Y)|0,o=o+Math.imul(k,$)|0,n=n+Math.imul(I,Z)|0,i=(i=i+Math.imul(I,X)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,X)|0,n=n+Math.imul(A,Q)|0,i=(i=i+Math.imul(A,ee)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,ee)|0,n=n+Math.imul(S,re)|0,i=(i=i+Math.imul(S,ne)|0)+Math.imul(O,re)|0,o=o+Math.imul(O,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,ae)|0,n=n+Math.imul(y,ue)|0,i=(i=i+Math.imul(y,ce)|0)+Math.imul(b,ue)|0,o=o+Math.imul(b,ce)|0,n=n+Math.imul(p,fe)|0,i=(i=i+Math.imul(p,de)|0)+Math.imul(g,fe)|0,o=o+Math.imul(g,de)|0;var Te=(c+(n=n+Math.imul(f,pe)|0)|0)+((8191&(i=(i=i+Math.imul(f,ge)|0)+Math.imul(d,pe)|0))<<13)|0;c=((o=o+Math.imul(d,ge)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(B,q),i=(i=Math.imul(B,V))+Math.imul(U,q)|0,o=Math.imul(U,V),n=n+Math.imul(L,Y)|0,i=(i=i+Math.imul(L,$)|0)+Math.imul(x,Y)|0,o=o+Math.imul(x,$)|0,n=n+Math.imul(N,Z)|0,i=(i=i+Math.imul(N,X)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,X)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,ee)|0,n=n+Math.imul(A,re)|0,i=(i=i+Math.imul(A,ne)|0)+Math.imul(M,re)|0,o=o+Math.imul(M,ne)|0,n=n+Math.imul(S,oe)|0,i=(i=i+Math.imul(S,ae)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,ae)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,ce)|0,n=n+Math.imul(y,fe)|0,i=(i=i+Math.imul(y,de)|0)+Math.imul(b,fe)|0,o=o+Math.imul(b,de)|0;var Ae=(c+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,ge)|0)+Math.imul(g,pe)|0))<<13)|0;c=((o=o+Math.imul(g,ge)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(B,Y),i=(i=Math.imul(B,$))+Math.imul(U,Y)|0,o=Math.imul(U,$),n=n+Math.imul(L,Z)|0,i=(i=i+Math.imul(L,X)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,X)|0,n=n+Math.imul(N,Q)|0,i=(i=i+Math.imul(N,ee)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,ee)|0,n=n+Math.imul(I,re)|0,i=(i=i+Math.imul(I,ne)|0)+Math.imul(j,re)|0,o=o+Math.imul(j,ne)|0,n=n+Math.imul(A,oe)|0,i=(i=i+Math.imul(A,ae)|0)+Math.imul(M,oe)|0,o=o+Math.imul(M,ae)|0,n=n+Math.imul(S,ue)|0,i=(i=i+Math.imul(S,ce)|0)+Math.imul(O,ue)|0,o=o+Math.imul(O,ce)|0,n=n+Math.imul(w,fe)|0,i=(i=i+Math.imul(w,de)|0)+Math.imul(v,fe)|0,o=o+Math.imul(v,de)|0;var Me=(c+(n=n+Math.imul(y,pe)|0)|0)+((8191&(i=(i=i+Math.imul(y,ge)|0)+Math.imul(b,pe)|0))<<13)|0;c=((o=o+Math.imul(b,ge)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(B,Z),i=(i=Math.imul(B,X))+Math.imul(U,Z)|0,o=Math.imul(U,X),n=n+Math.imul(L,Q)|0,i=(i=i+Math.imul(L,ee)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,ee)|0,n=n+Math.imul(N,re)|0,i=(i=i+Math.imul(N,ne)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ne)|0,n=n+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,ae)|0)+Math.imul(j,oe)|0,o=o+Math.imul(j,ae)|0,n=n+Math.imul(A,ue)|0,i=(i=i+Math.imul(A,ce)|0)+Math.imul(M,ue)|0,o=o+Math.imul(M,ce)|0,n=n+Math.imul(S,fe)|0,i=(i=i+Math.imul(S,de)|0)+Math.imul(O,fe)|0,o=o+Math.imul(O,de)|0;var De=(c+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,ge)|0)+Math.imul(v,pe)|0))<<13)|0;c=((o=o+Math.imul(v,ge)|0)+(i>>>13)|0)+(De>>>26)|0,De&=67108863,n=Math.imul(B,Q),i=(i=Math.imul(B,ee))+Math.imul(U,Q)|0,o=Math.imul(U,ee),n=n+Math.imul(L,re)|0,i=(i=i+Math.imul(L,ne)|0)+Math.imul(x,re)|0,o=o+Math.imul(x,ne)|0,n=n+Math.imul(N,oe)|0,i=(i=i+Math.imul(N,ae)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,ae)|0,n=n+Math.imul(I,ue)|0,i=(i=i+Math.imul(I,ce)|0)+Math.imul(j,ue)|0,o=o+Math.imul(j,ce)|0,n=n+Math.imul(A,fe)|0,i=(i=i+Math.imul(A,de)|0)+Math.imul(M,fe)|0,o=o+Math.imul(M,de)|0;var Ie=(c+(n=n+Math.imul(S,pe)|0)|0)+((8191&(i=(i=i+Math.imul(S,ge)|0)+Math.imul(O,pe)|0))<<13)|0;c=((o=o+Math.imul(O,ge)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(B,re),i=(i=Math.imul(B,ne))+Math.imul(U,re)|0,o=Math.imul(U,ne),n=n+Math.imul(L,oe)|0,i=(i=i+Math.imul(L,ae)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,ae)|0,n=n+Math.imul(N,ue)|0,i=(i=i+Math.imul(N,ce)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,ce)|0,n=n+Math.imul(I,fe)|0,i=(i=i+Math.imul(I,de)|0)+Math.imul(j,fe)|0,o=o+Math.imul(j,de)|0;var je=(c+(n=n+Math.imul(A,pe)|0)|0)+((8191&(i=(i=i+Math.imul(A,ge)|0)+Math.imul(M,pe)|0))<<13)|0;c=((o=o+Math.imul(M,ge)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,n=Math.imul(B,oe),i=(i=Math.imul(B,ae))+Math.imul(U,oe)|0,o=Math.imul(U,ae),n=n+Math.imul(L,ue)|0,i=(i=i+Math.imul(L,ce)|0)+Math.imul(x,ue)|0,o=o+Math.imul(x,ce)|0,n=n+Math.imul(N,fe)|0,i=(i=i+Math.imul(N,de)|0)+Math.imul(k,fe)|0,o=o+Math.imul(k,de)|0;var Re=(c+(n=n+Math.imul(I,pe)|0)|0)+((8191&(i=(i=i+Math.imul(I,ge)|0)+Math.imul(j,pe)|0))<<13)|0;c=((o=o+Math.imul(j,ge)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(B,ue),i=(i=Math.imul(B,ce))+Math.imul(U,ue)|0,o=Math.imul(U,ce),n=n+Math.imul(L,fe)|0,i=(i=i+Math.imul(L,de)|0)+Math.imul(x,fe)|0,o=o+Math.imul(x,de)|0;var Ne=(c+(n=n+Math.imul(N,pe)|0)|0)+((8191&(i=(i=i+Math.imul(N,ge)|0)+Math.imul(k,pe)|0))<<13)|0;c=((o=o+Math.imul(k,ge)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,n=Math.imul(B,fe),i=(i=Math.imul(B,de))+Math.imul(U,fe)|0,o=Math.imul(U,de);var ke=(c+(n=n+Math.imul(L,pe)|0)|0)+((8191&(i=(i=i+Math.imul(L,ge)|0)+Math.imul(x,pe)|0))<<13)|0;c=((o=o+Math.imul(x,ge)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863;var Ce=(c+(n=Math.imul(B,pe))|0)+((8191&(i=(i=Math.imul(B,ge))+Math.imul(U,pe)|0))<<13)|0;return c=((o=Math.imul(U,ge))+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,u[0]=me,u[1]=ye,u[2]=be,u[3]=_e,u[4]=we,u[5]=ve,u[6]=Ee,u[7]=Se,u[8]=Oe,u[9]=Te,u[10]=Ae,u[11]=Me,u[12]=De,u[13]=Ie,u[14]=je,u[15]=Re,u[16]=Ne,u[17]=ke,u[18]=Ce,0!==c&&(u[19]=c,r.length++),r};function g(e,t,r){return(new m).mulp(e,t,r)}function m(e,t){this.x=e,this.y=t}Math.imul||(p=h),o.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?p(this,e,t):r<63?h(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var a=i;i=0;for(var s=67108863&n,u=Math.min(o,t.length-1),c=Math.max(0,o-e.length+1);c<=u;c++){var l=o-c,f=(0|e.words[l])*(0|t.words[c]),d=67108863&f;s=67108863&(d=d+s|0),i+=(a=(a=a+(f/67108864|0)|0)+(d>>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):g(this,e,t)},m.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},m.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},m.prototype.permute=function(e,t,r,n,i,o){for(var a=0;a<o;a++)n[a]=t[e[a]],i[a]=r[e[a]]},m.prototype.transform=function(e,t,r,n,i,o){this.permute(o,e,t,r,n,i);for(var a=1;a<i;a<<=1)for(var s=a<<1,u=Math.cos(2*Math.PI/s),c=Math.sin(2*Math.PI/s),l=0;l<i;l+=s)for(var f=u,d=c,h=0;h<a;h++){var p=r[l+h],g=n[l+h],m=r[l+h+a],y=n[l+h+a],b=f*m-d*y;y=f*y+d*m,m=b,r[l+h]=p+m,n[l+h]=g+y,r[l+h+a]=p-m,n[l+h+a]=g-y,h!==s&&(b=u*f-c*d,d=u*d+c*f,f=b)}},m.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},m.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},m.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e},m.prototype.convert13b=function(e,t,r,i){for(var o=0,a=0;a<t;a++)o+=0|e[a],r[2*a]=8191&o,o>>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*t;a<i;++a)r[a]=0;n(0===o),n(0==(-8192&o))},m.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},m.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),o=this.stub(n),a=new Array(n),s=new Array(n),u=new Array(n),c=new Array(n),l=new Array(n),f=new Array(n),d=r.words;d.length=n,this.convert13b(e.words,e.length,a,n),this.convert13b(t.words,t.length,c,n),this.transform(a,o,s,u,n,i),this.transform(c,o,l,f,n,i);for(var h=0;h<n;h++){var p=s[h]*l[h]-u[h]*f[h];u[h]=s[h]*f[h]+u[h]*l[h],s[h]=p}return this.conjugate(s,u,n),this.transform(s,u,d,o,n,i),this.conjugate(d,o,n),this.normalize13b(d,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},o.prototype.mul=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),g(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function(e){n("number"==typeof e),n(e<67108864);for(var t=0,r=0;r<this.length;r++){var i=(0|this.words[r])*e,o=(67108863&i)+(67108863&t);t>>=26,t+=i/67108864|0,t+=o>>>26,this.words[r]=67108863&o}return 0!==t&&(this.words[r]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=(e.words[n]&1<<i)>>>i}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var i=r.sqr();n<t.length;n++,i=i.sqr())0!==t[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t<this.length;t++){var s=this.words[t]&o,u=(0|this.words[t])-s<<r;this.words[t]=u|a,a=s>>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this.strip()},o.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},o.prototype.iushrn=function(e,t,r){var i;n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<<o,u=r;if(i-=a,i=Math.max(0,i),u){for(var c=0;c<a;c++)u.words[c]=this.words[c];u.length=a}if(0===a);else if(this.length>a)for(this.length-=a,c=0;c<this.length;c++)this.words[c]=this.words[c+a];else this.words[0]=0,this.length=1;var l=0;for(c=this.length-1;c>=0&&(0!==l||c>=i);c--){var f=0|this.words[c];this.words[c]=l<<26-o|f>>>o,l=f&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<<t;return!(this.length<=r)&&!!(this.words[r]&i)},o.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this.strip()},o.prototype.maskn=function(e){return this.clone().imaskn(e)},o.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},o.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},o.prototype.addn=function(e){return this.clone().iaddn(e)},o.prototype.subn=function(e){return this.clone().isubn(e)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(e,t,r){var i,o,a=e.length+r;this._expand(a);var s=0;for(i=0;i<e.length;i++){o=(0|this.words[i+r])+s;var u=(0|e.words[i])*t;s=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)s=(o=(0|this.words[i+r])+s)>>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i<this.length;i++)s=(o=-(0|this.words[i])+s)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,a=0|i.words[i.length-1];0!==(r=26-this._countBits(a))&&(i=i.ushln(r),n.iushln(r),a=0|i.words[i.length-1]);var s,u=n.length-i.length;if("mod"!==t){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c<s.length;c++)s.words[c]=0}var l=n.clone()._ishlnsubmul(i,1,u);0===l.negative&&(n=l,s&&(s.words[u]=1));for(var f=u-1;f>=0;f--){var d=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]);for(d=Math.min(d/a|0,67108863),n._ishlnsubmul(i,d,f);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1);s&&(s.words[f]=d)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:i,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,a,s},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},o.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var l=r.clone(),f=t.clone();!t.isZero();){for(var d=0,h=1;0==(t.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(l),a.isub(f)),i.iushrn(1),a.iushrn(1);for(var p=0,g=1;0==(r.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(f)),s.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(s),a.isub(u)):(r.isub(t),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,a=new o(1),s=new o(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,l=1;0==(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var f=0,d=1;0==(r.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(r.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s)):(r.isub(t),s.isub(a))}return(i=0===t.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,a=r;0!==o&&a<this.length;a++){var s=0|this.words[a];o=(s+=o)>>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},o.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},o.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new S(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var y={k256:null,p224:null,p192:null,p25519:null};function b(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function _(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function O(e){S.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}b.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},b.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},b.prototype.split=function(e,t){e.iushrn(this.n,0,t)},b.prototype.imulK=function(e){return e.imul(this.k)},i(_,b),_.prototype.split=function(e,t){for(var r=Math.min(e.length,9),n=0;n<r;n++)t.words[n]=e.words[n];if(t.length=r,e.length<=9)return e.words[0]=0,void(e.length=1);var i=e.words[9];for(t.words[t.length++]=4194303&i,n=10;n<e.length;n++){var o=0|e.words[n];e.words[n-10]=(4194303&o)<<4|i>>>22,i=o}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},_.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(w,b),i(v,b),i(E,b),E.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(y[e])return y[e];var t;if("k256"===e)t=new _;else if("p224"===e)t=new w;else if("p192"===e)t=new v;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new E}return y[e]=t,t},S.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},S.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},S.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},S.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},S.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},S.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},S.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},S.prototype.isqr=function(e){return this.imul(e,e.clone())},S.prototype.sqr=function(e){return this.mul(e,e)},S.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var f=this.pow(l,i),d=this.pow(e,i.addn(1).iushrn(1)),h=this.pow(e,i),p=a;0!==h.cmp(s);){for(var g=h,m=0;0!==g.cmp(s);m++)g=g.redSqr();n(m<p);var y=this.pow(f,new o(1).iushln(p-m-1));d=d.redMul(y),f=y.redSqr(),h=h.redMul(f),p=m}return d},S.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},S.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var i=r[0],a=0,s=0,u=t.bitLength()%26;for(0===u&&(u=26),n=t.length-1;n>=0;n--){for(var c=t.words[n],l=u-1;l>=0;l--){var f=c>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==a?(a<<=1,a|=f,(4===++s||0===n&&0===l)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}u=26}return i},S.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},S.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new O(e)},i(O,S),O.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},O.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},O.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},O.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},O.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,r(97)(e))},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(0);function i(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(n.a)(e),i=Object(n.a)(t),o=r.getTime()-i.getTime();return o<0?-1:o>0?1:o}},function(e,t,r){"use strict";(function(e){r.d(t,"a",(function(){return T})),r.d(t,"g",(function(){return A})),r.d(t,"c",(function(){return M})),r.d(t,"h",(function(){return D})),r.d(t,"e",(function(){return I})),r.d(t,"f",(function(){return j})),r.d(t,"d",(function(){return R})),r.d(t,"b",(function(){return N}));var n=r(4),i=r.n(n),o=r(9),a=r.n(o),s=r(130),u=r(2),c=r(15),l=r(8),f=r(20),d=r(6),h=r(18),p=r(31),g=r(30);function m(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,i,o=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==r.return||r.return()}finally{if(s)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return y(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return y(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function b(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 _(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(Object(r),!0).forEach((function(t){w(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function w(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}let v=r(42),E=r(412);async function S(e){return 200!==e.status?e.text().then(t=>{throw new h.HTTPError(e.status,t)}):e}async function O(...e){let t=await Object(s.fetch)(...e);return t=await S(t),t.json()}async function T(){let e,t=await a.a.getItem("user-token"),r=l.b(),n=r.cloudFileId,i=r.encryptKeyId;try{e=await Object(g.post)(Object(f.a)().SYNC_SERVER+"/user-get-key",{token:t,fileId:n})}catch(e){return console.log(e),{error:{reason:"network"}}}return{valid:e.id==i&&(null==i||p.a.hasKey(i))}}async function A(e){let t=await a.a.getItem("user-token"),r=l.b().cloudFileId;try{await Object(g.post)(Object(f.a)().SYNC_SERVER+"/reset-user-file",{token:t,fileId:r})}catch(e){return e instanceof h.PostError?{error:{reason:"unauthorized"===e.reason?"unauthorized":"network"}}:{error:{reason:"internal"}}}if(e)try{await Object(g.post)(Object(f.a)().SYNC_SERVER+"/user-create-key",{token:t,fileId:r,keyId:e.key.getId(),keySalt:e.salt,testContent:e.testContent})}catch(e){return e instanceof h.PostError?{error:{reason:"network"}}:{error:{reason:"internal"}}}return{}}async function M(){let t=l.b(),r=t.id;if(!t.budgetName)return null;let n=i.a.getBudgetDir(r),o=new E;return await Object(d.runMutator)(async()=>{let t=await i.a.readFile(i.a.join(n,"db.sqlite"),"binary"),r=await c.openDatabase(t);c.execQuery(r,"\n DELETE FROM kvcache;\n DELETE FROM kvcache_key;\n ");let a=c.exportDatabase(r);c.closeDatabase(r);let s=JSON.parse(await i.a.readFile(i.a.join(n,"metadata.json")));s.resetClock=!0;let u=e.from(JSON.stringify(s),"utf8");o.addFile("db.sqlite",a),o.addFile("metadata.json",u)}),o.toBuffer()}async function D(){let e=await a.a.getItem("user-token");if(!e)throw Object(h.FileUploadError)("unauthorized");let t=await M();if(null==t)return;let r,n=l.b(),i=n.id,o=n.groupId,s=n.budgetName,c=n.cloudFileId,d=n.encryptKeyId,g=t,m=null;if(d){let e;try{e=await p.a.encrypt(t,d)}catch(e){throw Object(h.FileUploadError)("encrypt-failure",{isMissingKey:"missing-key"===e.message})}g=e.value,m=e.meta}c||(c=v.v4Sync());try{r=await O(Object(f.a)().SYNC_SERVER+"/upload-user-file",{method:"POST",headers:_(_({"Content-Length":g.length,"Content-Type":"application/encrypted-file","X-ACTUAL-TOKEN":e,"X-ACTUAL-FILE-ID":c,"X-ACTUAL-NAME":encodeURIComponent(s),"X-ACTUAL-FORMAT":2},m?{"X-ACTUAL-ENCRYPT-META":JSON.stringify(m)}:null),o?{"X-ACTUAL-GROUP-ID":o}:null),body:g})}catch(e){console.log("Upload failure",e);e instanceof h.PostError&&e.reason;if(e instanceof h.PostError)throw new h.FileUploadError("unauthorized"===e.reason?"unauthorized":e.reason||"network");throw Object(h.FileUploadError)("internal")}if("ok"!==r.status)throw Object(h.FileUploadError)("internal");l.b()&&l.b().id===i&&await l.d({lastUploaded:u.d(),cloudFileId:c,groupId:r.groupId})}async function I(){let e=l.b(),t=e.cloudFileId,r=e.groupId,n=e.lastUploaded,i=(e.id,n&&u.a(n,7)),o=u.d();n&&o<i||t&&r&&D().catch(e=>{})}async function j(e){const t=m(await a.a.multiGet(["user-token"]),1),r=m(t[0],2)[1];await Object(g.post)(Object(f.a)().SYNC_SERVER+"/delete-user-file",{token:r,fileId:e})}async function R(){let e,t=await a.a.getItem("user-token");if(!t)return null;try{e=await O(Object(f.a)().SYNC_SERVER+"/list-user-files",{headers:{"X-ACTUAL-TOKEN":t}})}catch(e){return console.log("Error",e),null}return"error"===e.status?null:e.data.map(e=>_(_({},e),{},{hasKey:p.a.hasKey(e.encryptKeyId)}))}async function N(t,r){let n,o,c=await a.a.getItem("user-token");try{n=await Object(s.fetch)(Object(f.a)().SYNC_SERVER+"/download-user-file",{headers:{"X-ACTUAL-TOKEN":c,"X-ACTUAL-FILE-ID":t}}).then(S).then(t=>t.arrayBuffer?t.arrayBuffer().then(t=>e.from(t)):t.buffer())}catch(e){throw console.log("Download failure",e),Object(h.FileDownloadError)("download-failure")}try{o=await O(Object(f.a)().SYNC_SERVER+"/get-user-file-info",{headers:{"X-ACTUAL-TOKEN":c,"X-ACTUAL-FILE-ID":t}})}catch(e){throw Object(h.FileDownloadError)("internal",{fileId:t})}if("ok"!==o.status)throw Object(h.FileDownloadError)("internal",{fileId:t});let l=o.data;if(l.encryptMeta)try{n=await p.a.decrypt(n,l.encryptMeta)}catch(e){throw Object(h.FileDownloadError)("decrypt-failure",{isMissingKey:"missing-key"===e.message})}let d=new E(n),g=d.getEntries(),m=g.find(e=>e.entryName.includes("db.sqlite")),y=g.find(e=>e.entryName.includes("metadata.json"));if(!m||!y)throw Object(h.FileDownloadError)("invalid-zip-file");let b,w=d.readFile(m),v=d.readFile(y);try{b=JSON.parse(v.toString("utf8"))}catch(e){throw Object(h.FileDownloadError)("invalid-meta-file")}b=_(_({},b),{},{cloudFileId:l.fileId,groupId:l.groupId,lastUploaded:u.d(),encryptKeyId:l.encryptMeta?l.encryptMeta.keyId:null});let T=i.a.getBudgetDir(b.id);if(await i.a.exists(T)){if(!r)throw Object(h.FileDownloadError)("file-exists",{id:b.id});{let e=i.a.join(T,"db.sqlite"),t=i.a.join(T,"metadata.json");await i.a.exists(e)&&await i.a.removeFile(e),await i.a.exists(t)&&await i.a.removeFile(t)}}else await i.a.mkdir(T);return await i.a.writeFile(i.a.join(T,"db.sqlite"),w),await i.a.writeFile(i.a.join(T,"metadata.json"),JSON.stringify(b)),{id:b.id}}}).call(this,r(10).Buffer)},function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"c",(function(){return i})),r.d(t,"b",(function(){return o}));r(12);const n=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"}));function i(e,t){return e<t?[e,t]:[t,e]}function o(e){return.075*Math.abs(e)|0}},function(e,t,r){"use strict";r.d(t,"a",(function(){return l})),r.d(t,"c",(function(){return f})),r.d(t,"b",(function(){return d})),r.d(t,"d",(function(){return h})),r.d(t,"e",(function(){return p}));var n=r(17);const i=["group_id"],o=["tombstone"];function a(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function s(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 u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){c(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function c(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}u(u({},n.i),{},{toExternal:(e,t,r)=>e,fromExternal(e){let t={};return"id"in e&&(t.id=e.id),"account_id"in e&&(t.acct=e.account_id),"amount"in e&&(t.amount=e.amount),"payee_id"in e&&(t.description=e.payee_id),"imported_payee"in e&&(t.imported_description=e.imported_payee),"category_id"in e&&(t.category=e.category_id),"date"in e&&(t.date=e.date),"notes"in e&&(t.notes=e.notes),"imported_id"in e&&(t.financial_id=e.imported_id),"transfer_id"in e&&(t.transferred_id=e.transfer_id),"cleared"in e&&(t.cleared=e.cleared),t}});const l=u(u({},n.a),{},{toExternal:e=>({id:e.id,name:e.name,type:e.type,offbudget:!!e.offbudget,closed:!!e.closed}),fromExternal(e){let t=u({},e);return"offbudget"in e&&(t.offbudget=e.offbudget?1:0),"closed"in e&&(t.closed=e.closed?1:0),t}}),f=u(u({},n.c),{},{toExternal:e=>({id:e.id,name:e.name,is_income:!!e.is_income,group_id:e.cat_group}),fromExternal(e){e.group_id;let t=a(e,i);return"is_income"in e&&(t.is_income=e.is_income?1:0),"group_id"in e&&(t.cat_group=e.group_id),t}}),d=u(u({},n.b),{},{toExternal:e=>({id:e.id,name:e.name,is_income:!!e.is_income,categories:e.categories.map(f.toExternal)}),fromExternal(e){let t=u({},e);return"is_income"in e&&(t.is_income=e.is_income?1:0),"categories"in e&&(t.categories=e.categories.map(f.fromExternal)),t}}),h=u(u({},n.e),{},{toExternal:e=>({id:e.id,name:e.name,category:e.category,transfer_acct:e.transfer_acct}),fromExternal:e=>e}),p=u(u({},n.f),{},{toExternal(e){e.tombstone;return a(e,o)},fromExternal:e=>e})},function(e,t,r){"use strict";r.d(t,"b",(function(){return A})),r.d(t,"c",(function(){return N})),r.d(t,"a",(function(){return k})),r.d(t,"d",(function(){return C}));var n=r(275),i=r.n(n),o=r(1),a=r(12),s=r(77),u=r(2),c=(r(39),r(20)),l=r(7),f=r(6),d=r(135),h=(r(111),r(18),r(21)),p=r(68);const g=["subtransactions"],m=["payee_name","subtransactions"];function y(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 b(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?y(Object(r),!0).forEach((function(t){_(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):y(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function w(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}const v=r(64),E=r(30).post,S=(r(434),r(42));function O(e,t){let r=Object(s.c)(b(b({},e),{},{is_parent:!0,subtransactions:t.map((t,r)=>Object(s.b)(e,b(b({},t),{},{sort_order:0-r})))})),n=r.subtransactions;return[w(r,g),...n]}function T(e){switch(e.type){case"credit":case"loan":return-e.balances.current;default:return e.balances.current}}async function A(e,t,r){let n=(await E(Object(c.a)().PLAID_SERVER+"/accounts",{userId:e,key:t,item_id:r})).accounts;return n.forEach(e=>{e.balances.current=T(e)}),n}function M(e){return{imported_id:e.transaction_id,payee_name:e.name,imported_payee:e.name,amount:-Object(a.a)(e.amount),date:e.date}}async function D(e,t,r,n,i,o){let a=[],s=null,l=0,f=0;for(;;){const p=u.d(),g=await E(Object(c.a)().PLAID_SERVER+"/transactions",{userId:e,key:t,item_id:""+n,account_id:r,start_date:i,end_date:p,count:100,offset:l});if(g.error_code)throw d=g.error_type,h=g.error_code,{type:"BankSyncError",category:d,code:h};if(0===g.transactions.length)break;if(f+=g.transactions.length,a=a.concat(g.transactions.filter(e=>!e.pending)),s=T(g.accounts[0]),f===g.total_transactions||null!=o&&a.length>=o)break;l+=100}var d,h;return a=null!=o?a.slice(0,o):a,{transactions:a.map(M),accountBalance:s}}async function I(e,t,r){if(null==e.payee&&t){let e=r.get(t.toLowerCase());if(e=e||await o.getPayeeByName(t),null!=e)return e.id;{let e={id:S.v4Sync(),name:t};return r.set(t.toLowerCase(),e),e.id}}return e.payee}async function j(e,t,{rawPayeeName:r}={}){let n=new Map,o=[];for(let a of e){if(null==a.date)throw new Error("`date` is required when adding a transaction");let e=a,s=e.payee_name,u=e.subtransactions;if(a=w(e,m),s){let e=s.trim();s=""===e?null:r?e:i()(e)}a.imported_payee=a.imported_payee||s,a.imported_payee&&(a.imported_payee=a.imported_payee.trim()),a.account=t,a.payee=await I(a,s,n),o.push({payee_name:s,subtransactions:u?u.map(e=>b(b({},e),{},{account:t})):null,trans:a})}return{normalized:o,payeesToCreate:n}}async function R(e,t){let r=new Set(t.map(e=>e.payee));await Object(l.c)(async()=>{for(let t of e.values())r.has(t.id)&&await o.insertPayee(t)})}async function N(e,t){const r=new Set,n=[],i=[];let s=await j(t,e),c=s.normalized,l=s.payeesToCreate,f=[];for(let t of c){let n=t.payee_name,i=t.trans,a=t.subtransactions;i=Object(h.k)(i);let s=null,c=null;i.imported_id&&(s=await o.first("SELECT * FROM v_transactions WHERE imported_id = ? AND account = ?",[i.imported_id,e]),s&&r.add(s.id)),s||(c=await o.all("SELECT id, date, imported_id, payee, category, notes FROM v_transactions\n WHERE date >= ? AND date <= ? AND amount = ? AND account = ? AND is_child = 0",[o.toDateRepr(u.q(i.date,4)),o.toDateRepr(u.a(i.date,1)),i.amount||0,e])),f.push({payee_name:n,trans:i,subtransactions:a,match:s,fuzzyDataset:c})}let d=f.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),b(b({},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),b(b({},e),{},{match:t})}return e});for(let e of d){e.payee_name;let t=e.trans,r=e.subtransactions,s=e.match;if(s){let e=b(b({},s),{},{cleared:1===s.cleared,date:o.fromDateRepr(s.date)});const r={date:t.date,imported_id:t.imported_id||null,payee:e.payee||t.payee||null,category:e.category||t.category||null,imported_payee:t.imported_payee||null,notes:e.notes||t.notes||null,cleared:null==t.cleared||t.cleared};Object(a.j)(e,r,Object.keys(r))&&n.push(b({id:e.id},r))}else{let e=b(b({},t),{},{id:S.v4Sync(),category:t.category||null,cleared:null==t.cleared||t.cleared});r&&r.length>0?i.push(...O(e,r)):i.push(e)}}return await R(l,[...i,...n]),await Object(p.a)({added:i,updated:n}),{added:i.map(e=>e.id),updated:n.map(e=>e.id)}}async function k(e,t,{runTransfers:r=!0}={}){const n=[];let i,a=await j(t,e,{rawPayeeName:!0}),s=a.normalized,u=a.payeesToCreate;for(let t of s){t.payee_name;let r=t.trans,i=t.subtransactions;r=Object(h.k)(r);let o=b(b({id:S.v4Sync()},r),{},{account:e,cleared:null==r.cleared||r.cleared});i&&i.length>0?n.push(...O(o,i)):n.push(o)}if(await R(u,n),r){let e=await Object(p.a)({added:n});i=e.added.map(e=>e.id)}else await Object(l.c)(async()=>{i=await Promise.all(n.map(async e=>o.insertTransaction(e)))});return i}async function C(e,t,r,n,i){const s=await o.first("SELECT * FROM v_transactions WHERE account = ? ORDER BY date DESC LIMIT 1",[r]);if(s){const c=await o.first("SELECT date FROM v_transactions WHERE account = ? ORDER BY date ASC LIMIT 1",[r]),l=o.fromDateRepr(c.date);let d=u.q(o.fromDateRepr(s.date),31);d<l&&(d=l);let h=await D(e,t,n,i,d),p=h.transactions,g=h.accountBalance;return 0===p.length?{added:[],updated:[]}:(p=p.map(e=>b(b({},e),{},{account:r})),Object(f.runMutator)(async()=>{const e=await N(r,p);return await async function(e,t){await o.runQuery("UPDATE accounts SET balance_current = ? WHERE id = ?",[Object(a.a)(t),e])}(r,g),e}))}{const a=await o.select("accounts",r),s=u.q(u.d(),0===a.offbudget?1:30),c=(await D(e,t,n,i,v.format(v.parseISO(s),"yyyy-MM-dd"))).transactions;let l=a.balance_current;const h=c.reduce((e,t)=>e-t.amount,l),p=c.length>0?c[c.length-1].date:u.d();let g=await Object(d.a)();return Object(f.runMutator)(async()=>{let e=await o.insertTransaction({account:r,amount:h,category:0===a.offbudget?g.category:null,payee:g.id,date:p,cleared:!0,starting_balance_flag:!0}),t=await N(r,c);return b(b({},t),{},{added:[e,...t.added]})})}}},function(e,t,r){"use strict";r.d(t,"d",(function(){return u})),r.d(t,"b",(function(){return c})),r.d(t,"e",(function(){return l})),r.d(t,"a",(function(){return f})),r.d(t,"c",(function(){return d}));var n=r(2),i=r(25);function o(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 a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach((function(t){s(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u(e,t,r){let i=n.d();return t?"completed":r?"paid":e===i?"due":e>i&&e<=n.a(i,7)?"upcoming":e<i?"missed":"scheduled"}function c(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:n.q(e.next_date,2)}}}});return Object(i.b)("transactions").filter({$or:t}).orderBy({date:"desc"}).groupBy("schedule").select(["schedule","date"])}function l(e){let t={start:n.l(e.start),frequency:e.frequency.toUpperCase(),byHourOfDay:[12]};e.interval&&(t.interval=e.interval);let r=e=>e.slice(0,2).toUpperCase();switch(e.frequency){case"weekly":return[t];case"monthly":if(e.patterns&&e.patterns.length>0){let n=e.patterns.filter(e=>"day"===e.type),i=e.patterns.filter(e=>"day"!==e.type);return[n.length>0&&a(a({},t),{},{byDayOfMonth:n.map(e=>e.value)}),i.length>0&&a(a({},t),{},{byDayOfWeek:i.map(e=>[r(e.type),e.value])})].filter(Boolean)}return[t];case"yearly":return[t];default:throw new Error("Invalid recurring date config")}}function f(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 d(e){return e&&"number"!=typeof e?(e.num1+e.num2)/2|0:e}},function(e,t,r){const n=r(119);e.exports={v4:function(){return Promise.resolve(n.v4())},v4Sync:function(){return n.v4()}}},function(e,t,r){"use strict";t.a={isMobile:!1,isWeb:!0,isDesktop:!1}},function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=r,r.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}},function(e,t,r){"use strict";var n=t,i=r(35),o=r(44),a=r(223);n.assert=o,n.toArray=a.toArray,n.zero2=a.zero2,n.toHex=a.toHex,n.encode=a.encode,n.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var i=1<<t+1,o=e.clone(),a=0;a<n.length;a++){var s,u=o.andln(i-1);o.isOdd()?(s=u>(i>>1)-1?(i>>1)-u:u,o.isubn(s)):s=0,n[a]=s,o.iushrn(1)}return n},n.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var a,s,u=e.andln(3)+i&3,c=t.andln(3)+o&3;3===u&&(u=-1),3===c&&(c=-1),a=0==(1&u)?0:3!==(n=e.andln(7)+i&7)&&5!==n||2!==c?u:-u,r[0].push(a),s=0==(1&c)?0:3!==(n=t.andln(7)+o&7)&&5!==n||2!==u?c:-c,r[1].push(s),2*i===a+1&&(i=1-i),2*o===s+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return r},n.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(e){return"string"==typeof e?n.toArray(e,"hex"):e},n.intFromLE=function(e){return new i(e,"hex","le")}},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(27),i=r(74);function o(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(i.a)(e),o=Object(i.a)(t),a=r.getTime()-Object(n.a)(r),s=o.getTime()-Object(n.a)(o);return Math.round((a-s)/864e5)}},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(3),i=r(0);function o(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(i.a)(e),o=Object(n.a)(t);return r.setDate(r.getDate()+o),r}},function(e,t,r){(function(e){function r(e,t){for(var r=0,n=e.length-1;n>=0;n--){var i=e[n];"."===i?e.splice(n,1):".."===i?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}function n(e,t){if(e.filter)return e.filter(t);for(var r=[],n=0;n<e.length;n++)t(e[n],n,e)&&r.push(e[n]);return r}t.resolve=function(){for(var t="",i=!1,o=arguments.length-1;o>=-1&&!i;o--){var a=o>=0?arguments[o]:e.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(t=a+"/"+t,i="/"===a.charAt(0))}return(i?"/":"")+(t=r(n(t.split("/"),(function(e){return!!e})),!i).join("/"))||"."},t.normalize=function(e){var o=t.isAbsolute(e),a="/"===i(e,-1);return(e=r(n(e.split("/"),(function(e){return!!e})),!o).join("/"))||o||(e="."),e&&a&&(e+="/"),(o?"/":"")+e},t.isAbsolute=function(e){return"/"===e.charAt(0)},t.join=function(){var e=Array.prototype.slice.call(arguments,0);return t.normalize(n(e,(function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e})).join("/"))},t.relative=function(e,r){function n(e){for(var t=0;t<e.length&&""===e[t];t++);for(var r=e.length-1;r>=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=t.resolve(e).substr(1),r=t.resolve(r).substr(1);for(var i=n(e.split("/")),o=n(r.split("/")),a=Math.min(i.length,o.length),s=a,u=0;u<a;u++)if(i[u]!==o[u]){s=u;break}var c=[];for(u=s;u<i.length;u++)c.push("..");return(c=c.concat(o.slice(s))).join("/")},t.sep="/",t.delimiter=":",t.dirname=function(e){if("string"!=typeof e&&(e+=""),0===e.length)return".";for(var t=e.charCodeAt(0),r=47===t,n=-1,i=!0,o=e.length-1;o>=1;--o)if(47===(t=e.charCodeAt(o))){if(!i){n=o;break}}else i=!1;return-1===n?r?"/":".":r&&1===n?"/":e.slice(0,n)},t.basename=function(e,t){var r=function(e){"string"!=typeof e&&(e+="");var t,r=0,n=-1,i=!0;for(t=e.length-1;t>=0;--t)if(47===e.charCodeAt(t)){if(!i){r=t+1;break}}else-1===n&&(i=!1,n=t+1);return-1===n?"":e.slice(r,n)}(e);return t&&r.substr(-1*t.length)===t&&(r=r.substr(0,r.length-t.length)),r},t.extname=function(e){"string"!=typeof e&&(e+="");for(var t=-1,r=0,n=-1,i=!0,o=0,a=e.length-1;a>=0;--a){var s=e.charCodeAt(a);if(47!==s)-1===n&&(i=!1,n=a+1),46===s?-1===t?t=a:1!==o&&(o=1):-1!==t&&(o=-1);else if(!i){r=a+1;break}}return-1===t||-1===n||0===o||1===o&&t===n-1&&t===r+1?"":e.slice(t,n)};var i="b"==="ab".substr(-1)?function(e,t,r){return e.substr(t,r)}:function(e,t,r){return t<0&&(t=e.length+t),e.substr(t,r)}}).call(this,r(19))},function(e,t){function r(e,t){return e+"!"+t}e.exports={unresolveName:function(e){let t=e.indexOf("!");return-1!==t?{sheet:e.slice(0,t),name:e.slice(t+1)}:{sheet:null,name:e}},resolveName:r,resolveNamesAsObjects:function(e){const t={};return Object.keys(e).forEach(n=>{const i=e[n];Object.keys(i).forEach(e=>{const o=i[e];t[r(n,e)]=o})}),t},resolveNamesAsArrays:function(e){const t=[];return Object.keys(e).forEach(n=>{const i=e[n];i.forEach(e=>{i[e];t.push(r(n,e))})}),t}}},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(3),i=r(55);function o(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(n.a)(t);return Object(i.a)(e,-r)}},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(3),i=r(0);function o(e,t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var r=t||{},o=r.locale,a=o&&o.options&&o.options.weekStartsOn,s=null==a?0:Object(n.a)(a),u=null==r.weekStartsOn?s:Object(n.a)(r.weekStartsOn);if(!(u>=0&&u<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var c=Object(i.a)(e),l=c.getUTCDay(),f=(l<u?7:0)+l-u;return c.setUTCDate(c.getUTCDate()-f),c.setUTCHours(0,0,0,0),c}},function(e,t,r){const n=r(6),i=n.runHandler,o=n.isMutating,a=(r(91).sequential,r(24).captureException);function s(){let e="undefined"!=typeof window?window:"undefined"!=typeof self?self:null;if(!e)throw new Error("Cannot get global object");return e}function u(e,t){s().__globalServerChannel&&s().__globalServerChannel.postMessage({type:"push",name:e,args:t})}s().__globalServerChannel=null,e.exports={init:function(e,t){s().__globalServerChannel=e,e.addEventListener("message",r=>{let n=r.data,s="string"==typeof n?JSON.parse(n):n;if(s.type&&("init"===s.type||s.type.startsWith("__")))return;let c=s.id,l=s.name,f=s.args,d=s.undoTag,h=s.catchErrors;t[l]?i(t[l],f,{undoTag:d,name:l}).then(r=>{h&&(r={data:r,error:null}),e.postMessage({type:"reply",id:c,result:r,mutated:o(t[l]),undoTag:d})},t=>{let r=function(e){return e.type&&"APIError"===e.type?e:{type:"InternalError",message:e.message}}(t);l.startsWith("api/")?e.postMessage({type:"reply",id:c,error:r}):h?e.postMessage({type:"reply",id:c,result:{error:r,data:null}}):e.postMessage({type:"error",id:c}),"InternalError"===r.type&&a(t),h||u("server-error")}):(console.warn("Unknown method: "+l),e.postMessage({type:"reply",id:c,result:null,error:{type:"APIError",message:"Unknown method: "+l}}))},!1),e.postMessage({type:"connect"})},send:u,getNumClients:function(){return 1},tapIntoAPI:function(){}}},function(e,t,r){"use strict";var n=r(44),i=r(11);function o(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function a(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function s(e){return 1===e.length?"0"+e:e}function u(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=i,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i<e.length;i+=2)r.push(parseInt(e[i]+e[i+1],16))}else for(var n=0,i=0;i<e.length;i++){var a=e.charCodeAt(i);a<128?r[n++]=a:a<2048?(r[n++]=a>>6|192,r[n++]=63&a|128):o(e,i)?(a=65536+((1023&a)<<10)+(1023&e.charCodeAt(++i)),r[n++]=a>>18|240,r[n++]=a>>12&63|128,r[n++]=a>>6&63|128,r[n++]=63&a|128):(r[n++]=a>>12|224,r[n++]=a>>6&63|128,r[n++]=63&a|128)}else for(i=0;i<e.length;i++)r[i]=0|e[i];return r},t.toHex=function(e){for(var t="",r=0;r<e.length;r++)t+=s(e[r].toString(16));return t},t.htonl=a,t.toHex32=function(e,t){for(var r="",n=0;n<e.length;n++){var i=e[n];"little"===t&&(i=a(i)),r+=u(i.toString(16))}return r},t.zero2=s,t.zero8=u,t.join32=function(e,t,r,i){var o=r-t;n(o%4==0);for(var a=new Array(o/4),s=0,u=t;s<a.length;s++,u+=4){var c;c="big"===i?e[u]<<24|e[u+1]<<16|e[u+2]<<8|e[u+3]:e[u+3]<<24|e[u+2]<<16|e[u+1]<<8|e[u],a[s]=c>>>0}return a},t.split32=function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n<e.length;n++,i+=4){var o=e[n];"big"===t?(r[i]=o>>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<<t|e>>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,r){return e+t+r>>>0},t.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},t.sum32_5=function(e,t,r,n,i){return e+t+r+n+i>>>0},t.sum64=function(e,t,r,n){var i=e[t],o=n+e[t+1]>>>0,a=(o<n?1:0)+r+i;e[t]=a>>>0,e[t+1]=o},t.sum64_hi=function(e,t,r,n){return(t+n>>>0<t?1:0)+e+r>>>0},t.sum64_lo=function(e,t,r,n){return t+n>>>0},t.sum64_4_hi=function(e,t,r,n,i,o,a,s){var u=0,c=t;return u+=(c=c+n>>>0)<t?1:0,u+=(c=c+o>>>0)<o?1:0,e+r+i+a+(u+=(c=c+s>>>0)<s?1:0)>>>0},t.sum64_4_lo=function(e,t,r,n,i,o,a,s){return t+n+o+s>>>0},t.sum64_5_hi=function(e,t,r,n,i,o,a,s,u,c){var l=0,f=t;return l+=(f=f+n>>>0)<t?1:0,l+=(f=f+o>>>0)<o?1:0,l+=(f=f+s>>>0)<s?1:0,e+r+i+a+u+(l+=(f=f+c>>>0)<c?1:0)>>>0},t.sum64_5_lo=function(e,t,r,n,i,o,a,s,u,c){return t+n+o+s+c>>>0},t.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},t.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},t.shr64_hi=function(e,t,r){return e>>>r},t.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},function(e,t,r){"use strict";var n=r(80),i=r(123),o=i(n("String.prototype.indexOf"));e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&o(e,".prototype.")>-1?i(r):r}},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(3),i=r(0);function o(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(i.a)(e).getTime(),o=Object(n.a)(t);return new Date(r+o)}},function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(129),i=r(24);function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,i,o=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==r.return||r.return()}finally{if(s)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return a(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return a(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}class s{constructor(){this.handlers={},this.services=[],this.events=Object(n.a)(),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(...e){for(let r of e){Object.keys(r.handlers).forEach(e=>{this.method(e,r.handlers[e])}),r.services.forEach(e=>{this.service(e)});for(let e of r.events.all.entries()){var t=o(e,2);let r=t[0],n=t[1];for(let e of n)this.events.on(r,e)}}}startServices(){this.unlistenServices.length>0&&Object(i.captureException)(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 u(){return new s}},function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(3),i=r(0),o=r(90);function a(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(i.a)(e),a=Object(n.a)(t),s=r.getMonth()+a,u=new Date(0);u.setFullYear(r.getFullYear(),s,1),u.setHours(0,0,0,0);var c=Object(o.a)(u);return r.setMonth(s,Math.min(c,r.getDate())),r}},function(e,t,r){"use strict";r.d(t,"d",(function(){return y})),r.d(t,"c",(function(){return H})),r.d(t,"a",(function(){return z})),r.d(t,"b",(function(){return q}));const n=["$transform"],i=["$dir"];function o(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 a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach((function(t){s(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,i,o=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==r.return||r.return()}finally{if(s)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return l(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return l(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}let f=0;function d(e){return f++,e+f}class h extends Error{}function p(e){return parseInt(e.replace(/-/g,""))}function g(e,t,r,n){return null!=e[t].tombstone?`${n} AND ${r}.tombstone = 0`:n}function m(e){let t=e.split(".");return{path:t.slice(0,-1).join("."),field:t[t.length-1]}}function y(e){return-1===e.indexOf(".")&&"group"!==e?e:`"${e}"`}function b(e,t,{literal:r=!1}={}){return{value:e,type:t,literal:r}}function _(e,t){let r=e.schema,n=e.paths,i=t.split(".");if(i.length<2)throw new h("Invalid path: "+t);let o,a=i[0],s=i.slice(1).reduce((e,t)=>{let n=r[e];if(null==n)throw new h(`Path error: ${e} table does not exist`);if(!n[t]||null==n[t].ref)throw new h(`Field not joinable on table ${e}: "${t}"`);return n[t].ref},a),u=i.slice(0,-1);if(1===u.length)o=u[0];else{let e=u.join("."),t=n.get(e);if(!t)throw new h("Path does not exist: "+e);o=t.tableId}return{tableName:s,tableId:d(s),joinField:i[i.length-1],joinTable:o}}function w(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,_(e,t))}),e.paths.get(r[r.length-1])}function v(e,t){if("string"!=typeof t)throw new h("Invalid field name, must be a string");let r,n=m(t),i=n.path,o=n.field;r=""===i?{tableName:e.implicitTableName,tableId:e.implicitTableId}:w(e,i);let a=function(e,t,r){if(null==e[t])throw new h(`Table "${t}" does not exist in the schema`);let n=e[t][r];if(null==n)throw new h(`Field "${r}" does not exist in table "${t}"`);return n}(e.schema,r.tableName,o);if(e.validateRefs&&a.ref&&"id"===a.type&&"id"!==o){let n=e.implicitTableName+"."+t,i=e.paths.get(n);i||(i=_(e,n),i.noMapping=!0,e.paths.set(n,i)),o="id",r=i}return b(r.tableId+"."+o,a.type)}function E(e){let t=e.match(/^(\d{4}-\d{2}-\d{2})$/);return t?b(p(t[1]),"date",{literal:!0}):null}function S(e){let t=e.match(/^(\d{4}-\d{2})$/);return t?b(p(t[1]),"date",{literal:!0}):null}function O(e,t){throw new h(`Bad ${t} format: ${e}`)}function T(e,t,r){if(t.type===r)return t;if("param"===t.type)return function(e,t){let r=e.paramType;if(r){let e={date:["string"],"date-month":["date"],"date-year":["date","date-month"],id:["string"],float:["integer"]};if(!(r===t||e[t]&&e[t].includes(r)))throw new Error(`Parameter "${name}" can't convert to ${t} (already inferred as ${r})`)}else e.paramType=t}(t,r),b(t.value,r);if("null"===t.type){if(!t.literal)throw new h("A non-literal null doesn't make sense");return"boolean"===r?b(0,"boolean",{literal:!0}):t}if("date"===r){if("string"===t.type){if(t.literal)return E(t.value)||O(t.value,"date");throw new h("Casting string fields to dates is not supported")}throw new h(`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 h(`Can't cast ${t.type} to date-month`);e=S(t.value)||E(t.value)||O(t.value,"date-month")}return e.literal?b(p(e.value.toString().slice(0,6)),"date-month",{literal:!0}):b(`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 h(`Can't cast ${t.type} to date-year`);e=function(e){let t=e.match(/^(\d{4})$/);return t?b(p(t[1]),"date",{literal:!0}):null}(t.value)||S(t.value)||E(t.value)||O(t.value,"date-year")}return e.literal?b(p(e.value.toString().slice(0,4)),"date-year",{literal:!0}):b(`CAST(SUBSTR(${e.value}, 1, 4) AS integer)`,"date-year")}if("id"===r){if("string"===t.type)return b(t.value,"id",{literal:t.literal})}else if("float"===r&&"integer"===t.type)return b(t.value,"float",{literal:t.literal});if("any"===t.type)return b(t.value,r,{literal:t.literal});throw new h(`Can't convert ${t.type} to ${r}`)}function A(e,t,r){let n=t;if(r&&(n=T(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 M(e,t,r){return t.map((e,t)=>A(0,e,r?r[t]:null))}function D(e,t,r){if(null==r&&(r=t),null!=t&&e.length<t)throw new h("Too few arguments");if(null!=r&&e.length>r)throw new h("Too many arguments")}function I(e,t){return(r,...n)=>{if(null==r||null==r.compileStack)throw new h("This function cannot track error data. It needs to accept the compiler state as the first argument.");r.compileStack.push({type:e,args:n});let i=t(r,...n);return r.compileStack.pop(),i}}function j(e){if("string"==typeof e)return e;if(void 0===e)return"undefined";let t=JSON.stringify(e);if(t.length>70){return JSON.stringify(e,null,2).split("\n").join("\n ")}return t}function R(e){if(void 0===e)throw new h("`undefined` is not a valid query value");if(null===e)return b("NULL","null",{literal:!0});if(e instanceof Date)return b(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 b(e=e.replace(/\\\$/g,"$"),"string",{literal:!0});if("boolean"==typeof e)return b(e?1:0,"boolean",{literal:!0});if("number"==typeof e)return b(e,(0|e)===e?"integer":"float",{literal:!0});if(Array.isArray(e))return b(e,"array",{literal:!0});throw new h("Unsupported type of expression: "+JSON.stringify(e))}const N=I("expr",(e,t)=>{if("string"==typeof t){if("$"===t[0]){let r="$"===t?e.implicitField:t.slice(1);if(null==r||""===r)throw new h("Invalid field reference: "+t);return v(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 R(t);if("object"==typeof t&&Object.keys(t).find(e=>"$"===e[0]))return k(e,t)}return R(t)});const k=I("function",(e,t)=>{let r=c(Object.keys(t),1)[0],n=t[r];if(Array.isArray(n)||(n=[n]),"$"!==r[0])throw new h(`Unknown property "${r}". Did you mean to call a function? Try prefixing it with $`);let i=n;switch("$condition"!==r&&(i=n.map(t=>N(e,t))),r){case"$sum":return D(i,1),b(`SUM(${c(M(0,i,["float"]),1)[0]})`,i[0].type);case"$sumOver":return b(`(SUM(${c(M(0,i,["float"]),1)[0]}) OVER (${e.orders?"ORDER BY "+F(e,e.orders):""} ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING))`,i[0].type);case"$count":return D(i,1),b(`COUNT(${c(M(0,i),1)[0]})`,"integer");case"$substr":{D(i,2,3);let e=c(M(0,i,["string","integer","integer"]),3);return b(`SUBSTR(${e[0]}, ${e[1]}, ${e[2]})`,"string")}case"$lower":return D(i,1),b(`LOWER(${c(M(0,i,["string"]),1)[0]})`,"string");case"$neg":D(i,1);c(M(0,i,["float"]),1)[0];return b(`(-${A(0,i[0])})`,i[0].type);case"$abs":D(i,1);c(M(0,i,["float"]),1)[0];return b(`ABS(${A(0,i[0])})`,i[0].type);case"$idiv":{D(i,2);let e=c(M(0,i,["integer","integer"]),2);e[0],e[1];return b(`(${A(0,i[0])} / ${A(0,i[1])})`,i[0].type)}case"$month":return D(i,1),T(0,i[0],"date-month");case"$year":return D(i,1),T(0,i[0],"date-year");case"$condition":return D(i,1),b(L(e,i[0]).join(" AND "),"boolean");case"$nocase":return D(i,1),b(c(M(0,i,["string"]),1)[0]+" COLLATE NOCASE",i[0].type);case"$literal":if(D(i,1),!i[0].literal)throw new h("Literal not passed to $literal");return i[0];default:throw new h("Unknown function: "+r)}}),C=I("op",(e,t,r)=>{let i,o=r.$transform,s=u(r,n),l=c(Object.keys(s),1)[0],f=N(e,r[l]);switch(i=o?k(a(a({},e),{},{implicitField:t}),"string"==typeof o?{[o]:"$"}:o):N(e,"$"+t),l){case"$gte":{let e=c(M(0,[i,f],[null,i.type]),2);return`${e[0]} >= ${e[1]}`}case"$lte":{let e=c(M(0,[i,f],[null,i.type]),2);return`${e[0]} <= ${e[1]}`}case"$gt":{let e=c(M(0,[i,f],[null,i.type]),2);return`${e[0]} > ${e[1]}`}case"$lt":{let e=c(M(0,[i,f],[null,i.type]),2);return`${e[0]} < ${e[1]}`}case"$eq":{if("null"===T(0,f,i.type).type)return A(0,i)+" IS NULL";let t=c(M(0,[i,f],[null,i.type]),2),r=t[0],n=t[1];if("param"===f.type){let t=e.namedParameters.map(e=>e===f||e===i?[e,a({},e)]:e);return e.namedParameters=[].concat.apply([],t),`CASE\n WHEN ${r} IS NULL THEN ${n} IS NULL\n ELSE ${r} = ${n}\n END`}return`${r} = ${n}`}case"$oneof":{let e=c(M(0,[i,f],[null,"array"]),2),t=e[0],r=e[1];return t+" IN ("+[...new Set(r)].map(e=>`'${e}'`).join(",")+")"}case"$like":{let e=c(M(0,[i,f],["string","string"]),2);return`${e[0]} LIKE ${e[1]}`}default:throw new h("Unknown operator: "+l)}});function L(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,r])=>"$and"===t?r?x(e,r):null:"$or"===t?r?function(e,t){if(!t)return"0";let r=L(e,t);if(0===r.length)return"0";return"("+r.join("\n OR ")+")"}(e,r):null:"string"==typeof r||"number"==typeof r||"boolean"==typeof r||r instanceof Date||null==r?C(e,t,{$eq:r}):Array.isArray(r)?r.map(r=>C(e,t,r)).join(" AND "):C(e,t,r)).filter(Boolean);return[...t,...n]},[])}function x(e,t){if(!t)return"1";let r=L(e,t);return 0===r.length?"1":"("+r.join("\n AND ")+")"}const P=I("filter",(e,t)=>x(e,t));const B=I("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("*")){return function(e,t){let r,n;if("*"===t)n={tableName:e.implicitTableName,tableId:e.implicitTableId};else if(t.match(/\.\*$/)){let i=m(t);r=i.path,n=w(e,i.path)}let i=e.schema[n.tableName];if(null==i)throw new Error(`Table "${n.tableName}" does not exist`);return Object.keys(i).map(e=>r?`${r}.${e}`:e)}(e,t).map(t=>{let r=N(e,"$"+t);return e.outputTypes.set(t,r.type),r.value+" AS "+y(t)}).join(", ")}let r=N(e,"$"+t);return e.outputTypes.set(t,r.type),r.value+" AS "+y(t)}let r=c(Object.entries(t)[0],2),i=r[0],o=r[1];if("$"===i[0])throw e.compileStack.push({type:"value",value:t}),new h(`Invalid field "${i}", are you trying to select a function? You need to name the expression`);if("string"==typeof o){let t=N(e,"$"+o);return e.outputTypes.set(i,t.type),`${t.value} AS ${y(i)}`}let s=k(a(a({},e),{},{orders:n}),o);return e.outputTypes.set(i,s.type),s.value+" AS "+y(i)}).join(", "))),U=I("groupBy",(e,t)=>t.map(t=>"string"==typeof t?N(e,"$"+t).value:k(e,t).value).join(", ")),F=I("orderBy",(e,t)=>t.map(t=>{let r,n=null;if("string"==typeof t)r=N(e,"$"+t).value;else{let o=Object.entries(t),a=o[0];if(1===o.length&&"$"!==a[0][0])n=a[1],r=N(e,"$"+a[0]).value;else{let o=t.$dir,a=u(t,i);n=o,r=k(e,a).value}}if(null!=n){if("desc"!==n&&"asc"!==n)throw new h("Invalid order direction: "+n);return`${r} ${n}`}return r}).join(", "));let W=["$sum","$count"];function H(e){return e.groupExpressions.length>0||e.selectExpressions.find(e=>{if("string"!=typeof e){let t=c(Object.entries(e)[0],2);t[0];return function e(t){if("object"!=typeof t||Array.isArray(t))return!1;let r=c(Object.entries(t)[0],2),n=r[0],i=r[1];return Array.isArray(i)||(i=[i]),-1!==W.indexOf(n)||i.find(t=>e(t))}(t[1])}return!1})}function z(e,t,r={}){let n=e.withDead,i=e.validateRefs,o=void 0===i||i,s=e.tableOptions,u=e.rawMode,l=r.tableViews,d=void 0===l?{}:l,p=r.tableFilters,m=void 0===p?e=>[]:p,b=r.customizeQuery,_=void 0===b?e=>e:b,w=e=>{let t=m(e);for(let e of t){if(Array.isArray(e))throw new h("Invalid internal table filter: only object filters are supported");if(-1!==Object.keys(e)[0].indexOf("."))throw new h("Invalid internal table filter: field names cannot contain paths")}return t},v=(e,t)=>("function"==typeof d?d(e,{withDead:n,isJoin:t,tableOptions:s}):d[e])||e,E=e.table,S=_(e),O=S.filterExpressions,T=S.selectExpressions,A=S.groupExpressions,M=S.orderExpressions,D=S.limit,I=S.offset,R=(S.calculation,""),N="",k="",C="",L="",W={schema:t,implicitTableName:E,implicitTableId:v(E),paths:new Map,dependencies:[E],compileStack:[],outputTypes:new Map,validateRefs:o,namedParameters:[]};f=0;try{if(R=B(W,T,H(e),M),O.length>0){N="WHERE "+P(W,O)}else N="WHERE 1";if(!u){let e=w(E);e.length>0&&(N+=" AND "+x(W,e))}if(A.length>0){C="GROUP BY "+U(W,A)}if(M.length>0){L="ORDER BY "+F(W,M)}W.paths.size>0&&(k=function(e,t,r){let n=[];return e.paths.forEach((i,o)=>{let s=e.paths.get(o),u=s.tableName,c=s.tableId,l=s.joinField,f=s.joinTable,d=s.noMapping,h=`${c}.id = ${t(f)}.${y(l)}`,p=r(u);p.length>0&&(h+=" AND "+x(a(a({},e),{},{implicitTableName:u,implicitTableId:c}),p)),n.push(`LEFT JOIN ${d?u:t(u,!0)} ${c} ON ${g(e.schema,u,c,h)}`),-1===e.dependencies.indexOf(u)&&e.dependencies.push(u)}),n.join("\n")}(W,v,w))}catch(e){if(e instanceof h)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 j(e.args[0]);case"op":{let t=c(e.args,2);return j({[t[0]]:t[1]})}case"value":return j(e.value);default:return""}}).map(e=>"\n "+e).join("");const n=t[0].type,i=t[0].args[0];r+=`\n ${n}(${j(1===i.length?i[0]:i)})`;{const t=new h;return t.message=e.message+"\n\nExpression stack:"+r,t.stack=null,t}}(e,W.compileStack);throw e}return{sqlPieces:{select:R,from:v(E),joins:k,where:N,groupBy:C,orderBy:L,limit:D,offset:I},state:W}}function q(e,t,r){let n=r,i=e.withDead?n.where:g(t.schema,t.implicitTableName,t.implicitTableId,n.where);return`\n SELECT ${n.select} FROM ${n.from}\n ${n.joins}\n ${i}\n ${n.groupBy}\n ${n.orderBy}\n ${null!=n.limit?"LIMIT "+n.limit:""}\n ${null!=n.offset?"OFFSET "+n.offset:""}\n `}},function(e,t,r){"use strict";var n={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"},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 i(e){return function(t){var r=t||{},n=r.width?String(r.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var o={date:i({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:i({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:i({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},a={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function s(e){return function(t,r){var n=r||{},i=n.width?String(n.width):e.defaultWidth;return("formatting"===(n.context?String(n.context):"standalone")&&e.formattingValues?e.formattingValues[i]||e.formattingValues[e.defaultFormattingWidth]:e.values[i]||e.values[e.defaultWidth])[e.argumentCallback?e.argumentCallback(t):t]}}function u(e){return function(t,r){var n=String(t),i=r||{},o=i.width,a=o&&e.matchPatterns[o]||e.matchPatterns[e.defaultMatchWidth],s=n.match(a);if(!s)return null;var u,c=s[0],l=o&&e.parsePatterns[o]||e.parsePatterns[e.defaultParseWidth];return u="[object Array]"===Object.prototype.toString.call(l)?l.findIndex((function(e){return e.test(n)})):function(e,t){for(var r in e)if(e.hasOwnProperty(r)&&t(e[r]))return r}(l,(function(e){return e.test(n)})),u=e.valueCallback?e.valueCallback(u):u,{value:u=i.valueCallback?i.valueCallback(u):u,rest:n.slice(c.length)}}}var c,l={formatDistance:function(e,t,r){var i;return r=r||{},i="string"==typeof n[e]?n[e]:1===t?n[e].one:n[e].other.replace("{{count}}",t),r.addSuffix?r.comparison>0?"in "+i:i+" ago":i},formatLong:o,formatRelative:function(e,t,r,n){return a[e]},localize:{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:s({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:s({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 Number(e)-1}}),month:s({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:s({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:s({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"})},match:{ordinalNumber:(c={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}},function(e,t){var r=String(e),n=t||{},i=r.match(c.matchPattern);if(!i)return null;var o=i[0],a=r.match(c.parsePattern);if(!a)return null;var s=c.valueCallback?c.valueCallback(a[0]):a[0];return{value:s=n.valueCallback?n.valueCallback(s):s,rest:r.slice(o.length)}}),era:u({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:u({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:u({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:u({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:u({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}};t.a=l},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(0);function i(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=1,r=Object(n.a)(e),i=r.getUTCDay(),o=(i<t?7:0)+i-t;return r.setUTCDate(r.getUTCDate()-o),r.setUTCHours(0,0,0,0),r}},function(e,t,r){"use strict";r.d(t,"d",(function(){return A})),r.d(t,"b",(function(){return M})),r.d(t,"a",(function(){return I})),r.d(t,"c",(function(){return j}));var n=r(5),i=r(1),o=r(2),a=r(12),s=r(49),u=r(124);function c(...e){return e.reduce((e,t)=>e+Object(u.number)(t),0)}const l=r(49).resolveName;const f=r(49).resolveName;function d(e){let t=o.m(e[0]);return o.p(t,"rollover")}function h(e,t){if(t.length>0){let r=d(t);n.b().createStatic(r,"carryover-"+e.id,!1),n.b().createStatic(r,"leftover-"+e.id,0),n.b().createStatic(r,"leftover-pos-"+e.id,0)}}function p(e,t,r){let i=d(r);e.blankSheet!==i&&(n.b().clearSheet(e.blankSheet),function(e,t,r){n.b().createStatic(t,"is-blank",!0),n.b().createStatic(t,"to-budget",0),n.b().createStatic(t,"buffered",0),e.forEach(e=>h(e,r))}(t,i,r),e.blankSheet=i)}var g=r(32);function m(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,i,o=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==r.return||r.return()}finally{if(s)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return y(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return y(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function b(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 _(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(Object(r),!0).forEach((function(t){w(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function w(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function v(){return n.b().meta().budgetType||"rollover"}function E(e,t,r,o,a){n.b().createDynamic(t,"sum-amount-"+e.id,{initialValue:0,run:()=>{let t=i.runQuery(`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 >= ${o} AND t.date <= ${a}\n AND category = '${e.id}' AND a.offbudget = 0`,[],!0)[0];return(t?t.amount:0)||0}}),"rollover"===v()?function(e,t,r){e.is_income||(n.b().createStatic(t,"budget-"+e.id,0),null==n.b().getCellValue(t,"budget-"+e.id)&&n.b().set(f(t,"budget-"+e.id),0),n.b().createStatic(t,"carryover-"+e.id,!1),n.b().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,i)=>Object(u.number)(e)+Object(u.number)(t)+(r?Object(u.number)(n):Object(u.number)(i))}),n.b().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){n.b().createStatic(t,"budget-"+e.id,0),null==n.b().getCellValue(t,"budget-"+e.id)&&n.b().set(l(t,"budget-"+e.id),0),n.b().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,i)=>e.is_income?Object(u.number)(t)-Object(u.number)(r)+(n?Object(u.number)(i):0):Object(u.number)(t)+Object(u.number)(r)+(n?Object(u.number)(i):0)}),n.b().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,Object(u.number)(e)+Object(u.number)(t)):t}),n.b().createStatic(t,"carryover-"+e.id,!1)}(e,t,r)}function S(e,t){n.b().createDynamic(t,"group-sum-amount-"+e.id,{initialValue:0,dependencies:e.categories.map(e=>"sum-amount-"+e.id),run:c}),e.is_income&&"rollover"===v()||(n.b().createDynamic(t,"group-budget-"+e.id,{initialValue:0,dependencies:e.categories.map(e=>"budget-"+e.id),run:c}),n.b().createDynamic(t,"group-leftover-"+e.id,{initialValue:0,dependencies:e.categories.map(e=>"leftover-"+e.id),run:c}))}function O(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=o.k(i.fromDateRepr(e.date)),r=o.p(t,v());n.b().recompute(Object(s.resolveName)(r,"sum-amount-"+e.category))}}function T(e,t,r){let a=v();if(1===r.tombstone&&t&&0===t.tombstone){let t=r.id;e.forEach(e=>{!function(e,t){n.b().removeDependencies(e,"total-budgeted",["group-budget-"+t]),n.b().removeDependencies(e,"total-spent",["group-sum-amount-"+t]),n.b().removeDependencies(e,"total-leftover",["group-leftover-"+t])}(o.p(e,a),t)})}else if(0===r.tombstone&&(!t||1===t.tombstone)){let t=r;t.is_income&&"rollover"===a||e.forEach(e=>{let r=o.p(e,a),s=i.runQuery("SELECT * FROM categories WHERE tombstone = 0 AND cat_group = ?",[t.id],!0);S(_(_({},t),{},{categories:s}),r),function(e,t){n.b().addDependencies(e,"total-budgeted",["group-budget-"+t]),n.b().addDependencies(e,"total-spent",["group-sum-amount-"+t]),n.b().addDependencies(e,"total-leftover",["group-leftover-"+t])}(r,t.id)})}}function A(e,t){let r=n.b().meta().createdMonths,u=void 0===r?new Set:r;n.h();try{t.forEach((t,r)=>{let c=e.get(r);t.forEach(e=>{let t=c&&c.get(e.id);if("zero_budget_months"===r)!function(e){let t=o.p(e.id);n.b().set(t+"!buffered",e.buffered)}(e);else if("zero_budgets"===r||"reflect_budgets"===r)!function(e){if(e.category){let t=o.p(e.month.toString());n.b().set(`${t}!budget-${e.category}`,e.amount||0),n.b().set(`${t}!carryover-${e.category}`,1===e.carryover)}}(e);else if("transactions"===r){let r=new Set(Object.keys(Object(a.f)(t||{},e)||{}));t&&O(t,r),O(e,r)}else"category_mapping"===r?function(e,t,r){e.forEach(e=>{let i=o.p(e,v());t&&n.b().recompute(Object(s.resolveName)(i,"sum-amount-"+t.transferId)),n.b().recompute(Object(s.resolveName)(i,"sum-amount-"+r.transferId))})}(u,t,e):"categories"===r?function(e,t,r){function i(e,t,r){n.b().addDependencies(e,"group-sum-amount-"+t,["sum-amount-"+r]),n.b().addDependencies(e,"group-budget-"+t,["budget-"+r]),n.b().addDependencies(e,"group-leftover-"+t,["leftover-"+r])}function a(e,t,r){n.b().removeDependencies(e,"group-sum-amount-"+t,["sum-amount-"+r]),n.b().removeDependencies(e,"group-budget-"+t,["budget-"+r]),n.b().removeDependencies(e,"group-leftover-"+t,["leftover-"+r])}let s=v();if(t&&0===t.tombstone&&1===r.tombstone){let t=r.id,n=r.cat_group;e.forEach(e=>{a(o.p(e),n,t)})}else if(0!==r.tombstone||t&&1!==t.tombstone){if(t&&t.cat_group!==r.cat_group){let n=r.id;e.forEach(e=>{let u=o.p(e,s);a(u,t.cat_group,n),i(u,r.cat_group,n)})}}else"rollover"===s&&h(r,e),e.forEach(e=>{let t=o.m(e),a=o.p(t,s),u=o.p(e,s),c=o.c(e),l=c.start,f=c.end;E(r,u,a,l,f);let d=r.id,h=r.cat_group;"rollover"===v()&&n.b().addDependencies(u,"last-month-overspent",[`${a}!leftover-${d}`,`${a}!carryover-${d}`]),i(u,h,d)})}(u,t,e):"category_groups"===r?T(u,t,e):"accounts"===r&&function(e,t,r){if(!t||t.offbudget!==r.offbudget){let t=i.runQuery("\n SELECT DISTINCT(category) as category FROM transactions\n WHERE acct = ?\n ",[r.id],!0);e.forEach(e=>{let r=o.p(e,v());t.forEach(e=>{n.b().recompute(Object(s.resolveName)(r,"sum-amount-"+e.category))})})}}(u,t,e)})})}finally{n.a()}}async function M(e,t){[...n.b().meta().createdMonths].map(r=>{let n=e.map(e=>g.c({month:r,category:e})).reduce((e,t)=>e+t,0),i=g.c({month:r,category:t});g.i({month:r,category:t,amount:n+i})})}async function D(e){const t=await i.getCategories(),r=await i.getCategoriesGrouped();n.h();let a=n.b().meta();a.createdMonths=a.createdMonths||new Set;let s=v();"rollover"===s&&p(a,t,e),e.forEach(e=>{if(!a.createdMonths.has(e)){let i=o.m(e),l=o.c(e),f=l.start,d=l.end,h=o.p(e,s),p=o.p(i,s);t.forEach(e=>{E(e,h,p,f,d)}),r.forEach(e=>{S(e,h)}),"rollover"===s?function(e,t,r,i){let o=e.filter(e=>e.is_income)[0],a=t.filter(e=>!e.is_income);var s;n.b().createStatic(i,"buffered",0),n.b().createDynamic(i,"from-last-month",{initialValue:0,dependencies:[r+"!to-budget",r+"!buffered"],run:(e,t)=>Object(u.number)(e)+Object(u.number)(t)}),n.b().createDynamic(i,"total-income",{initialValue:0,dependencies:["group-sum-amount-"+o.id],run:e=>e}),n.b().createDynamic(i,"available-funds",{initialValue:0,dependencies:["total-income","from-last-month"],run:(e,t)=>Object(u.number)(e)+Object(u.number)(t)}),n.b().createDynamic(i,"last-month-overspent",{initialValue:0,dependencies:(s=a.map(e=>[`${r}!leftover-${e.id}`,`${r}!carryover-${e.id}`]),Array.prototype.concat.apply([],s)),run:(...e)=>(e=function(e){let t=[];for(let r=0;r<e.length;r+=2)t.push([e[r],e[r+1]]);return t}(e)).reduce((e,[t,r])=>r?e:e+Math.min(0,Object(u.number)(t)),0)}),n.b().createDynamic(i,"total-budgeted",{initialValue:0,dependencies:e.filter(e=>!e.is_income).map(e=>"group-budget-"+e.id),run:(...e)=>-c(...e)}),n.b().createDynamic(i,"buffered",{initialValue:0}),n.b().createDynamic(i,"to-budget",{initialValue:0,dependencies:["available-funds","last-month-overspent","total-budgeted","buffered"],run:(e,t,r,n)=>Object(u.number)(e)+Object(u.number)(t)+Object(u.number)(r)-Object(u.number)(n)}),n.b().createDynamic(i,"total-spent",{initialValue:0,dependencies:e.filter(e=>!e.is_income).map(e=>"group-sum-amount-"+e.id),run:c}),n.b().createDynamic(i,"total-leftover",{initialValue:0,dependencies:e.filter(e=>!e.is_income).map(e=>"group-leftover-"+e.id),run:c})}(r,t,p,h):function(e,t,r){let i=e.filter(e=>e.is_income)[0],o=t.filter(e=>!e.is_income);n.b().createDynamic(r,"total-budgeted",{initialValue:0,dependencies:e.filter(e=>!e.is_income).map(e=>"group-budget-"+e.id),run:c}),n.b().createDynamic(r,"total-spent",{initialValue:0,refresh:!0,dependencies:o.map(e=>`${r}!spent-with-carryover-${e.id}`),run:c}),n.b().createDynamic(r,"total-income",{initialValue:0,dependencies:["group-sum-amount-"+i.id],run:e=>e}),n.b().createDynamic(r,"total-leftover",{initialValue:0,dependencies:["total-budgeted","total-spent"],run:c}),n.b().createDynamic(r,"total-budget-income",{initialValue:0,dependencies:["group-budget-"+i.id],run:e=>e}),n.b().createDynamic(r,"total-saved",{initialValue:0,dependencies:["total-budget-income","total-budgeted"],run:(e,t)=>e-t}),n.b().createDynamic(r,"real-saved",{initialValue:0,dependencies:["total-income","total-spent"],run:(e,t)=>e- -t})}(r,t,h),a.createdMonths.add(e)}}),n.b().setMeta(a),n.a(),await n.j()}async function I(){let e=await i.first("SELECT * FROM transactions WHERE isChild=0 AND date IS NOT NULL ORDER BY date ASC LIMIT 1"),t=e&&i.fromDateRepr(e.date),r=o.e(),a=function(e,t){return(e=o.h(e))>(t=o.h(t))&&(e=t),{start:e=o.r(e,3),end:t=o.b(t,12),range:o.o(e,t)}}(t||r,r),s=a.start,u=a.end,c=a.range,l=n.b().meta().createdMonths||new Set;return c.filter(e=>!l.has(e)).length>0&&await D(c),{start:s,end:u}}async function j(e){let t=n.b().meta();if(e===t.budgetType)return;t.budgetType=e,t.createdMonths=new Set;let r=n.b().getNodes();i.transaction(()=>{for(let e of r.keys()){let t=m(e.split("!"),2),r=t[0],i=t[1];r.match(/^budget\d+/)&&n.b().deleteCell(r,i)}}),n.b().startCacheBarrier(),n.f(i);let o=await I();return n.b().endCacheBarrier(),o}},function(e,t,r){"use strict";var n=r(22),i={y:function(e,t){var r=e.getUTCFullYear(),i=r>0?r:1-r;return Object(n.a)("yy"===t?i%100:i,t.length)},M:function(e,t){var r=e.getUTCMonth();return"M"===t?String(r+1):Object(n.a)(r+1,2)},d:function(e,t){return Object(n.a)(e.getUTCDate(),t.length)},a:function(e,t){var r=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":case"aaa":return r.toUpperCase();case"aaaaa":return r[0];case"aaaa":default:return"am"===r?"a.m.":"p.m."}},h:function(e,t){return Object(n.a)(e.getUTCHours()%12||12,t.length)},H:function(e,t){return Object(n.a)(e.getUTCHours(),t.length)},m:function(e,t){return Object(n.a)(e.getUTCMinutes(),t.length)},s:function(e,t){return Object(n.a)(e.getUTCSeconds(),t.length)}};t.a=i},function(e,t,r){"use strict";var n,i="object"==typeof Reflect?Reflect:null,o=i&&"function"==typeof i.apply?i.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};n=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var a=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}e.exports=s,e.exports.once=function(e,t){return new Promise((function(r,n){function i(r){e.removeListener(t,o),n(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}y(e,t,o,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&y(e,"error",t,r)}(e,i,{once:!0})}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var u=10;function c(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function f(e,t,r,n){var i,o,a,s;if(c(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),a=o[t]),void 0===a)a=o[t]=r,++e._eventsCount;else if("function"==typeof a?a=o[t]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(i=l(e))>0&&a.length>i&&!a.warned){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=a.length,s=u,console&&console.warn&&console.warn(s)}return e}function d(){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 h(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=d.bind(n);return i.listener=r,n.wrapFn=i,i}function p(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]: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}(i):m(i,i.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 m(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function y(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 i(o){n.once&&e.removeEventListener(t,i),r(o)}))}}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return u},set:function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");u=e}}),s.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},s.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||a(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},s.prototype.getMaxListeners=function(){return l(this)},s.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var n="error"===e,i=this._events;if(void 0!==i)n=n&&void 0===i.error;else if(!n)return!1;if(n){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)o(u,this,t);else{var c=u.length,l=m(u,c);for(r=0;r<c;++r)o(l[r],this,t)}return!0},s.prototype.addListener=function(e,t){return f(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return f(this,e,t,!0)},s.prototype.once=function(e,t){return c(t),this.on(e,h(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return c(t),this.prependListener(e,h(this,e,t)),this},s.prototype.removeListener=function(e,t){var r,n,i,o,a;if(c(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(i=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){a=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,a||t)}return this},s.prototype.off=s.prototype.removeListener,s.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 i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);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},s.prototype.listeners=function(e){return p(this,e,!0)},s.prototype.rawListeners=function(e){return p(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):g.call(e,t)},s.prototype.listenerCount=g,s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},function(e,t,r){"use strict";r.r(t),r.d(t,"addDays",(function(){return n.a})),r.d(t,"addHours",(function(){return a})),r.d(t,"addISOWeekYears",(function(){return p})),r.d(t,"addMilliseconds",(function(){return o.a})),r.d(t,"addMinutes",(function(){return g})),r.d(t,"addMonths",(function(){return m.a})),r.d(t,"addQuarters",(function(){return y})),r.d(t,"addSeconds",(function(){return b})),r.d(t,"addWeeks",(function(){return _.a})),r.d(t,"addYears",(function(){return w.a})),r.d(t,"areIntervalsOverlapping",(function(){return v})),r.d(t,"closestIndexTo",(function(){return E})),r.d(t,"closestTo",(function(){return S})),r.d(t,"compareAsc",(function(){return O.a})),r.d(t,"compareDesc",(function(){return T})),r.d(t,"differenceInCalendarDays",(function(){return d.a})),r.d(t,"differenceInCalendarISOWeekYears",(function(){return A})),r.d(t,"differenceInCalendarISOWeeks",(function(){return D})),r.d(t,"differenceInCalendarMonths",(function(){return I})),r.d(t,"differenceInCalendarQuarters",(function(){return R})),r.d(t,"differenceInCalendarWeeks",(function(){return N})),r.d(t,"differenceInCalendarYears",(function(){return k})),r.d(t,"differenceInDays",(function(){return C.a})),r.d(t,"differenceInHours",(function(){return x})),r.d(t,"differenceInISOWeekYears",(function(){return B})),r.d(t,"differenceInMilliseconds",(function(){return L})),r.d(t,"differenceInMinutes",(function(){return U})),r.d(t,"differenceInMonths",(function(){return F})),r.d(t,"differenceInQuarters",(function(){return W})),r.d(t,"differenceInSeconds",(function(){return H})),r.d(t,"differenceInWeeks",(function(){return z})),r.d(t,"differenceInYears",(function(){return q})),r.d(t,"eachDayOfInterval",(function(){return V})),r.d(t,"eachWeekOfInterval",(function(){return G})),r.d(t,"eachWeekendOfInterval",(function(){return K})),r.d(t,"eachWeekendOfMonth",(function(){return J})),r.d(t,"eachWeekendOfYear",(function(){return te})),r.d(t,"endOfDay",(function(){return re})),r.d(t,"endOfDecade",(function(){return ne})),r.d(t,"endOfHour",(function(){return ie})),r.d(t,"endOfISOWeek",(function(){return ae})),r.d(t,"endOfISOWeekYear",(function(){return se})),r.d(t,"endOfMinute",(function(){return ue})),r.d(t,"endOfMonth",(function(){return X.a})),r.d(t,"endOfQuarter",(function(){return ce})),r.d(t,"endOfSecond",(function(){return le})),r.d(t,"endOfWeek",(function(){return oe})),r.d(t,"endOfYear",(function(){return ee})),r.d(t,"format",(function(){return fe.a})),r.d(t,"formatDistance",(function(){return ge})),r.d(t,"formatDistanceStrict",(function(){return me})),r.d(t,"formatRelative",(function(){return be})),r.d(t,"fromUnixTime",(function(){return _e})),r.d(t,"getDate",(function(){return we.a})),r.d(t,"getDay",(function(){return ve})),r.d(t,"getDayOfYear",(function(){return Ee})),r.d(t,"getDaysInMonth",(function(){return Se.a})),r.d(t,"getDaysInYear",(function(){return Te})),r.d(t,"getDecade",(function(){return Ae})),r.d(t,"getHours",(function(){return Me})),r.d(t,"getISODay",(function(){return De})),r.d(t,"getISOWeek",(function(){return Ie})),r.d(t,"getISOWeekYear",(function(){return l})),r.d(t,"getISOWeeksInYear",(function(){return je})),r.d(t,"getMilliseconds",(function(){return Re})),r.d(t,"getMinutes",(function(){return Ne})),r.d(t,"getMonth",(function(){return ke})),r.d(t,"getOverlappingDaysInIntervals",(function(){return Ce})),r.d(t,"getQuarter",(function(){return j})),r.d(t,"getSeconds",(function(){return Le})),r.d(t,"getTime",(function(){return xe})),r.d(t,"getUnixTime",(function(){return Pe})),r.d(t,"getWeek",(function(){return Fe})),r.d(t,"getWeekOfMonth",(function(){return We})),r.d(t,"getWeekYear",(function(){return Be})),r.d(t,"getWeeksInMonth",(function(){return ze})),r.d(t,"getYear",(function(){return qe})),r.d(t,"isAfter",(function(){return Ve.a})),r.d(t,"isBefore",(function(){return Ge.a})),r.d(t,"isDate",(function(){return Ye})),r.d(t,"isEqual",(function(){return $e})),r.d(t,"isFirstDayOfMonth",(function(){return Ke})),r.d(t,"isFriday",(function(){return Ze})),r.d(t,"isLastDayOfMonth",(function(){return Xe})),r.d(t,"isLeapYear",(function(){return Oe})),r.d(t,"isMonday",(function(){return Je})),r.d(t,"isSameDay",(function(){return et})),r.d(t,"isSameHour",(function(){return rt})),r.d(t,"isSameISOWeek",(function(){return it})),r.d(t,"isSameISOWeekYear",(function(){return ot})),r.d(t,"isSameMinute",(function(){return st})),r.d(t,"isSameMonth",(function(){return ut})),r.d(t,"isSameQuarter",(function(){return lt})),r.d(t,"isSameSecond",(function(){return dt})),r.d(t,"isSameWeek",(function(){return nt})),r.d(t,"isSameYear",(function(){return ht})),r.d(t,"isSaturday",(function(){return pt})),r.d(t,"isSunday",(function(){return Y})),r.d(t,"isThursday",(function(){return gt})),r.d(t,"isTuesday",(function(){return mt})),r.d(t,"isValid",(function(){return yt.a})),r.d(t,"isWednesday",(function(){return bt})),r.d(t,"isWeekend",(function(){return $})),r.d(t,"isWithinInterval",(function(){return _t})),r.d(t,"lastDayOfDecade",(function(){return wt})),r.d(t,"lastDayOfISOWeek",(function(){return Et})),r.d(t,"lastDayOfISOWeekYear",(function(){return St})),r.d(t,"lastDayOfMonth",(function(){return He})),r.d(t,"lastDayOfQuarter",(function(){return Ot})),r.d(t,"lastDayOfWeek",(function(){return vt})),r.d(t,"lastDayOfYear",(function(){return Tt})),r.d(t,"lightFormat",(function(){return jt})),r.d(t,"max",(function(){return Nt})),r.d(t,"min",(function(){return kt})),r.d(t,"parse",(function(){return Ar})),r.d(t,"parseISO",(function(){return Ir.a})),r.d(t,"roundToNearestMinutes",(function(){return jr})),r.d(t,"setDate",(function(){return Rr})),r.d(t,"setDay",(function(){return Nr})),r.d(t,"setDayOfYear",(function(){return kr})),r.d(t,"setHours",(function(){return Cr})),r.d(t,"setISODay",(function(){return Lr})),r.d(t,"setISOWeek",(function(){return xr})),r.d(t,"setISOWeekYear",(function(){return h})),r.d(t,"setMilliseconds",(function(){return Pr})),r.d(t,"setMinutes",(function(){return Br})),r.d(t,"setMonth",(function(){return Ur})),r.d(t,"setQuarter",(function(){return Fr})),r.d(t,"setSeconds",(function(){return Wr})),r.d(t,"setWeek",(function(){return Hr})),r.d(t,"setWeekYear",(function(){return zr})),r.d(t,"setYear",(function(){return qr})),r.d(t,"startOfDay",(function(){return Qe.a})),r.d(t,"startOfDecade",(function(){return Vr})),r.d(t,"startOfHour",(function(){return tt})),r.d(t,"startOfISOWeek",(function(){return c})),r.d(t,"startOfISOWeekYear",(function(){return f})),r.d(t,"startOfMinute",(function(){return at})),r.d(t,"startOfMonth",(function(){return Z.a})),r.d(t,"startOfQuarter",(function(){return ct})),r.d(t,"startOfSecond",(function(){return ft})),r.d(t,"startOfWeek",(function(){return u})),r.d(t,"startOfWeekYear",(function(){return Ue})),r.d(t,"startOfYear",(function(){return Q})),r.d(t,"subDays",(function(){return Gr.a})),r.d(t,"subHours",(function(){return Yr})),r.d(t,"subISOWeekYears",(function(){return P})),r.d(t,"subMilliseconds",(function(){return ye.a})),r.d(t,"subMinutes",(function(){return $r})),r.d(t,"subMonths",(function(){return Kr.a})),r.d(t,"subQuarters",(function(){return Zr})),r.d(t,"subSeconds",(function(){return Xr})),r.d(t,"subWeeks",(function(){return Jr.a})),r.d(t,"subYears",(function(){return Qr.a})),r.d(t,"toDate",(function(){return s.a}));var n=r(47),i=r(3),o=r(55);function a(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(i.a)(t);return Object(o.a)(e,36e5*r)}var s=r(0);function u(e,t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var r=t||{},n=r.locale,o=n&&n.options&&n.options.weekStartsOn,a=null==o?0:Object(i.a)(o),u=null==r.weekStartsOn?a:Object(i.a)(r.weekStartsOn);if(!(u>=0&&u<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var c=Object(s.a)(e),l=c.getDay(),f=(l<u?7:0)+l-u;return c.setDate(c.getDate()-f),c.setHours(0,0,0,0),c}function c(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");return u(e,{weekStartsOn:1})}function l(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=Object(s.a)(e),r=t.getFullYear(),n=new Date(0);n.setFullYear(r+1,0,4),n.setHours(0,0,0,0);var i=c(n),o=new Date(0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);var a=c(o);return t.getTime()>=i.getTime()?r+1:t.getTime()>=a.getTime()?r:r-1}function f(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=l(e),r=new Date(0);r.setFullYear(t,0,4),r.setHours(0,0,0,0);var n=c(r);return n}var d=r(46);function h(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(s.a)(e),n=Object(i.a)(t),o=Object(d.a)(r,f(r)),a=new Date(0);return a.setFullYear(n,0,4),a.setHours(0,0,0,0),(r=f(a)).setDate(r.getDate()+o),r}function p(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(i.a)(t);return h(e,l(e)+r)}function g(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(i.a)(t);return Object(o.a)(e,6e4*r)}var m=r(57);function y(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(i.a)(t),n=3*r;return Object(m.a)(e,n)}function b(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(i.a)(t);return Object(o.a)(e,1e3*r)}var _=r(73),w=r(126);function v(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=e||{},n=t||{},i=Object(s.a)(r.start).getTime(),o=Object(s.a)(r.end).getTime(),a=Object(s.a)(n.start).getTime(),u=Object(s.a)(n.end).getTime();if(!(i<=o&&a<=u))throw new RangeError("Invalid interval");return i<u&&a<o}function E(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(s.a)(e);if(isNaN(r))return NaN;var n,i,o=r.getTime();return(null==t?[]:"function"==typeof t.forEach?t:Array.prototype.slice.call(t)).forEach((function(e,t){var r=Object(s.a)(e);if(isNaN(r))return n=NaN,void(i=NaN);var a=Math.abs(o-r.getTime());(null==n||a<i)&&(n=t,i=a)})),n}function S(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(s.a)(e);if(isNaN(r))return new Date(NaN);var n,i,o=r.getTime();return(null==t?[]:"function"==typeof t.forEach?t:Array.prototype.slice.call(t)).forEach((function(e){var t=Object(s.a)(e);if(isNaN(t))return n=new Date(NaN),void(i=NaN);var r=Math.abs(o-t.getTime());(null==n||r<i)&&(n=t,i=r)})),n}var O=r(36);function T(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(s.a)(e),n=Object(s.a)(t),i=r.getTime()-n.getTime();return i>0?-1:i<0?1:i}function A(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");return l(e)-l(t)}var M=r(27);function D(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=c(e),n=c(t),i=r.getTime()-Object(M.a)(r),o=n.getTime()-Object(M.a)(n);return Math.round((i-o)/6048e5)}function I(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(s.a)(e),n=Object(s.a)(t),i=r.getFullYear()-n.getFullYear(),o=r.getMonth()-n.getMonth();return 12*i+o}function j(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=Object(s.a)(e),r=Math.floor(t.getMonth()/3)+1;return r}function R(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(s.a)(e),n=Object(s.a)(t),i=r.getFullYear()-n.getFullYear(),o=j(r)-j(n);return 4*i+o}function N(e,t,r){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var n=u(e,r),i=u(t,r),o=n.getTime()-Object(M.a)(n),a=i.getTime()-Object(M.a)(i);return Math.round((o-a)/6048e5)}function k(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(s.a)(e),n=Object(s.a)(t);return r.getFullYear()-n.getFullYear()}var C=r(127);function L(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(s.a)(e),n=Object(s.a)(t);return r.getTime()-n.getTime()}function x(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=L(e,t)/36e5;return r>0?Math.floor(r):Math.ceil(r)}function P(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(i.a)(t);return p(e,-r)}function B(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(s.a)(e),n=Object(s.a)(t),i=Object(O.a)(r,n),o=Math.abs(A(r,n));r=P(r,i*o);var a=Object(O.a)(r,n)===-i,u=i*(o-a);return 0===u?0:u}function U(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=L(e,t)/6e4;return r>0?Math.floor(r):Math.ceil(r)}function F(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(s.a)(e),n=Object(s.a)(t),i=Object(O.a)(r,n),o=Math.abs(I(r,n));r.setMonth(r.getMonth()-i*o);var a=Object(O.a)(r,n)===-i,u=i*(o-a);return 0===u?0:u}function W(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=F(e,t)/3;return r>0?Math.floor(r):Math.ceil(r)}function H(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=L(e,t)/1e3;return r>0?Math.floor(r):Math.ceil(r)}function z(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(C.a)(e,t)/7;return r>0?Math.floor(r):Math.ceil(r)}function q(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(s.a)(e),n=Object(s.a)(t),i=Object(O.a)(r,n),o=Math.abs(k(r,n));r.setFullYear(r.getFullYear()-i*o);var a=Object(O.a)(r,n)===-i,u=i*(o-a);return 0===u?0:u}function V(e,t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var r=e||{},n=Object(s.a)(r.start),i=Object(s.a)(r.end),o=i.getTime();if(!(n.getTime()<=o))throw new RangeError("Invalid interval");var a=[],u=n;u.setHours(0,0,0,0);var c=t&&"step"in t?Number(t.step):1;if(c<1||isNaN(c))throw new RangeError("`options.step` must be a number greater than 1");for(;u.getTime()<=o;)a.push(Object(s.a)(u)),u.setDate(u.getDate()+c),u.setHours(0,0,0,0);return a}function G(e,t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var r=e||{},n=Object(s.a)(r.start),i=Object(s.a)(r.end),o=i.getTime();if(!(n.getTime()<=o))throw new RangeError("Invalid interval");var a=u(n,t),c=u(i,t);a.setHours(15),c.setHours(15),o=c.getTime();for(var l=[],f=a;f.getTime()<=o;)f.setHours(0),l.push(Object(s.a)(f)),(f=Object(_.a)(f,1)).setHours(15);return l}function Y(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");return 0===Object(s.a)(e).getDay()}function $(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=Object(s.a)(e),r=t.getDay();return 0===r||6===r}function K(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");for(var t=V(e),r=[],n=0;n++<t.length;){var i=t[n];$(i)&&(r.push(i),Y(i)&&(n+=5))}return r}var Z=r(65),X=r(82);function J(e){if(arguments.length<1)throw new TypeError("1 arguments required, but only "+arguments.length+" present");var t=Object(Z.a)(e);if(isNaN(t))throw new RangeError("The passed date is invalid");var r=Object(X.a)(e);return K({start:t,end:r})}function Q(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=Object(s.a)(e),r=new Date(0);return r.setFullYear(t.getFullYear(),0,1),r.setHours(0,0,0,0),r}function ee(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=Object(s.a)(e),r=t.getFullYear();return t.setFullYear(r+1,0,0),t.setHours(23,59,59,999),t}function te(e){if(arguments.length<1)throw new TypeError("1 arguments required, but only "+arguments.length+" present");var t=Q(e);if(isNaN(t))throw new RangeError("The passed date is invalid");var r=ee(e);return K({start:t,end:r})}function re(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=Object(s.a)(e);return t.setHours(23,59,59,999),t}function ne(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=Object(s.a)(e),r=t.getFullYear(),n=9+10*Math.floor(r/10);return t.setFullYear(n,11,31),t.setHours(23,59,59,999),t}function ie(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=Object(s.a)(e);return t.setMinutes(59,59,999),t}function oe(e,t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var r=t||{},n=r.locale,o=n&&n.options&&n.options.weekStartsOn,a=null==o?0:Object(i.a)(o),u=null==r.weekStartsOn?a:Object(i.a)(r.weekStartsOn);if(!(u>=0&&u<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var c=Object(s.a)(e),l=c.getDay(),f=6+(l<u?-7:0)-(l-u);return c.setDate(c.getDate()+f),c.setHours(23,59,59,999),c}function ae(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");return oe(e,{weekStartsOn:1})}function se(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=l(e),r=new Date(0);r.setFullYear(t+1,0,4),r.setHours(0,0,0,0);var n=c(r);return n.setMilliseconds(n.getMilliseconds()-1),n}function ue(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=Object(s.a)(e);return t.setSeconds(59,999),t}function ce(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=Object(s.a)(e),r=t.getMonth(),n=r-r%3+3;return t.setMonth(n,0),t.setHours(23,59,59,999),t}function le(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=Object(s.a)(e);return t.setMilliseconds(999),t}var fe=r(34);function de(e,t){if(null==e)throw new TypeError("assign requires that input parameter not be null or undefined");for(var r in t=t||{})t.hasOwnProperty(r)&&(e[r]=t[r]);return e}function he(e){return de({},e)}var pe=r(59);function ge(e,t,r){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var n=r||{},i=n.locale||pe.a;if(!i.formatDistance)throw new RangeError("locale must contain formatDistance property");var o=Object(O.a)(e,t);if(isNaN(o))throw new RangeError("Invalid time value");var a,u,c=he(n);c.addSuffix=Boolean(n.addSuffix),c.comparison=o,o>0?(a=Object(s.a)(t),u=Object(s.a)(e)):(a=Object(s.a)(e),u=Object(s.a)(t));var l,f=H(u,a),d=(Object(M.a)(u)-Object(M.a)(a))/1e3,h=Math.round((f-d)/60);if(h<2)return n.includeSeconds?f<5?i.formatDistance("lessThanXSeconds",5,c):f<10?i.formatDistance("lessThanXSeconds",10,c):f<20?i.formatDistance("lessThanXSeconds",20,c):f<40?i.formatDistance("halfAMinute",null,c):f<60?i.formatDistance("lessThanXMinutes",1,c):i.formatDistance("xMinutes",1,c):0===h?i.formatDistance("lessThanXMinutes",1,c):i.formatDistance("xMinutes",h,c);if(h<45)return i.formatDistance("xMinutes",h,c);if(h<90)return i.formatDistance("aboutXHours",1,c);if(h<1440){var p=Math.round(h/60);return i.formatDistance("aboutXHours",p,c)}if(h<2520)return i.formatDistance("xDays",1,c);if(h<43200){var g=Math.round(h/1440);return i.formatDistance("xDays",g,c)}if(h<86400)return l=Math.round(h/43200),i.formatDistance("aboutXMonths",l,c);if((l=F(u,a))<12){var m=Math.round(h/43200);return i.formatDistance("xMonths",m,c)}var y=l%12,b=Math.floor(l/12);return y<3?i.formatDistance("aboutXYears",b,c):y<9?i.formatDistance("overXYears",b,c):i.formatDistance("almostXYears",b+1,c)}function me(e,t,r){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var n=r||{},i=n.locale||pe.a;if(!i.formatDistance)throw new RangeError("locale must contain localize.formatDistance property");var o=Object(O.a)(e,t);if(isNaN(o))throw new RangeError("Invalid time value");var a,u,c=he(n);c.addSuffix=Boolean(n.addSuffix),c.comparison=o,o>0?(a=Object(s.a)(t),u=Object(s.a)(e)):(a=Object(s.a)(e),u=Object(s.a)(t));var l,f=null==n.roundingMethod?"round":String(n.roundingMethod);if("floor"===f)l=Math.floor;else if("ceil"===f)l=Math.ceil;else{if("round"!==f)throw new RangeError("roundingMethod must be 'floor', 'ceil' or 'round'");l=Math.round}var d,h=H(u,a),p=(Object(M.a)(u)-Object(M.a)(a))/1e3,g=l((h-p)/60);if("second"===(d=null==n.unit?g<1?"second":g<60?"minute":g<1440?"hour":g<43200?"day":g<525600?"month":"year":String(n.unit)))return i.formatDistance("xSeconds",h,c);if("minute"===d)return i.formatDistance("xMinutes",g,c);if("hour"===d){var m=l(g/60);return i.formatDistance("xHours",m,c)}if("day"===d){var y=l(g/1440);return i.formatDistance("xDays",y,c)}if("month"===d){var b=l(g/43200);return i.formatDistance("xMonths",b,c)}if("year"===d){var _=l(g/525600);return i.formatDistance("xYears",_,c)}throw new RangeError("unit must be 'second', 'minute', 'hour', 'day', 'month' or 'year'")}var ye=r(50);function be(e,t,r){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var n=Object(s.a)(e),i=Object(s.a)(t),o=r||{},a=o.locale||pe.a;if(!a.localize)throw new RangeError("locale must contain localize property");if(!a.formatLong)throw new RangeError("locale must contain formatLong property");if(!a.formatRelative)throw new RangeError("locale must contain formatRelative property");var u,c=Object(d.a)(n,i);if(isNaN(c))throw new RangeError("Invalid time value");u=c<-6?"other":c<-1?"lastWeek":c<0?"yesterday":c<1?"today":c<2?"tomorrow":c<7?"nextWeek":"other";var l=Object(ye.a)(n,Object(M.a)(n)),f=Object(ye.a)(i,Object(M.a)(i)),h=a.formatRelative(u,l,f,o);return Object(fe.a)(n,h,o)}function _e(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=Object(i.a)(e);return Object(s.a)(1e3*t)}var we=r(128);function ve(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=Object(s.a)(e),r=t.getDay();return r}function Ee(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=Object(s.a)(e),r=Object(d.a)(t,Q(t)),n=r+1;return n}var Se=r(90);function Oe(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=Object(s.a)(e),r=t.getFullYear();return r%400==0||r%4==0&&r%100!=0}function Te(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=Object(s.a)(e);return isNaN(t)?NaN:Oe(t)?366:365}function Ae(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=Object(s.a)(e),r=t.getFullYear(),n=10*Math.floor(r/10);return n}function Me(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=Object(s.a)(e),r=t.getHours();return r}function De(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=Object(s.a)(e),r=t.getDay();return 0===r&&(r=7),r}function Ie(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=Object(s.a)(e),r=c(t).getTime()-f(t).getTime();return Math.round(r/6048e5)+1}function je(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=f(e),r=f(Object(_.a)(t,60)),n=r.valueOf()-t.valueOf();return Math.round(n/6048e5)}function Re(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=Object(s.a)(e),r=t.getMilliseconds();return r}function Ne(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=Object(s.a)(e),r=t.getMinutes();return r}function ke(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=Object(s.a)(e),r=t.getMonth();return r}function Ce(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=e||{},n=t||{},i=Object(s.a)(r.start).getTime(),o=Object(s.a)(r.end).getTime(),a=Object(s.a)(n.start).getTime(),u=Object(s.a)(n.end).getTime();if(!(i<=o&&a<=u))throw new RangeError("Invalid interval");var c=i<u&&a<o;if(!c)return 0;var l=a<i?i:a,f=u>o?o:u,d=f-l;return Math.ceil(d/864e5)}function Le(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=Object(s.a)(e),r=t.getSeconds();return r}function xe(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=Object(s.a)(e),r=t.getTime();return r}function Pe(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");return Math.floor(xe(e)/1e3)}function Be(e,t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var r=Object(s.a)(e),n=r.getFullYear(),o=t||{},a=o.locale,c=a&&a.options&&a.options.firstWeekContainsDate,l=null==c?1:Object(i.a)(c),f=null==o.firstWeekContainsDate?l:Object(i.a)(o.firstWeekContainsDate);if(!(f>=1&&f<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var d=new Date(0);d.setFullYear(n+1,0,f),d.setHours(0,0,0,0);var h=u(d,t),p=new Date(0);p.setFullYear(n,0,f),p.setHours(0,0,0,0);var g=u(p,t);return r.getTime()>=h.getTime()?n+1:r.getTime()>=g.getTime()?n:n-1}function Ue(e,t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var r=t||{},n=r.locale,o=n&&n.options&&n.options.firstWeekContainsDate,a=null==o?1:Object(i.a)(o),s=null==r.firstWeekContainsDate?a:Object(i.a)(r.firstWeekContainsDate),c=Be(e,t),l=new Date(0);l.setFullYear(c,0,s),l.setHours(0,0,0,0);var f=u(l,t);return f}function Fe(e,t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var r=Object(s.a)(e),n=u(r,t).getTime()-Ue(r,t).getTime();return Math.round(n/6048e5)+1}function We(e,t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var r=t||{},n=r.locale,o=n&&n.options&&n.options.weekStartsOn,a=null==o?0:Object(i.a)(o),s=null==r.weekStartsOn?a:Object(i.a)(r.weekStartsOn);if(!(s>=0&&s<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var u=ve(Object(Z.a)(e)),c=ve(e),l=u<s?7-s:u,f=l>c?7-s:0;return Math.ceil((Object(we.a)(e)+f)/7)}function He(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=Object(s.a)(e),r=t.getMonth();return t.setFullYear(t.getFullYear(),r+1,0),t.setHours(0,0,0,0),t}function ze(e,t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");return N(He(e),Object(Z.a)(e),t)+1}function qe(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=Object(s.a)(e),r=t.getFullYear();return r}var Ve=r(168),Ge=r(107);function Ye(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");return e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)}function $e(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(s.a)(e),n=Object(s.a)(t);return r.getTime()===n.getTime()}function Ke(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");return 1===Object(s.a)(e).getDate()}function Ze(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");return 5===Object(s.a)(e).getDay()}function Xe(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=Object(s.a)(e);return re(t).getTime()===Object(X.a)(t).getTime()}function Je(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");return 1===Object(s.a)(e).getDay()}var Qe=r(74);function et(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(Qe.a)(e),n=Object(Qe.a)(t);return r.getTime()===n.getTime()}function tt(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=Object(s.a)(e);return t.setMinutes(0,0,0),t}function rt(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=tt(e),n=tt(t);return r.getTime()===n.getTime()}function nt(e,t,r){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var n=u(e,r),i=u(t,r);return n.getTime()===i.getTime()}function it(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");return nt(e,t,{weekStartsOn:1})}function ot(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=f(e),n=f(t);return r.getTime()===n.getTime()}function at(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=Object(s.a)(e);return t.setSeconds(0,0),t}function st(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=at(e),n=at(t);return r.getTime()===n.getTime()}function ut(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(s.a)(e),n=Object(s.a)(t);return r.getFullYear()===n.getFullYear()&&r.getMonth()===n.getMonth()}function ct(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=Object(s.a)(e),r=t.getMonth(),n=r-r%3;return t.setMonth(n,1),t.setHours(0,0,0,0),t}function lt(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=ct(e),n=ct(t);return r.getTime()===n.getTime()}function ft(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=Object(s.a)(e);return t.setMilliseconds(0),t}function dt(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=ft(e),n=ft(t);return r.getTime()===n.getTime()}function ht(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(s.a)(e),n=Object(s.a)(t);return r.getFullYear()===n.getFullYear()}function pt(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");return 6===Object(s.a)(e).getDay()}function gt(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");return 4===Object(s.a)(e).getDay()}function mt(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");return 2===Object(s.a)(e).getDay()}var yt=r(66);function bt(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");return 3===Object(s.a)(e).getDay()}function _t(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=t||{},n=Object(s.a)(e).getTime(),i=Object(s.a)(r.start).getTime(),o=Object(s.a)(r.end).getTime();if(!(i<=o))throw new RangeError("Invalid interval");return n>=i&&n<=o}function wt(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=Object(s.a)(e),r=t.getFullYear(),n=9+10*Math.floor(r/10);return t.setFullYear(n+1,0,0),t.setHours(0,0,0,0),t}function vt(e,t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var r=t||{},n=r.locale,o=n&&n.options&&n.options.weekStartsOn,a=null==o?0:Object(i.a)(o),u=null==r.weekStartsOn?a:Object(i.a)(r.weekStartsOn);if(!(u>=0&&u<=6))throw new RangeError("weekStartsOn must be between 0 and 6");var c=Object(s.a)(e),l=c.getDay(),f=6+(l<u?-7:0)-(l-u);return c.setHours(0,0,0,0),c.setDate(c.getDate()+f),c}function Et(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");return vt(e,{weekStartsOn:1})}function St(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=l(e),r=new Date(0);r.setFullYear(t+1,0,4),r.setHours(0,0,0,0);var n=c(r);return n.setDate(n.getDate()-1),n}function Ot(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=Object(s.a)(e),r=t.getMonth(),n=r-r%3+3;return t.setMonth(n,0),t.setHours(0,0,0,0),t}function Tt(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=Object(s.a)(e),r=t.getFullYear();return t.setFullYear(r+1,0,0),t.setHours(0,0,0,0),t}var At=r(62),Mt=/(\w)\1*|''|'(''|[^'])+('|$)|./g,Dt=/^'(.*?)'?$/,It=/''/g;function jt(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=String(t),n=Object(s.a)(e);if(!Object(yt.a)(n))throw new RangeError("Invalid time value");var i=Object(M.a)(n),o=Object(ye.a)(n,i),a=r.match(Mt).map((function(e){if("''"===e)return"'";var t=e[0];if("'"===t)return Rt(e);var r=At.a[t];return r?r(o,e,null,{}):e})).join("");return a}function Rt(e){return e.match(Dt)[1].replace(It,"'")}function Nt(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t;return(null==e?[]:"function"==typeof e.forEach?e:Array.prototype.slice.call(e)).forEach((function(e){var r=Object(s.a)(e);(void 0===t||t<r||isNaN(r))&&(t=r)})),t}function kt(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t;return(null==e?[]:"function"==typeof e.forEach?e:Array.prototype.slice.call(e)).forEach((function(e){var r=Object(s.a)(e);(void 0===t||t>r||isNaN(r))&&(t=r)})),t}var Ct=r(92);function Lt(e,t,r){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var n=r||{},o=n.locale,a=o&&o.options&&o.options.weekStartsOn,u=null==a?0:Object(i.a)(a),c=null==n.weekStartsOn?u:Object(i.a)(n.weekStartsOn);if(!(c>=0&&c<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var l=Object(s.a)(e),f=Object(i.a)(t),d=l.getUTCDay(),h=f%7,p=(h+7)%7,g=(p<c?7:0)+f-d;return l.setUTCDate(l.getUTCDate()+g),l}var xt=r(136);var Pt=r(51);var Bt=r(137);var Ut=r(60),Ft=/^(1[0-2]|0?\d)/,Wt=/^(3[0-1]|[0-2]?\d)/,Ht=/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,zt=/^(5[0-3]|[0-4]?\d)/,qt=/^(2[0-3]|[0-1]?\d)/,Vt=/^(2[0-4]|[0-1]?\d)/,Gt=/^(1[0-1]|0?\d)/,Yt=/^(1[0-2]|0?\d)/,$t=/^[0-5]?\d/,Kt=/^[0-5]?\d/,Zt=/^\d/,Xt=/^\d{1,2}/,Jt=/^\d{1,3}/,Qt=/^\d{1,4}/,er=/^-?\d+/,tr=/^-?\d/,rr=/^-?\d{1,2}/,nr=/^-?\d{1,3}/,ir=/^-?\d{1,4}/,or=/^([+-])(\d{2})(\d{2})?|Z/,ar=/^([+-])(\d{2})(\d{2})|Z/,sr=/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,ur=/^([+-])(\d{2}):(\d{2})|Z/,cr=/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/;function lr(e,t,r){var n=t.match(e);if(!n)return null;var i=parseInt(n[0],10);return{value:r?r(i):i,rest:t.slice(n[0].length)}}function fr(e,t){var r=t.match(e);return r?"Z"===r[0]?{value:0,rest:t.slice(1)}:{value:("+"===r[1]?1:-1)*(36e5*(r[2]?parseInt(r[2],10):0)+6e4*(r[3]?parseInt(r[3],10):0)+1e3*(r[5]?parseInt(r[5],10):0)),rest:t.slice(r[0].length)}:null}function dr(e,t){return lr(er,e,t)}function hr(e,t,r){switch(e){case 1:return lr(Zt,t,r);case 2:return lr(Xt,t,r);case 3:return lr(Jt,t,r);case 4:return lr(Qt,t,r);default:return lr(new RegExp("^\\d{1,"+e+"}"),t,r)}}function pr(e,t,r){switch(e){case 1:return lr(tr,t,r);case 2:return lr(rr,t,r);case 3:return lr(nr,t,r);case 4:return lr(ir,t,r);default:return lr(new RegExp("^-?\\d{1,"+e+"}"),t,r)}}function gr(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function mr(e,t){var r,n=t>0,i=n?t:1-t;if(i<=50)r=e||100;else{var o=i+50;r=e+100*Math.floor(o/100)-(e>=o%100?100:0)}return n?r:1-r}var yr=[31,28,31,30,31,30,31,31,30,31,30,31],br=[31,29,31,30,31,30,31,31,30,31,30,31];function _r(e){return e%400==0||e%4==0&&e%100!=0}var wr={G:{priority:140,parse:function(e,t,r,n){switch(t){case"G":case"GG":case"GGG":return r.era(e,{width:"abbreviated"})||r.era(e,{width:"narrow"});case"GGGGG":return r.era(e,{width:"narrow"});case"GGGG":default:return r.era(e,{width:"wide"})||r.era(e,{width:"abbreviated"})||r.era(e,{width:"narrow"})}},set:function(e,t,r,n){return e.setUTCFullYear(1===r?10:-9,0,1),e.setUTCHours(0,0,0,0),e}},y:{priority:130,parse:function(e,t,r,n){var i=function(e){return{year:e,isTwoDigitYear:"yy"===t}};switch(t){case"y":return hr(4,e,i);case"yo":return r.ordinalNumber(e,{unit:"year",valueCallback:i});default:return hr(t.length,e,i)}},validate:function(e,t,r){return t.isTwoDigitYear||t.year>0},set:function(e,t,r,n){var i=Object(Ct.a)(e,n);if(r.isTwoDigitYear){var o=mr(r.year,i);return e.setUTCFullYear(o,0,1),e.setUTCHours(0,0,0,0),e}var a=i>0?r.year:1-r.year;return e.setUTCFullYear(a,0,1),e.setUTCHours(0,0,0,0),e}},Y:{priority:130,parse:function(e,t,r,n){var i=function(e){return{year:e,isTwoDigitYear:"YY"===t}};switch(t){case"Y":return hr(4,e,i);case"Yo":return r.ordinalNumber(e,{unit:"year",valueCallback:i});default:return hr(t.length,e,i)}},validate:function(e,t,r){return t.isTwoDigitYear||t.year>0},set:function(e,t,r,n){var i=e.getUTCFullYear();if(r.isTwoDigitYear){var o=mr(r.year,i);return e.setUTCFullYear(o,0,n.firstWeekContainsDate),e.setUTCHours(0,0,0,0),Object(Pt.a)(e,n)}var a=i>0?r.year:1-r.year;return e.setUTCFullYear(a,0,n.firstWeekContainsDate),e.setUTCHours(0,0,0,0),Object(Pt.a)(e,n)}},R:{priority:130,parse:function(e,t,r,n){return pr("R"===t?4:t.length,e)},set:function(e,t,r,n){var i=new Date(0);return i.setUTCFullYear(r,0,4),i.setUTCHours(0,0,0,0),Object(Ut.a)(i)}},u:{priority:130,parse:function(e,t,r,n){return pr("u"===t?4:t.length,e)},set:function(e,t,r,n){return e.setUTCFullYear(r,0,1),e.setUTCHours(0,0,0,0),e}},Q:{priority:120,parse:function(e,t,r,n){switch(t){case"Q":case"QQ":return hr(t.length,e);case"Qo":return r.ordinalNumber(e,{unit:"quarter"});case"QQQ":return r.quarter(e,{width:"abbreviated",context:"formatting"})||r.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return r.quarter(e,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(e,{width:"wide",context:"formatting"})||r.quarter(e,{width:"abbreviated",context:"formatting"})||r.quarter(e,{width:"narrow",context:"formatting"})}},validate:function(e,t,r){return t>=1&&t<=4},set:function(e,t,r,n){return e.setUTCMonth(3*(r-1),1),e.setUTCHours(0,0,0,0),e}},q:{priority:120,parse:function(e,t,r,n){switch(t){case"q":case"qq":return hr(t.length,e);case"qo":return r.ordinalNumber(e,{unit:"quarter"});case"qqq":return r.quarter(e,{width:"abbreviated",context:"standalone"})||r.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return r.quarter(e,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(e,{width:"wide",context:"standalone"})||r.quarter(e,{width:"abbreviated",context:"standalone"})||r.quarter(e,{width:"narrow",context:"standalone"})}},validate:function(e,t,r){return t>=1&&t<=4},set:function(e,t,r,n){return e.setUTCMonth(3*(r-1),1),e.setUTCHours(0,0,0,0),e}},M:{priority:110,parse:function(e,t,r,n){var i=function(e){return e-1};switch(t){case"M":return lr(Ft,e,i);case"MM":return hr(2,e,i);case"Mo":return r.ordinalNumber(e,{unit:"month",valueCallback:i});case"MMM":return r.month(e,{width:"abbreviated",context:"formatting"})||r.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return r.month(e,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(e,{width:"wide",context:"formatting"})||r.month(e,{width:"abbreviated",context:"formatting"})||r.month(e,{width:"narrow",context:"formatting"})}},validate:function(e,t,r){return t>=0&&t<=11},set:function(e,t,r,n){return e.setUTCMonth(r,1),e.setUTCHours(0,0,0,0),e}},L:{priority:110,parse:function(e,t,r,n){var i=function(e){return e-1};switch(t){case"L":return lr(Ft,e,i);case"LL":return hr(2,e,i);case"Lo":return r.ordinalNumber(e,{unit:"month",valueCallback:i});case"LLL":return r.month(e,{width:"abbreviated",context:"standalone"})||r.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return r.month(e,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(e,{width:"wide",context:"standalone"})||r.month(e,{width:"abbreviated",context:"standalone"})||r.month(e,{width:"narrow",context:"standalone"})}},validate:function(e,t,r){return t>=0&&t<=11},set:function(e,t,r,n){return e.setUTCMonth(r,1),e.setUTCHours(0,0,0,0),e}},w:{priority:100,parse:function(e,t,r,n){switch(t){case"w":return lr(zt,e);case"wo":return r.ordinalNumber(e,{unit:"week"});default:return hr(t.length,e)}},validate:function(e,t,r){return t>=1&&t<=53},set:function(e,t,r,n){return Object(Pt.a)(function(e,t,r){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var n=Object(s.a)(e),o=Object(i.a)(t),a=Object(xt.a)(n,r)-o;return n.setUTCDate(n.getUTCDate()-7*a),n}(e,r,n),n)}},I:{priority:100,parse:function(e,t,r,n){switch(t){case"I":return lr(zt,e);case"Io":return r.ordinalNumber(e,{unit:"week"});default:return hr(t.length,e)}},validate:function(e,t,r){return t>=1&&t<=53},set:function(e,t,r,n){return Object(Ut.a)(function(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(s.a)(e),n=Object(i.a)(t),o=Object(Bt.a)(r)-n;return r.setUTCDate(r.getUTCDate()-7*o),r}(e,r,n),n)}},d:{priority:90,parse:function(e,t,r,n){switch(t){case"d":return lr(Wt,e);case"do":return r.ordinalNumber(e,{unit:"date"});default:return hr(t.length,e)}},validate:function(e,t,r){var n=_r(e.getUTCFullYear()),i=e.getUTCMonth();return n?t>=1&&t<=br[i]:t>=1&&t<=yr[i]},set:function(e,t,r,n){return e.setUTCDate(r),e.setUTCHours(0,0,0,0),e}},D:{priority:90,parse:function(e,t,r,n){switch(t){case"D":case"DD":return lr(Ht,e);case"Do":return r.ordinalNumber(e,{unit:"date"});default:return hr(t.length,e)}},validate:function(e,t,r){return _r(e.getUTCFullYear())?t>=1&&t<=366:t>=1&&t<=365},set:function(e,t,r,n){return e.setUTCMonth(0,r),e.setUTCHours(0,0,0,0),e}},E:{priority:90,parse:function(e,t,r,n){switch(t){case"E":case"EE":case"EEE":return r.day(e,{width:"abbreviated",context:"formatting"})||r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return r.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"});case"EEEE":default:return r.day(e,{width:"wide",context:"formatting"})||r.day(e,{width:"abbreviated",context:"formatting"})||r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"})}},validate:function(e,t,r){return t>=0&&t<=6},set:function(e,t,r,n){return(e=Lt(e,r,n)).setUTCHours(0,0,0,0),e}},e:{priority:90,parse:function(e,t,r,n){var i=function(e){var t=7*Math.floor((e-1)/7);return(e+n.weekStartsOn+6)%7+t};switch(t){case"e":case"ee":return hr(t.length,e,i);case"eo":return r.ordinalNumber(e,{unit:"day",valueCallback:i});case"eee":return r.day(e,{width:"abbreviated",context:"formatting"})||r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"});case"eeeee":return r.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"});case"eeee":default:return r.day(e,{width:"wide",context:"formatting"})||r.day(e,{width:"abbreviated",context:"formatting"})||r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"})}},validate:function(e,t,r){return t>=0&&t<=6},set:function(e,t,r,n){return(e=Lt(e,r,n)).setUTCHours(0,0,0,0),e}},c:{priority:90,parse:function(e,t,r,n){var i=function(e){var t=7*Math.floor((e-1)/7);return(e+n.weekStartsOn+6)%7+t};switch(t){case"c":case"cc":return hr(t.length,e,i);case"co":return r.ordinalNumber(e,{unit:"day",valueCallback:i});case"ccc":return r.day(e,{width:"abbreviated",context:"standalone"})||r.day(e,{width:"short",context:"standalone"})||r.day(e,{width:"narrow",context:"standalone"});case"ccccc":return r.day(e,{width:"narrow",context:"standalone"});case"cccccc":return r.day(e,{width:"short",context:"standalone"})||r.day(e,{width:"narrow",context:"standalone"});case"cccc":default:return r.day(e,{width:"wide",context:"standalone"})||r.day(e,{width:"abbreviated",context:"standalone"})||r.day(e,{width:"short",context:"standalone"})||r.day(e,{width:"narrow",context:"standalone"})}},validate:function(e,t,r){return t>=0&&t<=6},set:function(e,t,r,n){return(e=Lt(e,r,n)).setUTCHours(0,0,0,0),e}},i:{priority:90,parse:function(e,t,r,n){var i=function(e){return 0===e?7:e};switch(t){case"i":case"ii":return hr(t.length,e);case"io":return r.ordinalNumber(e,{unit:"day"});case"iii":return r.day(e,{width:"abbreviated",context:"formatting",valueCallback:i})||r.day(e,{width:"short",context:"formatting",valueCallback:i})||r.day(e,{width:"narrow",context:"formatting",valueCallback:i});case"iiiii":return r.day(e,{width:"narrow",context:"formatting",valueCallback:i});case"iiiiii":return r.day(e,{width:"short",context:"formatting",valueCallback:i})||r.day(e,{width:"narrow",context:"formatting",valueCallback:i});case"iiii":default:return r.day(e,{width:"wide",context:"formatting",valueCallback:i})||r.day(e,{width:"abbreviated",context:"formatting",valueCallback:i})||r.day(e,{width:"short",context:"formatting",valueCallback:i})||r.day(e,{width:"narrow",context:"formatting",valueCallback:i})}},validate:function(e,t,r){return t>=1&&t<=7},set:function(e,t,r,n){return(e=function(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(i.a)(t);r%7==0&&(r-=7);var n=1,o=Object(s.a)(e),a=o.getUTCDay(),u=r%7,c=(u+7)%7,l=(c<n?7:0)+r-a;return o.setUTCDate(o.getUTCDate()+l),o}(e,r,n)).setUTCHours(0,0,0,0),e}},a:{priority:80,parse:function(e,t,r,n){switch(t){case"a":case"aa":case"aaa":return r.dayPeriod(e,{width:"abbreviated",context:"formatting"})||r.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return r.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(e,{width:"wide",context:"formatting"})||r.dayPeriod(e,{width:"abbreviated",context:"formatting"})||r.dayPeriod(e,{width:"narrow",context:"formatting"})}},set:function(e,t,r,n){return e.setUTCHours(gr(r),0,0,0),e}},b:{priority:80,parse:function(e,t,r,n){switch(t){case"b":case"bb":case"bbb":return r.dayPeriod(e,{width:"abbreviated",context:"formatting"})||r.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return r.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(e,{width:"wide",context:"formatting"})||r.dayPeriod(e,{width:"abbreviated",context:"formatting"})||r.dayPeriod(e,{width:"narrow",context:"formatting"})}},set:function(e,t,r,n){return e.setUTCHours(gr(r),0,0,0),e}},B:{priority:80,parse:function(e,t,r,n){switch(t){case"B":case"BB":case"BBB":return r.dayPeriod(e,{width:"abbreviated",context:"formatting"})||r.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return r.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(e,{width:"wide",context:"formatting"})||r.dayPeriod(e,{width:"abbreviated",context:"formatting"})||r.dayPeriod(e,{width:"narrow",context:"formatting"})}},set:function(e,t,r,n){return e.setUTCHours(gr(r),0,0,0),e}},h:{priority:70,parse:function(e,t,r,n){switch(t){case"h":return lr(Yt,e);case"ho":return r.ordinalNumber(e,{unit:"hour"});default:return hr(t.length,e)}},validate:function(e,t,r){return t>=1&&t<=12},set:function(e,t,r,n){var i=e.getUTCHours()>=12;return i&&r<12?e.setUTCHours(r+12,0,0,0):i||12!==r?e.setUTCHours(r,0,0,0):e.setUTCHours(0,0,0,0),e}},H:{priority:70,parse:function(e,t,r,n){switch(t){case"H":return lr(qt,e);case"Ho":return r.ordinalNumber(e,{unit:"hour"});default:return hr(t.length,e)}},validate:function(e,t,r){return t>=0&&t<=23},set:function(e,t,r,n){return e.setUTCHours(r,0,0,0),e}},K:{priority:70,parse:function(e,t,r,n){switch(t){case"K":return lr(Gt,e);case"Ko":return r.ordinalNumber(e,{unit:"hour"});default:return hr(t.length,e)}},validate:function(e,t,r){return t>=0&&t<=11},set:function(e,t,r,n){return e.getUTCHours()>=12&&r<12?e.setUTCHours(r+12,0,0,0):e.setUTCHours(r,0,0,0),e}},k:{priority:70,parse:function(e,t,r,n){switch(t){case"k":return lr(Vt,e);case"ko":return r.ordinalNumber(e,{unit:"hour"});default:return hr(t.length,e)}},validate:function(e,t,r){return t>=1&&t<=24},set:function(e,t,r,n){var i=r<=24?r%24:r;return e.setUTCHours(i,0,0,0),e}},m:{priority:60,parse:function(e,t,r,n){switch(t){case"m":return lr($t,e);case"mo":return r.ordinalNumber(e,{unit:"minute"});default:return hr(t.length,e)}},validate:function(e,t,r){return t>=0&&t<=59},set:function(e,t,r,n){return e.setUTCMinutes(r,0,0),e}},s:{priority:50,parse:function(e,t,r,n){switch(t){case"s":return lr(Kt,e);case"so":return r.ordinalNumber(e,{unit:"second"});default:return hr(t.length,e)}},validate:function(e,t,r){return t>=0&&t<=59},set:function(e,t,r,n){return e.setUTCSeconds(r,0),e}},S:{priority:30,parse:function(e,t,r,n){return hr(t.length,e,(function(e){return Math.floor(e*Math.pow(10,3-t.length))}))},set:function(e,t,r,n){return e.setUTCMilliseconds(r),e}},X:{priority:10,parse:function(e,t,r,n){switch(t){case"X":return fr(or,e);case"XX":return fr(ar,e);case"XXXX":return fr(sr,e);case"XXXXX":return fr(cr,e);case"XXX":default:return fr(ur,e)}},set:function(e,t,r,n){return t.timestampIsSet?e:new Date(e.getTime()-r)}},x:{priority:10,parse:function(e,t,r,n){switch(t){case"x":return fr(or,e);case"xx":return fr(ar,e);case"xxxx":return fr(sr,e);case"xxxxx":return fr(cr,e);case"xxx":default:return fr(ur,e)}},set:function(e,t,r,n){return t.timestampIsSet?e:new Date(e.getTime()-r)}},t:{priority:40,parse:function(e,t,r,n){return dr(e)},set:function(e,t,r,n){return[new Date(1e3*r),{timestampIsSet:!0}]}},T:{priority:20,parse:function(e,t,r,n){return dr(e)},set:function(e,t,r,n){return[new Date(r),{timestampIsSet:!0}]}}},vr=r(94),Er=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Sr=/^'(.*?)'?$/,Or=/''/g,Tr=/\S/;function Ar(e,t,r,n){if(arguments.length<3)throw new TypeError("3 arguments required, but only "+arguments.length+" present");var o=String(e),a=String(t),u=n||{},c=u.locale||pe.a;if(!c.match)throw new RangeError("locale must contain match property");var l=c.options&&c.options.firstWeekContainsDate,f=null==l?1:Object(i.a)(l),d=null==u.firstWeekContainsDate?f:Object(i.a)(u.firstWeekContainsDate);if(!(d>=1&&d<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var h=c.options&&c.options.weekStartsOn,p=null==h?0:Object(i.a)(h),g=null==u.weekStartsOn?p:Object(i.a)(u.weekStartsOn);if(!(g>=0&&g<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(""===a)return""===o?Object(s.a)(r):new Date(NaN);var m,y={firstWeekContainsDate:d,weekStartsOn:g,locale:c},b=[{priority:10,set:Mr,index:0}],_=a.match(Er);for(m=0;m<_.length;m++){var w=_[m];!u.awareOfUnicodeTokens&&Object(vr.a)(w)&&Object(vr.b)(w);var v=w[0],E=wr[v];if(E){var S=E.parse(o,w,c.match,y);if(!S)return new Date(NaN);b.push({priority:E.priority,set:E.set,validate:E.validate,value:S.value,index:b.length}),o=S.rest}else{if("''"===w?w="'":"'"===v&&(w=Dr(w)),0!==o.indexOf(w))return new Date(NaN);o=o.slice(w.length)}}if(o.length>0&&Tr.test(o))return new Date(NaN);var O=b.map((function(e){return e.priority})).sort((function(e,t){return t-e})).filter((function(e,t,r){return r.indexOf(e)===t})).map((function(e){return b.filter((function(t){return t.priority===e})).reverse()})).map((function(e){return e[0]})),T=Object(s.a)(r);if(isNaN(T))return new Date(NaN);var A=Object(ye.a)(T,Object(M.a)(T)),D={};for(m=0;m<O.length;m++){var I=O[m];if(I.validate&&!I.validate(A,I.value,y))return new Date(NaN);var j=I.set(A,D,I.value,y);j[0]?(A=j[0],de(D,j[1])):A=j}return A}function Mr(e,t){if(t.timestampIsSet)return e;var r=new Date(0);return r.setFullYear(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()),r.setHours(e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()),r}function Dr(e){return e.match(Sr)[1].replace(Or,"'")}var Ir=r(109);function jr(e,t){if(arguments.length<1)throw new TypeError("1 argument required, but only none provided present");var r=t&&"nearestTo"in t?Object(i.a)(t.nearestTo):1;if(r<1||r>30)throw new RangeError("`options.nearestTo` must be between 1 and 30");var n=Object(s.a)(e),o=n.getSeconds(),a=n.getMinutes()+o/60,u=Math.floor(a/r)*r,c=a%r,l=Math.round(c/r)*r;return new Date(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),u+l)}function Rr(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(s.a)(e),n=Object(i.a)(t);return r.setDate(n),r}function Nr(e,t,r){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var o=r||{},a=o.locale,u=a&&a.options&&a.options.weekStartsOn,c=null==u?0:Object(i.a)(u),l=null==o.weekStartsOn?c:Object(i.a)(o.weekStartsOn);if(!(l>=0&&l<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=Object(s.a)(e,o),d=Object(i.a)(t),h=f.getDay(),p=d%7,g=(p+7)%7,m=(g<l?7:0)+d-h;return Object(n.a)(f,m,o)}function kr(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(s.a)(e),n=Object(i.a)(t);return r.setMonth(0),r.setDate(n),r}function Cr(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(s.a)(e),n=Object(i.a)(t);return r.setHours(n),r}function Lr(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(s.a)(e),o=Object(i.a)(t),a=De(r),u=o-a;return Object(n.a)(r,u)}function xr(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(s.a)(e),n=Object(i.a)(t),o=Ie(r)-n;return r.setDate(r.getDate()-7*o),r}function Pr(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(s.a)(e),n=Object(i.a)(t);return r.setMilliseconds(n),r}function Br(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(s.a)(e),n=Object(i.a)(t);return r.setMinutes(n),r}function Ur(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(s.a)(e),n=Object(i.a)(t),o=r.getFullYear(),a=r.getDate(),u=new Date(0);u.setFullYear(o,n,15),u.setHours(0,0,0,0);var c=Object(Se.a)(u);return r.setMonth(n,Math.min(a,c)),r}function Fr(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(s.a)(e),n=Object(i.a)(t),o=Math.floor(r.getMonth()/3)+1,a=n-o;return Ur(r,r.getMonth()+3*a)}function Wr(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(s.a)(e),n=Object(i.a)(t);return r.setSeconds(n),r}function Hr(e,t,r){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var n=Object(s.a)(e),o=Object(i.a)(t),a=Fe(n,r)-o;return n.setDate(n.getDate()-7*a),n}function zr(e,t,r){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var n=r||{},o=n.locale,a=o&&o.options&&o.options.firstWeekContainsDate,u=null==a?1:Object(i.a)(a),c=null==n.firstWeekContainsDate?u:Object(i.a)(n.firstWeekContainsDate),l=Object(s.a)(e),f=Object(i.a)(t),h=Object(d.a)(l,Ue(l,r)),p=new Date(0);return p.setFullYear(f,0,c),p.setHours(0,0,0,0),(l=Ue(p,r)).setDate(l.getDate()+h),l}function qr(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(s.a)(e),n=Object(i.a)(t);return isNaN(r)?new Date(NaN):(r.setFullYear(n),r)}function Vr(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=Object(s.a)(e),r=t.getFullYear(),n=10*Math.floor(r/10);return t.setFullYear(n,0,1),t.setHours(0,0,0,0),t}var Gr=r(133);function Yr(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(i.a)(t);return a(e,-r)}function $r(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(i.a)(t);return g(e,-r)}var Kr=r(132);function Zr(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(i.a)(t);return y(e,-r)}function Xr(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(i.a)(t);return b(e,-r)}var Jr=r(249),Qr=r(250)},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(0);function i(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=Object(n.a)(e);return t.setDate(1),t.setHours(0,0,0,0),t}},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(0);function i(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=Object(n.a)(e);return!isNaN(t)}},function(e,t,r){"use strict";r.d(t,"d",(function(){return c})),r.d(t,"e",(function(){return l})),r.d(t,"a",(function(){return d})),r.d(t,"b",(function(){return h})),r.d(t,"c",(function(){return p}));var n=r(17),i=r(2);function o(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 a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach((function(t){s(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u(e,t){return t.required||"id"===e}function c(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 Object(n.h)(Object(i.f)(e));if(null==e.match(/^\d{4}-\d{2}-\d{2}$/)||e.date<"2000-01-01")throw new Error("Invalid date: "+e);return Object(n.h)(e);case"date-month":return Object(n.h)(e.slice(0,7));case"date-year":return Object(n.h)(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&&(0|e)===e)return e;throw new Error("Can't convert to integer: "+JSON.stringify(e));case"json":return JSON.stringify(e)}return e}function l(e,t){if(null===e)return"boolean"!==t&&null;switch(t){case"date":return Object(n.d)(e);case"date-month":return Object(n.d)(e).slice(0,7);case"date-year":return Object(n.d)(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 f(e,t,r,n,{skipNull:i}={}){let o=e[r];if(null==o)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=o[e];if(null==t)throw new Error(`Field "${e}" does not exist on table ${r}: ${JSON.stringify(n)}`);if(u(e,t)&&null==n[e])throw new Error(`"${e}" is required for table "${r}": ${JSON.stringify(n)}`);return i&&null==n[e]?null:[s(e),c(n[e],t.type)]}).filter(Boolean))}function d(e,t,r,n){let i=a({},n),o=e[r];if(null==o)throw new Error(`Error inserting: table "${r}" does not exist`);return Object.keys(o).forEach(e=>{let t=o[e];if(null==i[e])if(void 0!==t.default)i[e]="function"==typeof t.default?t.default():t.default;else if(u(e,t))throw new Error(`"${e}" is required for table "${r}": ${JSON.stringify(i)}`)}),f(e,t,r,i,{skipNull:!0})}function h(e,t,r,n){let i=a({},n);if(null==e[r])throw new Error(`Error updating: table "${r}" does not exist`);return f(e,t,r,i)}function p(e,t,r,n){let i=e[r];if(null==i)throw new Error(`Table "${r}" does not exist`);let o=Object.keys(i),a={};for(let e=0;e<o.length;e++){let t=o[e],r=i[t];a[t]=l(n[t],r.type)}return a}},function(e,t,r){"use strict";r.d(t,"a",(function(){return l}));r(5);var n=r(7),i=r(1),o=r(108),a=r(111),s=r(21);const u=r(52);async function c(e){return Object(o.a)((e,t)=>i.selectWithSchema("transactions",e,t),e,e=>`id = '${e}'`,e=>"SELECT * FROM v_transactions_internal WHERE "+e)}async function l({added:e,deleted:t,updated:r,learnCategories:l=!1,detectOrphanPayees:f=!0}){let d=[],h=r?r.map(e=>e.id):[],p=t?await async function(e){let t=Object(o.b)(e,"parent_id"),r=await i.all("SELECT id FROM v_transactions_internal WHERE "+t),n=new Set(e);for(let e of r)n.add(e.id);return[...n]}(t.map(e=>e.id)):[],g=new Set,m=await i.all("SELECT * FROM accounts WHERE tombstone = 0");if(r){let e=r.filter(e=>e.payee).map(e=>e.id),t=await c(e);for(let e=0;e<t.length;e++)g.add(t[e].payee)}await Object(n.c)(async()=>{e&&(d=await Promise.all(e.map(async e=>i.insertTransaction(e)))),t&&await Promise.all(p.map(async e=>{await i.deleteTransaction({id:e})})),r&&await Promise.all(r.map(async e=>{if(e.account){1===m.find(t=>t.id===e.account).offbudget&&(e.category=null)}await i.updateTransaction(e)}))});let y,b=await c(d),_=await c(h),w=await c(p),v=b;if(await Object(n.c)(async()=>{await Promise.all(b.map(e=>a.b(e))),y=(await Promise.all(_.map(e=>a.c(e)))).filter(Boolean),await Promise.all(w.map(e=>a.a(e)))}),l){let t=new Set([...e?e.filter(e=>e.category).map(e=>e.id):[],...r?r.filter(e=>e.category).map(e=>e.id):[]]);await s.l(b.concat(_).filter(e=>t.has(e.id)))}if(f&&r){let e=r.map(e=>e.payee).filter(Boolean);if(e.length>0){let t=new Set(await i.getOrphanedPayees()),r=[...g].filter(e=>t.has(e));r.length>0&&u.send("orphaned-payees",{orphanedIds:r,updatedPayeeIds:e})}}return{added:v,updated:y}}},function(e,t,r){"use strict";t.a={info:(...e)=>{console.log(...e)},warn:(...e)=>{console.warn(...e)}}},function(e,t,r){"use strict";var n=r(16).Buffer,i=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 o(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===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=c,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=l,this.end=f,t=3;break;default:return this.write=d,void(this.end=h)}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,"<22>";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"<22>";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"<22>"}}(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 c(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 l(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 h(e){return e&&e.length?this.write(e):""}t.StringDecoder=o,o.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||""},o.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"<22>":t},o.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var i=a(t[n]);if(i>=0)return i>0&&(e.lastNeed=i-1),i;if(--n<r||-2===i)return 0;if((i=a(t[n]))>=0)return i>0&&(e.lastNeed=i-2),i;if(--n<r||-2===i)return 0;if((i=a(t[n]))>=0)return i>0&&(2===i?i=0:e.lastNeed=i-3),i;return 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)},o.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}},function(e,t,r){var n=r(16).Buffer,i=r(99).Transform,o=r(70).StringDecoder;function a(e){i.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}r(11)(a,i),a.prototype.update=function(e,t,r){"string"==typeof e&&(e=n.from(e,t));var i=this._update(e);return this.hashMode?this:(r&&(i=this._toString(i,r)),i)},a.prototype.setAutoPadding=function(){},a.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},a.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},a.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},a.prototype._transform=function(e,t,r){var n;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){n=e}finally{r(n)}},a.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)},a.prototype._finalOrDigest=function(e){var t=this.__final()||n.alloc(0);return e&&(t=this._toString(t,e,!0)),t},a.prototype._toString=function(e,t,r){if(this._decoder||(this._decoder=new o(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var n=this._decoder.write(e);return r&&(n+=this._decoder.end()),n},e.exports=a},function(e,t,r){"use strict";var n=r(122);e.exports=function(){return n()&&!!Symbol.toStringTag}},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(3),i=r(47);function o(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(n.a)(t),o=7*r;return Object(i.a)(e,o)}},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(0);function i(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=Object(n.a)(e);return t.setHours(0,0,0,0),t}},function(e,t,r){"use strict";function n(e){return Object.keys(e).filter(e=>"hash"!==e)}function i(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(t.millis()/1e3/60|0).toString(3);return function e(t,r,n){if(0===r.length)return t;const i=r[0],o=t[i]||{};return Object.assign({},t,{[i]:Object.assign({},o,e(o,r.slice(1),n),{hash:o.hash^n})})}(e=Object.assign({},e,{hash:e.hash^r}),n,r)}function a(e){let t={};for(let r of e)o(t,r);return t}function s(e,t){if(e.hash===t.hash)return null;let r=e,o=t,a="";for(;;){let e=[...new Set([...n(r),...n(o)]).values()];e.sort();let t=null;for(let n=0;n<e.length;n++){let i=e[n];if(!r[i]||!o[i])break;let a=r[i],s=o[i];if(a.hash!==s.hash){t=i;break}}if(!t)return i(a);a+=t,r=r[t]||{},o=o[t]||{}}}function u(e,t=2){if(!e.hash)return e;let r=n(e);r.sort();let i={hash:e.hash};return r=r.slice(-t).map(r=>i[r]=u(e[r],t)),i}function c(e,t="",r=0){return" ".repeat(r)+(""!==t?`k: ${t} `:"")+`hash: ${e.hash||"(empty)"}\n`+n(e).map(t=>c(e[t],t,r+2)).join("")}r.r(t),r.d(t,"getKeys",(function(){return n})),r.d(t,"keyToTimestamp",(function(){return i})),r.d(t,"insert",(function(){return o})),r.d(t,"build",(function(){return a})),r.d(t,"diff",(function(){return s})),r.d(t,"prune",(function(){return u})),r.d(t,"debug",(function(){return c}))},function(e,t,r){"use strict";(function(e){r.d(t,"f",(function(){return i})),r.d(t,"e",(function(){return o})),r.d(t,"c",(function(){return a})),r.d(t,"b",(function(){return s})),r.d(t,"a",(function(){return u})),r.d(t,"d",(function(){return c}));function n(e){switch(e){case"aes-256-gcm":return"AES-GCM";default:throw new Error("unsupported crypto algorithm: "+e)}}async function i(e){let t=new TextEncoder("utf-8").encode(e).buffer,r=await crypto.subtle.digest("sha-256",t),n=Array.from(new Uint8Array(r)).map(e=>String.fromCharCode(e)).join("");return btoa(n)}function o(t){return e.from(crypto.getRandomValues(new Uint8Array(t)))}async function a(t,r){let i=crypto.getRandomValues(new Uint8Array(12)),o=await crypto.subtle.encrypt({name:n("aes-256-gcm"),iv:i,tagLength:128},t.getValue().raw,r);o=e.from(o);let a=o.slice(-16);return o=o.slice(0,-16),{value:o,meta:{keyId:t.getId(),algorithm:"aes-256-gcm",iv:e.from(i).toString("base64"),authTag:a.toString("base64")}}}async function s(t,r,i){let o=i.algorithm,a=i.iv,s=i.authTag,u=await crypto.subtle.decrypt({name:n(o),iv:e.from(a,"base64"),tagLength:128},t.getValue().raw,e.concat([r,e.from(s,"base64")]));return e.from(u)}async function u({secret:t,salt:r}){let n=e.from(t),i=e.from(r),o=await crypto.subtle.importKey("raw",n,{name:"PBKDF2"},!1,["deriveBits","deriveKey"]),a=await crypto.subtle.deriveKey({name:"PBKDF2",hash:"SHA-512",salt:i,iterations:1e4},o,{name:"AES-GCM",length:256},!0,["encrypt","decrypt"]),s=await crypto.subtle.exportKey("raw",a);return{raw:a,base64:e.from(s).toString("base64")}}async function c(t){return{raw:await crypto.subtle.importKey("raw",e.from(t,"base64"),{name:"AES-GCM"},!1,["encrypt","decrypt"]),base64:t}}}).call(this,r(10).Buffer)},function(e,t,r){"use strict";r.d(t,"b",(function(){return d})),r.d(t,"c",(function(){return h})),r.d(t,"d",(function(){return p})),r.d(t,"e",(function(){return b})),r.d(t,"a",(function(){return _}));var n=r(12);const i=["subtransactions"];function o(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function a(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 s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){u(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function u(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const c=r(42);function l(e){return"number"==typeof e?e:0}function f(e,t){return{type:"SplitTransactionError",version:1,difference:l(t.amount)-e}}function d(e,t){let r="temp"===e.id?"temp":"";return s(s({amount:0},t),{},{payee:t.payee||e.payee,id:t.id?t.id:r+c.v4Sync(),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 h(e){const t=e.subtransactions.reduce((e,t)=>e+l(t.amount),0);return s(s({},e),{},{error:t===l(e.amount)?null:f(t,e)})}function p(e){return e.reduce((e,t)=>{let r=t.subtransactions,n=o(t,i);r=r||[],e.push(n);for(let t=0;t<r.length;t++)e.push(r[t]);return e},[])}function g(e){return s(s({},e[0]),{},{subtransactions:e.slice(1)})}function m(e){return null==e?null:p([e])}function y(e,t,r){let i=e.findIndex(e=>e.id===t),o=e[i],a=[...e];if(-1===i)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,i);if(null==t)return console.log("Cannot find parent index"),{diff:{deleted:[],updated:[]}};let o,s=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),u=r(g(s)),c=m(u);return null==c?(o={deleted:[{id:s[0].id}],updated:[]},u={id:s[0].id,_deleted:!0},a.splice(t,s.length)):(o=Object(n.d)(s,c),a.splice(t,s.length,...c)),{data:a,newTransaction:u,diff:o}}{let e=r(o),t=m(e)||[];return e&&(e.subtransactions=e.subtransactions||[]),a.splice(i,1,...t),{data:a,newTransaction:e||{id:o.id,_deleted:!0},diff:Object(n.d)([o],t)}}}function b(e,t){return y(e,t.id,e=>{if(e.is_parent){let r=e.id===t.id?t:e,n=e.subtransactions.map(n=>{let i=n;return e.id===t.id?i=s(s({},n),{},{payee:n.payee===e.payee?t.payee:n.payee}):n.id===t.id&&(i=t),d(r,i)});return h(s(s({},r),{},{subtransactions:n}))}return t})}function _(e,t){return y(e,t,e=>{if(e.is_parent){if(e.id===t)return null;if(1===e.subtransactions.length)return s(s({},e),{},{subtransactions:null,is_parent:!1,error:null});{let r=e.subtransactions.filter(e=>e.id!==t);return h(s(s({},e),{},{subtransactions:r}))}}return null})}},function(e,t,r){"use strict";var n=function(e,t){return e===t};t.a=function(e,t){var r;void 0===t&&(t=n);var i,o=[],a=!1,s=function(e,r){return t(e,o[r],r)};return function(){for(var t=arguments.length,n=new Array(t),u=0;u<t;u++)n[u]=arguments[u];return a&&r===this&&n.length===o.length&&n.every(s)||(i=e.apply(this,n),a=!0,r=this,o=n),i}}},function(e,t,r){"use strict";var n=r(114),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=f;var o=Object.create(r(100));o.inherits=r(11);var a=r(186),s=r(144);o.inherits(f,a);for(var u=i(s.prototype),c=0;c<u.length;c++){var l=u[c];f.prototype[l]||(f.prototype[l]=s.prototype[l])}function f(e){if(!(this instanceof f))return new f(e);a.call(this,e),s.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",d)}function d(){this.allowHalfOpen||this._writableState.ended||n.nextTick(h,this)}function h(e){e.end()}Object.defineProperty(f.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(f.prototype,"destroyed",{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)}}),f.prototype._destroy=function(e,t){this.push(null),this.end(),n.nextTick(t,e)}},function(e,t,r){"use strict";var n=SyntaxError,i=Function,o=TypeError,a=function(e){try{return i('"use strict"; return ('+e+").constructor;")()}catch(e){}},s=Object.getOwnPropertyDescriptor;if(s)try{s({},"")}catch(e){s=null}var u=function(){throw new o},c=s?function(){try{return u}catch(e){try{return s(arguments,"callee").get}catch(e){return u}}}():u,l=r(166)(),f=Object.getPrototypeOf||function(e){return e.__proto__},d={},h="undefined"==typeof Uint8Array?void 0:f(Uint8Array),p={"%AggregateError%":"undefined"==typeof AggregateError?void 0:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?void 0:ArrayBuffer,"%ArrayIteratorPrototype%":l?f([][Symbol.iterator]()):void 0,"%AsyncFromSyncIteratorPrototype%":void 0,"%AsyncFunction%":d,"%AsyncGenerator%":d,"%AsyncGeneratorFunction%":d,"%AsyncIteratorPrototype%":d,"%Atomics%":"undefined"==typeof Atomics?void 0:Atomics,"%BigInt%":"undefined"==typeof BigInt?void 0:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?void 0:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?void 0:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?void 0:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?void 0:FinalizationRegistry,"%Function%":i,"%GeneratorFunction%":d,"%Int8Array%":"undefined"==typeof Int8Array?void 0:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?void 0:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?void 0:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":l?f(f([][Symbol.iterator]())):void 0,"%JSON%":"object"==typeof JSON?JSON:void 0,"%Map%":"undefined"==typeof Map?void 0:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&l?f((new Map)[Symbol.iterator]()):void 0,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?void 0:Promise,"%Proxy%":"undefined"==typeof Proxy?void 0:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?void 0:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?void 0:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&l?f((new Set)[Symbol.iterator]()):void 0,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?void 0:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":l?f(""[Symbol.iterator]()):void 0,"%Symbol%":l?Symbol:void 0,"%SyntaxError%":n,"%ThrowTypeError%":c,"%TypedArray%":h,"%TypeError%":o,"%Uint8Array%":"undefined"==typeof Uint8Array?void 0:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?void 0:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?void 0:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?void 0:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?void 0:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?void 0:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?void 0:WeakSet},g={"%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"]},m=r(167),y=r(443),b=m.call(Function.call,Array.prototype.concat),_=m.call(Function.apply,Array.prototype.splice),w=m.call(Function.call,String.prototype.replace),v=m.call(Function.call,String.prototype.slice),E=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,S=/\\(\\)?/g,O=function(e){var t=v(e,0,1),r=v(e,-1);if("%"===t&&"%"!==r)throw new n("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new n("invalid intrinsic syntax, expected opening `%`");var i=[];return w(e,E,(function(e,t,r,n){i[i.length]=r?w(n,S,"$1"):t||e})),i},T=function(e,t){var r,i=e;if(y(g,i)&&(i="%"+(r=g[i])[0]+"%"),y(p,i)){var s=p[i];if(s===d&&(s=function e(t){var r;if("%AsyncFunction%"===t)r=a("async function () {}");else if("%GeneratorFunction%"===t)r=a("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=a("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var i=e("%AsyncGenerator%");i&&(r=f(i.prototype))}return p[t]=r,r}(i)),void 0===s&&!t)throw new o("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:i,value:s}}throw new n("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new o("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new o('"allowMissing" argument must be a boolean');var r=O(e),i=r.length>0?r[0]:"",a=T("%"+i+"%",t),u=a.name,c=a.value,l=!1,f=a.alias;f&&(i=f[0],_(r,b([0,1],f)));for(var d=1,h=!0;d<r.length;d+=1){var g=r[d],m=v(g,0,1),w=v(g,-1);if(('"'===m||"'"===m||"`"===m||'"'===w||"'"===w||"`"===w)&&m!==w)throw new n("property names with quotes must have matching quotes");if("constructor"!==g&&h||(l=!0),y(p,u="%"+(i+="."+g)+"%"))c=p[u];else if(null!=c){if(!(g in c)){if(!t)throw new o("base intrinsic for "+e+" exists, but the property is not available.");return}if(s&&d+1>=r.length){var E=s(c,g);c=(h=!!E)&&"get"in E&&!("originalValue"in E.get)?E.get:c[g]}else h=y(c,g),c=c[g];h&&!l&&(p[u]=c)}}return c}},function(e,t,r){"use strict";var n=r(165),i="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),o=Object.prototype.toString,a=Array.prototype.concat,s=Object.defineProperty,u=s&&function(){var e={};try{for(var t in s(e,"x",{enumerable:!1,value:e}),e)return!1;return e.x===e}catch(e){return!1}}(),c=function(e,t,r,n){var i;(!(t in e)||"function"==typeof(i=n)&&"[object Function]"===o.call(i)&&n())&&(u?s(e,t,{configurable:!0,enumerable:!1,value:r,writable:!0}):e[t]=r)},l=function(e,t){var r=arguments.length>2?arguments[2]:{},o=n(t);i&&(o=a.call(o,Object.getOwnPropertySymbols(t)));for(var s=0;s<o.length;s+=1)c(e,o[s],t[o[s]],r[o[s]])};l.supportsDescriptors=!!u,e.exports=l},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(0);function i(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=Object(n.a)(e),r=t.getMonth();return t.setFullYear(t.getFullYear(),r+1,0),t.setHours(23,59,59,999),t}},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 i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var i=r(139),o=r(180),a=r(295),s=r(315),u=s.fsSyncMethods,c=s.fsAsyncMethods,l=r(98),f=l.constants.F_OK,d=l.constants.R_OK,h=l.constants.W_OK,p=l.constants.X_OK;function g(e){for(var t={F_OK:f,R_OK:d,W_OK:h,X_OK:p,constants:l.constants,Stats:i.default,Dirent:o.default},r=0,n=u;r<n.length;r++){"function"==typeof e[m=n[r]]&&(t[m]=e[m].bind(e))}for(var s=0,g=c;s<g.length;s++){var m;"function"==typeof e[m=g[s]]&&(t[m]=e[m].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=g,t.fs=g(t.vol),e.exports=n(n({},e.exports),t.fs),e.exports.semantic=!0},function(e,t,r){"use strict";(function(t,n){var i=r(16).Buffer,o=t.crypto||t.msCrypto;o&&o.getRandomValues?e.exports=function(e,t){if(e>4294967295)throw new RangeError("requested too many random bytes");var r=i.allocUnsafe(e);if(e>0)if(e>65536)for(var a=0;a<e;a+=65536)o.getRandomValues(r.slice(a,a+65536));else o.getRandomValues(r);if("function"==typeof t)return n.nextTick((function(){t(null,r)}));return r}:e.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}}).call(this,r(23),r(19))},function(e,t,r){"use strict";var n={};function i(e,t,r){r||(r=Error);var i=function(e){var r,n;function i(r,n,i){return e.call(this,function(e,r,n){return"string"==typeof t?t:t(e,r,n)}(r,n,i))||this}return n=e,(r=i).prototype=Object.create(n.prototype),r.prototype.constructor=r,r.__proto__=n,i}(r);i.prototype.name=r.name,i.prototype.code=e,n[e]=i}function o(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))}i("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),i("ERR_INVALID_ARG_TYPE",(function(e,t,r){var n,i,a,s;if("string"==typeof t&&(i="not ",t.substr(!a||a<0?0:+a,i.length)===i)?(n="must not be",t=t.replace(/^not /,"")):n="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))s="The ".concat(e," ").concat(n," ").concat(o(t,"type"));else{var u=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";s='The "'.concat(e,'" ').concat(u," ").concat(n," ").concat(o(t,"type"))}return s+=". Received type ".concat(typeof r)}),TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=n},function(e,t,r){"use strict";(function(t){var n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=c;var i=r(192),o=r(196);r(11)(c,i);for(var a=n(o.prototype),s=0;s<a.length;s++){var u=a[s];c.prototype[u]||(c.prototype[u]=o.prototype[u])}function c(e){if(!(this instanceof c))return new c(e);i.call(this,e),o.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",l)))}function l(){this._writableState.ended||t.nextTick(f,this)}function f(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)}})}).call(this,r(19))},function(e,t,r){var n=r(16).Buffer;function i(e,t){this._block=n.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}i.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=n.from(e,t));for(var r=this._block,i=this._blockSize,o=e.length,a=this._len,s=0;s<o;){for(var u=a%i,c=Math.min(o-s,i-u),l=0;l<c;l++)r[u+l]=e[s+l];s+=c,(a+=c)%i==0&&this._update(r)}return this._len+=o,this},i.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=i},function(e,t,r){"use strict";var n={};function i(e,t,r){r||(r=Error);var i=function(e){var r,n;function i(r,n,i){return e.call(this,function(e,r,n){return"string"==typeof t?t:t(e,r,n)}(r,n,i))||this}return n=e,(r=i).prototype=Object.create(n.prototype),r.prototype.constructor=r,r.__proto__=n,i}(r);i.prototype.name=r.name,i.prototype.code=e,n[e]=i}function o(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))}i("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),i("ERR_INVALID_ARG_TYPE",(function(e,t,r){var n,i,a,s;if("string"==typeof t&&(i="not ",t.substr(!a||a<0?0:+a,i.length)===i)?(n="must not be",t=t.replace(/^not /,"")):n="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))s="The ".concat(e," ").concat(n," ").concat(o(t,"type"));else{var u=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";s='The "'.concat(e,'" ').concat(u," ").concat(n," ").concat(o(t,"type"))}return s+=". Received type ".concat(typeof r)}),TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=n},function(e,t,r){"use strict";(function(t){var n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=c;var i=r(217),o=r(221);r(11)(c,i);for(var a=n(o.prototype),s=0;s<a.length;s++){var u=a[s];c.prototype[u]||(c.prototype[u]=o.prototype[u])}function c(e){if(!(this instanceof c))return new c(e);i.call(this,e),o.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",l)))}function l(){this._writableState.ended||t.nextTick(f,this)}function f(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)}})}).call(this,r(19))},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(0);function i(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=Object(n.a)(e),r=t.getFullYear(),i=t.getMonth(),o=new Date(0);return o.setFullYear(r,i+1,0),o.setHours(0,0,0,0),o.getDate()}},function(e,t,r){"use strict";function n(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,i,o){t.running=e(...n),t.running.then(e=>{r(),i(e)},e=>{r(),o(e)})}return(...e)=>t.running?new Promise((r,n)=>{t.queue.push({resolve:r,reject:n,args:e})}):new Promise((t,r)=>n(e,t,r))}function i(e){let t=null;return(...r)=>t||(t=e(...r).finally(()=>{t=null}),t)}r.r(t),r.d(t,"sequential",(function(){return n})),r.d(t,"once",(function(){return i}))},function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(3),i=r(0),o=r(51);function a(e,t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var r=Object(i.a)(e,t),a=r.getUTCFullYear(),s=t||{},u=s.locale,c=u&&u.options&&u.options.firstWeekContainsDate,l=null==c?1:Object(n.a)(c),f=null==s.firstWeekContainsDate?l:Object(n.a)(s.firstWeekContainsDate);if(!(f>=1&&f<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var d=new Date(0);d.setUTCFullYear(a+1,0,f),d.setUTCHours(0,0,0,0);var h=Object(o.a)(d,t),p=new Date(0);p.setUTCFullYear(a,0,f),p.setUTCHours(0,0,0,0);var g=Object(o.a)(p,t);return r.getTime()>=h.getTime()?a+1:r.getTime()>=g.getTime()?a:a-1}},function(e,t,r){"use strict";r.d(t,"a",(function(){return Ce}));class n extends Error{}let i;class o{constructor(e,t){if(this.duration=t&&t.duration||0,this.generators=t&&t.generators&&t.generators.slice()||[],!Number.isInteger(this.duration)||this.duration<0)throw new n("duration must be a non-negative integer")}static set adapter(e){if(i)throw new Error(`"${i.name}" has already been configured.`);i=e}static get adapter(){if(!i)throw new Error("No date adapter has been configured. See rSchedule docs.");return i}static isDate(e){throw a("isDate()")}static fromDate(e,t){throw a("fromDate()")}static fromJSON(e){throw a("fromJSON()")}static fromDateTime(e){throw a("fromDateTime()")}toISOString(){return this.set("timezone","UTC").toDateTime().toISOString()}toDateTime(){return c.fromJSON(Object.assign(Object.assign({},this.toJSON()),{generators:this.generators}))}}function a(e){return new Error(`You must implement the "${e}" method for this DateAdapter class`)}var s;o.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}(s||(s={}));class u extends Error{}class c{constructor(e,t,r,n){if(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 u("duration must be a non-negative integer");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 c(t,e.timezone,e.duration,e.generators)}static fromDateAdapter(e){return c.fromJSON(Object.assign(Object.assign({},e.toJSON()),{generators:e.generators}))}get end(){if(this.duration)return this._end||(this._end=this.add(this.duration,"millisecond")),this._end}isEqual(e){return!!e&&(l(this,e),this.valueOf()===e.valueOf())}isBefore(e){return l(this,e),this.valueOf()<e.valueOf()}isBeforeOrEqual(e){return l(this,e),this.valueOf()<=e.valueOf()}isAfter(e){return l(this,e),this.valueOf()>e.valueOf()}isAfterOrEqual(e){return l(this,e),this.valueOf()>=e.valueOf()}isOccurring(e){if(!this.duration)throw new Error("DateTime#isOccurring() is only applicable to DateTimes with durations");return l(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 c(this.date,this.timezone,this.duration,t)}case"year":return this.forkDateTime(v(this.date,e));case"month":return this.forkDateTime(E(this.date,e));case"week":return this.forkDateTime(S(this.date,e));case"day":return this.forkDateTime(O(this.date,e));case"hour":return this.forkDateTime(T(this.date,e));case"minute":return this.forkDateTime(A(this.date,e));case"second":return this.forkDateTime(M(this.date,e));case"millisecond":return this.forkDateTime(D(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 v(e,-t)}(this.date,e));case"month":return this.forkDateTime(function(e,t){return E(e,-t)}(this.date,e));case"week":return this.forkDateTime(function(e,t){return S(e,-t)}(this.date,e));case"day":return this.forkDateTime(I(this.date,e));case"hour":return this.forkDateTime(function(e,t){return T(e,-t)}(this.date,e));case"minute":return this.forkDateTime(function(e,t){return A(e,-t)}(this.date,e));case"second":return this.forkDateTime(function(e,t){return M(e,-t)}(this.date,e));case"millisecond":return this.forkDateTime(function(e,t){return D(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/s.MILLISECONDS_IN_DAY)}(this.date);case"weekday":return s.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 c(this.date,this.timezone,t,this.generators);if("generators"===e)return new c(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=m(t,r.getUTCFullYear());r.getUTCDate()>e?(r.setUTCDate(1),r.setUTCMonth(t),r=I(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,t={}){let 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=h(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,t={}){let r=this.forkDateTime(this.date);switch(e){case"year":r=r.set("month",12);case"month":r=r.set("day",m(r.get("month"),r.get("year")));break;case"week":r=function(e,t){const r=h(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 u("DateTime has invalid date.");return!0}forkDateTime(e){return new c(e,this.timezone,this.duration,this.generators)}}function l(e,t){if(e.timezone!==t.timezone)throw new u("Attempted to compare a datetime to another date in a different timezone: "+JSON.stringify(e)+" and "+JSON.stringify(t));return!0}function f(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 d(e){return Array.from(new Map(e.map(e=>[e.toISOString(),e])).values())}function h(e="SU"){const t=s.WEEKDAYS.slice();let r=t.indexOf(e);for(;0!==r;)p(t),r--;return t}function p(e,t="first"){return 0===e.length||("first"===t?e.push(e.shift()):e.unshift(e.pop())),e}function g(e,t){if(e===t)return 0;const r=s.WEEKDAYS.indexOf(e)-s.WEEKDAYS.indexOf(t);return r>0?7-r:Math.abs(r)}function m(e,t){return{1:31,2:y(t),3:31,4:30,5:31,6:30,7:31,8:31,9:30,10:31,11:30,12:31}[e]}function y(e){return b(e)?29:28}function b(e){return e%400==0||e%4==0&&e%100!=0}function _(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 w(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");const r=e.valueOf(),n=_(t);return new Date(r+n)}function v(e,t){return E(e,12*_(t))}function E(e,t){const r=_(t),n=(e=new Date(e)).getUTCMonth()+r,i=new Date(0);i.setUTCFullYear(e.getUTCFullYear(),n,1),i.setUTCHours(0,0,0,0);const o=m(i.getUTCMonth()+1,i.getUTCFullYear());return e.setUTCMonth(n,Math.min(o,e.getUTCDate())),e}function S(e,t){return O(e,7*_(t))}function O(e,t){return D(e,_(t)*s.MILLISECONDS_IN_DAY)}function T(e,t){return w(e,_(t)*s.MILLISECONDS_IN_HOUR)}function A(e,t){return w(e,_(t)*s.MILLISECONDS_IN_MINUTE)}function M(e,t){return w(e,_(t)*s.MILLISECONDS_IN_SECOND)}function D(e,t){const r=_(t),n=e.getTime();return new Date(n+r)}function I(e,t){return O(e,-t)}class j extends Error{}class R extends Error{}function N(e,t){return e>t?1:t>e?-1:0}function k(e){return JSON.parse(JSON.stringify(e))}function C(e,t){return e instanceof c?e.timezone!==t?o.adapter.fromDateTime(e).set("timezone",t).toDateTime():e:e instanceof o?e.set("timezone",t).toDateTime():o.adapter.fromDate(e).set("timezone",t).toDateTime()}function L(e,t){return e.timezone!==t?o.adapter.fromDateTime(e).set("timezone",t).toDateTime():e}class x extends Error{}function P(e,t){const r=function(e){let t,r;if(e.start instanceof c)t=e.start;else if(e.start instanceof o)t=e.start.toDateTime();else{if(!o.adapter.isDate(e.start))throw new x('"start" must be either a `DateAdapter` instance or an instance of the date a DateAdapter is wrapping (e.g. `StandardDateAdapter` wraps a `Date`)');t=o.adapter.fromDate(e.start).toDateTime()}if(e.end)if(e.end instanceof c)r=e.end;else if(e.end instanceof o)r=e.end.toDateTime();else{if(!o.adapter.isDate(e.end))throw new x('"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=o.adapter.fromDate(e.end).toDateTime()}if(void 0!==e.duration){if(!Number.isInteger(e.duration))throw new x('"duration" expects a whole number');if(e.duration<=0)throw new x('"duration" must be greater than 0')}if(void 0!==e.count){if(!Number.isInteger(e.count))throw new x('"count" must be a whole number');if(e.count<0)throw new x('"count" must be greater than 0')}if(void 0!==e.end&&void 0!==e.count)throw new x('"end" and "count" cannot both be present');return{start:t,end:r,count:e.count,duration:e.duration}}(t),n=k(t);return e.forEach(e=>{e.normalizeOptions(n,r)}),Object.keys(r).forEach(e=>{void 0===r[e]&&delete r[e]}),r}function B(e){const t=k(e);return t.start=e.start,e.end&&(t.end=e.end),t}class U extends Error{}class F{constructor(e){this.date=e}}class W{constructor(e){this.date=e}}class H{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({},k(t)),{start:t.start,end:t.end}),this.reverse=void 0===this.options.count&&r.reverse||!1;const n=this.normalizeDateTimeArgs(r),i=n.start,o=n.end;if(void 0!==t.count?this.start=t.start:i&&t.start?this.start=i.isAfterOrEqual(t.start)?i:t.start:this.start=i||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,i=1;for(;n&&i<=this.options.count;)if(i++,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 W&&r<50;){if(t=this.runRules(t.date),this.isDatePastEnd(t.date))return null;r++}if(t instanceof W)throw new U(`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 U("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 F(e);for(const e of this.rules){if(t instanceof W)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&&L(e.start,this.options.start.timezone),end:e.end&&L(e.end,this.options.start.timezone)}}}class z{constructor(e={}){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(...e){return e.reduce((e,t)=>t({base:e,timezone:this.timezone}),this)}occurrences(e={}){return new q(this,this.normalizeOccurrencesArgs(e))}collections(e={}){return new G(this,this.normalizeCollectionsArgs(e))}occursBetween(e,t,r={}){const n=this.normalizeDateInput(e),i=this.normalizeDateInput(t);if(this.hasDuration&&!r.excludeEnds){const e=this.getMaxDuration("occursBetween",r),t=this._run({start:n.subtract(e,"millisecond"),end:i,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:i})){if(r.excludeEnds){if(e.isEqual(n))continue;if(e.isEqual(i))break}return!0}return!1}occursOn(e){const t=this.normalizeOccursOnArgs(e);if(t.weekday){if(this.isInfinite&&!t.before)throw new j("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 i=n.next().value;if(!i)return!1;for(;i;){if(i.get("weekday")===t.weekday)return!0;i=n.next({skipToDate:i.add(g(i.get("weekday"),t.weekday),"day").granularity("day")}).value}return!1}if(!t.date)throw new j('"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,t={}){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,t={}){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 o.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 j("`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(e={}){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?C(e,this.timezone):void 0}normalizeDateInputToAdapter(e){if(e)return function(e){return e instanceof c?o.adapter.fromDateTime(e):e instanceof o?e:o.adapter.fromDate(e)}(e)}normalizeRunOutput(e){return L(e,this.timezone)}getMaxDuration(e,t){const r=t.maxDuration||this.maxDuration;if(!Number.isInteger(r))throw new j(`When an occurrence generator has a duration, a 'maxDuration' argument must be supplied to ${e}().`);return r}}class q{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 R("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?C(e,this.iterable.timezone):void 0}normalizeDateOutput(e){if(e)return e?o.adapter.fromDateTime(e):void 0}}class V{constructor(e=[],t,r,n){this.dates=e,this.granularity=t,this.periodStart=r,this.periodEnd=n}}class G{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 R("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 o.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=[],i=0;for(;t&&(void 0===this.args.take||this.args.take>i);){for(;t&&t.isBeforeOrEqual(r.end);)n.push(t),t=e.next().value;if(yield new V(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),i++}}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 Y extends z{constructor(e,t){super(t),this.streams=e,this.config=t,this.timezone=t.timezone,this.streams=e.map(e=>e instanceof Y?e:e.set("timezone",this.timezone)),this.isInfinite=this.calculateIsInfinite(),this.hasDuration=this.calculateHasDuration()}normalizeDateInput(e){if(e)return C(e,this.timezone)}normalizeRunOutput(e){return L(e,this.timezone)}}class ${constructor(e,t){this.runArgs=t,this.stream=e._run(this.runArgs),this.next()}next(e){const t=this.stream.next(e),r=t.done,n=t.value;return this.done="boolean"!=typeof r||r,this.value=n,{done:r,value:n}}}function K(e,t={},r={}){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 Z(e,t){return e.done&&t.done?0:e.done?1:t.done?-1:e.value.isAfter(t.value)?1:-1}function X(e,t){return e.done&&t.done?0:e.done?-1:t.done?1:e.value.isAfter(t.value)?-1:1}function J(e,t={},r={}){return K(e,t,r),e.sort(t.reverse?X:Z).filter(e=>!e.done).shift()}function Q(...e){return t=>new ee(e,t)}class ee extends Y{set(e,t){return new ee(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(e={}){const t=this.streams.map(t=>new $(t,e));if(this.config.base&&t.push(new $(this.config.base,e)),0===t.length)return;let r=J(t,e);for(;r&&!r.done;){const n=yield this.normalizeRunOutput(r.value);n&&n.skipToDate||r.next(),r=J(t,e,n)}}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 te extends z{constructor(e={}){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(e={}){return new q(this,this.normalizeOccurrencesArgs(e))}collections(e={}){return new G(this,this.normalizeCollectionsArgs(e))}add(e){return new te({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 te({dates:t,timezone:this.timezone,data:this.data})}set(e,t,r={}){let n=this.timezone,i=this.adapters.slice();if("timezone"===e){if(t===this.timezone)return this;r.keepLocalTime&&(i=this.adapters.map(e=>{const r=e.toJSON();return r.timezone=t,this.dateAdapter.fromJSON(r)})),n=t}else if("dates"===e)i=t;else{if("duration"!==e)throw new j(`Unexpected prop argument "${e}". Accepted values are "timezone" or "dates"`);i=i.map(e=>e.set("duration",t||0))}return new te({dates:i,data:this.data,timezone:n})}filter(e){return new te({dates:this.adapters.filter(e),data:this.data,timezone:this.timezone})}*_run(e={}){let t=this.datetimes.sort(f);e.start&&(t=t.filter(t=>t.isAfterOrEqual(e.start))),e.end&&(t=t.filter(t=>t.isBeforeOrEqual(e.end))),e.reverse&&(t=t.slice().reverse()),e.take&&(t=t.slice(0,e.take));const r=t.slice();let n,i=r.shift();for(;i;)if(n&&n.skipToDate&&(e.reverse?n.skipToDate.isBefore(i):n.skipToDate.isAfter(i)))i=r.shift();else{if(i=i.add(this,"generator"),n=yield this.normalizeRunOutput(i),n&&n.skipToDate&&(e.reverse?n.skipToDate.isAfterOrEqual(i):n.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=r.shift()}}}class re extends Error{}let ne;class ie{constructor(e,t){if(this.duration=t&&t.duration||0,this.generators=t&&t.generators&&t.generators.slice()||[],!Number.isInteger(this.duration)||this.duration<0)throw new re("duration must be a non-negative integer")}static set adapter(e){if(ne)throw new Error(`"${ne.name}" has already been configured.`);ne=e}static get adapter(){if(!ne)throw new Error("No date adapter has been configured. See rSchedule docs.");return ne}static isDate(e){throw oe("isDate()")}static fromDate(e,t){throw oe("fromDate()")}static fromJSON(e){throw oe("fromJSON()")}static fromDateTime(e){throw oe("fromDateTime()")}toISOString(){return this.set("timezone","UTC").toDateTime().toISOString()}toDateTime(){return ue.fromJSON(Object.assign(Object.assign({},this.toJSON()),{generators:this.generators}))}}function oe(e){return new Error(`You must implement the "${e}" method for this DateAdapter class`)}var ae;ie.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}(ae||(ae={}));class se extends Error{}class ue{constructor(e,t,r,n){if(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 se("duration must be a non-negative integer");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 ue(t,e.timezone,e.duration,e.generators)}static fromDateAdapter(e){return ue.fromJSON(Object.assign(Object.assign({},e.toJSON()),{generators:e.generators}))}get end(){if(this.duration)return this._end||(this._end=this.add(this.duration,"millisecond")),this._end}isEqual(e){return!!e&&(ce(this,e),this.valueOf()===e.valueOf())}isBefore(e){return ce(this,e),this.valueOf()<e.valueOf()}isBeforeOrEqual(e){return ce(this,e),this.valueOf()<=e.valueOf()}isAfter(e){return ce(this,e),this.valueOf()>e.valueOf()}isAfterOrEqual(e){return ce(this,e),this.valueOf()>=e.valueOf()}isOccurring(e){if(!this.duration)throw new Error("DateTime#isOccurring() is only applicable to DateTimes with durations");return ce(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 ue(this.date,this.timezone,this.duration,t)}case"year":return this.forkDateTime(me(this.date,e));case"month":return this.forkDateTime(ye(this.date,e));case"week":return this.forkDateTime(be(this.date,e));case"day":return this.forkDateTime(_e(this.date,e));case"hour":return this.forkDateTime(we(this.date,e));case"minute":return this.forkDateTime(ve(this.date,e));case"second":return this.forkDateTime(Ee(this.date,e));case"millisecond":return this.forkDateTime(Se(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 me(e,-t)}(this.date,e));case"month":return this.forkDateTime(function(e,t){return ye(e,-t)}(this.date,e));case"week":return this.forkDateTime(function(e,t){return be(e,-t)}(this.date,e));case"day":return this.forkDateTime(Oe(this.date,e));case"hour":return this.forkDateTime(function(e,t){return we(e,-t)}(this.date,e));case"minute":return this.forkDateTime(function(e,t){return ve(e,-t)}(this.date,e));case"second":return this.forkDateTime(function(e,t){return Ee(e,-t)}(this.date,e));case"millisecond":return this.forkDateTime(function(e,t){return Se(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/ae.MILLISECONDS_IN_DAY)}(this.date);case"weekday":return ae.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 ue(this.date,this.timezone,t,this.generators);if("generators"===e)return new ue(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=de(t,r.getUTCFullYear());r.getUTCDate()>e?(r.setUTCDate(1),r.setUTCMonth(t),r=Oe(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,t={}){let 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=le(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,t={}){let r=this.forkDateTime(this.date);switch(e){case"year":r=r.set("month",12);case"month":r=r.set("day",de(r.get("month"),r.get("year")));break;case"week":r=function(e,t){const r=le(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 se("DateTime has invalid date.");return!0}forkDateTime(e){return new ue(e,this.timezone,this.duration,this.generators)}}function ce(e,t){if(e.timezone!==t.timezone)throw new se("Attempted to compare a datetime to another date in a different timezone: "+JSON.stringify(e)+" and "+JSON.stringify(t));return!0}function le(e="SU"){const t=ae.WEEKDAYS.slice();let r=t.indexOf(e);for(;0!==r;)fe(t),r--;return t}function fe(e,t="first"){return 0===e.length||("first"===t?e.push(e.shift()):e.unshift(e.pop())),e}function de(e,t){return{1:31,2:he(t),3:31,4:30,5:31,6:30,7:31,8:31,9:30,10:31,11:30,12:31}[e]}function he(e){return function(e){return e%400==0||e%4==0&&e%100!=0}(e)?29:28}function pe(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 ge(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");const r=e.valueOf(),n=pe(t);return new Date(r+n)}function me(e,t){return ye(e,12*pe(t))}function ye(e,t){const r=pe(t),n=(e=new Date(e)).getUTCMonth()+r,i=new Date(0);i.setUTCFullYear(e.getUTCFullYear(),n,1),i.setUTCHours(0,0,0,0);const o=de(i.getUTCMonth()+1,i.getUTCFullYear());return e.setUTCMonth(n,Math.min(o,e.getUTCDate())),e}function be(e,t){return _e(e,7*pe(t))}function _e(e,t){return Se(e,pe(t)*ae.MILLISECONDS_IN_DAY)}function we(e,t){return ge(e,pe(t)*ae.MILLISECONDS_IN_HOUR)}function ve(e,t){return ge(e,pe(t)*ae.MILLISECONDS_IN_MINUTE)}function Ee(e,t){return ge(e,pe(t)*ae.MILLISECONDS_IN_SECOND)}function Se(e,t){const r=pe(t),n=e.getTime();return new Date(n+r)}function Oe(e,t){return _e(e,-t)}function Te(e,t){return e.timezone!==t?ie.adapter.fromDateTime(e).set("timezone",t).toDateTime():e}class Ae extends z{constructor(e,t,r={}){super(r),this.recurrenceRules=e,this.options=B(t),this.normOptions=P(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(e={}){return new q(this,this.normalizeOccurrencesArgs(e))}collections(e={}){return new G(this,this.normalizeCollectionsArgs(e))}*_run(e={}){const t=this.normalizeRunArgs(e),r=new H((n=this.recurrenceRules,e=>n.reduce((t,r)=>{const n=r.get(e);return n&&t.push(n),t},[])),this.normOptions,t);var n;let i=r.next().value,o=0;for(;i&&(void 0===t.take||o<t.take);){o++,i=i.add(this,"generator");const e=yield this.normalizeRunOutput(i);i=(null==e?void 0:e.skipToDate)?r.next(Object.assign(Object.assign({},e),{skipToDate:Te(e.skipToDate,r.start.timezone)})).value:r.next(e).value}}}class Me extends Ae{constructor(e,t={}){super(Me.recurrenceRules,e,t)}set(e,t,r={}){let n=B(this.options),i=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 c?r.toDateTime():r.date}i=t}else"options"===e?n=t:n[e]=t;return new Me(n,{data:this.data,maxDuration:this.maxDuration,timezone:i})}}Me.recurrenceRules=[];class De extends z{constructor(e){super(e),this.data=e.data}occurrences(e={}){return new q(this,this.normalizeOccurrencesArgs(e))}collections(e={}){return new G(this,this.normalizeCollectionsArgs(e))}*_run(e={}){const t=e.take;delete e.take;const r=this.occurrenceStream._run(e);let n=r.next().value,i=0;for(;n&&(void 0===t||t>i);){n=n.add(this,"generator");const e=yield this.normalizeRunOutput(n);n=r.next(e).value,i++}}}function Ie(...e){return t=>new je(e,t)}class je extends Y{set(e,t){return new je(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(e={}){if(!this.config.base)return;const t=new $(this.config.base,e),r=new $(new ee(this.streams,{timezone:this.config.timezone}),e);for(Re(t,r,e);!t.done;){const n=yield this.normalizeRunOutput(t.value);n&&n.skipToDate||t.next(),Re(t,r,e,n)}}calculateIsInfinite(){return!(!this.config.base||!this.config.base.isInfinite)}calculateHasDuration(){return!(!this.config.base||!this.config.base.hasDuration)}}function Re(e,t,r={},n={}){for(K([e,t],r,n),Ne(e,t,r);!e.done&&!t.done&&e.value.isEqual(t.value);)e.next(),Ne(e,t,r)}function Ne(e,t,r={}){if(r.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 ke extends Y{set(e,t){return new ke([],Object.assign(Object.assign({},this.config),{base:this.config.base&&this.config.base.set("timezone",t),timezone:t}))}*_run(e={}){if(!this.config.base)return;const t=new $(this.config.base,e);for(;!t.done;){const e=yield this.normalizeRunOutput(t.value),r=t.value;for(t.next(e);(!e||!e.skipToDate)&&!t.done&&t.value.isEqual(r);)t.next()}}calculateIsInfinite(){return!(!this.config.base||!this.config.base.isInfinite)}calculateHasDuration(){return!(!this.config.base||!this.config.base.hasDuration)}}class Ce extends De{constructor(e={}){super(e),this.rrules=[],this.exrules=[];for(const t of["rrules","exrules"]){const r=e[t];r&&(this[t]=r.map(e=>e instanceof Me?e.set("timezone",this.timezone):new Me(e,{timezone:this.timezone})))}for(const t of["rdates","exdates"]){const r=e[t];this[t]=r?r instanceof te?r.set("timezone",this.timezone):new te({dates:r,timezone:this.timezone}):new te({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=[Q(...this.rrules),Ie(...this.exrules),Q(this.rdates),Ie(this.exdates),e=>new ke([],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 i=this.rdates,o=this.exdates;switch(e){case"rrule":r.push(t);break;case"exrule":n.push(t);break;case"rdate":i=this.rdates.add(t);break;case"exdate":o=this.exdates.add(t)}return new Ce({timezone:this.timezone,data:this.data,rrules:r,exrules:n,rdates:i,exdates:o})}remove(e,t){let r=this.rrules,n=this.exrules,i=this.rdates,o=this.exdates;switch(e){case"rrule":r=r.filter(e=>e!==t);break;case"exrule":n=n.filter(e=>e!==t);break;case"rdate":i=this.rdates.remove(t);break;case"exdate":o=this.exdates.remove(t)}return new Ce({timezone:this.timezone,data:this.data,rrules:r,exrules:n,rdates:i,exdates:o})}set(e,t,r={}){let n=this.timezone,i=this.rrules,o=this.exrules,a=this.rdates,s=this.exdates;switch(e){case"timezone":if(t===this.timezone&&!r.keepLocalTime)return this;r.keepLocalTime&&(i=i.map(e=>e.set("timezone",t,r)),o=o.map(e=>e.set("timezone",t,r)),a=a.set("timezone",t,r),s=s.set("timezone",t,r)),n=t;break;case"rrules":i=t;break;case"exrules":o=t;break;case"rdates":a=t;break;case"exdates":s=t}return new Ce({timezone:n,data:this.data,rrules:i,exrules:o,rdates:a,exdates:s})}}Error;Error;class Le{constructor(e){this.processor=e,this.start=e.start,this.end=e.end,this.options=e.options}}class xe extends Le{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 F(e))}validateDate(e){const t=e.date;return e instanceof F&&this.dateIsWithinInterval(t)?e:(this.skipToInterval(t),new W(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 Pe({first:this.firstIntervalStartDate,second:e,unit:this.intervalUnit,interval:this.options.interval,weekStart:this.options.weekStart,direction:"after"})}}function Pe({first:e,second:t,unit:r,interval:n,weekStart:i,direction:o}){let a=(()=>{let n,o;switch(r){case"year":return o=12*(t.get("year")-e.get("year")),o=o+t.get("month")-e.get("month"),Math.floor(o/12);case"month":return o=12*(t.get("year")-e.get("year")),o=o+t.get("month")-e.get("month"),o;case"week":e=e.granularity("week",{weekStart:i}),n=s.MILLISECONDS_IN_WEEK;break;case"day":n=s.MILLISECONDS_IN_DAY;break;case"hour":n=s.MILLISECONDS_IN_HOUR;break;case"minute":n=s.MILLISECONDS_IN_MINUTE;break;case"second":n=s.MILLISECONDS_IN_SECOND;break;case"millisecond":n=1;break;default:throw new Error("Unexpected `unit` value")}const a=t.valueOf()-e.valueOf();return Math.floor(a/n)})();return a=("after"===o?Math.ceil:Math.floor)(a/n)*n,a}class Be extends xe{setToCurrentInterval(){return this.intervalEndDate.subtract(1,"millisecond")}intervalDifference(e){return Pe({first:this.firstIntervalStartDate,second:e,unit:this.intervalUnit,interval:this.options.interval,weekStart:this.options.weekStart,direction:"before"})}}const Ue=["MILLISECONDLY","SECONDLY","MINUTELY","HOURLY","DAILY","WEEKLY","MONTHLY","YEARLY"],Fe={name:"FrequencyRule",get:e=>void 0!==e.options.byMillisecondOfSecond||"MILLISECONDLY"!==e.options.frequency?null:e.reverse?new Be(e,e.end):new xe(e,e.start),normalizeOptions:(e,t)=>{if(!Ue.includes(e.frequency))throw new x('"frequency" must be one of '+JSON.stringify(Ue));if(void 0!==e.interval){if(!Number.isInteger(e.interval))throw new x('"interval" expects a whole number');if(e.interval<1)throw new x('"interval" cannot be less than 1')}if(void 0!==e.weekStart&&!s.WEEKDAYS.includes(e.weekStart))throw new x('"weekStart" must be one of '+JSON.stringify(s.WEEKDAYS));t.frequency=e.frequency,t.interval=e.interval||1,t.weekStart=e.weekStart||"MO"},deps:()=>[Fe]};function We(e){return Array.isArray(e)&&e.length>0}const He=new WeakMap;class ze extends Le{constructor(e){super(e),He.has(this.processor)||He.set(this.processor,new xe(e,e.start)),this.frequency=He.get(this.processor)}validateDate(e){return this.frequency.validateDate(e)}}class qe extends Le{constructor(e){super(e),He.has(this.processor)||He.set(this.processor,new Be(e,e.end)),this.frequency=He.get(this.processor)}validateDate(e){return this.frequency.validateDate(e)}}class Ve extends qe{run(e){const t=e.get(this.granularity);for(const r of this.option)if(!(t<r))return t===r?this.validateDate(new F(e)):this.validateDate(new W(e.endGranularity(this.baseGranularity).set(this.granularity,r)));return this.validateDate(new W(e.endGranularity(this.baseGranularity).subtract(1,this.baseGranularity).set(this.granularity,this.option[0])))}}class Ge extends Ve{constructor(){super(...arguments),this.baseGranularity="second",this.granularity="millisecond",this.option=this.options.byMillisecondOfSecond.slice().reverse()}}class Ye extends ze{run(e){const t=e.get(this.granularity);for(const r of this.option)if(!(t>r))return t===r?this.validateDate(new F(e)):this.validateDate(new W(e.granularity(this.baseGranularity).set(this.granularity,r)));return this.validateDate(new W(e.granularity(this.baseGranularity).add(1,this.baseGranularity).set(this.granularity,this.option[0])))}}class $e extends Ye{constructor(){super(...arguments),this.baseGranularity="second",this.granularity="millisecond",this.option=this.options.byMillisecondOfSecond}}const Ke={name:"ByMillisecondOfSecond",get:e=>void 0===e.options.byMillisecondOfSecond?null:e.reverse?new Ge(e):new $e(e),normalizeOptions:(e,t)=>{if(void 0!==e.byMillisecondOfSecond){if(!We(e.byMillisecondOfSecond))throw new x('"byMillisecondOfSecond" expects a non-empty array');if(e.byMillisecondOfSecond.some(e=>e<0||e>999))throw new x('"byMillisecondOfSecond" values must be >= 0 && <= 999');t.byMillisecondOfSecond=e.byMillisecondOfSecond,t.byMillisecondOfSecond.sort(N)}else"MILLISECONDLY"!==e.frequency&&(t.byMillisecondOfSecond=[t.start.get("millisecond")])},deps:()=>[Fe,Ke]};class Ze extends Ve{constructor(){super(...arguments),this.baseGranularity="minute",this.granularity="second",this.option=this.options.bySecondOfMinute.slice().reverse()}}class Xe extends Ye{constructor(){super(...arguments),this.baseGranularity="minute",this.granularity="second",this.option=this.options.bySecondOfMinute}}const Je={name:"BySecondOfMinute",get:e=>void 0===e.options.bySecondOfMinute?null:e.reverse?new Ze(e):new Xe(e),normalizeOptions:(e,t)=>{if(void 0!==e.bySecondOfMinute){if(!We(e.bySecondOfMinute))throw new x('"bySecondOfMinute" expects a non-empty array');if(e.bySecondOfMinute.some(e=>e<0||e>60))throw new x('"bySecondOfMinute" values must be >= 0 && <= 60');t.bySecondOfMinute=e.bySecondOfMinute,t.bySecondOfMinute.sort(N)}else["SECONDLY","MILLISECONDLY"].includes(e.frequency)||(t.bySecondOfMinute=[t.start.get("second")])},deps:()=>[Fe,Je,Ke]};class Qe extends Ve{constructor(){super(...arguments),this.baseGranularity="hour",this.granularity="minute",this.option=this.options.byMinuteOfHour.slice().reverse()}}class et extends Ye{constructor(){super(...arguments),this.baseGranularity="hour",this.granularity="minute",this.option=this.options.byMinuteOfHour}}const tt={name:"ByMinuteOfHour",get:e=>void 0===e.options.byMinuteOfHour?null:e.reverse?new Qe(e):new et(e),normalizeOptions:(e,t)=>{if(void 0!==e.byMinuteOfHour){if(!We(e.byMinuteOfHour))throw new x('"byMinuteOfHour" expects a non-empty array');if(e.byMinuteOfHour.some(e=>e<0||e>59))throw new x('"byMinuteOfHour" values must be >= 0 && <= 59');t.byMinuteOfHour=e.byMinuteOfHour,t.byMinuteOfHour.sort(N)}else["MINUTELY","SECONDLY","MILLISECONDLY"].includes(e.frequency)||(t.byMinuteOfHour=[t.start.get("minute")])},deps:()=>[Fe,tt,Je,Ke]};class rt extends Ve{constructor(){super(...arguments),this.baseGranularity="day",this.granularity="hour",this.option=this.options.byHourOfDay.slice().reverse()}}class nt extends Ye{constructor(){super(...arguments),this.baseGranularity="day",this.granularity="hour",this.option=this.options.byHourOfDay}}const it={name:"ByHourOfDay",get:e=>void 0===e.options.byHourOfDay?null:e.reverse?new rt(e):new nt(e),normalizeOptions:(e,t)=>{if(void 0!==e.byHourOfDay){if(!We(e.byHourOfDay))throw new x('"byHourOfDay" expects a non-empty array');if(e.byHourOfDay.some(e=>e<0||e>23))throw new x('"byHourOfDay" values must be >= 0 && <= 23');t.byHourOfDay=e.byHourOfDay,t.byHourOfDay.sort(N)}else["YEARLY","MONTHLY","WEEKLY","DAILY"].includes(e.frequency)&&(t.byHourOfDay=[t.start.get("hour")])},deps:()=>[Fe,it,tt,Je,Ke]};function ot(e,t){return e.add(g(e.get("weekday"),t),"day")}function at(e,t,r){let n=e.set("day",1);return r<0&&(n=n.add(1,"month")),n=ot(n,t),r<0?n.add(r,"week"):n.add(r-1,"week")}class st extends ze{run(e){const t=ut(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 F(e)):this.validateDate(new W(e.granularity("month").set("day",n)));let n,i=e,o=0;for(;!n&&o<30;)i=i.granularity("month").add(1,"month"),n=ut(i,this.options.byDayOfMonth,this.options.byDayOfWeek)[0],o++;if(o>=13)throw new U("byDayOfMonth Infinite while loop");return this.validateDate(new W(i.set("day",n)))}}function ut(e,t,r){const n=e.endGranularity("month").get("day");let i=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(...i.filter(e=>t.set("day",e).get("weekday")===r));const o=at(e,...r).get("day");i.includes(o)&&n.push(o)}),i=Array.from(new Set(n))}return i.sort((e,t)=>e>t?1:e<t?-1:0)}class ct extends qe{run(e){const t=ut(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 F(e)):this.validateDate(new W(e.endGranularity("month").set("day",n)));let n,i=e,o=0;for(;!n&&o<30;)i=i.endGranularity("month").subtract(1,"month"),n=ut(i,this.options.byDayOfMonth,this.options.byDayOfWeek).pop(),o++;if(o>=13)throw new U("byDayOfMonth Infinite while loop");return this.validateDate(new W(i.set("day",n)))}}const lt={name:"ByDayOfMonth",get:e=>void 0===e.options.byDayOfMonth?null:e.reverse?new ct(e):new st(e),normalizeOptions:(e,t)=>{if(void 0!==e.byDayOfMonth){if("WEEKLY"===e.frequency)throw new x('when "frequency" is "WEEKLY", "byDayOfMonth" cannot be present');if(!We(e.byDayOfMonth))throw new x('"byDayOfMonth" expects a non-empty array');if(e.byDayOfMonth.some(e=>0===e||e<-31||e>31))throw new x('"byDayOfMonth" values must be `num !== 0 && num <= 31 && num >= -31`');t.byDayOfMonth=e.byDayOfMonth.slice()}else We(e.byDayOfWeek)||We(e.byDayOfYear)||!["YEARLY","MONTHLY"].includes(e.frequency)||(t.byDayOfMonth=[t.start.get("day")])},deps:()=>[Fe,lt,it,tt,Je,Ke]};function ft(e,t,r){let n=e.set("month",1).set("day",1);return r<0&&(n=n.add(1,"year")),n=ot(n,t),r<0?n.add(r,"week"):n.add(r-1,"week")}function dt(e,t){const r=g(e.get("weekday"),t);return e.subtract(0===r?0:7-r,"day")}class ht extends qe{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=pt(e,this.options.byDayOfWeek)[0],r=0,n=e;for(;!t&&r<28;)r++,n=n.granularity("year").subtract(1,"millisecond"),t=pt(n,this.options.byDayOfWeek)[0];if(!t)throw new U("The byDayOfWeek rule appears to contain an impossible combination");return this.result(e,t)}expandMonthly(e){let t=gt(e,this.options.byDayOfWeek)[0],r=0,n=e;for(;!t&&r<50;)r++,n=n.granularity("month").subtract(1,"millisecond"),t=gt(n,this.options.byDayOfWeek)[0];if(!t)throw new U("The byDayOfWeek rule appears to contain an impossible combination");return this.result(e,t)}expand(e){const t=this.options.byDayOfWeek.map(t=>dt(e,t)).sort(f).pop();return this.result(e,t)}result(e,t){return t.isEqual(e)?this.validateDate(new F(e)):this.validateDate(new W(t.endGranularity("day")))}}function pt(e,t){return d([...t.filter(e=>Array.isArray(e)).map(t=>ft(e,...t)),...t.filter(e=>"string"==typeof e).map(t=>dt(e,t)).filter(t=>t.get("year")===e.get("year"))]).filter(t=>t.isBeforeOrEqual(e)).sort(f).reverse()}function gt(e,t){return d([...t.filter(e=>Array.isArray(e)).map(t=>at(e,...t)),...t.filter(e=>"string"==typeof e).map(t=>dt(e,t)).filter(t=>t.get("year")===e.get("year")&&t.get("month")===e.get("month"))]).filter(t=>t.isBeforeOrEqual(e)).sort(f).reverse()}class mt extends ze{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=yt(e,this.options.byDayOfWeek)[0],r=0,n=e;for(;!t&&r<28;)r++,n=n.granularity("year").add(1,"year"),t=yt(n,this.options.byDayOfWeek)[0];if(!t)throw new U("The byDayOfWeek rule appears to contain an impossible combination");return this.result(e,t)}expandMonthly(e){let t=bt(e,this.options.byDayOfWeek)[0],r=0,n=e;for(;!t&&r<50;)r++,n=n.granularity("month").add(1,"month"),t=bt(n,this.options.byDayOfWeek)[0];if(!t)throw new U("The byDayOfWeek rule appears to contain an impossible combination");return this.result(e,t)}expand(e){const t=this.options.byDayOfWeek.map(t=>ot(e,t)).sort(f)[0];return this.result(e,t)}result(e,t){return t.isEqual(e)?this.validateDate(new F(e)):this.validateDate(new W(t.granularity("day")))}}function yt(e,t){return d([...t.filter(e=>Array.isArray(e)).map(t=>ft(e,...t)),...t.filter(e=>"string"==typeof e).map(t=>ot(e,t)).filter(t=>t.get("year")===e.get("year"))]).filter(t=>t.isAfterOrEqual(e)).sort(f)}function bt(e,t){return d([...t.filter(e=>Array.isArray(e)).map(t=>at(e,...t)),...t.filter(e=>"string"==typeof e).map(t=>ot(e,t)).filter(t=>t.get("year")===e.get("year")&&t.get("month")===e.get("month"))]).filter(t=>t.isAfterOrEqual(e)).sort(f)}const _t={name:"ByDayOfWeek",get:e=>void 0===e.options.byDayOfWeek?null:e.reverse?new ht(e):new mt(e),normalizeOptions:(e,t)=>{if(void 0!==e.byDayOfWeek){if(!We(e.byDayOfWeek))throw new x('"byDayOfWeek" expects a non-empty array');const r=e.byDayOfWeek.find(e=>Array.isArray(e)?!s.WEEKDAYS.includes(e[0]):!s.WEEKDAYS.includes(e));if(r)throw new x(`"byDayOfWeek" expects weedays in the form ${JSON.stringify(s.WEEKDAYS)} but "${r}" was provided`);if(!["YEARLY","MONTHLY"].includes(e.frequency)&&e.byDayOfWeek.some(e=>Array.isArray(e)))throw new x('"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 x('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 x('when "frequency" is "YEARLY", each "byDayOfWeek" can optionally only have a numeric value >= -366 and <= 366 and !== 0');t.byDayOfWeek=e.byDayOfWeek}else We(e.byDayOfMonth)||"WEEKLY"!==e.frequency||(t.byDayOfWeek=[t.start.get("weekday")])},deps:()=>[Fe,_t,it,tt,Je,Ke]};class wt extends qe{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 F(e)):this.validateDate(new W(e.endGranularity("year").set("month",r)));return this.validateDate(new W(e.endGranularity("year").subtract(1,"year").set("month",this.option[0])))}}class vt extends ze{run(e){const t=e.get("month");for(const r of this.options.byMonthOfYear)if(!(t>r))return t===r?this.validateDate(new F(e)):this.validateDate(new W(e.granularity("year").set("month",r)));return this.validateDate(new W(e.granularity("year").add(1,"year").set("month",this.options.byMonthOfYear[0])))}}const Et={name:"ByMonthOfYear",get:e=>void 0===e.options.byMonthOfYear?null:e.reverse?new wt(e):new vt(e),normalizeOptions:(e,t)=>{if(void 0!==e.byMonthOfYear){if(!We(e.byMonthOfYear))throw new x('"byMonthOfYear" expects a non-empty array');if(e.byMonthOfYear.some(e=>e<1||e>12))throw new x('"byMonthOfYear" values must be `num >= 1 && num >= 12`');t.byMonthOfYear=e.byMonthOfYear.slice(),t.byMonthOfYear.sort(N)}else We(e.byDayOfMonth)||We(e.byDayOfWeek)||We(e.byDayOfYear)||"YEARLY"!==e.frequency||(t.byMonthOfYear=[t.start.get("month")])},deps:()=>[Fe,Et,lt,it,tt,Je,Ke]},St=[Fe,Et,lt,_t,it,tt,Je,Ke];class Ot extends o{constructor(e,t={}){if(super(void 0,t),!["UTC",null,void 0].includes(t.timezone))throw new n(`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,this.assertIsValid()}static isDate(e){return"[object Date]"===Object.prototype.toString.call(e)}static fromDate(e,t){return new Ot(e,t)}static fromJSON(e){const t=[e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond];switch(e.timezone){case"UTC":return new Ot(new Date(Date.UTC(...t)),{timezone:"UTC",duration:e.duration});case null:return new Ot(new Date(...t),{timezone:null,duration:e.duration});default:throw new n(`The \`StandardDateAdapter\` only supports datetimes in UTC or LOCAL (null) time. You provided a JSON object with timezone "${e.timezone}".`)}}static fromDateTime(e){const t=Ot.fromJSON(e.toJSON());return t.generators.push(...e.generators),t}get date(){return new Date(this._date)}get end(){if(this.duration)return this._end||(this._end=Ot.fromDateTime(this.toDateTime().add(this.duration,"millisecond")).date),this._end}set(e,t){if("timezone"===e)return this.timezone===t?this:new Ot(this._date,{timezone:t,duration:this.duration,generators:this.generators});if("duration"===e)return this.duration===t?this:new Ot(this._date,{timezone:this.timezone,duration:t,generators:this.generators});throw new j(`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(!Ot.isDate(this._date)||isNaN(this._date.valueOf()))throw new n("StandardDateAdapter has invalid date.");if(![null,"UTC"].includes(this.timezone))throw new n(`StandardDateAdapter only supports local (null) and UTC timezones but "${this.timezone}" was specified.`);if(this.duration&&this.duration<=0)throw new n("If provided, duration must be greater than 0.");return!0}}Ot.hasTimezoneSupport=!1,o.adapter=Ot,Me.recurrenceRules=St;class Tt extends Error{}class At extends Error{}function Mt(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 Dt(e,t){z.JSON_FN_MAP.set(e,t)}z.JSON_FN_MAP=new Map,z.prototype.toJSON=function(e){throw new At(`To support smaller bundles, ${this.constructor.name}#toJSON() must be manually added. See "@rschedule/json-tools" in the rSchedule docs.`)},z.fromJSON=function(e,t){if("object"!=typeof e||null===e)throw new Tt(`Invalid json "${e}"`);const r=z.JSON_FN_MAP.get(e.type);if(!r)throw new Tt(`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)},te.prototype.toJSON=function(e={}){const t={type:"Dates",dates:this.adapters.map(e=>e.toJSON())};return e.nested||(t.timezone=this.timezone),Mt(this,t,e),t},te.fromJSON=function(e,t={}){if("Dates"!==e.type)throw new Tt("Invalid Dates JSON");return new te({dates:e.dates.map(e=>o.adapter.fromJSON(e)),data:"function"==typeof t.data?t.data(e):e.data,timezone:t.timezone||e.timezone})},Dt("Dates",te.fromJSON),Me.prototype.toJSON=function(e={}){const t={type:"Rule",config:Object.assign(Object.assign({},k(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),Mt(this,t,e),t},Me.fromJSON=function(e,t={}){const r=Object.assign(Object.assign({},e.config),{start:o.adapter.fromJSON(e.config.start),end:e.config.end&&o.adapter.fromJSON(e.config.end)});return new Me(r,{data:"function"==typeof t.data?t.data(e):e.data,timezone:t.timezone||e.timezone})},Dt("Rule",Me.fromJSON),Ce.prototype.toJSON=function(e={}){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),Mt(this,t,e),t},Ce.fromJSON=function(e,t={}){if("Schedule"!==e.type)throw new Tt("Invalid Schedule JSON");return new Ce({rrules:e.rrules.map(r=>Me.fromJSON(r,Object.assign({timezone:e.timezone},t))),exrules:e.exrules.map(r=>Me.fromJSON(r,Object.assign({timezone:e.timezone},t))),rdates:te.fromJSON(e.rdates,Object.assign({timezone:e.timezone},t)),exdates:te.fromJSON(e.exdates,Object.assign({timezone:e.timezone},t)),data:"function"==typeof t.data?t.data(e):e.data,timezone:t.timezone||e.timezone})},Dt("Schedule",Ce.fromJSON)},function(e,t,r){"use strict";r.d(t,"a",(function(){return i})),r.d(t,"b",(function(){return o}));var n=["D","DD","YY","YYYY"];function i(e){return-1!==n.indexOf(e)}function o(e){throw new RangeError("`options.awareOfUnicodeTokens` must be set to `true` to use `"+e+"` token; see: https://git.io/fxCyr")}},function(e,t,r){"use strict";r.d(t,"a",(function(){return y})),r.d(t,"c",(function(){return b})),r.d(t,"b",(function(){return _})),r.d(t,"d",(function(){return w})),r.d(t,"e",(function(){return v}));var n=r(4),i=r.n(n),o=r(2),a=r(15),s=r(8),u=r(37);function c(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 l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?c(Object(r),!0).forEach((function(t){f(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function f(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const d=r(52),h=r(42),p=r(64);let g=null;async function m(e){const t=i.a.getBudgetDir(e),r=i.a.join(t,"backups");let n=[];await i.a.exists(r)&&(n=await i.a.listDir(r),n=n.filter(e=>e.match(/\.sqlite$/)));const o=await Promise.all(n.map(async e=>{const t=await i.a.getModifiedTime(i.a.join(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 y(e){let t=await m(e),r=await async function(e){const t=i.a.getBudgetDir(e);return await i.a.exists(i.a.join(t,"db.latest.sqlite"))?{id:"db.latest.sqlite",date:null,isLatest:!0}:null}(e);return r&&t.unshift(r),t=t.map(e=>l(l({},e),{},{date:e.date?p.format(e.date,"yyyy-MM-dd h:mm"):null})),t}async function b(e){const t=i.a.getBudgetDir(e);await i.a.exists(i.a.join(t,"db.latest.sqlite"))&&await i.a.removeFile(i.a.join(i.a.getBudgetDir(e),"db.latest.sqlite"));let r=h.v4Sync()+".sqlite",n=i.a.join(t,"backups",r);await i.a.exists(i.a.join(t,"backups"))||await i.a.mkdir(i.a.join(t,"backups")),await i.a.copyFile(i.a.join(t,"db.sqlite"),n);const s=a.openDatabase(n);await a.runQuery(s,"DELETE FROM messages_crdt"),await a.runQuery(s,"DELETE FROM messages_clock"),a.closeDatabase(s);const u=await async function(e){const t=e.reduce((e,t)=>{const r=p.format(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],i=e===o.d();for(let e of n.slice(i?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 m(e));for(let e of u)await i.a.removeFile(i.a.join(t,"backups",e));d.send("backups-updated",await y(e))}async function _(e,t){const r=i.a.getBudgetDir(e);if(await i.a.exists(i.a.join(r,"db.latest.sqlite"))||(await i.a.copyFile(i.a.join(r,"db.sqlite"),i.a.join(r,"db.latest.sqlite")),await i.a.copyFile(i.a.join(r,"metadata.json"),i.a.join(r,"metadata.latest.json")),v(),w(e),await s.c(e)),"db.latest.sqlite"===t){console.log("Reverting backup"),await i.a.copyFile(i.a.join(r,"db.latest.sqlite"),i.a.join(r,"db.sqlite")),await i.a.copyFile(i.a.join(r,"metadata.latest.json"),i.a.join(r,"metadata.json")),await i.a.removeFile(i.a.join(r,"db.latest.sqlite")),await i.a.removeFile(i.a.join(r,"metadata.latest.json"));try{await u.h()}catch(e){}s.e()}else{console.log("Loading backup",t),await s.c(e),await s.d({groupId:null,lastSyncedTimestamp:null,lastUploaded:null});try{await u.h()}catch(e){}s.e(),await i.a.copyFile(i.a.join(r,"backups",t),i.a.join(r,"db.sqlite"))}}function w(e){g&&clearInterval(g),g=setInterval(async()=>{console.log("Making backup"),await b(e)},9e5)}function v(){clearInterval(g),g=null}},function(e,t,r){"use strict";r.d(t,"b",(function(){return h})),r.d(t,"a",(function(){return m})),r.d(t,"c",(function(){return w}));var n=r(9),i=r.n(n),o=r(76);function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,i,o=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==r.return||r.return()}finally{if(s)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return s(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return s(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}let u,c,l=r(438),f=r(42),d=!0;function h(e){d=null==e||"true"===e}async function p(e){return"user-"+(await Object(o.f)(e)).replace(/[=/]/g,"")}function g(e){return!e.startsWith("user-")}async function m(){c=l.init("7e6461b8dde1d5dbf04ed1711768257a");let e=a(await i.a.multiGet(["distinct-id-v2","user-id","track-usage"]),3),t=a(e[0],2)[1],r=a(e[1],2)[1];if(h(a(e[2],2)[1]),null==t){if(r){let e=await p(r);u=e,v({$name:e})}else u=f.v4Sync();await i.a.setItem("distinct-id-v2",u)}else u=t,g(t)||v({$name:t})}let y=!1,b=[];function _(e){return(...t)=>{y?b.push([e,[u,...t]]):e(u,...t)}}const w=_((e,t,r)=>{}),v=_((e,t)=>{})},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,r){"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}},function(e,t,r){e.exports=i;var n=r(63).EventEmitter;function i(){n.call(this)}r(11)(i,n),i.Readable=r(142),i.Writable=r(303),i.Duplex=r(304),i.Transform=r(305),i.PassThrough=r(306),i.Stream=i,i.prototype.pipe=function(e,t){var r=this;function i(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",i),e.on("drain",o),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 c(e){if(l(),0===n.listenerCount(this,"error"))throw e}function l(){r.removeListener("data",i),e.removeListener("drain",o),r.removeListener("end",s),r.removeListener("close",u),r.removeListener("error",c),e.removeListener("error",c),r.removeListener("end",l),r.removeListener("close",l),e.removeListener("close",l)}return r.on("error",c),e.on("error",c),r.on("end",l),r.on("close",l),e.on("close",l),e.emit("pipe",r),e}},function(e,t,r){function n(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===n(e)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===n(e)},t.isObject=function(e){return"object"==typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===n(e)},t.isError=function(e){return"[object Error]"===n(e)||e instanceof Error},t.isFunction=function(e){return"function"==typeof e},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(10).Buffer.isBuffer},function(e,t,r){"use strict";var n=r(11),i=r(146),o=r(148),a=r(149),s=r(71);function u(e){s.call(this,"digest"),this._hash=e}n(u,s),u.prototype._update=function(e){this._hash.update(e)},u.prototype._final=function(){return this._hash.digest()},e.exports=function(e){return"md5"===(e=e.toLowerCase())?new i:"rmd160"===e||"ripemd160"===e?new o:new u(a(e))}},function(e,t,r){(function(t){e.exports=function(e,r){for(var n=Math.min(e.length,r.length),i=new t(n),o=0;o<n;++o)i[o]=e[o]^r[o];return i}}).call(this,r(10).Buffer)},function(e,t,r){"use strict";var n=r(53),i=r(44);function o(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}t.BlockHash=o,o.prototype.update=function(e,t){if(e=n.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian);for(var i=0;i<e.length;i+=this._delta32)this._update(e,i,i+this._delta32)}return this},o.prototype.digest=function(e){return this.update(this._pad()),i(null===this.pending),this._digest(e)},o.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(e<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=e>>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o<this.padLength;o++)n[i++]=0;return n}},function(e,t,r){"use strict";const n=r(11),i=r(161).Reporter,o=r(159).Buffer;function a(e,t){i.call(this,t),o.isBuffer(e)?(this.base=e,this.offset=0,this.length=e.length):this.error("Input not Buffer")}function s(e,t){if(Array.isArray(e))this.length=0,this.value=e.map((function(e){return s.isEncoderBuffer(e)||(e=new s(e,t)),this.length+=e.length,e}),this);else if("number"==typeof e){if(!(0<=e&&e<=255))return t.error("non-byte EncoderBuffer value");this.value=e,this.length=1}else if("string"==typeof e)this.value=e,this.length=o.byteLength(e);else{if(!o.isBuffer(e))return t.error("Unsupported type: "+typeof e);this.value=e,this.length=e.length}}n(a,i),t.DecoderBuffer=a,a.isDecoderBuffer=function(e){if(e instanceof a)return!0;return"object"==typeof e&&o.isBuffer(e.base)&&"DecoderBuffer"===e.constructor.name&&"number"==typeof e.offset&&"number"==typeof e.length&&"function"==typeof e.save&&"function"==typeof e.restore&&"function"==typeof e.isEmpty&&"function"==typeof e.readUInt8&&"function"==typeof e.skip&&"function"==typeof e.raw},a.prototype.save=function(){return{offset:this.offset,reporter:i.prototype.save.call(this)}},a.prototype.restore=function(e){const t=new a(this.base);return t.offset=e.offset,t.length=this.offset,this.offset=e.offset,i.prototype.restore.call(this,e.reporter),t},a.prototype.isEmpty=function(){return this.offset===this.length},a.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")},a.prototype.skip=function(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");const r=new a(this.base);return r._reporterState=this._reporterState,r.offset=this.offset,r.length=this.offset+e,this.offset+=e,r},a.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)},t.EncoderBuffer=s,s.isEncoderBuffer=function(e){if(e instanceof s)return!0;return"object"==typeof e&&"EncoderBuffer"===e.constructor.name&&"number"==typeof e.length&&"function"==typeof e.join},s.prototype.join=function(e,t){return e||(e=o.alloc(this.length)),t||(t=0),0===this.length||(Array.isArray(this.value)?this.value.forEach((function(r){r.join(e,t),t+=r.length})):("number"==typeof this.value?e[t]=this.value:"string"==typeof this.value?e.write(this.value,t):o.isBuffer(this.value)&&this.value.copy(e,t),t+=this.length)),e}},function(e,t,r){e.exports=r(413),e.exports.FileSystem=r(164),e.exports.Constants=r(242),e.exports.Errors=r(243),e.exports.FileAttr=r(414)},function(e,t,r){e.exports=r(472),e.exports.Constants=r(268),e.exports.Errors=r(473),e.exports.FileAttr=r(474)},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(0);function i(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(n.a)(e),i=Object(n.a)(t);return r.getTime()<i.getTime()}},function(e,t,r){"use strict";async function n(e,t,r,n,i=[]){let o=[],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,i,!0);a=new Set([...a,...u]),o=o.concat(s)}}return o}function i(e,t){return t+" IN ("+[...new Set(e)].map(e=>`'${e}'`).join(",")+")"}r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return i}))},function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(3),i=r(27),o={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},a=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,s=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,u=/^([+-])(\d{2})(?::?(\d{2}))?$/;function c(e,t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var r=t||{},o=null==r.additionalDigits?2:Object(n.a)(r.additionalDigits);if(2!==o&&1!==o&&0!==o)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 a=l(e),s=f(a.date,o),u=d(s.restDateString,s.year);if(isNaN(u)||!u)return new Date(NaN);var c,h=u.getTime(),g=0;if(a.time&&(g=p(a.time),isNaN(g)))return new Date(NaN);if(a.timezone){if(c=m(a.timezone),isNaN(c))return new Date(NaN)}else{var y=h+g,b=new Date(y);c=Object(i.a)(b);var _=new Date(y);_.setDate(b.getDate()+1);var w=Object(i.a)(_)-c;w>0&&(c+=w)}return new Date(h+g+c)}function l(e){var t,r={},n=e.split(o.dateTimeDelimiter);if(/:/.test(n[0])?(r.date=null,t=n[0]):(r.date=n[0],t=n[1],o.timeZoneDelimiter.test(r.date)&&(r.date=e.split(o.timeZoneDelimiter)[0],t=e.substr(r.date.length,e.length))),t){var i=o.timezone.exec(t);i?(r.time=t.replace(i[1],""),r.timezone=i[1]):r.time=t}return r}function f(e,t){var r=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),n=e.match(r);if(!n)return{year:null};var i=n[1]&&parseInt(n[1]),o=n[2]&&parseInt(n[2]);return{year:null==o?i:100*o,restDateString:e.slice((n[1]||n[2]).length)}}function d(e,t){if(null===t)return null;var r=e.match(a);if(!r)return null;var n=!!r[4],i=h(r[1]),o=h(r[2])-1,s=h(r[3]),u=h(r[4])-1,c=h(r[5])-1;if(n)return function(e,t,r){return!(t<0||t>52||r<0||r>6)}(0,u,c)?function(e,t,r){var n=new Date(0);n.setUTCFullYear(e,0,4);var i=n.getUTCDay()||7,o=7*(t||0)+(r||0)+1-i;return n.setUTCDate(n.getUTCDate()+o),n}(t,u,c):new Date(NaN);var l=new Date(0);return function(e,t,r){return!(t<0||t>11||r<1||r>(y[t]||(b(e)?29:28)))}(t,o,s)&&function(e,t){return!(t<1||t>(b(e)?366:365))}(t,i)?(l.setUTCFullYear(t,o,Math.max(i,s)),l):new Date(NaN)}function h(e){return e?parseInt(e):1}function p(e){var t=e.match(s);if(!t)return null;var r=g(t[1]),n=g(t[2]),i=g(t[3]);return function(e,t,r){return!(r<0||r>=60||t<0||t>=60||e<0||e>=25)}(r,n,i)?r%24*36e5+6e4*n+1e3*i:NaN}function g(e){return e&&parseFloat(e.replace(",","."))||0}function m(e){if("Z"===e)return 0;var t=e.match(u);if(!t)return 0;var r="+"===t[1]?-1:1,n=parseInt(t[2]),i=t[3]&&parseInt(t[3])||0;return function(e,t){return!(t<0||t>59)}(0,i)?r*(36e5*n+6e4*i):NaN}var y=[31,null,31,30,31,30,31,31,30,31,30,31];function b(e){return e%400==0||e%4==0&&e%100}},function(e,t,r){"use strict";r.d(t,"b",(function(){return s})),r.d(t,"a",(function(){return c}));var n=r(1),i=r(7);let o,a;async function s(){let e=(await n.all("SELECT * FROM category_mapping")).map(e=>[e.id,e.transferId]),t=(await n.all("SELECT * FROM payee_mapping")).map(e=>[e.id,e.targetId]);o=new Map(e.concat(t)),a&&a(),a=Object(i.a)(u)}function u(e,t){t.forEach((e,t)=>{if(-1!==t.indexOf("mapping")){let r="category_mapping"===t?"transferId":"targetId";e.forEach(e=>{o.set(e.id,e[r])})}})}function c(){return o}},function(e,t,r){"use strict";r.d(t,"b",(function(){return f})),r.d(t,"a",(function(){return d})),r.d(t,"c",(function(){return h}));var n=r(1);function i(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,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}async function a(e){if(e.payee){let t=await n.first("SELECT id, transfer_acct FROM v_payees WHERE id = ?",[e.payee]),r=t.transfer_acct;t.id;return r}return null}async function s(e,t){return(await n.first("SELECT offbudget FROM accounts WHERE id = ?",[e.account])).offbudget===(await n.first("SELECT offbudget FROM accounts WHERE id = ?",[t])).offbudget&&(await n.updateTransaction({id:e.id,category:null}),!0)}async function u(e,t){let r=(await n.first("SELECT id FROM payees WHERE transfer_acct = ?",[e.account])).id;if(e.parent_id){let t=await n.first("\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 n.updateTransaction({id:e.id,payee:null}),{id:e.id,payee:null}):null}const a=await n.insertTransaction({account:t,amount:-e.amount,payee:r,date:e.date,transfer_id:e.id,notes:e.notes||null,cleared:!1});await n.updateTransaction({id:e.id,transfer_id:a});const u=await s(e,t);return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){o(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({id:e.id,transfer_id:a},u?{category:null}:{})}async function c(e){return(await n.getTransaction(e.transfer_id)).is_child?await n.updateTransaction({id:e.transfer_id,transfer_id:null,payee:null}):await n.deleteTransaction({id:e.transfer_id}),await n.updateTransaction({id:e.id,transfer_id:null}),{id:e.id,transfer_id:null}}async function l(e,t){let r=await async function(e){return n.first("SELECT * FROM payees WHERE transfer_acct = ?",[e])}(e.account);await n.updateTransaction({id:e.transfer_id,account:t,payee:r.id,date:e.date,notes:e.notes,amount:-e.amount});if(await s(e,t))return{id:e.id,category:null}}async function f(e){let t=await a(e);if(t)return u(e,t)}async function d(e){e.transfer_id&&await c(e)}async function h(e){const t=await a(e);return t&&!e.transfer_id?u(e,t):!t&&e.transfer_id?c(e):t&&e.transfer_id?l(e,t):void 0}},function(e,t,r){(function(e){var n=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(!y(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(s(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}})),u=n[r];r<o;u=n[++r])g(u)||!w(u)?a+=" "+u:a+=" "+s(u);return a},t.deprecate=function(r,n){if(void 0!==e&&!0===e.noDeprecation)return r;if(void 0===e)return function(){return t.deprecate(r,n).apply(this,arguments)};var i=!1;return function(){if(!i){if(e.throwDeprecation)throw new Error(n);e.traceDeprecation?console.trace(n):console.error(n),i=!0}return r.apply(this,arguments)}};var o,a={};function s(e,r){var n={seen:[],stylize:c};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),p(r)?n.showHidden=r:r&&t._extend(n,r),b(n.showHidden)&&(n.showHidden=!1),b(n.depth)&&(n.depth=2),b(n.colors)&&(n.colors=!1),b(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=u),l(n,e,n.depth)}function u(e,t){var r=s.styles[t];return r?"["+s.colors[r][0]+"m"+e+"["+s.colors[r][1]+"m":e}function c(e,t){return e}function l(e,r,n){if(e.customInspect&&r&&S(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,e);return y(i)||(i=l(e,i,n)),i}var o=function(e,t){if(b(t))return e.stylize("undefined","undefined");if(y(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(m(t))return e.stylize(""+t,"number");if(p(t))return e.stylize(""+t,"boolean");if(g(t))return e.stylize("null","null")}(e,r);if(o)return o;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)),E(r)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return f(r);if(0===a.length){if(S(r)){var u=r.name?": "+r.name:"";return e.stylize("[Function"+u+"]","special")}if(_(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(v(r))return e.stylize(Date.prototype.toString.call(r),"date");if(E(r))return f(r)}var c,w="",O=!1,T=["{","}"];(h(r)&&(O=!0,T=["[","]"]),S(r))&&(w=" [Function"+(r.name?": "+r.name:"")+"]");return _(r)&&(w=" "+RegExp.prototype.toString.call(r)),v(r)&&(w=" "+Date.prototype.toUTCString.call(r)),E(r)&&(w=" "+f(r)),0!==a.length||O&&0!=r.length?n<0?_(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),c=O?function(e,t,r,n,i){for(var o=[],a=0,s=t.length;a<s;++a)D(t,String(a))?o.push(d(e,t,r,n,String(a),!0)):o.push("");return i.forEach((function(i){i.match(/^\d+$/)||o.push(d(e,t,r,n,i,!0))})),o}(e,r,n,s,a):a.map((function(t){return d(e,r,n,s,t,O)})),e.seen.pop(),function(e,t,r){if(e.reduce((function(e,t){return t.indexOf("\n")>=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(c,w,T)):T[0]+w+T[1]}function f(e){return"["+Error.prototype.toString.call(e)+"]"}function d(e,t,r,n,i,o){var a,s,u;if((u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(s=e.stylize("[Setter]","special")),D(n,i)||(a="["+i+"]"),s||(e.seen.indexOf(u.value)<0?(s=g(r)?l(e,u.value,null):l(e,u.value,r-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),b(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),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 p(e){return"boolean"==typeof e}function g(e){return null===e}function m(e){return"number"==typeof e}function y(e){return"string"==typeof e}function b(e){return void 0===e}function _(e){return w(e)&&"[object RegExp]"===O(e)}function w(e){return"object"==typeof e&&null!==e}function v(e){return w(e)&&"[object Date]"===O(e)}function E(e){return w(e)&&("[object Error]"===O(e)||e instanceof Error)}function S(e){return"function"==typeof e}function O(e){return Object.prototype.toString.call(e)}function T(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(r){if(b(o)&&(o=e.env.NODE_DEBUG||""),r=r.toUpperCase(),!a[r])if(new RegExp("\\b"+r+"\\b","i").test(o)){var n=e.pid;a[r]=function(){var e=t.format.apply(t,arguments);console.error("%s %d: %s",r,n,e)}}else a[r]=function(){};return a[r]},t.inspect=s,s.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]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=h,t.isBoolean=p,t.isNull=g,t.isNullOrUndefined=function(e){return null==e},t.isNumber=m,t.isString=y,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=b,t.isRegExp=_,t.isObject=w,t.isDate=v,t.isError=E,t.isFunction=S,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(293);var A=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function M(){var e=new Date,t=[T(e.getHours()),T(e.getMinutes()),T(e.getSeconds())].join(":");return[e.getDate(),A[e.getMonth()],t].join(" ")}function D(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){console.log("%s - %s",M(),t.format.apply(t,arguments))},t.inherits=r(294),t._extend=function(e,t){if(!t||!w(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var I="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(I&&e[I]){var t;if("function"!=typeof(t=e[I]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,I,{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})),i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);i.push((function(e,n){e?r(e):t(n)}));try{e.apply(this,i)}catch(e){r(e)}return n}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),I&&Object.defineProperty(t,I,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,n(e))},t.promisify.custom=I,t.callbackify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');function r(){for(var r=[],n=0;n<arguments.length;n++)r.push(arguments[n]);var i=r.pop();if("function"!=typeof i)throw new TypeError("The last argument must be of type Function");var o=this,a=function(){return i.apply(o,arguments)};t.apply(this,r).then((function(t){e.nextTick(a,null,t)}),(function(t){e.nextTick(j,t,a)}))}return Object.setPrototypeOf(r,Object.getPrototypeOf(t)),Object.defineProperties(r,n(t)),r}}).call(this,r(19))},function(e,t,r){(function(e){var n=void 0!==e&&e||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function o(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new o(i.call(setTimeout,n,arguments),clearTimeout)},t.setInterval=function(){return new o(i.call(setInterval,n,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(n,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},r(297),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,r(23))},function(e,t,r){"use strict";(function(t){void 0===t||!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports={nextTick:function(e,r,n,i){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var o,a,s=arguments.length;switch(s){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick((function(){e.call(null,r)}));case 3:return t.nextTick((function(){e.call(null,r,n)}));case 4:return t.nextTick((function(){e.call(null,r,n,i)}));default:for(o=new Array(s-1),a=0;a<o.length;)o[a++]=arguments[a];return t.nextTick((function(){e.apply(null,o)}))}}}:e.exports=t}).call(this,r(19))},function(e,t,r){var n=r(16).Buffer;function i(e){n.isBuffer(e)||(e=n.from(e));for(var t=e.length/4|0,r=new Array(t),i=0;i<t;i++)r[i]=e.readUInt32BE(4*i);return r}function o(e){for(;0<e.length;e++)e[0]=0}function a(e,t,r,n,i){for(var o,a,s,u,c=r[0],l=r[1],f=r[2],d=r[3],h=e[0]^t[0],p=e[1]^t[1],g=e[2]^t[2],m=e[3]^t[3],y=4,b=1;b<i;b++)o=c[h>>>24]^l[p>>>16&255]^f[g>>>8&255]^d[255&m]^t[y++],a=c[p>>>24]^l[g>>>16&255]^f[m>>>8&255]^d[255&h]^t[y++],s=c[g>>>24]^l[m>>>16&255]^f[h>>>8&255]^d[255&p]^t[y++],u=c[m>>>24]^l[h>>>16&255]^f[p>>>8&255]^d[255&g]^t[y++],h=o,p=a,g=s,m=u;return o=(n[h>>>24]<<24|n[p>>>16&255]<<16|n[g>>>8&255]<<8|n[255&m])^t[y++],a=(n[p>>>24]<<24|n[g>>>16&255]<<16|n[m>>>8&255]<<8|n[255&h])^t[y++],s=(n[g>>>24]<<24|n[m>>>16&255]<<16|n[h>>>8&255]<<8|n[255&p])^t[y++],u=(n[m>>>24]<<24|n[h>>>16&255]<<16|n[p>>>8&255]<<8|n[255&g])^t[y++],[o>>>=0,a>>>=0,s>>>=0,u>>>=0]}var s=[0,1,2,4,8,16,32,64,128,27,54],u=function(){for(var e=new Array(256),t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var r=[],n=[],i=[[],[],[],[]],o=[[],[],[],[]],a=0,s=0,u=0;u<256;++u){var c=s^s<<1^s<<2^s<<3^s<<4;c=c>>>8^255&c^99,r[a]=c,n[c]=a;var l=e[a],f=e[l],d=e[f],h=257*e[c]^16843008*c;i[0][a]=h<<24|h>>>8,i[1][a]=h<<16|h>>>16,i[2][a]=h<<8|h>>>24,i[3][a]=h,h=16843009*d^65537*f^257*l^16843008*a,o[0][c]=h<<24|h>>>8,o[1][c]=h<<16|h>>>16,o[2][c]=h<<8|h>>>24,o[3][c]=h,0===a?a=s=1:(a=l^e[e[e[d^l]]],s^=e[e[s]])}return{SBOX:r,INV_SBOX:n,SUB_MIX:i,INV_SUB_MIX:o}}();function c(e){this._key=i(e),this._reset()}c.blockSize=16,c.keySize=32,c.prototype.blockSize=c.blockSize,c.prototype.keySize=c.keySize,c.prototype._reset=function(){for(var e=this._key,t=e.length,r=t+6,n=4*(r+1),i=[],o=0;o<t;o++)i[o]=e[o];for(o=t;o<n;o++){var a=i[o-1];o%t==0?(a=a<<8|a>>>24,a=u.SBOX[a>>>24]<<24|u.SBOX[a>>>16&255]<<16|u.SBOX[a>>>8&255]<<8|u.SBOX[255&a],a^=s[o/t|0]<<24):t>6&&o%t==4&&(a=u.SBOX[a>>>24]<<24|u.SBOX[a>>>16&255]<<16|u.SBOX[a>>>8&255]<<8|u.SBOX[255&a]),i[o]=i[o-t]^a}for(var c=[],l=0;l<n;l++){var f=n-l,d=i[f-(l%4?0:4)];c[l]=l<4||f<=4?d:u.INV_SUB_MIX[0][u.SBOX[d>>>24]]^u.INV_SUB_MIX[1][u.SBOX[d>>>16&255]]^u.INV_SUB_MIX[2][u.SBOX[d>>>8&255]]^u.INV_SUB_MIX[3][u.SBOX[255&d]]}this._nRounds=r,this._keySchedule=i,this._invKeySchedule=c},c.prototype.encryptBlockRaw=function(e){return a(e=i(e),this._keySchedule,u.SUB_MIX,u.SBOX,this._nRounds)},c.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),r=n.allocUnsafe(16);return r.writeUInt32BE(t[0],0),r.writeUInt32BE(t[1],4),r.writeUInt32BE(t[2],8),r.writeUInt32BE(t[3],12),r},c.prototype.decryptBlock=function(e){var t=(e=i(e))[1];e[1]=e[3],e[3]=t;var r=a(e,this._invKeySchedule,u.INV_SUB_MIX,u.INV_SBOX,this._nRounds),o=n.allocUnsafe(16);return o.writeUInt32BE(r[0],0),o.writeUInt32BE(r[3],4),o.writeUInt32BE(r[2],8),o.writeUInt32BE(r[1],12),o},c.prototype.scrub=function(){o(this._keySchedule),o(this._invKeySchedule),o(this._key)},e.exports.AES=c},function(e,t,r){var n=r(16).Buffer,i=r(146);e.exports=function(e,t,r,o){if(n.isBuffer(e)||(e=n.from(e,"binary")),t&&(n.isBuffer(t)||(t=n.from(t,"binary")),8!==t.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var a=r/8,s=n.alloc(a),u=n.alloc(o||0),c=n.alloc(0);a>0||o>0;){var l=new i;l.update(c),l.update(e),t&&l.update(t),c=l.digest();var f=0;if(a>0){var d=s.length-a;f=Math.min(a,c.length),c.copy(s,d,0,f),a-=f}if(f<c.length&&o>0){var h=u.length-o,p=Math.min(o,c.length-f);c.copy(u,h,f,f+p),o-=p}}return c.fill(0),{key:s,iv:u}}},function(e,t,r){"use strict";var n=r(35),i=r(45),o=i.getNAF,a=i.getJSF,s=i.assert;function u(e,t){this.type=e,this.p=new n(t.p,16),this.red=t.prime?n.red(t.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=t.n&&new n(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function c(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=u,u.prototype.point=function(){throw new Error("Not implemented")},u.prototype.validate=function(){throw new Error("Not implemented")},u.prototype._fixedNafMul=function(e,t){s(e.precomputed);var r=e._getDoubles(),n=o(t,1,this._bitLength),i=(1<<r.step+1)-(r.step%2==0?2:1);i/=3;var a,u,c=[];for(a=0;a<n.length;a+=r.step){u=0;for(var l=a+r.step-1;l>=a;l--)u=(u<<1)+n[l];c.push(u)}for(var f=this.jpoint(null,null,null),d=this.jpoint(null,null,null),h=i;h>0;h--){for(a=0;a<c.length;a++)(u=c[a])===h?d=d.mixedAdd(r.points[a]):u===-h&&(d=d.mixedAdd(r.points[a].neg()));f=f.add(d)}return f.toP()},u.prototype._wnafMul=function(e,t){var r=4,n=e._getNAFPoints(r);r=n.wnd;for(var i=n.points,a=o(t,r,this._bitLength),u=this.jpoint(null,null,null),c=a.length-1;c>=0;c--){for(var l=0;c>=0&&0===a[c];c--)l++;if(c>=0&&l++,u=u.dblp(l),c<0)break;var f=a[c];s(0!==f),u="affine"===e.type?f>0?u.mixedAdd(i[f-1>>1]):u.mixedAdd(i[-f-1>>1].neg()):f>0?u.add(i[f-1>>1]):u.add(i[-f-1>>1].neg())}return"affine"===e.type?u.toP():u},u.prototype._wnafMulAdd=function(e,t,r,n,i){var s,u,c,l=this._wnafT1,f=this._wnafT2,d=this._wnafT3,h=0;for(s=0;s<n;s++){var p=(c=t[s])._getNAFPoints(e);l[s]=p.wnd,f[s]=p.points}for(s=n-1;s>=1;s-=2){var g=s-1,m=s;if(1===l[g]&&1===l[m]){var y=[t[g],null,null,t[m]];0===t[g].y.cmp(t[m].y)?(y[1]=t[g].add(t[m]),y[2]=t[g].toJ().mixedAdd(t[m].neg())):0===t[g].y.cmp(t[m].y.redNeg())?(y[1]=t[g].toJ().mixedAdd(t[m]),y[2]=t[g].add(t[m].neg())):(y[1]=t[g].toJ().mixedAdd(t[m]),y[2]=t[g].toJ().mixedAdd(t[m].neg()));var b=[-3,-1,-5,-7,0,7,5,1,3],_=a(r[g],r[m]);for(h=Math.max(_[0].length,h),d[g]=new Array(h),d[m]=new Array(h),u=0;u<h;u++){var w=0|_[0][u],v=0|_[1][u];d[g][u]=b[3*(w+1)+(v+1)],d[m][u]=0,f[g]=y}}else d[g]=o(r[g],l[g],this._bitLength),d[m]=o(r[m],l[m],this._bitLength),h=Math.max(d[g].length,h),h=Math.max(d[m].length,h)}var E=this.jpoint(null,null,null),S=this._wnafT4;for(s=h;s>=0;s--){for(var O=0;s>=0;){var T=!0;for(u=0;u<n;u++)S[u]=0|d[u][s],0!==S[u]&&(T=!1);if(!T)break;O++,s--}if(s>=0&&O++,E=E.dblp(O),s<0)break;for(u=0;u<n;u++){var A=S[u];0!==A&&(A>0?c=f[u][A-1>>1]:A<0&&(c=f[u][-A-1>>1].neg()),E="affine"===c.type?E.mixedAdd(c):E.add(c))}}for(s=0;s<n;s++)f[s]=null;return i?E:E.toP()},u.BasePoint=c,c.prototype.eq=function(){throw new Error("Not implemented")},c.prototype.validate=function(){return this.curve.validate(this)},u.prototype.decodePoint=function(e,t){e=i.toArray(e,t);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*r)return 6===e[0]?s(e[e.length-1]%2==0):7===e[0]&&s(e[e.length-1]%2==1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw new Error("Unknown point format")},c.prototype.encodeCompressed=function(e){return this.encode(e,!0)},c.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},c.prototype.encode=function(e,t){return i.encode(this._encode(t),e)},c.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},c.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},c.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<t;i+=e){for(var o=0;o<e;o++)n=n.dbl();r.push(n)}return{step:e,points:r}},c.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,n=1===r?null:this.dbl(),i=1;i<r;i++)t[i]=t[i-1].add(n);return{wnd:e,points:t}},c.prototype._getBeta=function(){return null},c.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t}},function(e,t,r){var n=r(382),i=r(389),o=r(390),a=r(151),s=r(203),u=r(16).Buffer;function c(e){var t;"object"!=typeof e||u.isBuffer(e)||(t=e.passphrase,e=e.key),"string"==typeof e&&(e=u.from(e));var r,c,l=o(e,t),f=l.tag,d=l.data;switch(f){case"CERTIFICATE":c=n.certificate.decode(d,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(c||(c=n.PublicKey.decode(d,"der")),r=c.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return n.RSAPublicKey.decode(c.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return c.subjectPrivateKey=c.subjectPublicKey,{type:"ec",data:c};case"1.2.840.10040.4.1":return c.algorithm.params.pub_key=n.DSAparam.decode(c.subjectPublicKey.data,"der"),{type:"dsa",data:c.algorithm.params};default:throw new Error("unknown key id "+r)}case"ENCRYPTED PRIVATE KEY":d=function(e,t){var r=e.algorithm.decrypt.kde.kdeparams.salt,n=parseInt(e.algorithm.decrypt.kde.kdeparams.iters.toString(),10),o=i[e.algorithm.decrypt.cipher.algo.join(".")],c=e.algorithm.decrypt.cipher.iv,l=e.subjectPrivateKey,f=parseInt(o.split("-")[1],10)/8,d=s.pbkdf2Sync(t,r,n,f,"sha1"),h=a.createDecipheriv(o,d,c),p=[];return p.push(h.update(l)),p.push(h.final()),u.concat(p)}(d=n.EncryptedPrivateKey.decode(d,"der"),t);case"PRIVATE KEY":switch(r=(c=n.PrivateKey.decode(d,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return n.RSAPrivateKey.decode(c.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:c.algorithm.curve,privateKey:n.ECPrivateKey.decode(c.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return c.algorithm.params.priv_key=n.DSAparam.decode(c.subjectPrivateKey,"der"),{type:"dsa",params:c.algorithm.params};default:throw new Error("unknown key id "+r)}case"RSA PUBLIC KEY":return n.RSAPublicKey.decode(d,"der");case"RSA PRIVATE KEY":return n.RSAPrivateKey.decode(d,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:n.DSAPrivateKey.decode(d,"der")};case"EC PRIVATE KEY":return{curve:(d=n.ECPrivateKey.decode(d,"der")).parameters.value,privateKey:d.privateKey};default:throw new Error("unknown key type "+f)}}e.exports=c,c.signature=n.signature},function(e,t,r){var n=r(407),i=r(408),o=i;o.v1=n,o.v4=i,e.exports=o},function(e,t,r){"use strict";(function(e){var n=r(10).Buffer,i=r(99).Transform,o=r(419),a=r(112),s=r(141).ok,u=r(10).kMaxLength,c="Cannot create final Buffer. It would be larger than 0x"+u.toString(16)+" bytes";o.Z_MIN_WINDOWBITS=8,o.Z_MAX_WINDOWBITS=15,o.Z_DEFAULT_WINDOWBITS=15,o.Z_MIN_CHUNK=64,o.Z_MAX_CHUNK=1/0,o.Z_DEFAULT_CHUNK=16384,o.Z_MIN_MEMLEVEL=1,o.Z_MAX_MEMLEVEL=9,o.Z_DEFAULT_MEMLEVEL=8,o.Z_MIN_LEVEL=-1,o.Z_MAX_LEVEL=9,o.Z_DEFAULT_LEVEL=o.Z_DEFAULT_COMPRESSION;for(var l=Object.keys(o),f=0;f<l.length;f++){var d=l[f];d.match(/^Z/)&&Object.defineProperty(t,d,{enumerable:!0,value:o[d],writable:!1})}for(var h={Z_OK:o.Z_OK,Z_STREAM_END:o.Z_STREAM_END,Z_NEED_DICT:o.Z_NEED_DICT,Z_ERRNO:o.Z_ERRNO,Z_STREAM_ERROR:o.Z_STREAM_ERROR,Z_DATA_ERROR:o.Z_DATA_ERROR,Z_MEM_ERROR:o.Z_MEM_ERROR,Z_BUF_ERROR:o.Z_BUF_ERROR,Z_VERSION_ERROR:o.Z_VERSION_ERROR},p=Object.keys(h),g=0;g<p.length;g++){var m=p[g];h[h[m]]=m}function y(e,t,r){var i=[],o=0;function a(){for(var t;null!==(t=e.read());)i.push(t),o+=t.length;e.once("readable",a)}function s(){var t,a=null;o>=u?a=new RangeError(c):t=n.concat(i,o),i=[],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 b(e,t){if("string"==typeof t&&(t=n.from(t)),!n.isBuffer(t))throw new TypeError("Not a string or buffer");var r=e._finishFlushFlag;return e._processChunk(t,r)}function _(e){if(!(this instanceof _))return new _(e);M.call(this,e,o.DEFLATE)}function w(e){if(!(this instanceof w))return new w(e);M.call(this,e,o.INFLATE)}function v(e){if(!(this instanceof v))return new v(e);M.call(this,e,o.GZIP)}function E(e){if(!(this instanceof E))return new E(e);M.call(this,e,o.GUNZIP)}function S(e){if(!(this instanceof S))return new S(e);M.call(this,e,o.DEFLATERAW)}function O(e){if(!(this instanceof O))return new O(e);M.call(this,e,o.INFLATERAW)}function T(e){if(!(this instanceof T))return new T(e);M.call(this,e,o.UNZIP)}function A(e){return e===o.Z_NO_FLUSH||e===o.Z_PARTIAL_FLUSH||e===o.Z_SYNC_FLUSH||e===o.Z_FULL_FLUSH||e===o.Z_FINISH||e===o.Z_BLOCK}function M(e,r){var a=this;if(this._opts=e=e||{},this._chunkSize=e.chunkSize||t.Z_DEFAULT_CHUNK,i.call(this,e),e.flush&&!A(e.flush))throw new Error("Invalid flush flag: "+e.flush);if(e.finishFlush&&!A(e.finishFlush))throw new Error("Invalid flush flag: "+e.finishFlush);if(this._flushFlag=e.flush||o.Z_NO_FLUSH,this._finishFlushFlag=void 0!==e.finishFlush?e.finishFlush:o.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&&!n.isBuffer(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new o.Zlib(r);var s=this;this._hadError=!1,this._handle.onerror=function(e,r){D(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 c=t.Z_DEFAULT_STRATEGY;"number"==typeof e.strategy&&(c=e.strategy),this._handle.init(e.windowBits||t.Z_DEFAULT_WINDOWBITS,u,e.memLevel||t.Z_DEFAULT_MEMLEVEL,c,e.dictionary),this._buffer=n.allocUnsafe(this._chunkSize),this._offset=0,this._level=u,this._strategy=c,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!a._handle},configurable:!0,enumerable:!0})}function D(t,r){r&&e.nextTick(r),t._handle&&(t._handle.close(),t._handle=null)}function I(e){e.emit("close")}Object.defineProperty(t,"codes",{enumerable:!0,value:Object.freeze(h),writable:!1}),t.Deflate=_,t.Inflate=w,t.Gzip=v,t.Gunzip=E,t.DeflateRaw=S,t.InflateRaw=O,t.Unzip=T,t.createDeflate=function(e){return new _(e)},t.createInflate=function(e){return new w(e)},t.createDeflateRaw=function(e){return new S(e)},t.createInflateRaw=function(e){return new O(e)},t.createGzip=function(e){return new v(e)},t.createGunzip=function(e){return new E(e)},t.createUnzip=function(e){return new T(e)},t.deflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),y(new _(t),e,r)},t.deflateSync=function(e,t){return b(new _(t),e)},t.gzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),y(new v(t),e,r)},t.gzipSync=function(e,t){return b(new v(t),e)},t.deflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),y(new S(t),e,r)},t.deflateRawSync=function(e,t){return b(new S(t),e)},t.unzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),y(new T(t),e,r)},t.unzipSync=function(e,t){return b(new T(t),e)},t.inflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),y(new w(t),e,r)},t.inflateSync=function(e,t){return b(new w(t),e)},t.gunzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),y(new E(t),e,r)},t.gunzipSync=function(e,t){return b(new E(t),e)},t.inflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),y(new O(t),e,r)},t.inflateRawSync=function(e,t){return b(new O(t),e)},a.inherits(M,i),M.prototype.params=function(r,n,i){if(r<t.Z_MIN_LEVEL||r>t.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+r);if(n!=t.Z_FILTERED&&n!=t.Z_HUFFMAN_ONLY&&n!=t.Z_RLE&&n!=t.Z_FIXED&&n!=t.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+n);if(this._level!==r||this._strategy!==n){var a=this;this.flush(o.Z_SYNC_FLUSH,(function(){s(a._handle,"zlib binding closed"),a._handle.params(r,n),a._hadError||(a._level=r,a._strategy=n,i&&i())}))}else e.nextTick(i)},M.prototype.reset=function(){return s(this._handle,"zlib binding closed"),this._handle.reset()},M.prototype._flush=function(e){this._transform(n.alloc(0),"",e)},M.prototype.flush=function(t,r){var i=this,a=this._writableState;("function"==typeof t||void 0===t&&!r)&&(r=t,t=o.Z_FULL_FLUSH),a.ended?r&&e.nextTick(r):a.ending?r&&this.once("end",r):a.needDrain?r&&this.once("drain",(function(){return i.flush(t,r)})):(this._flushFlag=t,this.write(n.alloc(0),"",r))},M.prototype.close=function(t){D(this,t),e.nextTick(I,this)},M.prototype._transform=function(e,t,r){var i,a=this._writableState,s=(a.ending||a.ended)&&(!e||a.length===e.length);return null===e||n.isBuffer(e)?this._handle?(s?i=this._finishFlushFlag:(i=this._flushFlag,e.length>=a.length&&(this._flushFlag=this._opts.flush||o.Z_NO_FLUSH)),void this._processChunk(e,i,r)):r(new Error("zlib binding closed")):r(new Error("invalid input"))},M.prototype._processChunk=function(e,t,r){var i=e&&e.length,o=this._chunkSize-this._offset,a=0,l=this,f="function"==typeof r;if(!f){var d,h=[],p=0;this.on("error",(function(e){d=e})),s(this._handle,"zlib binding closed");do{var g=this._handle.writeSync(t,e,a,i,this._buffer,this._offset,o)}while(!this._hadError&&b(g[0],g[1]));if(this._hadError)throw d;if(p>=u)throw D(this),new RangeError(c);var m=n.concat(h,p);return D(this),m}s(this._handle,"zlib binding closed");var y=this._handle.write(t,e,a,i,this._buffer,this._offset,o);function b(u,c){if(this&&(this.buffer=null,this.callback=null),!l._hadError){var d=o-c;if(s(d>=0,"have should not go down"),d>0){var g=l._buffer.slice(l._offset,l._offset+d);l._offset+=d,f?l.push(g):(h.push(g),p+=g.length)}if((0===c||l._offset>=l._chunkSize)&&(o=l._chunkSize,l._offset=0,l._buffer=n.allocUnsafe(l._chunkSize)),0===c){if(a+=i-u,i=u,!f)return!0;var m=l._handle.write(t,e,a,i,l._buffer,l._offset,l._chunkSize);return m.callback=b,void(m.buffer=e)}if(!f)return!1;r()}}y.buffer=e,y.callback=b},a.inherits(_,M),a.inherits(w,M),a.inherits(v,M),a.inherits(E,M),a.inherits(S,M),a.inherits(O,M),a.inherits(T,M)}).call(this,r(19))},function(e,t,r){"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function i(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 n in r)i(r,n)&&(e[n]=r[n])}}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,i){if(t.subarray&&e.subarray)e.set(t.subarray(r,r+n),i);else for(var o=0;o<n;o++)e[i+o]=t[r+o]},flattenChunks:function(e){var t,r,n,i,o,a;for(n=0,t=0,r=e.length;t<r;t++)n+=e[t].length;for(a=new Uint8Array(n),i=0,t=0,r=e.length;t<r;t++)o=e[t],a.set(o,i),i+=o.length;return a}},a={arraySet:function(e,t,r,n,i){for(var o=0;o<n;o++)e[i+o]=t[r+o]},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,a))},t.setTyped(n)},function(e,t,r){"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 i=Object.getOwnPropertyDescriptor(e,t);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},function(e,t,r){"use strict";var n=r(167),i=r(80),o=i("%Function.prototype.apply%"),a=i("%Function.prototype.call%"),s=i("%Reflect.apply%",!0)||n.call(a,o),u=i("%Object.getOwnPropertyDescriptor%",!0),c=i("%Object.defineProperty%",!0),l=i("%Math.max%");if(c)try{c({},"a",{value:1})}catch(e){c=null}e.exports=function(e){var t=s(n,a,arguments);if(u&&c){var r=u(t,"length");r.configurable&&c(t,"length",{value:1+l(0,e.length-(arguments.length-1))})}return t};var f=function(){return s(n,o,arguments)};c?c(e.exports,"apply",{value:f}):e.exports.apply=f},function(e,t){e.exports={first:function(e){return e[0]},firstValue:function(e){const t=Object.keys(e[0]);return e[0][t[0]]},number:function(e){if("number"==typeof e)return e;if("string"==typeof e){const t=parseFloat(e);return isNaN(t)?0:t}return 0},min:function(e,t){return Math.min(e,t)},max:function(e,t){return Math.max(e,t)}}},function(e,t,r){"use strict";r.d(t,"b",(function(){return a})),r.d(t,"a",(function(){return s}));var n=r(1),i=r(13),o=r(75);function a(){let e=n.runQuery("SELECT timestamp FROM messages_crdt",[],!0),t={};for(let r=0;r<e.length;r++)t=o.insert(t,i.default.parse(e[r].timestamp));return{numMessages:e.length,trie:t}}async function s(){let e=a(),t=Object(i.getClock)();t.merkle=e.trie,n.runQuery(n.cache("INSERT OR REPLACE INTO messages_clock (id, clock) VALUES (1, ?)"),[Object(i.serializeClock)(t)])}},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(3),i=r(57);function o(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(n.a)(t);return Object(i.a)(e,12*r)}},function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0),i=r(46),o=r(36);function a(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(n.a)(e),a=Object(n.a)(t),s=Object(o.a)(r,a),u=Math.abs(Object(i.a)(r,a));r.setDate(r.getDate()-s*u);var c=Object(o.a)(r,a)===-s,l=s*(u-c);return 0===l?0:l}},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(0);function i(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=Object(n.a)(e),r=t.getDate();return r}},function(e,t,r){"use strict";t.a=function(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&&n.splice(n.indexOf(r)>>>0,1)},emit:function(t,r){(e.get(t)||[]).slice().map((function(e){e(r)})),(e.get("*")||[]).slice().map((function(e){e(t,r)}))}}}},function(e,t){e.exports={fetch:self.fetch,fetchBinary:()=>{throw new Error("fetchBinary not implemented")}}},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0),i=r(60);function o(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=Object(n.a)(e),r=t.getUTCFullYear(),o=new Date(0);o.setUTCFullYear(r+1,0,4),o.setUTCHours(0,0,0,0);var a=Object(i.a)(o),s=new Date(0);s.setUTCFullYear(r,0,4),s.setUTCHours(0,0,0,0);var u=Object(i.a)(s);return t.getTime()>=a.getTime()?r+1:t.getTime()>=u.getTime()?r:r-1}},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(3),i=r(57);function o(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(n.a)(t);return Object(i.a)(e,-r)}},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(3),i=r(47);function o(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(n.a)(t);return Object(i.a)(e,-r)}},function(e,t,r){"use strict";function n(e,t){switch(e){case"brokerage":case"investment":return"investment";case"credit":return"credit";case"loan":return"debt";case"other":return"other";case"depository":default:switch(t){case"money market":case"savings":return"savings";case"cd":return"cd";default:return"checking"}}}r.d(t,"a",(function(){return n}))},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(1);async function i(){let e=await n.first("\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 n.first("SELECT * FROM categories WHERE is_income = 1 AND tombstone = 0")),{id:await async function(e){let t=await n.first("SELECT id FROM payees WHERE LOWER(name) = ? AND tombstone = 0",[e.toLowerCase()]);return t?t.id:n.insertPayee({name:e})}("Starting Balance"),category:e?e.id:null}}},function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(0),i=r(51),o=r(3),a=r(92);function s(e,t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var r=t||{},n=r.locale,s=n&&n.options&&n.options.firstWeekContainsDate,u=null==s?1:Object(o.a)(s),c=null==r.firstWeekContainsDate?u:Object(o.a)(r.firstWeekContainsDate),l=Object(a.a)(e,t),f=new Date(0);f.setUTCFullYear(l,0,c),f.setUTCHours(0,0,0,0);var d=Object(i.a)(f,t);return d}function u(e,t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var r=Object(n.a)(e),o=Object(i.a)(r,t).getTime()-s(r,t).getTime();return Math.round(o/6048e5)+1}},function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n=r(0),i=r(60),o=r(131);function a(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=Object(o.a)(e),r=new Date(0);r.setUTCFullYear(t,0,4),r.setUTCHours(0,0,0,0);var n=Object(i.a)(r);return n}function s(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=Object(n.a)(e),r=Object(i.a)(t).getTime()-a(t).getTime();return Math.round(r/6048e5)+1}},function(e,t,r){"use strict";r.d(t,"b",(function(){return g})),r.d(t,"a",(function(){return m}));var n=r(9),i=r.n(n),o=r(1),a=r(20),s=r(40),u=r(134),c=r(12),l=r(30),f=r(6);function d(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,i,o=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==r.return||r.return()}finally{if(s)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return h(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return h(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}const p=r(42);async function g(e,t){let r=d(await i.a.multiGet(["user-id","user-key"]),2),n=d(r[0],2)[1],s=d(r[1],2)[1];if(null==e||!e.institution_id||!e.name)throw new Error("Invalid institution object");let u=p.v4Sync();return await Object(l.post)(Object(a.a)().PLAID_SERVER+"/handoff_public_token",{userId:n,key:s,item_id:u,public_token:t}),await Object(f.runMutator)(()=>o.insertWithUUID("banks",{id:u,bank_id:e.institution_id,name:e.name})),u}async function m(e,t,r=[]){let n=d(await i.a.multiGet(["user-id","user-key"]),2),a=d(n[0],2)[1],l=d(n[1],2)[1],h=await s.b(a,l,e);return h=h.filter(e=>t.includes(e.account_id)),Promise.all(h.map(async t=>{let n=await Object(f.runMutator)(async()=>{let n=await o.insertAccount({account_id:t.account_id,name:t.name,official_name:t.official_name,type:Object(u.a)(t.type),balance_current:Object(c.a)(t.balances.current),mask:t.mask,bank:e,offbudget:r.includes(t.account_id)?1:0});return await o.insertPayee({name:"",transfer_acct:n}),n});return await s.d(a,l,n,t.account_id,e),n}))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(98),i=r(292),o=n.constants.S_IFMT,a=n.constants.S_IFDIR,s=n.constants.S_IFREG,u=n.constants.S_IFBLK,c=n.constants.S_IFCHR,l=n.constants.S_IFLNK,f=n.constants.S_IFIFO,d=n.constants.S_IFSOCK,h=function(){function e(){}return e.build=function(t,r){void 0===r&&(r=!1);var n=new e,o=t.uid,a=t.gid,s=t.atime,u=t.mtime,c=t.ctime,l=r?i.default:function(e){return e};n.uid=l(o),n.gid=l(a),n.rdev=l(0),n.blksize=l(4096),n.ino=l(t.ino),n.size=l(t.getSize()),n.blocks=l(1),n.atime=s,n.mtime=u,n.ctime=c,n.birthtime=c,n.atimeMs=l(s.getTime()),n.mtimeMs=l(u.getTime());var f=l(c.getTime());return n.ctimeMs=f,n.birthtimeMs=f,n.dev=l(0),n.mode=l(t.mode),n.nlink=l(t.nlink),n},e.prototype._checkModeProperty=function(e){return(Number(this.mode)&o)===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(c)},e.prototype.isSymbolicLink=function(){return this._checkModeProperty(l)},e.prototype.isFIFO=function(){return this._checkModeProperty(f)},e.prototype.isSocket=function(){return this._checkModeProperty(d)},e}();t.Stats=h,t.default=h},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),i=0;for(t=0;t<r;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)n[i]=o[a];return n};Object.defineProperty(t,"__esModule",{value:!0});var i=r(10);function o(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return new(i.Buffer.bind.apply(i.Buffer,n([void 0,e],t)))}t.Buffer=i.Buffer;var a=i.Buffer.allocUnsafe||o;t.bufferAllocUnsafe=a;var s=i.Buffer.from||o;t.bufferFrom=s},function(e,t,r){"use strict";(function(t){var n=r(183);
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
* @license MIT
*/function i(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0}function o(e){return t.Buffer&&"function"==typeof t.Buffer.isBuffer?t.Buffer.isBuffer(e):!(null==e||!e._isBuffer)}var a=r(112),s=Object.prototype.hasOwnProperty,u=Array.prototype.slice,c="foo"===function(){}.name;function l(e){return Object.prototype.toString.call(e)}function f(e){return!o(e)&&("function"==typeof t.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):!!e&&(e instanceof DataView||!!(e.buffer&&e.buffer instanceof ArrayBuffer))))}var d=e.exports=b,h=/\s*function\s+([^\(\s]*)\s*/;function p(e){if(a.isFunction(e)){if(c)return e.name;var t=e.toString().match(h);return t&&t[1]}}function g(e,t){return"string"==typeof e?e.length<t?e:e.slice(0,t):e}function m(e){if(c||!a.isFunction(e))return a.inspect(e);var t=p(e);return"[Function"+(t?": "+t:"")+"]"}function y(e,t,r,n,i){throw new d.AssertionError({message:r,actual:e,expected:t,operator:n,stackStartFunction:i})}function b(e,t){e||y(e,!0,t,"==",d.ok)}function _(e,t,r,n){if(e===t)return!0;if(o(e)&&o(t))return 0===i(e,t);if(a.isDate(e)&&a.isDate(t))return e.getTime()===t.getTime();if(a.isRegExp(e)&&a.isRegExp(t))return e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase;if(null!==e&&"object"==typeof e||null!==t&&"object"==typeof t){if(f(e)&&f(t)&&l(e)===l(t)&&!(e instanceof Float32Array||e instanceof Float64Array))return 0===i(new Uint8Array(e.buffer),new Uint8Array(t.buffer));if(o(e)!==o(t))return!1;var s=(n=n||{actual:[],expected:[]}).actual.indexOf(e);return-1!==s&&s===n.expected.indexOf(t)||(n.actual.push(e),n.expected.push(t),function(e,t,r,n){if(null==e||null==t)return!1;if(a.isPrimitive(e)||a.isPrimitive(t))return e===t;if(r&&Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;var i=w(e),o=w(t);if(i&&!o||!i&&o)return!1;if(i)return e=u.call(e),t=u.call(t),_(e,t,r);var s,c,l=S(e),f=S(t);if(l.length!==f.length)return!1;for(l.sort(),f.sort(),c=l.length-1;c>=0;c--)if(l[c]!==f[c])return!1;for(c=l.length-1;c>=0;c--)if(s=l[c],!_(e[s],t[s],r,n))return!1;return!0}(e,t,r,n))}return r?e===t:e==t}function w(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function v(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function E(e,t,r,n){var i;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),i=function(e){var t;try{e()}catch(e){t=e}return t}(t),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),e&&!i&&y(i,r,"Missing expected exception"+n);var o="string"==typeof n,s=!e&&i&&!r;if((!e&&a.isError(i)&&o&&v(i,r)||s)&&y(i,r,"Got unwanted exception"+n),e&&i&&r&&!v(i,r)||!e&&i)throw i}d.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=function(e){return g(m(e.actual),128)+" "+e.operator+" "+g(m(e.expected),128)}(this),this.generatedMessage=!0);var t=e.stackStartFunction||y;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var r=new Error;if(r.stack){var n=r.stack,i=p(t),o=n.indexOf("\n"+i);if(o>=0){var a=n.indexOf("\n",o+1);n=n.substring(a+1)}this.stack=n}}},a.inherits(d.AssertionError,Error),d.fail=y,d.ok=b,d.equal=function(e,t,r){e!=t&&y(e,t,r,"==",d.equal)},d.notEqual=function(e,t,r){e==t&&y(e,t,r,"!=",d.notEqual)},d.deepEqual=function(e,t,r){_(e,t,!1)||y(e,t,r,"deepEqual",d.deepEqual)},d.deepStrictEqual=function(e,t,r){_(e,t,!0)||y(e,t,r,"deepStrictEqual",d.deepStrictEqual)},d.notDeepEqual=function(e,t,r){_(e,t,!1)&&y(e,t,r,"notDeepEqual",d.notDeepEqual)},d.notDeepStrictEqual=function e(t,r,n){_(t,r,!0)&&y(t,r,n,"notDeepStrictEqual",e)},d.strictEqual=function(e,t,r){e!==t&&y(e,t,r,"===",d.strictEqual)},d.notStrictEqual=function(e,t,r){e===t&&y(e,t,r,"!==",d.notStrictEqual)},d.throws=function(e,t,r){E(!0,e,t,r)},d.doesNotThrow=function(e,t,r){E(!1,e,t,r)},d.ifError=function(e){if(e)throw e},d.strict=n((function e(t,r){t||y(t,!0,r,"==",e)}),d,{equal:d.strictEqual,deepEqual:d.deepStrictEqual,notEqual:d.notStrictEqual,notDeepEqual:d.notDeepStrictEqual}),d.strict.strict=d.strict;var S=Object.keys||function(e){var t=[];for(var r in e)s.call(e,r)&&t.push(r);return t}}).call(this,r(23))},function(e,t,r){(t=e.exports=r(186)).Stream=t,t.Readable=t,t.Writable=r(144),t.Duplex=r(79),t.Transform=r(189),t.PassThrough=r(302)},function(e,t,r){var n=r(10),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=a),o(i,a),a.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(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 i(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},function(e,t,r){"use strict";(function(t,n,i){var o=r(114);function a(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;e.entry=null;for(;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}e.exports=b;var s,u=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?n:o.nextTick;b.WritableState=y;var c=Object.create(r(100));c.inherits=r(11);var l={deprecate:r(145)},f=r(187),d=r(143).Buffer,h=i.Uint8Array||function(){};var p,g=r(188);function m(){}function y(e,t){s=s||r(79),e=e||{};var n=t instanceof s;this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,c=e.writableHighWaterMark,l=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(c||0===c)?c:l,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var f=!1===e.decodeStrings;this.decodeStrings=!f,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(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(O,e,t),e._writableState.errorEmitted=!0,e.emit("error",n)):(i(n),e._writableState.errorEmitted=!0,e.emit("error",n),O(e,t))}(e,r,n,t,i);else{var a=E(r);a||r.corked||r.bufferProcessing||!r.bufferedRequest||v(e,r),n?u(w,e,r,a,i):w(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.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function b(e){if(s=s||r(79),!(p.call(b,this)||this instanceof s))return new b(e);this._writableState=new y(e,this),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)),f.call(this)}function _(e,t,r,n,i,o,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function w(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),O(e,t)}function v(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),o=t.corkedRequestsFree;o.entry=r;for(var s=0,u=!0;r;)i[s]=r,r.isBuf||(u=!1),r=r.next,s+=1;i.allBuffers=u,_(e,t,!0,t.length,i,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new a(t),t.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,l=r.encoding,f=r.callback;if(_(e,t,!1,t.objectMode?1:c.length,c,l,f),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function E(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function S(e,t){e._final((function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),O(e,t)}))}function O(e,t){var r=E(t);return r&&(!function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,o.nextTick(S,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),r}c.inherits(b,f),y.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(y.prototype,"buffer",{get:l.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]?(p=Function.prototype[Symbol.hasInstance],Object.defineProperty(b,Symbol.hasInstance,{value:function(e){return!!p.call(this,e)||this===b&&(e&&e._writableState instanceof y)}})):p=function(e){return e instanceof this},b.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},b.prototype.write=function(e,t,r){var n,i=this._writableState,a=!1,s=!i.objectMode&&(n=e,d.isBuffer(n)||n instanceof h);return s&&!d.isBuffer(e)&&(e=function(e){return d.from(e)}(e)),"function"==typeof t&&(r=t,t=null),s?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof r&&(r=m),i.ended?function(e,t){var r=new Error("write after end");e.emit("error",r),o.nextTick(t,r)}(this,r):(s||function(e,t,r,n){var i=!0,a=!1;return null===r?a=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||t.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(e.emit("error",a),o.nextTick(n,a),i=!1),i}(this,i,e,r))&&(i.pendingcb++,a=function(e,t,r,n,i,o){if(!r){var a=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=d.from(t,r));return t}(t,n,i);n!==a&&(r=!0,i="buffer",n=a)}var s=t.objectMode?1:n.length;t.length+=s;var u=t.length<t.highWaterMark;u||(t.needDrain=!0);if(t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else _(e,t,!1,s,n,i,o);return u}(this,i,s,e,t,r)),a},b.prototype.cork=function(){this._writableState.corked++},b.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||v(this,e))},b.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 TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(b.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),b.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},b.prototype._writev=null,b.prototype.end=function(e,t,r){var n=this._writableState;"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||n.finished||function(e,t,r){t.ending=!0,O(e,t),r&&(t.finished?o.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,n,r)},Object.defineProperty(b.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),b.prototype.destroy=g.destroy,b.prototype._undestroy=g.undestroy,b.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,r(19),r(113).setImmediate,r(23))},function(e,t,r){(function(t){function r(e){try{if(!t.localStorage)return!1}catch(e){return!1}var r=t.localStorage[e];return null!=r&&"true"===String(r).toLowerCase()}e.exports=function(e,t){if(r("noDeprecation"))return e;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}}}).call(this,r(23))},function(e,t,r){"use strict";var n=r(11),i=r(191),o=r(16).Buffer,a=new Array(16);function s(){i.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function u(e,t){return e<<t|e>>>32-t}function c(e,t,r,n,i,o,a){return u(e+(t&r|~t&n)+i+o|0,a)+t|0}function l(e,t,r,n,i,o,a){return u(e+(t&n|r&~n)+i+o|0,a)+t|0}function f(e,t,r,n,i,o,a){return u(e+(t^r^n)+i+o|0,a)+t|0}function d(e,t,r,n,i,o,a){return u(e+(r^(t|~n))+i+o|0,a)+t|0}n(s,i),s.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,n=this._b,i=this._c,o=this._d;r=c(r,n,i,o,e[0],3614090360,7),o=c(o,r,n,i,e[1],3905402710,12),i=c(i,o,r,n,e[2],606105819,17),n=c(n,i,o,r,e[3],3250441966,22),r=c(r,n,i,o,e[4],4118548399,7),o=c(o,r,n,i,e[5],1200080426,12),i=c(i,o,r,n,e[6],2821735955,17),n=c(n,i,o,r,e[7],4249261313,22),r=c(r,n,i,o,e[8],1770035416,7),o=c(o,r,n,i,e[9],2336552879,12),i=c(i,o,r,n,e[10],4294925233,17),n=c(n,i,o,r,e[11],2304563134,22),r=c(r,n,i,o,e[12],1804603682,7),o=c(o,r,n,i,e[13],4254626195,12),i=c(i,o,r,n,e[14],2792965006,17),r=l(r,n=c(n,i,o,r,e[15],1236535329,22),i,o,e[1],4129170786,5),o=l(o,r,n,i,e[6],3225465664,9),i=l(i,o,r,n,e[11],643717713,14),n=l(n,i,o,r,e[0],3921069994,20),r=l(r,n,i,o,e[5],3593408605,5),o=l(o,r,n,i,e[10],38016083,9),i=l(i,o,r,n,e[15],3634488961,14),n=l(n,i,o,r,e[4],3889429448,20),r=l(r,n,i,o,e[9],568446438,5),o=l(o,r,n,i,e[14],3275163606,9),i=l(i,o,r,n,e[3],4107603335,14),n=l(n,i,o,r,e[8],1163531501,20),r=l(r,n,i,o,e[13],2850285829,5),o=l(o,r,n,i,e[2],4243563512,9),i=l(i,o,r,n,e[7],1735328473,14),r=f(r,n=l(n,i,o,r,e[12],2368359562,20),i,o,e[5],4294588738,4),o=f(o,r,n,i,e[8],2272392833,11),i=f(i,o,r,n,e[11],1839030562,16),n=f(n,i,o,r,e[14],4259657740,23),r=f(r,n,i,o,e[1],2763975236,4),o=f(o,r,n,i,e[4],1272893353,11),i=f(i,o,r,n,e[7],4139469664,16),n=f(n,i,o,r,e[10],3200236656,23),r=f(r,n,i,o,e[13],681279174,4),o=f(o,r,n,i,e[0],3936430074,11),i=f(i,o,r,n,e[3],3572445317,16),n=f(n,i,o,r,e[6],76029189,23),r=f(r,n,i,o,e[9],3654602809,4),o=f(o,r,n,i,e[12],3873151461,11),i=f(i,o,r,n,e[15],530742520,16),r=d(r,n=f(n,i,o,r,e[2],3299628645,23),i,o,e[0],4096336452,6),o=d(o,r,n,i,e[7],1126891415,10),i=d(i,o,r,n,e[14],2878612391,15),n=d(n,i,o,r,e[5],4237533241,21),r=d(r,n,i,o,e[12],1700485571,6),o=d(o,r,n,i,e[3],2399980690,10),i=d(i,o,r,n,e[10],4293915773,15),n=d(n,i,o,r,e[1],2240044497,21),r=d(r,n,i,o,e[8],1873313359,6),o=d(o,r,n,i,e[15],4264355552,10),i=d(i,o,r,n,e[6],2734768916,15),n=d(n,i,o,r,e[13],1309151649,21),r=d(r,n,i,o,e[4],4149444226,6),o=d(o,r,n,i,e[11],3174756917,10),i=d(i,o,r,n,e[2],718787259,15),n=d(n,i,o,r,e[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+i|0,this._d=this._d+o|0},s.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=o.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e},e.exports=s},function(e,t,r){"use strict";var n=r(85).codes.ERR_STREAM_PREMATURE_CLOSE;function i(){}e.exports=function e(t,r,o){if("function"==typeof r)return e(t,null,r);r||(r={}),o=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}(o||i);var a=r.readable||!1!==r.readable&&t.readable,s=r.writable||!1!==r.writable&&t.writable,u=function(){t.writable||l()},c=t._writableState&&t._writableState.finished,l=function(){s=!1,c=!0,a||o.call(t)},f=t._readableState&&t._readableState.endEmitted,d=function(){a=!1,f=!0,s||o.call(t)},h=function(e){o.call(t,e)},p=function(){var e;return a&&!f?(t._readableState&&t._readableState.ended||(e=new n),o.call(t,e)):s&&!c?(t._writableState&&t._writableState.ended||(e=new n),o.call(t,e)):void 0},g=function(){t.req.on("finish",l)};return!function(e){return e.setHeader&&"function"==typeof e.abort}(t)?s&&!t._writableState&&(t.on("end",u),t.on("close",u)):(t.on("complete",l),t.on("abort",p),t.req?g():t.on("request",g)),t.on("end",d),t.on("finish",l),!1!==r.error&&t.on("error",h),t.on("close",p),function(){t.removeListener("complete",l),t.removeListener("abort",p),t.removeListener("request",g),t.req&&t.req.removeListener("finish",l),t.removeListener("end",u),t.removeListener("close",u),t.removeListener("finish",l),t.removeListener("end",d),t.removeListener("error",h),t.removeListener("close",p)}}},function(e,t,r){"use strict";var n=r(10).Buffer,i=r(11),o=r(191),a=new Array(16),s=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],u=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],c=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],l=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],f=[0,1518500249,1859775393,2400959708,2840853838],d=[1352829926,1548603684,1836072691,2053994217,0];function h(){o.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function p(e,t){return e<<t|e>>>32-t}function g(e,t,r,n,i,o,a,s){return p(e+(t^r^n)+o+a|0,s)+i|0}function m(e,t,r,n,i,o,a,s){return p(e+(t&r|~t&n)+o+a|0,s)+i|0}function y(e,t,r,n,i,o,a,s){return p(e+((t|~r)^n)+o+a|0,s)+i|0}function b(e,t,r,n,i,o,a,s){return p(e+(t&n|r&~n)+o+a|0,s)+i|0}function _(e,t,r,n,i,o,a,s){return p(e+(t^(r|~n))+o+a|0,s)+i|0}i(h,o),h.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);for(var r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,h=0|this._e,w=0|this._a,v=0|this._b,E=0|this._c,S=0|this._d,O=0|this._e,T=0;T<80;T+=1){var A,M;T<16?(A=g(r,n,i,o,h,e[s[T]],f[0],c[T]),M=_(w,v,E,S,O,e[u[T]],d[0],l[T])):T<32?(A=m(r,n,i,o,h,e[s[T]],f[1],c[T]),M=b(w,v,E,S,O,e[u[T]],d[1],l[T])):T<48?(A=y(r,n,i,o,h,e[s[T]],f[2],c[T]),M=y(w,v,E,S,O,e[u[T]],d[2],l[T])):T<64?(A=b(r,n,i,o,h,e[s[T]],f[3],c[T]),M=m(w,v,E,S,O,e[u[T]],d[3],l[T])):(A=_(r,n,i,o,h,e[s[T]],f[4],c[T]),M=g(w,v,E,S,O,e[u[T]],d[4],l[T])),r=h,h=o,o=p(i,10),i=n,n=A,w=O,O=S,S=p(E,10),E=v,v=M}var D=this._b+i+S|0;this._b=this._c+o+O|0,this._c=this._d+h+w|0,this._d=this._e+r+v|0,this._e=this._a+n+E|0,this._a=D},h.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=n.alloc?n.alloc(20):new n(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e},e.exports=h},function(e,t,r){(t=e.exports=function(e){e=e.toLowerCase();var r=t[e];if(!r)throw new Error(e+" is not supported (we accept pull requests)");return new r}).sha=r(324),t.sha1=r(325),t.sha224=r(326),t.sha256=r(198),t.sha384=r(327),t.sha512=r(199)},function(e,t,r){"use strict";var n=r(44);function i(e){this.options=e,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0}e.exports=i,i.prototype._init=function(){},i.prototype.update=function(e){return 0===e.length?[]:"decrypt"===this.type?this._updateDecrypt(e):this._updateEncrypt(e)},i.prototype._buffer=function(e,t){for(var r=Math.min(this.buffer.length-this.bufferOff,e.length-t),n=0;n<r;n++)this.buffer[this.bufferOff+n]=e[t+n];return this.bufferOff+=r,r},i.prototype._flushBuffer=function(e,t){return this._update(this.buffer,0,e,t),this.bufferOff=0,this.blockSize},i.prototype._updateEncrypt=function(e){var t=0,r=0,n=(this.bufferOff+e.length)/this.blockSize|0,i=new Array(n*this.blockSize);0!==this.bufferOff&&(t+=this._buffer(e,t),this.bufferOff===this.buffer.length&&(r+=this._flushBuffer(i,r)));for(var o=e.length-(e.length-t)%this.blockSize;t<o;t+=this.blockSize)this._update(e,t,i,r),r+=this.blockSize;for(;t<e.length;t++,this.bufferOff++)this.buffer[this.bufferOff]=e[t];return i},i.prototype._updateDecrypt=function(e){for(var t=0,r=0,n=Math.ceil((this.bufferOff+e.length)/this.blockSize)-1,i=new Array(n*this.blockSize);n>0;n--)t+=this._buffer(e,t),r+=this._flushBuffer(i,r);return t+=this._buffer(e,t),i},i.prototype.final=function(e){var t,r;return e&&(t=this.update(e)),r="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),t?t.concat(r):r},i.prototype._pad=function(e,t){if(0===t)return!1;for(;t<e.length;)e[t++]=0;return!0},i.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];var e=new Array(this.blockSize);return this._update(this.buffer,0,e,0),e},i.prototype._unpad=function(e){return e},i.prototype._finalDecrypt=function(){n.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var e=new Array(this.blockSize);return this._flushBuffer(e,0),this._unpad(e)}},function(e,t,r){var n=r(336),i=r(344),o=r(212);t.createCipher=t.Cipher=n.createCipher,t.createCipheriv=t.Cipheriv=n.createCipheriv,t.createDecipher=t.Decipher=i.createDecipher,t.createDecipheriv=t.Decipheriv=i.createDecipheriv,t.listCiphers=t.getCiphers=function(){return Object.keys(o)}},function(e,t,r){var n={ECB:r(337),CBC:r(338),CFB:r(339),CFB8:r(340),CFB1:r(341),OFB:r(342),CTR:r(210),GCM:r(210)},i=r(212);for(var o in i)i[o].module=n[i[o].mode];e.exports=i},function(e,t,r){var n;function i(e){this.rand=e}if(e.exports=function(e){return n||(n=new i(null)),n.generate(e)},e.exports.Rand=i,i.prototype.generate=function(e){return this._rand(e)},i.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r<t.length;r++)t[r]=this.rand.getByte();return t},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?i.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?i.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"==typeof window&&(i.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var o=r(348);if("function"!=typeof o.randomBytes)throw new Error("Not supported");i.prototype._rand=function(e){return o.randomBytes(e)}}catch(e){}},function(e,t,r){"use strict";var n=r(88).codes.ERR_STREAM_PREMATURE_CLOSE;function i(){}e.exports=function e(t,r,o){if("function"==typeof r)return e(t,null,r);r||(r={}),o=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}(o||i);var a=r.readable||!1!==r.readable&&t.readable,s=r.writable||!1!==r.writable&&t.writable,u=function(){t.writable||l()},c=t._writableState&&t._writableState.finished,l=function(){s=!1,c=!0,a||o.call(t)},f=t._readableState&&t._readableState.endEmitted,d=function(){a=!1,f=!0,s||o.call(t)},h=function(e){o.call(t,e)},p=function(){var e;return a&&!f?(t._readableState&&t._readableState.ended||(e=new n),o.call(t,e)):s&&!c?(t._writableState&&t._writableState.ended||(e=new n),o.call(t,e)):void 0},g=function(){t.req.on("finish",l)};return!function(e){return e.setHeader&&"function"==typeof e.abort}(t)?s&&!t._writableState&&(t.on("end",u),t.on("close",u)):(t.on("complete",l),t.on("abort",p),t.req?g():t.on("request",g)),t.on("end",d),t.on("finish",l),!1!==r.error&&t.on("error",h),t.on("close",p),function(){t.removeListener("complete",l),t.removeListener("abort",p),t.removeListener("request",g),t.req&&t.req.removeListener("finish",l),t.removeListener("end",u),t.removeListener("close",u),t.removeListener("finish",l),t.removeListener("end",d),t.removeListener("error",h),t.removeListener("close",p)}}},function(e,t,r){(function(t){var n=r(361),i=r(84);function o(e){var t,r=e.modulus.byteLength();do{t=new n(i(r))}while(t.cmp(e.modulus)>=0||!t.umod(e.prime1)||!t.umod(e.prime2));return t}function a(e,r){var i=function(e){var t=o(e);return{blinder:t.toRed(n.mont(e.modulus)).redPow(new n(e.publicExponent)).fromRed(),unblinder:t.invm(e.modulus)}}(r),a=r.modulus.byteLength(),s=new n(e).mul(i.blinder).umod(r.modulus),u=s.toRed(n.mont(r.prime1)),c=s.toRed(n.mont(r.prime2)),l=r.coefficient,f=r.prime1,d=r.prime2,h=u.redPow(r.exponent1).fromRed(),p=c.redPow(r.exponent2).fromRed(),g=h.isub(p).imul(l).umod(f).imul(d);return p.iadd(g).imul(i.unblinder).umod(r.modulus).toArrayLike(t,"be",a)}a.getr=o,e.exports=a}).call(this,r(10).Buffer)},function(e,t,r){"use strict";var n=t;n.version=r(363).version,n.utils=r(45),n.rand=r(153),n.curve=r(224),n.curves=r(157),n.ec=r(374),n.eddsa=r(378)},function(e,t,r){"use strict";var n,i=t,o=r(158),a=r(224),s=r(45).assert;function u(e){"short"===e.type?this.curve=new a.short(e):"edwards"===e.type?this.curve=new a.edwards(e):this.curve=new a.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function c(e,t){Object.defineProperty(i,e,{configurable:!0,enumerable:!0,get:function(){var r=new u(t);return Object.defineProperty(i,e,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=u,c("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),c("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),c("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),c("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),c("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),c("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),c("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=r(373)}catch(e){n=void 0}c("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},function(e,t,r){var n=t;n.utils=r(53),n.common=r(103),n.sha=r(367),n.ripemd=r(371),n.hmac=r(372),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},function(e,t,r){"use strict";(function(t){var n,i=r(10),o=i.Buffer,a={};for(n in i)i.hasOwnProperty(n)&&"SlowBuffer"!==n&&"Buffer"!==n&&(a[n]=i[n]);var s=a.Buffer={};for(n in o)o.hasOwnProperty(n)&&"allocUnsafe"!==n&&"allocUnsafeSlow"!==n&&(s[n]=o[n]);if(a.Buffer.prototype=o.prototype,s.from&&s.from!==Uint8Array.from||(s.from=function(e,t,r){if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type '+typeof e);if(e&&void 0===e.length)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);return o(e,t,r)}),s.alloc||(s.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError('The "size" argument must be of type number. Received type '+typeof e);if(e<0||e>=2*(1<<30))throw new RangeError('The value "'+e+'" is invalid for option "size"');var n=o(e);return t&&0!==t.length?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n}),!a.kStringMaxLength)try{a.kStringMaxLength=t.binding("buffer").kStringMaxLength}catch(e){}a.constants||(a.constants={MAX_LENGTH:a.kMaxLength},a.kStringMaxLength&&(a.constants.MAX_STRING_LENGTH=a.kStringMaxLength)),e.exports=a}).call(this,r(19))},function(e,t,r){"use strict";const n=r(161).Reporter,i=r(104).EncoderBuffer,o=r(104).DecoderBuffer,a=r(44),s=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],u=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(s);function c(e,t,r){const n={};this._baseState=n,n.name=r,n.enc=e,n.parent=t||null,n.children=null,n.tag=null,n.args=null,n.reverseArgs=null,n.choice=null,n.optional=!1,n.any=!1,n.obj=!1,n.use=null,n.useDecoder=null,n.key=null,n.default=null,n.explicit=null,n.implicit=null,n.contains=null,n.parent||(n.children=[],this._wrap())}e.exports=c;const l=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];c.prototype.clone=function(){const e=this._baseState,t={};l.forEach((function(r){t[r]=e[r]}));const r=new this.constructor(t.parent);return r._baseState=t,r},c.prototype._wrap=function(){const e=this._baseState;u.forEach((function(t){this[t]=function(){const r=new this.constructor(this);return e.children.push(r),r[t].apply(r,arguments)}}),this)},c.prototype._init=function(e){const t=this._baseState;a(null===t.parent),e.call(this),t.children=t.children.filter((function(e){return e._baseState.parent===this}),this),a.equal(t.children.length,1,"Root node can have only one child")},c.prototype._useArgs=function(e){const t=this._baseState,r=e.filter((function(e){return e instanceof this.constructor}),this);e=e.filter((function(e){return!(e instanceof this.constructor)}),this),0!==r.length&&(a(null===t.children),t.children=r,r.forEach((function(e){e._baseState.parent=this}),this)),0!==e.length&&(a(null===t.args),t.args=e,t.reverseArgs=e.map((function(e){if("object"!=typeof e||e.constructor!==Object)return e;const t={};return Object.keys(e).forEach((function(r){r==(0|r)&&(r|=0);const n=e[r];t[n]=r})),t})))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach((function(e){c.prototype[e]=function(){const t=this._baseState;throw new Error(e+" not implemented for encoding: "+t.enc)}})),s.forEach((function(e){c.prototype[e]=function(){const t=this._baseState,r=Array.prototype.slice.call(arguments);return a(null===t.tag),t.tag=e,this._useArgs(r),this}})),c.prototype.use=function(e){a(e);const t=this._baseState;return a(null===t.use),t.use=e,this},c.prototype.optional=function(){return this._baseState.optional=!0,this},c.prototype.def=function(e){const t=this._baseState;return a(null===t.default),t.default=e,t.optional=!0,this},c.prototype.explicit=function(e){const t=this._baseState;return a(null===t.explicit&&null===t.implicit),t.explicit=e,this},c.prototype.implicit=function(e){const t=this._baseState;return a(null===t.explicit&&null===t.implicit),t.implicit=e,this},c.prototype.obj=function(){const e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,0!==t.length&&this._useArgs(t),this},c.prototype.key=function(e){const t=this._baseState;return a(null===t.key),t.key=e,this},c.prototype.any=function(){return this._baseState.any=!0,this},c.prototype.choice=function(e){const t=this._baseState;return a(null===t.choice),t.choice=e,this._useArgs(Object.keys(e).map((function(t){return e[t]}))),this},c.prototype.contains=function(e){const t=this._baseState;return a(null===t.use),t.contains=e,this},c.prototype._decode=function(e,t){const r=this._baseState;if(null===r.parent)return e.wrapResult(r.children[0]._decode(e,t));let n,i=r.default,a=!0,s=null;if(null!==r.key&&(s=e.enterKey(r.key)),r.optional){let n=null;if(null!==r.explicit?n=r.explicit:null!==r.implicit?n=r.implicit:null!==r.tag&&(n=r.tag),null!==n||r.any){if(a=this._peekTag(e,n,r.any),e.isError(a))return a}else{const n=e.save();try{null===r.choice?this._decodeGeneric(r.tag,e,t):this._decodeChoice(e,t),a=!0}catch(e){a=!1}e.restore(n)}}if(r.obj&&a&&(n=e.enterObject()),a){if(null!==r.explicit){const t=this._decodeTag(e,r.explicit);if(e.isError(t))return t;e=t}const n=e.offset;if(null===r.use&&null===r.choice){let t;r.any&&(t=e.save());const n=this._decodeTag(e,null!==r.implicit?r.implicit:r.tag,r.any);if(e.isError(n))return n;r.any?i=e.raw(t):e=n}if(t&&t.track&&null!==r.tag&&t.track(e.path(),n,e.length,"tagged"),t&&t.track&&null!==r.tag&&t.track(e.path(),e.offset,e.length,"content"),r.any||(i=null===r.choice?this._decodeGeneric(r.tag,e,t):this._decodeChoice(e,t)),e.isError(i))return i;if(r.any||null!==r.choice||null===r.children||r.children.forEach((function(r){r._decode(e,t)})),r.contains&&("octstr"===r.tag||"bitstr"===r.tag)){const n=new o(i);i=this._getUse(r.contains,e._reporterState.obj)._decode(n,t)}}return r.obj&&a&&(i=e.leaveObject(n)),null===r.key||null===i&&!0!==a?null!==s&&e.exitKey(s):e.leaveKey(s,r.key,i),i},c.prototype._decodeGeneric=function(e,t,r){const n=this._baseState;return"seq"===e||"set"===e?null:"seqof"===e||"setof"===e?this._decodeList(t,e,n.args[0],r):/str$/.test(e)?this._decodeStr(t,e,r):"objid"===e&&n.args?this._decodeObjid(t,n.args[0],n.args[1],r):"objid"===e?this._decodeObjid(t,null,null,r):"gentime"===e||"utctime"===e?this._decodeTime(t,e,r):"null_"===e?this._decodeNull(t,r):"bool"===e?this._decodeBool(t,r):"objDesc"===e?this._decodeStr(t,e,r):"int"===e||"enum"===e?this._decodeInt(t,n.args&&n.args[0],r):null!==n.use?this._getUse(n.use,t._reporterState.obj)._decode(t,r):t.error("unknown tag: "+e)},c.prototype._getUse=function(e,t){const r=this._baseState;return r.useDecoder=this._use(e,t),a(null===r.useDecoder._baseState.parent),r.useDecoder=r.useDecoder._baseState.children[0],r.implicit!==r.useDecoder._baseState.implicit&&(r.useDecoder=r.useDecoder.clone(),r.useDecoder._baseState.implicit=r.implicit),r.useDecoder},c.prototype._decodeChoice=function(e,t){const r=this._baseState;let n=null,i=!1;return Object.keys(r.choice).some((function(o){const a=e.save(),s=r.choice[o];try{const r=s._decode(e,t);if(e.isError(r))return!1;n={type:o,value:r},i=!0}catch(t){return e.restore(a),!1}return!0}),this),i?n:e.error("Choice not matched")},c.prototype._createEncoderBuffer=function(e){return new i(e,this.reporter)},c.prototype._encode=function(e,t,r){const n=this._baseState;if(null!==n.default&&n.default===e)return;const i=this._encodeValue(e,t,r);return void 0===i||this._skipDefault(i,t,r)?void 0:i},c.prototype._encodeValue=function(e,t,r){const i=this._baseState;if(null===i.parent)return i.children[0]._encode(e,t||new n);let o=null;if(this.reporter=t,i.optional&&void 0===e){if(null===i.default)return;e=i.default}let a=null,s=!1;if(i.any)o=this._createEncoderBuffer(e);else if(i.choice)o=this._encodeChoice(e,t);else if(i.contains)a=this._getUse(i.contains,r)._encode(e,t),s=!0;else if(i.children)a=i.children.map((function(r){if("null_"===r._baseState.tag)return r._encode(null,t,e);if(null===r._baseState.key)return t.error("Child should have a key");const n=t.enterKey(r._baseState.key);if("object"!=typeof e)return t.error("Child expected, but input is not object");const i=r._encode(e[r._baseState.key],t,e);return t.leaveKey(n),i}),this).filter((function(e){return e})),a=this._createEncoderBuffer(a);else if("seqof"===i.tag||"setof"===i.tag){if(!i.args||1!==i.args.length)return t.error("Too many args for : "+i.tag);if(!Array.isArray(e))return t.error("seqof/setof, but data is not Array");const r=this.clone();r._baseState.implicit=null,a=this._createEncoderBuffer(e.map((function(r){const n=this._baseState;return this._getUse(n.args[0],e)._encode(r,t)}),r))}else null!==i.use?o=this._getUse(i.use,r)._encode(e,t):(a=this._encodePrimitive(i.tag,e),s=!0);if(!i.any&&null===i.choice){const e=null!==i.implicit?i.implicit:i.tag,r=null===i.implicit?"universal":"context";null===e?null===i.use&&t.error("Tag could be omitted only for .use()"):null===i.use&&(o=this._encodeComposite(e,s,r,a))}return null!==i.explicit&&(o=this._encodeComposite(i.explicit,!1,"context",o)),o},c.prototype._encodeChoice=function(e,t){const r=this._baseState,n=r.choice[e.type];return n||a(!1,e.type+" not found in "+JSON.stringify(Object.keys(r.choice))),n._encode(e.value,t)},c.prototype._encodePrimitive=function(e,t){const r=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);if("objid"===e&&r.args)return this._encodeObjid(t,r.reverseArgs[0],r.args[1]);if("objid"===e)return this._encodeObjid(t,null,null);if("gentime"===e||"utctime"===e)return this._encodeTime(t,e);if("null_"===e)return this._encodeNull();if("int"===e||"enum"===e)return this._encodeInt(t,r.args&&r.reverseArgs[0]);if("bool"===e)return this._encodeBool(t);if("objDesc"===e)return this._encodeStr(t,e);throw new Error("Unsupported tag: "+e)},c.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)},c.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(e)}},function(e,t,r){"use strict";const n=r(11);function i(e){this._reporterState={obj:null,path:[],options:e||{},errors:[]}}function o(e,t){this.path=e,this.rethrow(t)}t.Reporter=i,i.prototype.isError=function(e){return e instanceof o},i.prototype.save=function(){const e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}},i.prototype.restore=function(e){const t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)},i.prototype.enterKey=function(e){return this._reporterState.path.push(e)},i.prototype.exitKey=function(e){const t=this._reporterState;t.path=t.path.slice(0,e-1)},i.prototype.leaveKey=function(e,t,r){const n=this._reporterState;this.exitKey(e),null!==n.obj&&(n.obj[t]=r)},i.prototype.path=function(){return this._reporterState.path.join("/")},i.prototype.enterObject=function(){const e=this._reporterState,t=e.obj;return e.obj={},t},i.prototype.leaveObject=function(e){const t=this._reporterState,r=t.obj;return t.obj=e,r},i.prototype.error=function(e){let t;const r=this._reporterState,n=e instanceof o;if(t=n?e:new o(r.path.map((function(e){return"["+JSON.stringify(e)+"]"})).join(""),e.message||e,e.stack),!r.options.partial)throw t;return n||r.errors.push(t),t},i.prototype.wrapResult=function(e){const t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e},n(o,Error),o.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,o),!this.stack)try{throw new Error(this.message)}catch(e){this.stack=e.stack}return this}},function(e,t,r){"use strict";function n(e){const t={};return Object.keys(e).forEach((function(r){(0|r)==r&&(r|=0);const n=e[r];t[n]=r})),t}t.tagClass={0:"universal",1:"application",2:"context",3:"private"},t.tagClassByName=n(t.tagClass),t.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},t.tagByName=n(t.tag)},function(e,t,r){var n=r(411),i=n,o=globalThis;i.exportSymbol("proto.EncryptedData",null,o),i.exportSymbol("proto.Message",null,o),i.exportSymbol("proto.MessageEnvelope",null,o),i.exportSymbol("proto.SyncRequest",null,o),i.exportSymbol("proto.SyncResponse",null,o),proto.EncryptedData=function(e){n.Message.initialize(this,e,0,-1,null,null)},i.inherits(proto.EncryptedData,n.Message),i.DEBUG&&!COMPILED&&(proto.EncryptedData.displayName="proto.EncryptedData"),proto.Message=function(e){n.Message.initialize(this,e,0,-1,null,null)},i.inherits(proto.Message,n.Message),i.DEBUG&&!COMPILED&&(proto.Message.displayName="proto.Message"),proto.MessageEnvelope=function(e){n.Message.initialize(this,e,0,-1,null,null)},i.inherits(proto.MessageEnvelope,n.Message),i.DEBUG&&!COMPILED&&(proto.MessageEnvelope.displayName="proto.MessageEnvelope"),proto.SyncRequest=function(e){n.Message.initialize(this,e,0,-1,proto.SyncRequest.repeatedFields_,null)},i.inherits(proto.SyncRequest,n.Message),i.DEBUG&&!COMPILED&&(proto.SyncRequest.displayName="proto.SyncRequest"),proto.SyncResponse=function(e){n.Message.initialize(this,e,0,-1,proto.SyncResponse.repeatedFields_,null)},i.inherits(proto.SyncResponse,n.Message),i.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)},i.object.extend(t,proto)},function(e,t,r){(function(e){t.require=function(){var t=r(83);if(e.versions.electron)try{originalFs=r(!function(){var e=new Error("Cannot find module 'original-fs'");throw e.code="MODULE_NOT_FOUND",e}()),Object.keys(originalFs).length>0&&(t=originalFs)}catch(e){}return t}}).call(this,r(19))},function(e,t,r){"use strict";var n=Array.prototype.slice,i=r(253),o=Object.keys,a=o?function(e){return o(e)}:r(441),s=Object.keys;a.shim=function(){Object.keys?function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2)||(Object.keys=function(e){return i(e)?s(n.call(e)):s(e)}):Object.keys=a;return Object.keys||a},e.exports=a},function(e,t,r){"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(122);e.exports=function(){return"function"==typeof n&&("function"==typeof Symbol&&("symbol"==typeof n("foo")&&("symbol"==typeof Symbol("bar")&&i())))}},function(e,t,r){"use strict";var n=r(442);e.exports=Function.prototype.bind||n},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(0);function i(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(n.a)(e),i=Object(n.a)(t);return r.getTime()>i.getTime()}},function(e,t){e.exports={send:void 0}},function(e,t,r){"use strict";r.d(t,"a",(function(){return A}));var n=r(274),i=r.n(n),o=r(4),a=r.n(o),s=r(15);function u(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,i,o=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==r.return||r.return()}finally{if(s)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return c(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return c(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}const l=r(42);let f=a.a.migrationsPath,d={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.map(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 i=n[1],o=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 c=t.name.split("!")[0],l=e.runQuery("SELECT * FROM spreadsheet_cells WHERE name = ?",[`${c}!carryover-${s}`],!0),f="budget-report"===i?"reflect_budgets":"zero_budgets";e.runQuery(`INSERT INTO ${f} (id, month, category, amount, carryover) VALUES (?, ?, ?, ?, ?)`,[`${o}-${s}`,a,s,u,l.length>0&&"true"===r(l[0])?1:0])})});let i=e.runQuery("SELECT * FROM spreadsheet_cells WHERE name LIKE 'budget%!buffered'",[],!0);e.transaction(()=>{i.map(t=>{let n=t.name.match(/^budget(\d+)!buffered$/);if(n){let i=n[1].slice(0,4)+"-"+n[1].slice(4),o=parseInt(r(t));isNaN(o)&&(o=0),e.runQuery("INSERT INTO zero_budget_months (id, buffered) VALUES (?, ?)",[i,o])}})});let o=e.runQuery("SELECT * FROM spreadsheet_cells WHERE name LIKE 'notes!%'",[],!0);e.transaction(()=>{o.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=u(t.name.split("!"),2)[1];e.runQuery("INSERT INTO notes (id, note) VALUES (?, ?)",[r,n])}})}),e.execQuery("\n DROP TABLE spreadsheet_cells;\n ANALYZE;\n VACUUM;\n ")}};function h(e){return parseInt(e.match(/^(\d)+/)[0])}async function p(e,t,r){const n=await a.a.readFile(a.a.join(r,t));t.match(/\.js$/)?await async function(e,t){const r={runQuery:(t,r,n)=>s.runQuery(e,t,r,n),execQuery:t=>s.execQuery(e,t),transaction:t=>s.transaction(e,t)};if(null==d[t])throw new Error("Could not find JS migration code to run for "+t);return(0,d[t])(r,()=>l.v4Sync())}(e,h(t)):await async function(e,t){try{await s.execQuery(e,t)}catch(e){throw console.log("Error applying sql:",t),e}}(e,n),await s.runQuery(e,"INSERT INTO __migrations__ (id) VALUES (?)",[h(t)])}async function g(e){let t=await async function(e){return(await s.runQuery(e,"SELECT * FROM __migrations__ ORDER BY id ASC",[],!0)).map(e=>e.id)}(e),r=await async function(e){return(await a.a.listDir(e)).filter(e=>e.match(/(\.sql|\.js)$/)).sort((e,t)=>{const r=h(e),n=h(t);return r<n?-1:r>n?1:0})}(f);!function(e,t){for(let r=0;r<e.length;r++)if(r>=t.length||e[r]!==h(t[r]))throw new Error("out-of-sync-migrations")}(t,r);const n=function(e,t){return t.filter(t=>{const r=h(t);return-1===e.indexOf(r)})}(t,r);for(let t of n)await p(e,t,f);return n}var m=r(1),y=r(33),b=r(58);const _=["fields"];function w(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 v(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?w(Object(r),!0).forEach((function(t){E(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):w(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function E(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function S(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function O(e){return Object.keys(e).map(t=>{let r=e[t],n=r!==t;return r.match(/[ .]/)||(r="_."+r),n?`${r} AS ${Object(b.d)(t)}`:""+r}).join(", ")}async function T(){let e=(await m.first("SELECT value FROM __meta__ WHERE key = ?",["view-hash"])||{}).value,t=function(e,t){let r=t.views,n=[];return Object.keys(r).forEach(t=>{let i=r[t],o=i.fields,a=void 0===o?{}:o,s=S(i,_),u=Object.fromEntries(Object.keys(e[t]).map(e=>[e,e])),c=v(v({},u),a);Object.keys(s).forEach(e=>{let t,r=e=>O(v(v({},u),e)),i=e=>O(v(v({},c),e));t="function"==typeof s[e]?s[e](i,r):s[e],t=t.trim().replace(/;$/,""),n.push(`\n DROP VIEW IF EXISTS ${e};\n CREATE VIEW ${e} AS ${t};\n `)})}),n.join("\n")}(y.a,y.b),r=i()(t);e!==r&&(await m.execQuery(t),await m.runQuery("INSERT OR REPLACE INTO __meta__ (key, value) VALUES (?, ?)",["view-hash",r]))}async function A(){await async function(){await g(m.getDatabase())}(),await T()}},function(e,t,r){"use strict";const n=r(290),i=Symbol("max"),o=Symbol("length"),a=Symbol("lengthCalculator"),s=Symbol("allowStale"),u=Symbol("maxAge"),c=Symbol("dispose"),l=Symbol("noDisposeOnSet"),f=Symbol("lruList"),d=Symbol("cache"),h=Symbol("updateAgeOnGet"),p=()=>1;const g=(e,t,r)=>{const n=e[d].get(t);if(n){const t=n.value;if(m(e,t)){if(b(e,n),!e[s])return}else r&&(e[h]&&(n.value.now=Date.now()),e[f].unshiftNode(n));return t.value}},m=(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]},y=e=>{if(e[o]>e[i])for(let t=e[f].tail;e[o]>e[i]&&null!==t;){const r=t.prev;b(e,t),t=r}},b=(e,t)=>{if(t){const r=t.value;e[c]&&e[c](r.key,r.value),e[o]-=r.length,e[d].delete(r.key),e[f].removeNode(t)}};class _{constructor(e,t,r,n,i){this.key=e,this.value=t,this.length=r,this.now=n,this.maxAge=i||0}}const w=(e,t,r,n)=>{let i=r.value;m(e,i)&&(b(e,r),e[s]||(i=void 0)),i&&t.call(n,i.value,i.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[i]=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[c]=e.dispose,this[l]=e.noDisposeOnSet||!1,this[h]=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[i]=e||1/0,y(this)}get max(){return this[i]}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,y(this)}get maxAge(){return this[u]}set lengthCalculator(e){"function"!=typeof e&&(e=p),e!==this[a]&&(this[a]=e,this[o]=0,this[f].forEach(e=>{e.length=this[a](e.value,e.key),this[o]+=e.length})),y(this)}get lengthCalculator(){return this[a]}get length(){return this[o]}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[c]&&this[f]&&this[f].length&&this[f].forEach(e=>this[c](e.key,e.value)),this[d]=new Map,this[f]=new n,this[o]=0}dump(){return this[f].map(e=>!m(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[i])return b(this,this[d].get(e)),!1;const a=this[d].get(e).value;return this[c]&&(this[l]||this[c](e,a.value)),a.now=n,a.maxAge=r,a.value=t,this[o]+=s-a.length,a.length=s,this.get(e),y(this),!0}const h=new _(e,t,s,n,r);return h.length>this[i]?(this[c]&&this[c](e,t),!1):(this[o]+=h.length,this[f].unshift(h),this[d].set(e,this[f].head),y(this),!0)}has(e){if(!this[d].has(e))return!1;const t=this[d].get(e).value;return!m(this,t)}get(e){return g(this,e,!0)}peek(e){return g(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],i=n.e||0;if(0===i)this.set(n.k,n.v);else{const e=i-t;e>0&&this.set(n.k,n.v,e)}}}prune(){this[d].forEach((e,t)=>g(this,t,!1))}}},function(e,t,r){"use strict";r.d(t,"a",(function(){return h}));var n=r(129),i=r(33),o=r(58),a=r(26);function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,i,o=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==r.return||r.return()}finally{if(s)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return u(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return u(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}const c=r(409),l=r(49),f=l.unresolveName,d=l.resolveName;class h{constructor(e,t){this.graph=new c,this.nodes=new Map,this.transactionDepth=0,this.saveCache=e,this.setCacheStatus=t,this.dirtyCells=[],this.computeQueue=[],this.events=Object(n.a)(),this._meta={createdMonths:new Set}}meta(){return this._meta}setMeta(e){this._meta=e}_getNode(e){const t=f(e).sheet;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(e=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 returned a promise! this is discouraged because errors are not handled properly")}else{if(!t.sql){e++;continue}r=Object(a.a)(t.query,t.sql.sqlPieces,t.sql.state)}}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}),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",(...r)=>(t(),e(...r)));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(d(e,t)).value}getCellExpr(e,t){return this.getNode(d(e,t)).expr}getCellValueLoose(e,t){let r=d(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=d(e,t),a=this._getNode(n);if(a.query!==r){a.query=r;let e=Object(o.a)(a.query,i.a,i.b),t=e.sqlPieces,s=e.state;a.sql={sqlPieces:t,state:s},this.transaction(()=>{this._markDirty(n)})}}createStatic(e,t,r){let n=d(e,t);this.nodes.has(n)||this.create(n,r)}createDynamic(e,t,{dependencies:r=[],run:n,initialValue:i,refresh:o}){let a=d(e,t),s=this._getNode(a);s.dynamic||(s.dynamic=!0,s._run=n,r=r.map(t=>{let r;return r=f(t).sheet?t:d(e,t),r}),s._dependencies=r,this.graph.removeIncomingEdges(a),r.forEach(e=>{this.graph.addEdge(e,a)}),(null==s.value||o)&&this.transaction(()=>{s.value=i,this._markDirty(a)}))}clearSheet(e){for(let r of this.nodes.entries()){var t=s(r,2);let n=t[0];t[1].sheet===e&&this.nodes.delete(n)}}voidCell(e,t,r=null){let n=this.getNode(d(e,t));n._run=null,n.dynamic=!1,n.value=r}deleteCell(e,t){this.voidCell(e,t),this.nodes.delete(d(e,t))}addDependencies(e,t,r){let n=d(e,t);r=r.map(t=>f(t).sheet?t:d(e,t));let i=this.getNode(n),o=r.filter(e=>-1===(i._dependencies||[]).indexOf(e));o.length>0&&(i._dependencies=(i._dependencies||[]).concat(o),o.forEach(e=>{this.graph.addEdge(e,n)}),this.recompute(n))}removeDependencies(e,t,r){let n=d(e,t);r=r.map(t=>f(t).sheet?t:d(e,t));let i=this.getNode(n);i._dependencies=(i._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()}}},function(e,t,r){"use strict";(function(e){r.d(t,"b",(function(){return u})),r.d(t,"a",(function(){return c}));var n=r(31),i=r(8);let o=r(18).SyncError,a=r(163);function s(t){return e.isBuffer(t)?t:e.from(t)}async function u(t,r,s,u){let c=i.b().encryptKeyId,l=new a.SyncRequest;for(let t=0;t<u.length;t++){let r=u[t],i=new a.MessageEnvelope;i.setTimestamp(r.timestamp);let s=new a.Message;s.setDataset(r.dataset),s.setRow(r.row),s.setColumn(r.column),s.setValue(r.value);let f=s.serializeBinary();if(c){let t,r=new a.EncryptedData;try{t=await n.a.encrypt(f,c)}catch(e){throw new o("encrypt-failure",{isMissingKey:"missing-key"===e.message})}r.setData(t.value),r.setIv(e.from(t.meta.iv,"base64")),r.setAuthtag(e.from(t.meta.authTag,"base64")),i.setContent(r.serializeBinary()),i.setIsencrypted(!0)}else i.setContent(f);l.addMessages(i)}return l.setGroupid(t),l.setFileid(r),l.setKeyid(c),l.setSince(s),l.serializeBinary()}async function c(e){let t=i.b().encryptKeyId,r=a.SyncResponse.deserializeBinary(e),u=JSON.parse(r.getMerkle()),c=r.getMessagesList(),l=[];for(let e=0;e<c.length;e++){let r,i=c[e],u=i.getTimestamp();if(i.getIsencrypted()){let e,u=a.EncryptedData.deserializeBinary(i.getContent());try{e=await n.a.decrypt(s(u.getData()),{keyId:t,algorithm:"aes-256-gcm",iv:s(u.getIv()),authTag:s(u.getAuthtag())})}catch(e){throw console.log(e),new o("decrypt-failure",{isMissingKey:"missing-key"===e.message})}r=a.Message.deserializeBinary(e)}else r=a.Message.deserializeBinary(i.getContent());l.push({timestamp:u,dataset:r.getDataset(),row:r.getRow(),column:r.getColumn(),value:r.getValue()})}return{messages:l,merkle:u}}}).call(this,r(10).Buffer)},function(e,t,r){"use strict";r.d(t,"b",(function(){return a})),r.d(t,"a",(function(){return s}));var n=r(4),i=r.n(n);const o=r(42);async function a(e){let t=1,r="My Finances";for(;e.find(e=>e.name===r);)r="My Finances "+t,t++;return r}async function s(e){let t=e.replace(/( |[^A-Za-z0-9])/g,"-")+"-"+o.v4Sync().slice(0,7),r=0,n=i.a.getBudgetDir(t);for(;await i.a.exists(n);)r++,n=i.a.getBudgetDir(t+r.toString());return r>0&&(t+=r.toString()),t}},function(e,t,r){"use strict";r.d(t,"b",(function(){return s})),r.d(t,"a",(function(){return u}));r(83);var n=r(176),i=r.n(n),o=r(26),a=r(12);async function s(e,t,r,n){const o=t.reduce((e,{id:t,name:r})=>(e[t]=r,e),{}),s=r.reduce((e,{name:t,categories:r})=>(r.forEach(r=>e[r.id]=`${t}: ${r.name}`),e),{}),u=n.reduce((e,{id:t,name:r})=>(e[t]=r,e),{}),c=e.map(({account:e,date:t,payee:r,notes:n,category:i,amount:c})=>({Account:o[e],Date:t,Payee:u[r],Notes:n,Category:s[i],Amount:null==c?0:Object(a.k)(c)}));return i()(c,{header:!0})}async function u(e){let t=(await Object(o.b)(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"}))).data,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:Object(a.k)(e.Amount)}));return i()(n,{header:!0})}},function(e,t,r){(function(t){const n=r(437),i=r(70).StringDecoder;e.exports=function(e,r={}){const o=[];if(t.isBuffer(e)){e=(new i).write(e)}function a(e){e&&o.push(e.toString())}let s=new n.Stringifier(r);s.on("data",a);for(let t of e)s.write(t);return s.end(),s.off("data",a),o.join("")}}).call(this,r(10).Buffer)},function(e,t,r){"use strict";var n=r(165),i=r(254),o=r(444),a=r(446),s=r(447),u=r(449),c=r(450),l=r(451),f=r(80),d=r(54),h=r(457),p=r(460),g=r(462),m=r(465),y=r(467),b=d("Date.prototype.getTime"),_=Object.getPrototypeOf,w=d("Object.prototype.toString"),v=f("%Set%",!0),E=d("Map.prototype.has",!0),S=d("Map.prototype.get",!0),O=d("Map.prototype.size",!0),T=d("Set.prototype.add",!0),A=d("Set.prototype.delete",!0),M=d("Set.prototype.has",!0),D=d("Set.prototype.size",!0);function I(e,t,r,n){for(var i,o=p(e);(i=o.next())&&!i.done;)if(C(t,i.value,r,n))return A(e,i.value),!0;return!1}function j(e){return void 0===e?null:"object"!=typeof e?"symbol"!=typeof e&&("string"!=typeof e&&"number"!=typeof e||+e==+e):void 0}function R(e,t,r,n,i,o){var a=j(r);if(null!=a)return a;var s=S(t,a),u=y({},i,{strict:!1});return!(void 0===s&&!E(t,a)||!C(n,s,u,o))&&(!E(e,a)&&C(n,s,u,o))}function N(e,t,r){var n=j(r);return null!=n?n:M(t,n)&&!M(e,n)}function k(e,t,r,n,i,o){for(var a,s,u=p(e);(a=u.next())&&!a.done;)if(C(r,s=a.value,i,o)&&C(n,S(t,s),i,o))return A(e,s),!0;return!1}function C(e,t,r,f){var d=r||{};if(d.strict?o(e,t):e===t)return!0;if(l(e)!==l(t))return!1;if(!e||!t||"object"!=typeof e&&"object"!=typeof t)return d.strict?o(e,t):e==t;var g,A=f.has(e),j=f.has(t);if(A&&j){if(f.get(e)===f.get(t))return!0}else g={};return A||f.set(e,g),j||f.set(t,g),function(e,t,r,o){var l,f;if(typeof e!=typeof t)return!1;if(null==e||null==t)return!1;if(w(e)!==w(t))return!1;if(i(e)!==i(t))return!1;var d=u(e),g=u(t);if(d!==g)return!1;var A=e instanceof Error,j=t instanceof Error;if(A!==j)return!1;if((A||j)&&(e.name!==t.name||e.message!==t.message))return!1;var x=a(e),P=a(t);if(x!==P)return!1;if((x||P)&&(e.source!==t.source||s(e)!==s(t)))return!1;var B=c(e),U=c(t);if(B!==U)return!1;if((B||U)&&b(e)!==b(t))return!1;if(r.strict&&_&&_(e)!==_(t))return!1;if(m(e)!==m(t))return!1;var F=L(e),W=L(t);if(F!==W)return!1;if(F||W){if(e.length!==t.length)return!1;for(l=0;l<e.length;l++)if(e[l]!==t[l])return!1;return!0}if(typeof e!=typeof t)return!1;var H=n(e),z=n(t);if(H.length!==z.length)return!1;for(H.sort(),z.sort(),l=H.length-1;l>=0;l--)if(H[l]!=z[l])return!1;for(l=H.length-1;l>=0;l--)if(f=H[l],!C(e[f],t[f],r,o))return!1;var q=h(e),V=h(t);if(q!==V)return!1;if("Set"===q||"Set"===V)return function(e,t,r,n){if(D(e)!==D(t))return!1;var i,o,a,s=p(e),u=p(t);for(;(i=s.next())&&!i.done;)if(i.value&&"object"==typeof i.value)a||(a=new v),T(a,i.value);else if(!M(t,i.value)){if(r.strict)return!1;if(!N(e,t,i.value))return!1;a||(a=new v),T(a,i.value)}if(a){for(;(o=u.next())&&!o.done;)if(o.value&&"object"==typeof o.value){if(!I(a,o.value,r.strict,n))return!1}else if(!r.strict&&!M(e,o.value)&&!I(a,o.value,r.strict,n))return!1;return 0===D(a)}return!0}(e,t,r,o);if("Map"===q)return function(e,t,r,n){if(O(e)!==O(t))return!1;var i,o,a,s,u,c,l=p(e),f=p(t);for(;(i=l.next())&&!i.done;)if(s=i.value[0],u=i.value[1],s&&"object"==typeof s)a||(a=new v),T(a,s);else if(void 0===(c=S(t,s))&&!E(t,s)||!C(u,c,r,n)){if(r.strict)return!1;if(!R(e,t,s,u,r,n))return!1;a||(a=new v),T(a,s)}if(a){for(;(o=f.next())&&!o.done;)if(s=o.value[0],c=o.value[1],s&&"object"==typeof s){if(!k(a,e,s,c,r,n))return!1}else if(!(r.strict||e.has(s)&&C(S(e,s),c,r,n)||k(a,e,s,c,y({},r,{strict:!1}),n)))return!1;return 0===D(a)}return!0}(e,t,r,o);return!0}(e,t,d,f)}function L(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 C(e,t,r,g())}},function(e,t){var r={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},function(e,t,r){let n=i();function i(){return 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){if("QuotaExceededError"===e.target.error.name)throw new Error("indexeddb-quota-error")}},e(r)}})}e.exports={getDatabase:function(){return n},openDatabase:function(){return null==n&&(n=i()),n},closeDatabase:function(){if(n){n.then(e=>{e.close()});n=null}},getStore:function(e,t){let r=e.transaction([t],"readwrite");return{trans:r,store:r.objectStore(t)}},get:async function(e,t,r=(e=>e)){return new Promise((n,i)=>{let o=e.get(t);o.onsuccess=e=>{n(r(o.result))},o.onerror=e=>i(e)})},set:async function(e,t){return new Promise((r,n)=>{let i=e.put(t);i.onsuccess=e=>r(),i.onerror=e=>n(e)})},del:async function(e,t){return new Promise((r,n)=>{let i=e.delete(t);i.onsuccess=e=>r(),i.onerror=e=>n(e)})}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(98),i=r(181),o=n.constants.S_IFMT,a=n.constants.S_IFDIR,s=n.constants.S_IFREG,u=n.constants.S_IFBLK,c=n.constants.S_IFCHR,l=n.constants.S_IFLNK,f=n.constants.S_IFIFO,d=n.constants.S_IFSOCK,h=function(){function e(){this.name="",this.mode=0}return e.build=function(t,r){var n=new e,o=t.getNode().mode;return n.name=i.strToEncoding(t.getName(),r),n.mode=o,n},e.prototype._checkModeProperty=function(e){return(this.mode&o)===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(c)},e.prototype.isSymbolicLink=function(){return this._checkModeProperty(l)},e.prototype.isFIFO=function(){return this._checkModeProperty(f)},e.prototype.isSocket=function(){return this._checkModeProperty(d)},e}();t.Dirent=h,t.default=h},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(140),i=r(182);t.ENCODING_UTF8="utf8",t.assertEncoding=function(e){if(e&&!n.Buffer.isEncoding(e))throw new i.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}},function(e,t,r){"use strict";(function(e){var n,i=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])})(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 o=r(141),a=r(112),s="undefined"==typeof Symbol?"_kCode":Symbol("code"),u={};function c(e){return function(e){function t(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];var i=e.call(this,f(t,r))||this;return i.code=t,i[s]=t,i.name=e.prototype.name+" ["+i[s]+"]",i}return i(t,e),t}(e)}var l=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 i(r,e),r}(e.Error);function f(e,t){o.strictEqual(typeof e,"string");var r,n=u[e];if(o(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 h(e,t){if(o(e,"expected is required"),o("string"==typeof t,"thing is required"),Array.isArray(e)){var r=e.length;return o(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=l,t.message=f,t.E=d,t.Error=c(e.Error),t.TypeError=c(e.TypeError),t.RangeError=c(e.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,i;o(e,"name is required"),t.includes("not ")?(n="must not be",t=t.split("not ")[1]):n="must be";if(Array.isArray(e)){var a=e.map((function(e){return'"'+e+'"'})).join(", ");i="The "+a+" arguments "+n+" "+h(t,"type")}else if(e.includes(" argument"))i="The "+e+" "+n+" "+h(t,"type");else{var s=e.includes(".")?"property":"argument";i='The "'+e+'" '+s+" "+n+" "+h(t,"type")}arguments.length>=3&&(i+=". Received type "+(null!==r?typeof r:"null"));return i})),d("ERR_INVALID_ARRAY_LENGTH",(function(e,t,r){return o.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 "+h(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];o(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")}).call(this,r(23))},function(e,t,r){"use strict";
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/var n=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;function a(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var r,s,u=a(e),c=1;c<arguments.length;c++){for(var l in r=Object(arguments[c]))i.call(r,l)&&(u[l]=r[l]);if(n){s=n(r);for(var f=0;f<s.length;f++)o.call(r,s[f])&&(u[s[f]]=r[s[f]])}}return u}},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});function n(){var t=function(){if(void 0!==e)return e;try{return r(19)}catch(e){return}}()||{};return t.getuid||(t.getuid=function(){return 0}),t.getgid||(t.getgid=function(){return 0}),t.cwd||(t.cwd=function(){return"/"}),t.nextTick||(t.nextTick=r(185).default),t.emitWarning||(t.emitWarning=function(e,t){console.warn(t+(t?": ":"")+e)}),t.env||(t.env={}),t}t.createProcess=n,t.default=n()}).call(this,r(19))},function(e,t,r){"use strict";(function(e,r){var n;Object.defineProperty(t,"__esModule",{value:!0}),n="function"==typeof e?e.bind(r):setTimeout.bind(r),t.default=n}).call(this,r(113).setImmediate,r(23))},function(e,t,r){"use strict";(function(t,n){var i=r(114);e.exports=_;var o,a=r(178);_.ReadableState=b;r(63).EventEmitter;var s=function(e,t){return e.listeners(t).length},u=r(187),c=r(143).Buffer,l=t.Uint8Array||function(){};var f=Object.create(r(100));f.inherits=r(11);var d=r(299),h=void 0;h=d&&d.debuglog?d.debuglog("stream"):function(){};var p,g=r(300),m=r(188);f.inherits(_,u);var y=["error","close","destroy","pause","resume"];function b(e,t){e=e||{};var n=t instanceof(o=o||r(79));this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,a=e.readableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(a||0===a)?a:s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new g,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.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(p||(p=r(70).StringDecoder),this.decoder=new p(e.encoding),this.encoding=e.encoding)}function _(e){if(o=o||r(79),!(this instanceof _))return new _(e);this._readableState=new b(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),u.call(this)}function w(e,t,r,n,i){var o,a=e._readableState;null===t?(a.reading=!1,function(e,t){if(t.ended)return;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,S(e)}(e,a)):(i||(o=function(e,t){var r;n=t,c.isBuffer(n)||n instanceof l||"string"==typeof t||void 0===t||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk"));var n;return r}(a,t)),o?e.emit("error",o):a.objectMode||t&&t.length>0?("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===c.prototype||(t=function(e){return c.from(e)}(t)),n?a.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):v(e,a,t,!0):a.ended?e.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?v(e,a,t,!1):T(e,a)):v(e,a,t,!1))):n||(a.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(a)}function v(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&S(e)),T(e,t)}Object.defineProperty(_.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),_.prototype.destroy=m.destroy,_.prototype._undestroy=m.undestroy,_.prototype._destroy=function(e,t){this.push(null),t(e)},_.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=c.from(e,t),t=""),r=!0),w(this,e,t,!1,r)},_.prototype.unshift=function(e){return w(this,e,null,!0,!1)},_.prototype.isPaused=function(){return!1===this._readableState.flowing},_.prototype.setEncoding=function(e){return p||(p=r(70).StringDecoder),this._readableState.decoder=new p(e),this._readableState.encoding=e,this};function E(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>=8388608?e=8388608:(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 S(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(h("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?i.nextTick(O,e):O(e))}function O(e){h("emit readable"),e.emit("readable"),I(e)}function T(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(A,e,t))}function A(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(h("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}function M(e){h("readable nexttick read 0"),e.read(0)}function D(e,t){t.reading||(h("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),I(e),t.flowing&&!t.reading&&e.read(0)}function I(e){var t=e._readableState;for(h("flow",t.flowing);t.flowing&&null!==e.read(););}function j(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.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var n;e<t.head.data.length?(n=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):n=e===t.head.data.length?t.shift():r?function(e,t){var r=t.head,n=1,i=r.data;e-=i.length;for(;r=r.next;){var o=r.data,a=e>o.length?o.length:e;if(a===o.length?i+=o:i+=o.slice(0,e),0===(e-=a)){a===o.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(a));break}++n}return t.length-=n,i}(e,t):function(e,t){var r=c.allocUnsafe(e),n=t.head,i=1;n.data.copy(r),e-=n.data.length;for(;n=n.next;){var o=n.data,a=e>o.length?o.length:e;if(o.copy(r,r.length-e,0,a),0===(e-=a)){a===o.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=o.slice(a));break}++i}return t.length-=i,r}(e,t);return n}(e,t.buffer,t.decoder),r);var r}function R(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,i.nextTick(N,t,e))}function N(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function k(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}_.prototype.read=function(e){h("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return h("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?R(this):S(this),null;if(0===(e=E(e,t))&&t.ended)return 0===t.length&&R(this),null;var n,i=t.needReadable;return h("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&h("length less than watermark",i=!0),t.ended||t.reading?h("reading or ended",i=!1):i&&(h("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=E(r,t))),null===(n=e>0?j(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&R(this)),null!==n&&this.emit("data",n),n},_.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},_.prototype.pipe=function(e,t){var r=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e)}o.pipesCount+=1,h("pipe count=%d opts=%j",o.pipesCount,t);var u=(!t||!1!==t.end)&&e!==n.stdout&&e!==n.stderr?l:_;function c(t,n){h("onunpipe"),t===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,h("cleanup"),e.removeListener("close",y),e.removeListener("finish",b),e.removeListener("drain",f),e.removeListener("error",m),e.removeListener("unpipe",c),r.removeListener("end",l),r.removeListener("end",_),r.removeListener("data",g),d=!0,!o.awaitDrain||e._writableState&&!e._writableState.needDrain||f())}function l(){h("onend"),e.end()}o.endEmitted?i.nextTick(u):r.once("end",u),e.on("unpipe",c);var f=function(e){return function(){var t=e._readableState;h("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,I(e))}}(r);e.on("drain",f);var d=!1;var p=!1;function g(t){h("ondata"),p=!1,!1!==e.write(t)||p||((1===o.pipesCount&&o.pipes===e||o.pipesCount>1&&-1!==k(o.pipes,e))&&!d&&(h("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,p=!0),r.pause())}function m(t){h("onerror",t),_(),e.removeListener("error",m),0===s(e,"error")&&e.emit("error",t)}function y(){e.removeListener("finish",b),_()}function b(){h("onfinish"),e.removeListener("close",y),_()}function _(){h("unpipe"),r.unpipe(e)}return r.on("data",g),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?a(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",m),e.once("close",y),e.once("finish",b),e.emit("pipe",r),o.flowing||(h("pipe resume"),r.resume()),e},_.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,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,r);return this}var a=k(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},_.prototype.on=function(e,t){var r=u.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var n=this._readableState;n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.emittedReadable=!1,n.reading?n.length&&S(this):i.nextTick(M,this))}return r},_.prototype.addListener=_.prototype.on,_.prototype.resume=function(){var e=this._readableState;return e.flowing||(h("resume"),e.flowing=!0,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(D,e,t))}(this,e)),this},_.prototype.pause=function(){return h("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(h("pause"),this._readableState.flowing=!1,this.emit("pause")),this},_.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",(function(){if(h("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){(h("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i)||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o<y.length;o++)e.on(y[o],this.emit.bind(this,y[o]));return this._read=function(t){h("wrapped _read",t),n&&(n=!1,e.resume())},this},Object.defineProperty(_.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),_._fromList=j}).call(this,r(23),r(19))},function(e,t,r){e.exports=r(63).EventEmitter},function(e,t,r){"use strict";var n=r(114);function i(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var r=this,o=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return o||a?(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||n.nextTick(i,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?(n.nextTick(i,r,e),r._writableState&&(r._writableState.errorEmitted=!0)):t&&t(e)})),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.finished=!1,this._writableState.errorEmitted=!1)}}},function(e,t,r){"use strict";e.exports=a;var n=r(79),i=Object.create(r(100));function o(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(!n)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function a(e){if(!(this instanceof a))return new a(e);n.call(this,e),this._transformState={afterTransform:o.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",s)}function s(){var e=this;"function"==typeof this._flush?this._flush((function(t,r){u(e,t,r)})):u(this,null,null)}function u(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}i.inherits=r(11),i.inherits(a,n),a.prototype.push=function(e,t){return this._transformState.needTransform=!1,n.prototype.push.call(this,e,t)},a.prototype._transform=function(e,t,r){throw new Error("_transform() is not implemented")},a.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},a.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},a.prototype._destroy=function(e,t){var r=this;n.prototype._destroy.call(this,e,(function(e){t(e),r.emit("close")}))}},function(e,t,r){"use strict";t.randomBytes=t.rng=t.pseudoRandomBytes=t.prng=r(84),t.createHash=t.Hash=r(101),t.createHmac=t.Hmac=r(200);var n=r(329),i=Object.keys(n),o=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(i);t.getHashes=function(){return o};var a=r(203);t.pbkdf2=a.pbkdf2,t.pbkdf2Sync=a.pbkdf2Sync;var s=r(331);t.Cipher=s.Cipher,t.createCipher=s.createCipher,t.Cipheriv=s.Cipheriv,t.createCipheriv=s.createCipheriv,t.Decipher=s.Decipher,t.createDecipher=s.createDecipher,t.Decipheriv=s.Decipheriv,t.createDecipheriv=s.createDecipheriv,t.getCiphers=s.getCiphers,t.listCiphers=s.listCiphers;var u=r(346);t.DiffieHellmanGroup=u.DiffieHellmanGroup,t.createDiffieHellmanGroup=u.createDiffieHellmanGroup,t.getDiffieHellman=u.getDiffieHellman,t.createDiffieHellman=u.createDiffieHellman,t.DiffieHellman=u.DiffieHellman;var c=r(351);t.createSign=c.createSign,t.Sign=c.Sign,t.createVerify=c.createVerify,t.Verify=c.Verify,t.createECDH=r(392);var l=r(393);t.publicEncrypt=l.publicEncrypt,t.privateEncrypt=l.privateEncrypt,t.publicDecrypt=l.publicDecrypt,t.privateDecrypt=l.privateDecrypt;var f=r(396);t.randomFill=f.randomFill,t.randomFillSync=f.randomFillSync,t.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))},t.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}},function(e,t,r){"use strict";var n=r(16).Buffer,i=r(316).Transform;function o(e){i.call(this),this._block=n.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}r(11)(o,i),o.prototype._transform=function(e,t,r){var n=null;try{this.update(e,t)}catch(e){n=e}r(n)},o.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},o.prototype.update=function(e,t){if(function(e,t){if(!n.isBuffer(e)&&"string"!=typeof e)throw new TypeError(t+" must be a string or a buffer")}(e,"Data"),this._finalized)throw new Error("Digest already called");n.isBuffer(e)||(e=n.from(e,t));for(var r=this._block,i=0;this._blockOffset+e.length-i>=this._blockSize;){for(var o=this._blockOffset;o<this._blockSize;)r[o++]=e[i++];this._update(),this._blockOffset=0}for(;i<e.length;)r[this._blockOffset++]=e[i++];for(var a=0,s=8*e.length;s>0;++a)this._length[a]+=s,(s=this._length[a]/4294967296|0)>0&&(this._length[a]-=4294967296*s);return this},o.prototype._update=function(){throw new Error("_update is not implemented")},o.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return t},o.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=o},function(e,t,r){"use strict";(function(t,n){var i;e.exports=T,T.ReadableState=O;r(63).EventEmitter;var o=function(e,t){return e.listeners(t).length},a=r(193),s=r(10).Buffer,u=t.Uint8Array||function(){};var c,l=r(317);c=l&&l.debuglog?l.debuglog("stream"):function(){};var f,d,h,p=r(318),g=r(194),m=r(195).getHighWaterMark,y=r(85).codes,b=y.ERR_INVALID_ARG_TYPE,_=y.ERR_STREAM_PUSH_AFTER_EOF,w=y.ERR_METHOD_NOT_IMPLEMENTED,v=y.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(11)(T,a);var E=g.errorOrDestroy,S=["error","close","destroy","pause","resume"];function O(e,t,n){i=i||r(86),e=e||{},"boolean"!=typeof n&&(n=t instanceof i),this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=m(this,e,"readableHighWaterMark",n),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(70).StringDecoder),this.decoder=new f(e.encoding),this.encoding=e.encoding)}function T(e){if(i=i||r(86),!(this instanceof T))return new T(e);var t=this instanceof i;this._readableState=new O(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),a.call(this)}function A(e,t,r,n,i){c("readableAddChunk",t);var o,a=e._readableState;if(null===t)a.reading=!1,function(e,t){if(c("onEofChunk"),t.ended)return;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?I(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,j(e)))}(e,a);else if(i||(o=function(e,t){var r;n=t,s.isBuffer(n)||n instanceof u||"string"==typeof t||void 0===t||e.objectMode||(r=new b("chunk",["string","Buffer","Uint8Array"],t));var n;return r}(a,t)),o)E(e,o);else if(a.objectMode||t&&t.length>0)if("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===s.prototype||(t=function(e){return s.from(e)}(t)),n)a.endEmitted?E(e,new v):M(e,a,t,!0);else if(a.ended)E(e,new _);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?M(e,a,t,!1):R(e,a)):M(e,a,t,!1)}else n||(a.reading=!1,R(e,a));return!a.ended&&(a.length<a.highWaterMark||0===a.length)}function M(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&&I(e)),R(e,t)}Object.defineProperty(T.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),T.prototype.destroy=g.destroy,T.prototype._undestroy=g.undestroy,T.prototype._destroy=function(e,t){t(e)},T.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=s.from(e,t),t=""),r=!0),A(this,e,t,!1,r)},T.prototype.unshift=function(e){return A(this,e,null,!0,!1)},T.prototype.isPaused=function(){return!1===this._readableState.flowing},T.prototype.setEncoding=function(e){f||(f=r(70).StringDecoder);var t=new f(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,i="";null!==n;)i+=t.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};function D(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>=1073741824?e=1073741824:(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 I(e){var t=e._readableState;c("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(c("emitReadable",t.flowing),t.emittedReadable=!0,n.nextTick(j,e))}function j(e){var t=e._readableState;c("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,x(e)}function R(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(N,e,t))}function N(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(c("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function k(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 C(e){c("readable nexttick read 0"),e.read(0)}function L(e,t){c("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),x(e),t.flowing&&!t.reading&&e.read(0)}function x(e){var t=e._readableState;for(c("flow",t.flowing);t.flowing&&null!==e.read(););}function P(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 B(e){var t=e._readableState;c("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,n.nextTick(U,t,e))}function U(e,t){if(c("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 F(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}T.prototype.read=function(e){c("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 c("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?B(this):I(this),null;if(0===(e=D(e,t))&&t.ended)return 0===t.length&&B(this),null;var n,i=t.needReadable;return c("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&c("length less than watermark",i=!0),t.ended||t.reading?c("reading or ended",i=!1):i&&(c("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=D(r,t))),null===(n=e>0?P(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&&B(this)),null!==n&&this.emit("data",n),n},T.prototype._read=function(e){E(this,new w("_read()"))},T.prototype.pipe=function(e,t){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,c("pipe count=%d opts=%j",i.pipesCount,t);var a=(!t||!1!==t.end)&&e!==n.stdout&&e!==n.stderr?u:m;function s(t,n){c("onunpipe"),t===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,c("cleanup"),e.removeListener("close",p),e.removeListener("finish",g),e.removeListener("drain",l),e.removeListener("error",h),e.removeListener("unpipe",s),r.removeListener("end",u),r.removeListener("end",m),r.removeListener("data",d),f=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||l())}function u(){c("onend"),e.end()}i.endEmitted?n.nextTick(a):r.once("end",a),e.on("unpipe",s);var l=function(e){return function(){var t=e._readableState;c("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&o(e,"data")&&(t.flowing=!0,x(e))}}(r);e.on("drain",l);var f=!1;function d(t){c("ondata");var n=e.write(t);c("dest.write",n),!1===n&&((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==F(i.pipes,e))&&!f&&(c("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function h(t){c("onerror",t),m(),e.removeListener("error",h),0===o(e,"error")&&E(e,t)}function p(){e.removeListener("finish",g),m()}function g(){c("onfinish"),e.removeListener("close",p),m()}function m(){c("unpipe"),r.unpipe(e)}return r.on("data",d),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",h),e.once("close",p),e.once("finish",g),e.emit("pipe",r),i.flowing||(c("pipe resume"),r.resume()),e},T.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,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var a=F(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},T.prototype.on=function(e,t){var r=a.prototype.on.call(this,e,t),i=this._readableState;return"data"===e?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===e&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,c("on readable",i.length,i.reading),i.length?I(this):i.reading||n.nextTick(C,this))),r},T.prototype.addListener=T.prototype.on,T.prototype.removeListener=function(e,t){var r=a.prototype.removeListener.call(this,e,t);return"readable"===e&&n.nextTick(k,this),r},T.prototype.removeAllListeners=function(e){var t=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||n.nextTick(k,this),t},T.prototype.resume=function(){var e=this._readableState;return e.flowing||(c("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n.nextTick(L,e,t))}(this,e)),e.paused=!1,this},T.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},T.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",(function(){if(c("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){(c("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i)||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o<S.length;o++)e.on(S[o],this.emit.bind(this,S[o]));return this._read=function(t){c("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(T.prototype[Symbol.asyncIterator]=function(){return void 0===d&&(d=r(320)),d(this)}),Object.defineProperty(T.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(T.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(T.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),T._fromList=P,Object.defineProperty(T.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(T.from=function(e,t){return void 0===h&&(h=r(321)),h(T,e,t)})}).call(this,r(23),r(19))},function(e,t,r){e.exports=r(63).EventEmitter},function(e,t,r){"use strict";(function(t){function r(e,t){i(e,t),n(e)}function n(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function i(e,t){e.emit("error",t)}e.exports={destroy:function(e,o){var a=this,s=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return s||u?(o?o(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,t.nextTick(i,this,e)):t.nextTick(i,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!o&&e?a._writableState?a._writableState.errorEmitted?t.nextTick(n,a):(a._writableState.errorEmitted=!0,t.nextTick(r,a,e)):t.nextTick(r,a,e):o?(t.nextTick(n,a),o(e)):t.nextTick(n,a)})),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)}}}).call(this,r(19))},function(e,t,r){"use strict";var n=r(85).codes.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,r,i){var o=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,r);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new n(i?r:"highWaterMark",o);return Math.floor(o)}return e.objectMode?16:16384}}},function(e,t,r){"use strict";(function(t,n){function i(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;e.entry=null;for(;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}var o;e.exports=T,T.WritableState=O;var a={deprecate:r(145)},s=r(193),u=r(10).Buffer,c=t.Uint8Array||function(){};var l,f=r(194),d=r(195).getHighWaterMark,h=r(85).codes,p=h.ERR_INVALID_ARG_TYPE,g=h.ERR_METHOD_NOT_IMPLEMENTED,m=h.ERR_MULTIPLE_CALLBACK,y=h.ERR_STREAM_CANNOT_PIPE,b=h.ERR_STREAM_DESTROYED,_=h.ERR_STREAM_NULL_VALUES,w=h.ERR_STREAM_WRITE_AFTER_END,v=h.ERR_UNKNOWN_ENCODING,E=f.errorOrDestroy;function S(){}function O(e,t,a){o=o||r(86),e=e||{},"boolean"!=typeof a&&(a=t instanceof o),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,i=r.sync,o=r.writecb;if("function"!=typeof o)throw new m;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,i,o){--t.pendingcb,r?(n.nextTick(o,i),n.nextTick(R,e,t),e._writableState.errorEmitted=!0,E(e,i)):(o(i),e._writableState.errorEmitted=!0,E(e,i),R(e,t))}(e,r,i,t,o);else{var a=I(r)||e.destroyed;a||r.corked||r.bufferProcessing||!r.bufferedRequest||D(e,r),i?n.nextTick(M,e,r,a,o):M(e,r,a,o)}}(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 T(e){var t=this instanceof(o=o||r(86));if(!t&&!l.call(T,this))return new T(e);this._writableState=new O(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)),s.call(this)}function A(e,t,r,n,i,o,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new b("write")):r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function M(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),R(e,t)}function D(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 c=r.chunk,l=r.encoding,f=r.callback;if(A(e,t,!1,t.objectMode?1:c.length,c,l,f),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function I(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function j(e,t){e._final((function(r){t.pendingcb--,r&&E(e,r),t.prefinished=!0,e.emit("prefinish"),R(e,t)}))}function R(e,t){var r=I(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,n.nextTick(j,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var i=e._readableState;(!i||i.autoDestroy&&i.endEmitted)&&e.destroy()}return r}r(11)(T,s),O.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(O.prototype,"buffer",{get:a.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]?(l=Function.prototype[Symbol.hasInstance],Object.defineProperty(T,Symbol.hasInstance,{value:function(e){return!!l.call(this,e)||this===T&&(e&&e._writableState instanceof O)}})):l=function(e){return e instanceof this},T.prototype.pipe=function(){E(this,new y)},T.prototype.write=function(e,t,r){var i,o=this._writableState,a=!1,s=!o.objectMode&&(i=e,u.isBuffer(i)||i instanceof c);return s&&!u.isBuffer(e)&&(e=function(e){return u.from(e)}(e)),"function"==typeof t&&(r=t,t=null),s?t="buffer":t||(t=o.defaultEncoding),"function"!=typeof r&&(r=S),o.ending?function(e,t){var r=new w;E(e,r),n.nextTick(t,r)}(this,r):(s||function(e,t,r,i){var o;return null===r?o=new _:"string"==typeof r||t.objectMode||(o=new p("chunk",["string","Buffer"],r)),!o||(E(e,o),n.nextTick(i,o),!1)}(this,o,e,r))&&(o.pendingcb++,a=function(e,t,r,n,i,o){if(!r){var a=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=u.from(t,r));return t}(t,n,i);n!==a&&(r=!0,i="buffer",n=a)}var s=t.objectMode?1:n.length;t.length+=s;var c=t.length<t.highWaterMark;c||(t.needDrain=!0);if(t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else A(e,t,!1,s,n,i,o);return c}(this,o,s,e,t,r)),a},T.prototype.cork=function(){this._writableState.corked++},T.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||D(this,e))},T.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 v(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(T.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(T.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),T.prototype._write=function(e,t,r){r(new g("_write()"))},T.prototype._writev=null,T.prototype.end=function(e,t,r){var i=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),i.corked&&(i.corked=1,this.uncork()),i.ending||function(e,t,r){t.ending=!0,R(e,t),r&&(t.finished?n.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,i,r),this},Object.defineProperty(T.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(T.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),T.prototype.destroy=f.destroy,T.prototype._undestroy=f.undestroy,T.prototype._destroy=function(e,t){t(e)}}).call(this,r(23),r(19))},function(e,t,r){"use strict";e.exports=l;var n=r(85).codes,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,a=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=n.ERR_TRANSFORM_WITH_LENGTH_0,u=r(86);function c(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function l(e){if(!(this instanceof l))return new l(e);u.call(this,e),this._transformState={afterTransform:c.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(11)(l,u),l.prototype.push=function(e,t){return this._transformState.needTransform=!1,u.prototype.push.call(this,e,t)},l.prototype._transform=function(e,t,r){r(new i("_transform()"))},l.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},l.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))},l.prototype._destroy=function(e,t){u.prototype._destroy.call(this,e,(function(e){t(e)}))}},function(e,t,r){var n=r(11),i=r(87),o=r(16).Buffer,a=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],s=new Array(64);function u(){this.init(),this._w=s,i.call(this,64,56)}function c(e,t,r){return r^e&(t^r)}function l(e,t,r){return e&t|r&(e|t)}function f(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function d(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function h(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}n(u,i),u.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},u.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,u=0|this._e,p=0|this._f,g=0|this._g,m=0|this._h,y=0;y<16;++y)r[y]=e.readInt32BE(4*y);for(;y<64;++y)r[y]=0|(((t=r[y-2])>>>17|t<<15)^(t>>>19|t<<13)^t>>>10)+r[y-7]+h(r[y-15])+r[y-16];for(var b=0;b<64;++b){var _=m+d(u)+c(u,p,g)+a[b]+r[b]|0,w=f(n)+l(n,i,o)|0;m=g,g=p,p=u,u=s+_|0,s=o,o=i,i=n,n=_+w|0}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0,this._f=p+this._f|0,this._g=g+this._g|0,this._h=m+this._h|0},u.prototype._hash=function(){var e=o.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=u},function(e,t,r){var n=r(11),i=r(87),o=r(16).Buffer,a=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],s=new Array(160);function u(){this.init(),this._w=s,i.call(this,128,112)}function c(e,t,r){return r^e&(t^r)}function l(e,t,r){return e&t|r&(e|t)}function f(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function d(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function h(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function p(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function g(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function m(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function y(e,t){return e>>>0<t>>>0?1:0}n(u,i),u.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},u.prototype._update=function(e){for(var t=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,o=0|this._dh,s=0|this._eh,u=0|this._fh,b=0|this._gh,_=0|this._hh,w=0|this._al,v=0|this._bl,E=0|this._cl,S=0|this._dl,O=0|this._el,T=0|this._fl,A=0|this._gl,M=0|this._hl,D=0;D<32;D+=2)t[D]=e.readInt32BE(4*D),t[D+1]=e.readInt32BE(4*D+4);for(;D<160;D+=2){var I=t[D-30],j=t[D-30+1],R=h(I,j),N=p(j,I),k=g(I=t[D-4],j=t[D-4+1]),C=m(j,I),L=t[D-14],x=t[D-14+1],P=t[D-32],B=t[D-32+1],U=N+x|0,F=R+L+y(U,N)|0;F=(F=F+k+y(U=U+C|0,C)|0)+P+y(U=U+B|0,B)|0,t[D]=F,t[D+1]=U}for(var W=0;W<160;W+=2){F=t[W],U=t[W+1];var H=l(r,n,i),z=l(w,v,E),q=f(r,w),V=f(w,r),G=d(s,O),Y=d(O,s),$=a[W],K=a[W+1],Z=c(s,u,b),X=c(O,T,A),J=M+Y|0,Q=_+G+y(J,M)|0;Q=(Q=(Q=Q+Z+y(J=J+X|0,X)|0)+$+y(J=J+K|0,K)|0)+F+y(J=J+U|0,U)|0;var ee=V+z|0,te=q+H+y(ee,V)|0;_=b,M=A,b=u,A=T,u=s,T=O,s=o+Q+y(O=S+J|0,S)|0,o=i,S=E,i=n,E=v,n=r,v=w,r=Q+te+y(w=J+ee|0,J)|0}this._al=this._al+w|0,this._bl=this._bl+v|0,this._cl=this._cl+E|0,this._dl=this._dl+S|0,this._el=this._el+O|0,this._fl=this._fl+T|0,this._gl=this._gl+A|0,this._hl=this._hl+M|0,this._ah=this._ah+r+y(this._al,w)|0,this._bh=this._bh+n+y(this._bl,v)|0,this._ch=this._ch+i+y(this._cl,E)|0,this._dh=this._dh+o+y(this._dl,S)|0,this._eh=this._eh+s+y(this._el,O)|0,this._fh=this._fh+u+y(this._fl,T)|0,this._gh=this._gh+b+y(this._gl,A)|0,this._hh=this._hh+_+y(this._hl,M)|0},u.prototype._hash=function(){var e=o.allocUnsafe(64);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e},e.exports=u},function(e,t,r){"use strict";var n=r(11),i=r(328),o=r(71),a=r(16).Buffer,s=r(201),u=r(148),c=r(149),l=a.alloc(128);function f(e,t){o.call(this,"digest"),"string"==typeof t&&(t=a.from(t));var r="sha512"===e||"sha384"===e?128:64;(this._alg=e,this._key=t,t.length>r)?t=("rmd160"===e?new u:c(e)).update(t).digest():t.length<r&&(t=a.concat([t,l],r));for(var n=this._ipad=a.allocUnsafe(r),i=this._opad=a.allocUnsafe(r),s=0;s<r;s++)n[s]=54^t[s],i[s]=92^t[s];this._hash="rmd160"===e?new u:c(e),this._hash.update(n)}n(f,o),f.prototype._update=function(e){this._hash.update(e)},f.prototype._final=function(){var e=this._hash.digest();return("rmd160"===this._alg?new u:c(this._alg)).update(this._opad).update(e).digest()},e.exports=function(e,t){return"rmd160"===(e=e.toLowerCase())||"ripemd160"===e?new f("rmd160",t):"md5"===e?new i(s,t):new f(e,t)}},function(e,t,r){var n=r(146);e.exports=function(e){return(new n).update(e).digest()}},function(e){e.exports=JSON.parse('{"sha224WithRSAEncryption":{"sign":"rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"RSA-SHA224":{"sign":"ecdsa/rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"sha256WithRSAEncryption":{"sign":"rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"RSA-SHA256":{"sign":"ecdsa/rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"sha384WithRSAEncryption":{"sign":"rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"RSA-SHA384":{"sign":"ecdsa/rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"sha512WithRSAEncryption":{"sign":"rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA512":{"sign":"ecdsa/rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA1":{"sign":"rsa","hash":"sha1","id":"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{"sign":"ecdsa","hash":"sha1","id":""},"sha256":{"sign":"ecdsa","hash":"sha256","id":""},"sha224":{"sign":"ecdsa","hash":"sha224","id":""},"sha384":{"sign":"ecdsa","hash":"sha384","id":""},"sha512":{"sign":"ecdsa","hash":"sha512","id":""},"DSA-SHA":{"sign":"dsa","hash":"sha1","id":""},"DSA-SHA1":{"sign":"dsa","hash":"sha1","id":""},"DSA":{"sign":"dsa","hash":"sha1","id":""},"DSA-WITH-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-WITH-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-WITH-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-WITH-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-RIPEMD160":{"sign":"dsa","hash":"rmd160","id":""},"ripemd160WithRSA":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"RSA-RIPEMD160":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"md5WithRSAEncryption":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"},"RSA-MD5":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"}}')},function(e,t,r){t.pbkdf2=r(330),t.pbkdf2Sync=r(206)},function(e,t){var r=Math.pow(2,30)-1;e.exports=function(e,t){if("number"!=typeof e)throw new TypeError("Iterations not a number");if(e<0)throw new TypeError("Bad iterations");if("number"!=typeof t)throw new TypeError("Key length not a number");if(t<0||t>r||t!=t)throw new TypeError("Bad key length")}},function(e,t,r){(function(t,r){var n;if(t.process&&t.process.browser)n="utf-8";else if(t.process&&t.process.version){n=parseInt(r.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary"}else n="utf-8";e.exports=n}).call(this,r(23),r(19))},function(e,t,r){var n=r(201),i=r(148),o=r(149),a=r(16).Buffer,s=r(204),u=r(205),c=r(207),l=a.alloc(128),f={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function d(e,t,r){var s=function(e){function t(t){return o(e).update(t).digest()}return"rmd160"===e||"ripemd160"===e?function(e){return(new i).update(e).digest()}:"md5"===e?n:t}(e),u="sha512"===e||"sha384"===e?128:64;t.length>u?t=s(t):t.length<u&&(t=a.concat([t,l],u));for(var c=a.allocUnsafe(u+f[e]),d=a.allocUnsafe(u+f[e]),h=0;h<u;h++)c[h]=54^t[h],d[h]=92^t[h];var p=a.allocUnsafe(u+r+4);c.copy(p,0,0,u),this.ipad1=p,this.ipad2=c,this.opad=d,this.alg=e,this.blocksize=u,this.hash=s,this.size=f[e]}d.prototype.run=function(e,t){return e.copy(t,this.blocksize),this.hash(t).copy(this.opad,this.blocksize),this.hash(this.opad)},e.exports=function(e,t,r,n,i){s(r,n);var o=new d(i=i||"sha1",e=c(e,u,"Password"),(t=c(t,u,"Salt")).length),l=a.allocUnsafe(n),h=a.allocUnsafe(t.length+4);t.copy(h,0,0,t.length);for(var p=0,g=f[i],m=Math.ceil(n/g),y=1;y<=m;y++){h.writeUInt32BE(y,t.length);for(var b=o.run(h,o.ipad1),_=b,w=1;w<r;w++){_=o.run(_,o.ipad2);for(var v=0;v<g;v++)b[v]^=_[v]}b.copy(l,p),p+=g}return l}},function(e,t,r){var n=r(16).Buffer;e.exports=function(e,t,r){if(n.isBuffer(e))return e;if("string"==typeof e)return n.from(e,t);if(ArrayBuffer.isView(e))return n.from(e.buffer);throw new TypeError(r+" must be a string, a Buffer, a typed array or a DataView")}},function(e,t,r){"use strict";t.readUInt32BE=function(e,t){return(e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t])>>>0},t.writeUInt32BE=function(e,t,r){e[0+r]=t>>>24,e[1+r]=t>>>16&255,e[2+r]=t>>>8&255,e[3+r]=255&t},t.ip=function(e,t,r,n){for(var i=0,o=0,a=6;a>=0;a-=2){for(var s=0;s<=24;s+=8)i<<=1,i|=t>>>s+a&1;for(s=0;s<=24;s+=8)i<<=1,i|=e>>>s+a&1}for(a=6;a>=0;a-=2){for(s=1;s<=25;s+=8)o<<=1,o|=t>>>s+a&1;for(s=1;s<=25;s+=8)o<<=1,o|=e>>>s+a&1}r[n+0]=i>>>0,r[n+1]=o>>>0},t.rip=function(e,t,r,n){for(var i=0,o=0,a=0;a<4;a++)for(var s=24;s>=0;s-=8)i<<=1,i|=t>>>s+a&1,i<<=1,i|=e>>>s+a&1;for(a=4;a<8;a++)for(s=24;s>=0;s-=8)o<<=1,o|=t>>>s+a&1,o<<=1,o|=e>>>s+a&1;r[n+0]=i>>>0,r[n+1]=o>>>0},t.pc1=function(e,t,r,n){for(var i=0,o=0,a=7;a>=5;a--){for(var s=0;s<=24;s+=8)i<<=1,i|=t>>s+a&1;for(s=0;s<=24;s+=8)i<<=1,i|=e>>s+a&1}for(s=0;s<=24;s+=8)i<<=1,i|=t>>s+a&1;for(a=1;a<=3;a++){for(s=0;s<=24;s+=8)o<<=1,o|=t>>s+a&1;for(s=0;s<=24;s+=8)o<<=1,o|=e>>s+a&1}for(s=0;s<=24;s+=8)o<<=1,o|=e>>s+a&1;r[n+0]=i>>>0,r[n+1]=o>>>0},t.r28shl=function(e,t){return e<<t&268435455|e>>>28-t};var n=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];t.pc2=function(e,t,r,i){for(var o=0,a=0,s=n.length>>>1,u=0;u<s;u++)o<<=1,o|=e>>>n[u]&1;for(u=s;u<n.length;u++)a<<=1,a|=t>>>n[u]&1;r[i+0]=o>>>0,r[i+1]=a>>>0},t.expand=function(e,t,r){var n=0,i=0;n=(1&e)<<5|e>>>27;for(var o=23;o>=15;o-=4)n<<=6,n|=e>>>o&63;for(o=11;o>=3;o-=4)i|=e>>>o&63,i<<=6;i|=(31&e)<<1|e>>>31,t[r+0]=n>>>0,t[r+1]=i>>>0};var i=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];t.substitute=function(e,t){for(var r=0,n=0;n<4;n++){r<<=4,r|=i[64*n+(e>>>18-6*n&63)]}for(n=0;n<4;n++){r<<=4,r|=i[256+64*n+(t>>>18-6*n&63)]}return r>>>0};var o=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];t.permute=function(e){for(var t=0,r=0;r<o.length;r++)t<<=1,t|=e>>>o[r]&1;return t>>>0},t.padSplit=function(e,t,r){for(var n=e.toString(2);n.length<t;)n="0"+n;for(var i=[],o=0;o<t;o+=r)i.push(n.slice(o,o+r));return i.join(" ")}},function(e,t,r){"use strict";var n=r(44),i=r(11),o=r(208),a=r(150);function s(){this.tmp=new Array(2),this.keys=null}function u(e){a.call(this,e);var t=new s;this._desState=t,this.deriveKeys(t,e.key)}i(u,a),e.exports=u,u.create=function(e){return new u(e)};var c=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];u.prototype.deriveKeys=function(e,t){e.keys=new Array(32),n.equal(t.length,this.blockSize,"Invalid key length");var r=o.readUInt32BE(t,0),i=o.readUInt32BE(t,4);o.pc1(r,i,e.tmp,0),r=e.tmp[0],i=e.tmp[1];for(var a=0;a<e.keys.length;a+=2){var s=c[a>>>1];r=o.r28shl(r,s),i=o.r28shl(i,s),o.pc2(r,i,e.keys,a)}},u.prototype._update=function(e,t,r,n){var i=this._desState,a=o.readUInt32BE(e,t),s=o.readUInt32BE(e,t+4);o.ip(a,s,i.tmp,0),a=i.tmp[0],s=i.tmp[1],"encrypt"===this.type?this._encrypt(i,a,s,i.tmp,0):this._decrypt(i,a,s,i.tmp,0),a=i.tmp[0],s=i.tmp[1],o.writeUInt32BE(r,a,n),o.writeUInt32BE(r,s,n+4)},u.prototype._pad=function(e,t){for(var r=e.length-t,n=t;n<e.length;n++)e[n]=r;return!0},u.prototype._unpad=function(e){for(var t=e[e.length-1],r=e.length-t;r<e.length;r++)n.equal(e[r],t);return e.slice(0,e.length-t)},u.prototype._encrypt=function(e,t,r,n,i){for(var a=t,s=r,u=0;u<e.keys.length;u+=2){var c=e.keys[u],l=e.keys[u+1];o.expand(s,e.tmp,0),c^=e.tmp[0],l^=e.tmp[1];var f=o.substitute(c,l),d=s;s=(a^o.permute(f))>>>0,a=d}o.rip(s,a,n,i)},u.prototype._decrypt=function(e,t,r,n,i){for(var a=r,s=t,u=e.keys.length-2;u>=0;u-=2){var c=e.keys[u],l=e.keys[u+1];o.expand(a,e.tmp,0),c^=e.tmp[0],l^=e.tmp[1];var f=o.substitute(c,l),d=a;a=(s^o.permute(f))>>>0,s=d}o.rip(a,s,n,i)}},function(e,t,r){var n=r(102),i=r(16).Buffer,o=r(211);function a(e){var t=e._cipher.encryptBlockRaw(e._prev);return o(e._prev),t}t.encrypt=function(e,t){var r=Math.ceil(t.length/16),o=e._cache.length;e._cache=i.concat([e._cache,i.allocUnsafe(16*r)]);for(var s=0;s<r;s++){var u=a(e),c=o+16*s;e._cache.writeUInt32BE(u[0],c+0),e._cache.writeUInt32BE(u[1],c+4),e._cache.writeUInt32BE(u[2],c+8),e._cache.writeUInt32BE(u[3],c+12)}var l=e._cache.slice(0,t.length);return e._cache=e._cache.slice(t.length),n(t,l)}},function(e,t){e.exports=function(e){for(var t,r=e.length;r--;){if(255!==(t=e.readUInt8(r))){t++,e.writeUInt8(t,r);break}e.writeUInt8(0,r)}}},function(e){e.exports=JSON.parse('{"aes-128-ecb":{"cipher":"AES","key":128,"iv":0,"mode":"ECB","type":"block"},"aes-192-ecb":{"cipher":"AES","key":192,"iv":0,"mode":"ECB","type":"block"},"aes-256-ecb":{"cipher":"AES","key":256,"iv":0,"mode":"ECB","type":"block"},"aes-128-cbc":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes-192-cbc":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes-256-cbc":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes128":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes192":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes256":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes-128-cfb":{"cipher":"AES","key":128,"iv":16,"mode":"CFB","type":"stream"},"aes-192-cfb":{"cipher":"AES","key":192,"iv":16,"mode":"CFB","type":"stream"},"aes-256-cfb":{"cipher":"AES","key":256,"iv":16,"mode":"CFB","type":"stream"},"aes-128-cfb8":{"cipher":"AES","key":128,"iv":16,"mode":"CFB8","type":"stream"},"aes-192-cfb8":{"cipher":"AES","key":192,"iv":16,"mode":"CFB8","type":"stream"},"aes-256-cfb8":{"cipher":"AES","key":256,"iv":16,"mode":"CFB8","type":"stream"},"aes-128-cfb1":{"cipher":"AES","key":128,"iv":16,"mode":"CFB1","type":"stream"},"aes-192-cfb1":{"cipher":"AES","key":192,"iv":16,"mode":"CFB1","type":"stream"},"aes-256-cfb1":{"cipher":"AES","key":256,"iv":16,"mode":"CFB1","type":"stream"},"aes-128-ofb":{"cipher":"AES","key":128,"iv":16,"mode":"OFB","type":"stream"},"aes-192-ofb":{"cipher":"AES","key":192,"iv":16,"mode":"OFB","type":"stream"},"aes-256-ofb":{"cipher":"AES","key":256,"iv":16,"mode":"OFB","type":"stream"},"aes-128-ctr":{"cipher":"AES","key":128,"iv":16,"mode":"CTR","type":"stream"},"aes-192-ctr":{"cipher":"AES","key":192,"iv":16,"mode":"CTR","type":"stream"},"aes-256-ctr":{"cipher":"AES","key":256,"iv":16,"mode":"CTR","type":"stream"},"aes-128-gcm":{"cipher":"AES","key":128,"iv":12,"mode":"GCM","type":"auth"},"aes-192-gcm":{"cipher":"AES","key":192,"iv":12,"mode":"GCM","type":"auth"},"aes-256-gcm":{"cipher":"AES","key":256,"iv":12,"mode":"GCM","type":"auth"}}')},function(e,t,r){var n=r(115),i=r(16).Buffer,o=r(71),a=r(11),s=r(343),u=r(102),c=r(211);function l(e,t,r,a){o.call(this);var u=i.alloc(4,0);this._cipher=new n.AES(t);var l=this._cipher.encryptBlock(u);this._ghash=new s(l),r=function(e,t,r){if(12===t.length)return e._finID=i.concat([t,i.from([0,0,0,1])]),i.concat([t,i.from([0,0,0,2])]);var n=new s(r),o=t.length,a=o%16;n.update(t),a&&(a=16-a,n.update(i.alloc(a,0))),n.update(i.alloc(8,0));var u=8*o,l=i.alloc(8);l.writeUIntBE(u,0,8),n.update(l),e._finID=n.state;var f=i.from(e._finID);return c(f),f}(this,r,l),this._prev=i.from(r),this._cache=i.allocUnsafe(0),this._secCache=i.allocUnsafe(0),this._decrypt=a,this._alen=0,this._len=0,this._mode=e,this._authTag=null,this._called=!1}a(l,o),l.prototype._update=function(e){if(!this._called&&this._alen){var t=16-this._alen%16;t<16&&(t=i.alloc(t,0),this._ghash.update(t))}this._called=!0;var r=this._mode.encrypt(this,e);return this._decrypt?this._ghash.update(e):this._ghash.update(r),this._len+=e.length,r},l.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=u(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(e,t){var r=0;e.length!==t.length&&r++;for(var n=Math.min(e.length,t.length),i=0;i<n;++i)r+=e[i]^t[i];return r}(e,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=e,this._cipher.scrub()},l.prototype.getAuthTag=function(){if(this._decrypt||!i.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag},l.prototype.setAuthTag=function(e){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=e},l.prototype.setAAD=function(e){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(e),this._alen+=e.length},e.exports=l},function(e,t,r){var n=r(115),i=r(16).Buffer,o=r(71);function a(e,t,r,a){o.call(this),this._cipher=new n.AES(t),this._prev=i.from(r),this._cache=i.allocUnsafe(0),this._secCache=i.allocUnsafe(0),this._decrypt=a,this._mode=e}r(11)(a,o),a.prototype._update=function(e){return this._mode.encrypt(this,e,this._decrypt)},a.prototype._final=function(){this._cipher.scrub()},e.exports=a},function(e,t,r){var n=r(84);e.exports=b,b.simpleSieve=m,b.fermatTest=y;var i=r(35),o=new i(24),a=new(r(216)),s=new i(1),u=new i(2),c=new i(5),l=(new i(16),new i(8),new i(10)),f=new i(3),d=(new i(7),new i(11)),h=new i(4),p=(new i(12),null);function g(){if(null!==p)return p;var e=[];e[0]=2;for(var t=1,r=3;r<1048576;r+=2){for(var n=Math.ceil(Math.sqrt(r)),i=0;i<t&&e[i]<=n&&r%e[i]!=0;i++);t!==i&&e[i]<=n||(e[t++]=r)}return p=e,e}function m(e){for(var t=g(),r=0;r<t.length;r++)if(0===e.modn(t[r]))return 0===e.cmpn(t[r]);return!0}function y(e){var t=i.mont(e);return 0===u.toRed(t).redPow(e.subn(1)).fromRed().cmpn(1)}function b(e,t){if(e<16)return new i(2===t||5===t?[140,123]:[140,39]);var r,p;for(t=new i(t);;){for(r=new i(n(Math.ceil(e/8)));r.bitLength()>e;)r.ishrn(1);if(r.isEven()&&r.iadd(s),r.testn(1)||r.iadd(u),t.cmp(u)){if(!t.cmp(c))for(;r.mod(l).cmp(f);)r.iadd(h)}else for(;r.mod(o).cmp(d);)r.iadd(h);if(m(p=r.shrn(1))&&m(r)&&y(p)&&y(r)&&a.test(p)&&a.test(r))return r}}},function(e,t,r){var n=r(35),i=r(153);function o(e){this.rand=e||new i.Rand}e.exports=o,o.create=function(e){return new o(e)},o.prototype._randbelow=function(e){var t=e.bitLength(),r=Math.ceil(t/8);do{var i=new n(this.rand.generate(r))}while(i.cmp(e)>=0);return i},o.prototype._randrange=function(e,t){var r=t.sub(e);return e.add(this._randbelow(r))},o.prototype.test=function(e,t,r){var i=e.bitLength(),o=n.mont(e),a=new n(1).toRed(o);t||(t=Math.max(1,i/48|0));for(var s=e.subn(1),u=0;!s.testn(u);u++);for(var c=e.shrn(u),l=s.toRed(o);t>0;t--){var f=this._randrange(new n(2),s);r&&r(f);var d=f.toRed(o).redPow(c);if(0!==d.cmp(a)&&0!==d.cmp(l)){for(var h=1;h<u;h++){if(0===(d=d.redSqr()).cmp(a))return!1;if(0===d.cmp(l))break}if(h===u)return!1}}return!0},o.prototype.getDivisor=function(e,t){var r=e.bitLength(),i=n.mont(e),o=new n(1).toRed(i);t||(t=Math.max(1,r/48|0));for(var a=e.subn(1),s=0;!a.testn(s);s++);for(var u=e.shrn(s),c=a.toRed(i);t>0;t--){var l=this._randrange(new n(2),a),f=e.gcd(l);if(0!==f.cmpn(1))return f;var d=l.toRed(i).redPow(u);if(0!==d.cmp(o)&&0!==d.cmp(c)){for(var h=1;h<s;h++){if(0===(d=d.redSqr()).cmp(o))return d.fromRed().subn(1).gcd(e);if(0===d.cmp(c))break}if(h===s)return(d=d.redSqr()).fromRed().subn(1).gcd(e)}}return!1}},function(e,t,r){"use strict";(function(t,n){var i;e.exports=T,T.ReadableState=O;r(63).EventEmitter;var o=function(e,t){return e.listeners(t).length},a=r(218),s=r(10).Buffer,u=t.Uint8Array||function(){};var c,l=r(353);c=l&&l.debuglog?l.debuglog("stream"):function(){};var f,d,h,p=r(354),g=r(219),m=r(220).getHighWaterMark,y=r(88).codes,b=y.ERR_INVALID_ARG_TYPE,_=y.ERR_STREAM_PUSH_AFTER_EOF,w=y.ERR_METHOD_NOT_IMPLEMENTED,v=y.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(11)(T,a);var E=g.errorOrDestroy,S=["error","close","destroy","pause","resume"];function O(e,t,n){i=i||r(89),e=e||{},"boolean"!=typeof n&&(n=t instanceof i),this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=m(this,e,"readableHighWaterMark",n),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(70).StringDecoder),this.decoder=new f(e.encoding),this.encoding=e.encoding)}function T(e){if(i=i||r(89),!(this instanceof T))return new T(e);var t=this instanceof i;this._readableState=new O(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),a.call(this)}function A(e,t,r,n,i){c("readableAddChunk",t);var o,a=e._readableState;if(null===t)a.reading=!1,function(e,t){if(c("onEofChunk"),t.ended)return;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?I(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,j(e)))}(e,a);else if(i||(o=function(e,t){var r;n=t,s.isBuffer(n)||n instanceof u||"string"==typeof t||void 0===t||e.objectMode||(r=new b("chunk",["string","Buffer","Uint8Array"],t));var n;return r}(a,t)),o)E(e,o);else if(a.objectMode||t&&t.length>0)if("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===s.prototype||(t=function(e){return s.from(e)}(t)),n)a.endEmitted?E(e,new v):M(e,a,t,!0);else if(a.ended)E(e,new _);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?M(e,a,t,!1):R(e,a)):M(e,a,t,!1)}else n||(a.reading=!1,R(e,a));return!a.ended&&(a.length<a.highWaterMark||0===a.length)}function M(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&&I(e)),R(e,t)}Object.defineProperty(T.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),T.prototype.destroy=g.destroy,T.prototype._undestroy=g.undestroy,T.prototype._destroy=function(e,t){t(e)},T.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=s.from(e,t),t=""),r=!0),A(this,e,t,!1,r)},T.prototype.unshift=function(e){return A(this,e,null,!0,!1)},T.prototype.isPaused=function(){return!1===this._readableState.flowing},T.prototype.setEncoding=function(e){f||(f=r(70).StringDecoder);var t=new f(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,i="";null!==n;)i+=t.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};function D(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>=1073741824?e=1073741824:(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 I(e){var t=e._readableState;c("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(c("emitReadable",t.flowing),t.emittedReadable=!0,n.nextTick(j,e))}function j(e){var t=e._readableState;c("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,x(e)}function R(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(N,e,t))}function N(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(c("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function k(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 C(e){c("readable nexttick read 0"),e.read(0)}function L(e,t){c("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),x(e),t.flowing&&!t.reading&&e.read(0)}function x(e){var t=e._readableState;for(c("flow",t.flowing);t.flowing&&null!==e.read(););}function P(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 B(e){var t=e._readableState;c("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,n.nextTick(U,t,e))}function U(e,t){if(c("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 F(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}T.prototype.read=function(e){c("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 c("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?B(this):I(this),null;if(0===(e=D(e,t))&&t.ended)return 0===t.length&&B(this),null;var n,i=t.needReadable;return c("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&c("length less than watermark",i=!0),t.ended||t.reading?c("reading or ended",i=!1):i&&(c("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=D(r,t))),null===(n=e>0?P(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&&B(this)),null!==n&&this.emit("data",n),n},T.prototype._read=function(e){E(this,new w("_read()"))},T.prototype.pipe=function(e,t){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,c("pipe count=%d opts=%j",i.pipesCount,t);var a=(!t||!1!==t.end)&&e!==n.stdout&&e!==n.stderr?u:m;function s(t,n){c("onunpipe"),t===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,c("cleanup"),e.removeListener("close",p),e.removeListener("finish",g),e.removeListener("drain",l),e.removeListener("error",h),e.removeListener("unpipe",s),r.removeListener("end",u),r.removeListener("end",m),r.removeListener("data",d),f=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||l())}function u(){c("onend"),e.end()}i.endEmitted?n.nextTick(a):r.once("end",a),e.on("unpipe",s);var l=function(e){return function(){var t=e._readableState;c("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&o(e,"data")&&(t.flowing=!0,x(e))}}(r);e.on("drain",l);var f=!1;function d(t){c("ondata");var n=e.write(t);c("dest.write",n),!1===n&&((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==F(i.pipes,e))&&!f&&(c("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function h(t){c("onerror",t),m(),e.removeListener("error",h),0===o(e,"error")&&E(e,t)}function p(){e.removeListener("finish",g),m()}function g(){c("onfinish"),e.removeListener("close",p),m()}function m(){c("unpipe"),r.unpipe(e)}return r.on("data",d),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",h),e.once("close",p),e.once("finish",g),e.emit("pipe",r),i.flowing||(c("pipe resume"),r.resume()),e},T.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,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var a=F(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},T.prototype.on=function(e,t){var r=a.prototype.on.call(this,e,t),i=this._readableState;return"data"===e?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===e&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,c("on readable",i.length,i.reading),i.length?I(this):i.reading||n.nextTick(C,this))),r},T.prototype.addListener=T.prototype.on,T.prototype.removeListener=function(e,t){var r=a.prototype.removeListener.call(this,e,t);return"readable"===e&&n.nextTick(k,this),r},T.prototype.removeAllListeners=function(e){var t=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||n.nextTick(k,this),t},T.prototype.resume=function(){var e=this._readableState;return e.flowing||(c("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n.nextTick(L,e,t))}(this,e)),e.paused=!1,this},T.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},T.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",(function(){if(c("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){(c("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i)||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o<S.length;o++)e.on(S[o],this.emit.bind(this,S[o]));return this._read=function(t){c("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(T.prototype[Symbol.asyncIterator]=function(){return void 0===d&&(d=r(356)),d(this)}),Object.defineProperty(T.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(T.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(T.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),T._fromList=P,Object.defineProperty(T.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(T.from=function(e,t){return void 0===h&&(h=r(357)),h(T,e,t)})}).call(this,r(23),r(19))},function(e,t,r){e.exports=r(63).EventEmitter},function(e,t,r){"use strict";(function(t){function r(e,t){i(e,t),n(e)}function n(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function i(e,t){e.emit("error",t)}e.exports={destroy:function(e,o){var a=this,s=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return s||u?(o?o(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,t.nextTick(i,this,e)):t.nextTick(i,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!o&&e?a._writableState?a._writableState.errorEmitted?t.nextTick(n,a):(a._writableState.errorEmitted=!0,t.nextTick(r,a,e)):t.nextTick(r,a,e):o?(t.nextTick(n,a),o(e)):t.nextTick(n,a)})),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)}}}).call(this,r(19))},function(e,t,r){"use strict";var n=r(88).codes.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,r,i){var o=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,r);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new n(i?r:"highWaterMark",o);return Math.floor(o)}return e.objectMode?16:16384}}},function(e,t,r){"use strict";(function(t,n){function i(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;e.entry=null;for(;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}var o;e.exports=T,T.WritableState=O;var a={deprecate:r(145)},s=r(218),u=r(10).Buffer,c=t.Uint8Array||function(){};var l,f=r(219),d=r(220).getHighWaterMark,h=r(88).codes,p=h.ERR_INVALID_ARG_TYPE,g=h.ERR_METHOD_NOT_IMPLEMENTED,m=h.ERR_MULTIPLE_CALLBACK,y=h.ERR_STREAM_CANNOT_PIPE,b=h.ERR_STREAM_DESTROYED,_=h.ERR_STREAM_NULL_VALUES,w=h.ERR_STREAM_WRITE_AFTER_END,v=h.ERR_UNKNOWN_ENCODING,E=f.errorOrDestroy;function S(){}function O(e,t,a){o=o||r(89),e=e||{},"boolean"!=typeof a&&(a=t instanceof o),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,i=r.sync,o=r.writecb;if("function"!=typeof o)throw new m;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,i,o){--t.pendingcb,r?(n.nextTick(o,i),n.nextTick(R,e,t),e._writableState.errorEmitted=!0,E(e,i)):(o(i),e._writableState.errorEmitted=!0,E(e,i),R(e,t))}(e,r,i,t,o);else{var a=I(r)||e.destroyed;a||r.corked||r.bufferProcessing||!r.bufferedRequest||D(e,r),i?n.nextTick(M,e,r,a,o):M(e,r,a,o)}}(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 T(e){var t=this instanceof(o=o||r(89));if(!t&&!l.call(T,this))return new T(e);this._writableState=new O(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)),s.call(this)}function A(e,t,r,n,i,o,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new b("write")):r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function M(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),R(e,t)}function D(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 c=r.chunk,l=r.encoding,f=r.callback;if(A(e,t,!1,t.objectMode?1:c.length,c,l,f),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function I(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function j(e,t){e._final((function(r){t.pendingcb--,r&&E(e,r),t.prefinished=!0,e.emit("prefinish"),R(e,t)}))}function R(e,t){var r=I(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,n.nextTick(j,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var i=e._readableState;(!i||i.autoDestroy&&i.endEmitted)&&e.destroy()}return r}r(11)(T,s),O.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(O.prototype,"buffer",{get:a.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]?(l=Function.prototype[Symbol.hasInstance],Object.defineProperty(T,Symbol.hasInstance,{value:function(e){return!!l.call(this,e)||this===T&&(e&&e._writableState instanceof O)}})):l=function(e){return e instanceof this},T.prototype.pipe=function(){E(this,new y)},T.prototype.write=function(e,t,r){var i,o=this._writableState,a=!1,s=!o.objectMode&&(i=e,u.isBuffer(i)||i instanceof c);return s&&!u.isBuffer(e)&&(e=function(e){return u.from(e)}(e)),"function"==typeof t&&(r=t,t=null),s?t="buffer":t||(t=o.defaultEncoding),"function"!=typeof r&&(r=S),o.ending?function(e,t){var r=new w;E(e,r),n.nextTick(t,r)}(this,r):(s||function(e,t,r,i){var o;return null===r?o=new _:"string"==typeof r||t.objectMode||(o=new p("chunk",["string","Buffer"],r)),!o||(E(e,o),n.nextTick(i,o),!1)}(this,o,e,r))&&(o.pendingcb++,a=function(e,t,r,n,i,o){if(!r){var a=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=u.from(t,r));return t}(t,n,i);n!==a&&(r=!0,i="buffer",n=a)}var s=t.objectMode?1:n.length;t.length+=s;var c=t.length<t.highWaterMark;c||(t.needDrain=!0);if(t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else A(e,t,!1,s,n,i,o);return c}(this,o,s,e,t,r)),a},T.prototype.cork=function(){this._writableState.corked++},T.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||D(this,e))},T.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 v(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(T.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(T.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),T.prototype._write=function(e,t,r){r(new g("_write()"))},T.prototype._writev=null,T.prototype.end=function(e,t,r){var i=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),i.corked&&(i.corked=1,this.uncork()),i.ending||function(e,t,r){t.ending=!0,R(e,t),r&&(t.finished?n.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,i,r),this},Object.defineProperty(T.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(T.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),T.prototype.destroy=f.destroy,T.prototype._undestroy=f.undestroy,T.prototype._destroy=function(e,t){t(e)}}).call(this,r(23),r(19))},function(e,t,r){"use strict";e.exports=l;var n=r(88).codes,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,a=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=n.ERR_TRANSFORM_WITH_LENGTH_0,u=r(89);function c(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function l(e){if(!(this instanceof l))return new l(e);u.call(this,e),this._transformState={afterTransform:c.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(11)(l,u),l.prototype.push=function(e,t){return this._transformState.needTransform=!1,u.prototype.push.call(this,e,t)},l.prototype._transform=function(e,t,r){r(new i("_transform()"))},l.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},l.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))},l.prototype._destroy=function(e,t){u.prototype._destroy.call(this,e,(function(e){t(e)}))}},function(e,t,r){"use strict";var n=t;function i(e){return 1===e.length?"0"+e:e}function o(e){for(var t="",r=0;r<e.length;r++)t+=i(e[r].toString(16));return t}n.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var n=0;n<e.length;n++)r[n]=0|e[n];return r}if("hex"===t){(e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e);for(n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16))}else for(n=0;n<e.length;n++){var i=e.charCodeAt(n),o=i>>8,a=255&i;o?r.push(o,a):r.push(a)}return r},n.zero2=i,n.toHex=o,n.encode=function(e,t){return"hex"===t?o(e):e}},function(e,t,r){"use strict";var n=t;n.base=r(117),n.short=r(364),n.mont=r(365),n.edwards=r(366)},function(e,t,r){"use strict";var n=r(53).rotr32;function i(e,t,r){return e&t^~e&r}function o(e,t,r){return e&t^e&r^t&r}function a(e,t,r){return e^t^r}t.ft_1=function(e,t,r,n){return 0===e?i(t,r,n):1===e||3===e?a(t,r,n):2===e?o(t,r,n):void 0},t.ch32=i,t.maj32=o,t.p32=a,t.s0_256=function(e){return n(e,2)^n(e,13)^n(e,22)},t.s1_256=function(e){return n(e,6)^n(e,11)^n(e,25)},t.g0_256=function(e){return n(e,7)^n(e,18)^e>>>3},t.g1_256=function(e){return n(e,17)^n(e,19)^e>>>10}},function(e,t,r){"use strict";var n=r(53),i=r(103),o=r(225),a=r(44),s=n.sum32,u=n.sum32_4,c=n.sum32_5,l=o.ch32,f=o.maj32,d=o.s0_256,h=o.s1_256,p=o.g0_256,g=o.g1_256,m=i.BlockHash,y=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function b(){if(!(this instanceof b))return new b;m.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=y,this.W=new Array(64)}n.inherits(b,m),e.exports=b,b.blockSize=512,b.outSize=256,b.hmacStrength=192,b.padLength=64,b.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=u(g(r[n-2]),r[n-7],p(r[n-15]),r[n-16]);var i=this.h[0],o=this.h[1],m=this.h[2],y=this.h[3],b=this.h[4],_=this.h[5],w=this.h[6],v=this.h[7];for(a(this.k.length===r.length),n=0;n<r.length;n++){var E=c(v,h(b),l(b,_,w),this.k[n],r[n]),S=s(d(i),f(i,o,m));v=w,w=_,_=b,b=s(y,E),y=m,m=o,o=i,i=s(E,S)}this.h[0]=s(this.h[0],i),this.h[1]=s(this.h[1],o),this.h[2]=s(this.h[2],m),this.h[3]=s(this.h[3],y),this.h[4]=s(this.h[4],b),this.h[5]=s(this.h[5],_),this.h[6]=s(this.h[6],w),this.h[7]=s(this.h[7],v)},b.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},function(e,t,r){"use strict";var n=r(53),i=r(103),o=r(44),a=n.rotr64_hi,s=n.rotr64_lo,u=n.shr64_hi,c=n.shr64_lo,l=n.sum64,f=n.sum64_hi,d=n.sum64_lo,h=n.sum64_4_hi,p=n.sum64_4_lo,g=n.sum64_5_hi,m=n.sum64_5_lo,y=i.BlockHash,b=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function _(){if(!(this instanceof _))return new _;y.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=b,this.W=new Array(160)}function w(e,t,r,n,i){var o=e&r^~e&i;return o<0&&(o+=4294967296),o}function v(e,t,r,n,i,o){var a=t&n^~t&o;return a<0&&(a+=4294967296),a}function E(e,t,r,n,i){var o=e&r^e&i^r&i;return o<0&&(o+=4294967296),o}function S(e,t,r,n,i,o){var a=t&n^t&o^n&o;return a<0&&(a+=4294967296),a}function O(e,t){var r=a(e,t,28)^a(t,e,2)^a(t,e,7);return r<0&&(r+=4294967296),r}function T(e,t){var r=s(e,t,28)^s(t,e,2)^s(t,e,7);return r<0&&(r+=4294967296),r}function A(e,t){var r=a(e,t,14)^a(e,t,18)^a(t,e,9);return r<0&&(r+=4294967296),r}function M(e,t){var r=s(e,t,14)^s(e,t,18)^s(t,e,9);return r<0&&(r+=4294967296),r}function D(e,t){var r=a(e,t,1)^a(e,t,8)^u(e,t,7);return r<0&&(r+=4294967296),r}function I(e,t){var r=s(e,t,1)^s(e,t,8)^c(e,t,7);return r<0&&(r+=4294967296),r}function j(e,t){var r=a(e,t,19)^a(t,e,29)^u(e,t,6);return r<0&&(r+=4294967296),r}function R(e,t){var r=s(e,t,19)^s(t,e,29)^c(e,t,6);return r<0&&(r+=4294967296),r}n.inherits(_,y),e.exports=_,_.blockSize=1024,_.outSize=512,_.hmacStrength=192,_.padLength=128,_.prototype._prepareBlock=function(e,t){for(var r=this.W,n=0;n<32;n++)r[n]=e[t+n];for(;n<r.length;n+=2){var i=j(r[n-4],r[n-3]),o=R(r[n-4],r[n-3]),a=r[n-14],s=r[n-13],u=D(r[n-30],r[n-29]),c=I(r[n-30],r[n-29]),l=r[n-32],f=r[n-31];r[n]=h(i,o,a,s,u,c,l,f),r[n+1]=p(i,o,a,s,u,c,l,f)}},_.prototype._update=function(e,t){this._prepareBlock(e,t);var r=this.W,n=this.h[0],i=this.h[1],a=this.h[2],s=this.h[3],u=this.h[4],c=this.h[5],h=this.h[6],p=this.h[7],y=this.h[8],b=this.h[9],_=this.h[10],D=this.h[11],I=this.h[12],j=this.h[13],R=this.h[14],N=this.h[15];o(this.k.length===r.length);for(var k=0;k<r.length;k+=2){var C=R,L=N,x=A(y,b),P=M(y,b),B=w(y,b,_,D,I),U=v(y,b,_,D,I,j),F=this.k[k],W=this.k[k+1],H=r[k],z=r[k+1],q=g(C,L,x,P,B,U,F,W,H,z),V=m(C,L,x,P,B,U,F,W,H,z);C=O(n,i),L=T(n,i),x=E(n,i,a,s,u),P=S(n,i,a,s,u,c);var G=f(C,L,x,P),Y=d(C,L,x,P);R=I,N=j,I=_,j=D,_=y,D=b,y=f(h,p,q,V),b=d(p,p,q,V),h=u,p=c,u=a,c=s,a=n,s=i,n=f(q,V,G,Y),i=d(q,V,G,Y)}l(this.h,0,n,i),l(this.h,2,a,s),l(this.h,4,u,c),l(this.h,6,h,p),l(this.h,8,y,b),l(this.h,10,_,D),l(this.h,12,I,j),l(this.h,14,R,N)},_.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},function(e,t,r){(function(e){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var a;"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{a="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(381).Buffer}catch(e){}function s(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+e)}function u(e,t,r){var n=s(e,r);return r-1>=t&&(n|=s(e,r-1)<<4),n}function c(e,t,r,i){for(var o=0,a=0,s=Math.min(e.length,r),u=t;u<s;u++){var c=e.charCodeAt(u)-48;o*=i,a=c>=49?c-49+10:c>=17?c-17+10:c,n(c>=0&&a<i,"Invalid character"),o+=a}return o}function l(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,r):(this._parseBase(e,t,i),"le"===r&&this._initArray(this.toArray(),t,r)))},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,a,s=0;if("be"===r)for(i=e.length-1,o=0;i>=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i<e.length;i+=3)a=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this._strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,a=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=u(e,t,n)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)i=u(e,t,n)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this._strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,a=o%n,s=Math.min(o,o-a)+r,u=0,l=r;l<s;l+=n)u=c(e,l,l+n,t),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==a){var f=1;for(u=c(e,l,e.length,t),l=0;l<a;l++)f*=t;this.imuln(f),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this._strip()},o.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype._move=function(e){l(e,this)},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch(e){o.prototype.inspect=f}else o.prototype.inspect=f;function f(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var d=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,a=0;a<this.length;a++){var s=this.words[a],u=(16777215&(s<<i|o)).toString(16);r=0!==(o=s>>>24-i&16777215)||a!==this.length-1?d[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=h[e],l=p[e];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var g=f.modrn(l).toString(e);r=(f=f.idivn(l)).isZero()?g+r:d[c-g.length]+g+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16,2)},a&&(o.prototype.toBuffer=function(e,t){return this.toArrayLike(a,e,t)}),o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function g(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var c=1;c<n;c++){for(var l=u>>>26,f=67108863&u,d=Math.min(c,t.length-1),h=Math.max(0,c-e.length+1);h<=d;h++){var p=c-h|0;l+=(a=(i=0|e.words[p])*(o=0|t.words[h])+f)/67108864|0,f=67108863&a}r.words[c]=0|f,u=0|l}return 0!==u?r.words[c]=0|u:r.length--,r._strip()}o.prototype.toArrayLike=function(e,t,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var a=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](a,i),a},o.prototype._toArrayLikeLE=function(e,t){for(var r=0,n=0,i=0,o=0;i<this.length;i++){var a=this.words[i]<<o|n;e[r++]=255&a,r<e.length&&(e[r++]=a>>8&255),r<e.length&&(e[r++]=a>>16&255),6===o?(r<e.length&&(e[r++]=a>>24&255),n=0,o=0):(n=a>>>24,o+=2)}if(r<e.length)for(e[r++]=n;r<e.length;)e[r++]=0},o.prototype._toArrayLikeBE=function(e,t){for(var r=e.length-1,n=0,i=0,o=0;i<this.length;i++){var a=this.words[i]<<o|n;e[r--]=255&a,r>=0&&(e[r--]=a>>8&255),r>=0&&(e[r--]=a>>16&255),6===o?(r>=0&&(e[r--]=a>>24&255),n=0,o=0):(n=a>>>24,o+=2)}if(r>=0)for(e[r--]=n;r>=0;)e[r--]=0},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this._strip()},o.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this._strip()},o.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this._strip()},o.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this._strip()},o.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o<n.length;o++)t=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&t,i=t>>>26;for(;0!==i&&o<r.length;o++)t=(0|r.words[o])+i,this.words[o]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,a=0;a<n.length;a++)o=(t=(0|r.words[a])-(0|n.words[a])+o)>>26,this.words[a]=67108863&t;for(;0!==o&&a<r.length;a++)o=(t=(0|r.words[a])+o)>>26,this.words[a]=67108863&t;if(0===o&&a<r.length&&r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=Math.max(this.length,a),r!==this&&(this.negative=1),this._strip()},o.prototype.sub=function(e){return this.clone().isub(e)};var m=function(e,t,r){var n,i,o,a=e.words,s=t.words,u=r.words,c=0,l=0|a[0],f=8191&l,d=l>>>13,h=0|a[1],p=8191&h,g=h>>>13,m=0|a[2],y=8191&m,b=m>>>13,_=0|a[3],w=8191&_,v=_>>>13,E=0|a[4],S=8191&E,O=E>>>13,T=0|a[5],A=8191&T,M=T>>>13,D=0|a[6],I=8191&D,j=D>>>13,R=0|a[7],N=8191&R,k=R>>>13,C=0|a[8],L=8191&C,x=C>>>13,P=0|a[9],B=8191&P,U=P>>>13,F=0|s[0],W=8191&F,H=F>>>13,z=0|s[1],q=8191&z,V=z>>>13,G=0|s[2],Y=8191&G,$=G>>>13,K=0|s[3],Z=8191&K,X=K>>>13,J=0|s[4],Q=8191&J,ee=J>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,le=0|s[8],fe=8191&le,de=le>>>13,he=0|s[9],pe=8191&he,ge=he>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(c+(n=Math.imul(f,W))|0)+((8191&(i=(i=Math.imul(f,H))+Math.imul(d,W)|0))<<13)|0;c=((o=Math.imul(d,H))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(p,W),i=(i=Math.imul(p,H))+Math.imul(g,W)|0,o=Math.imul(g,H);var ye=(c+(n=n+Math.imul(f,q)|0)|0)+((8191&(i=(i=i+Math.imul(f,V)|0)+Math.imul(d,q)|0))<<13)|0;c=((o=o+Math.imul(d,V)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,W),i=(i=Math.imul(y,H))+Math.imul(b,W)|0,o=Math.imul(b,H),n=n+Math.imul(p,q)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(g,q)|0,o=o+Math.imul(g,V)|0;var be=(c+(n=n+Math.imul(f,Y)|0)|0)+((8191&(i=(i=i+Math.imul(f,$)|0)+Math.imul(d,Y)|0))<<13)|0;c=((o=o+Math.imul(d,$)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(w,W),i=(i=Math.imul(w,H))+Math.imul(v,W)|0,o=Math.imul(v,H),n=n+Math.imul(y,q)|0,i=(i=i+Math.imul(y,V)|0)+Math.imul(b,q)|0,o=o+Math.imul(b,V)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(g,Y)|0,o=o+Math.imul(g,$)|0;var _e=(c+(n=n+Math.imul(f,Z)|0)|0)+((8191&(i=(i=i+Math.imul(f,X)|0)+Math.imul(d,Z)|0))<<13)|0;c=((o=o+Math.imul(d,X)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(S,W),i=(i=Math.imul(S,H))+Math.imul(O,W)|0,o=Math.imul(O,H),n=n+Math.imul(w,q)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(v,q)|0,o=o+Math.imul(v,V)|0,n=n+Math.imul(y,Y)|0,i=(i=i+Math.imul(y,$)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,$)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(g,Z)|0,o=o+Math.imul(g,X)|0;var we=(c+(n=n+Math.imul(f,Q)|0)|0)+((8191&(i=(i=i+Math.imul(f,ee)|0)+Math.imul(d,Q)|0))<<13)|0;c=((o=o+Math.imul(d,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(A,W),i=(i=Math.imul(A,H))+Math.imul(M,W)|0,o=Math.imul(M,H),n=n+Math.imul(S,q)|0,i=(i=i+Math.imul(S,V)|0)+Math.imul(O,q)|0,o=o+Math.imul(O,V)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,$)|0)+Math.imul(v,Y)|0,o=o+Math.imul(v,$)|0,n=n+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,X)|0)+Math.imul(b,Z)|0,o=o+Math.imul(b,X)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,ee)|0;var ve=(c+(n=n+Math.imul(f,re)|0)|0)+((8191&(i=(i=i+Math.imul(f,ne)|0)+Math.imul(d,re)|0))<<13)|0;c=((o=o+Math.imul(d,ne)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(I,W),i=(i=Math.imul(I,H))+Math.imul(j,W)|0,o=Math.imul(j,H),n=n+Math.imul(A,q)|0,i=(i=i+Math.imul(A,V)|0)+Math.imul(M,q)|0,o=o+Math.imul(M,V)|0,n=n+Math.imul(S,Y)|0,i=(i=i+Math.imul(S,$)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,$)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,X)|0,n=n+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(g,re)|0,o=o+Math.imul(g,ne)|0;var Ee=(c+(n=n+Math.imul(f,oe)|0)|0)+((8191&(i=(i=i+Math.imul(f,ae)|0)+Math.imul(d,oe)|0))<<13)|0;c=((o=o+Math.imul(d,ae)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(N,W),i=(i=Math.imul(N,H))+Math.imul(k,W)|0,o=Math.imul(k,H),n=n+Math.imul(I,q)|0,i=(i=i+Math.imul(I,V)|0)+Math.imul(j,q)|0,o=o+Math.imul(j,V)|0,n=n+Math.imul(A,Y)|0,i=(i=i+Math.imul(A,$)|0)+Math.imul(M,Y)|0,o=o+Math.imul(M,$)|0,n=n+Math.imul(S,Z)|0,i=(i=i+Math.imul(S,X)|0)+Math.imul(O,Z)|0,o=o+Math.imul(O,X)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,ee)|0,n=n+Math.imul(y,re)|0,i=(i=i+Math.imul(y,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(g,oe)|0,o=o+Math.imul(g,ae)|0;var Se=(c+(n=n+Math.imul(f,ue)|0)|0)+((8191&(i=(i=i+Math.imul(f,ce)|0)+Math.imul(d,ue)|0))<<13)|0;c=((o=o+Math.imul(d,ce)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(L,W),i=(i=Math.imul(L,H))+Math.imul(x,W)|0,o=Math.imul(x,H),n=n+Math.imul(N,q)|0,i=(i=i+Math.imul(N,V)|0)+Math.imul(k,q)|0,o=o+Math.imul(k,V)|0,n=n+Math.imul(I,Y)|0,i=(i=i+Math.imul(I,$)|0)+Math.imul(j,Y)|0,o=o+Math.imul(j,$)|0,n=n+Math.imul(A,Z)|0,i=(i=i+Math.imul(A,X)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,X)|0,n=n+Math.imul(S,Q)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(v,re)|0,o=o+Math.imul(v,ne)|0,n=n+Math.imul(y,oe)|0,i=(i=i+Math.imul(y,ae)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,ae)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(g,ue)|0,o=o+Math.imul(g,ce)|0;var Oe=(c+(n=n+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,de)|0)+Math.imul(d,fe)|0))<<13)|0;c=((o=o+Math.imul(d,de)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(B,W),i=(i=Math.imul(B,H))+Math.imul(U,W)|0,o=Math.imul(U,H),n=n+Math.imul(L,q)|0,i=(i=i+Math.imul(L,V)|0)+Math.imul(x,q)|0,o=o+Math.imul(x,V)|0,n=n+Math.imul(N,Y)|0,i=(i=i+Math.imul(N,$)|0)+Math.imul(k,Y)|0,o=o+Math.imul(k,$)|0,n=n+Math.imul(I,Z)|0,i=(i=i+Math.imul(I,X)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,X)|0,n=n+Math.imul(A,Q)|0,i=(i=i+Math.imul(A,ee)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,ee)|0,n=n+Math.imul(S,re)|0,i=(i=i+Math.imul(S,ne)|0)+Math.imul(O,re)|0,o=o+Math.imul(O,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,ae)|0,n=n+Math.imul(y,ue)|0,i=(i=i+Math.imul(y,ce)|0)+Math.imul(b,ue)|0,o=o+Math.imul(b,ce)|0,n=n+Math.imul(p,fe)|0,i=(i=i+Math.imul(p,de)|0)+Math.imul(g,fe)|0,o=o+Math.imul(g,de)|0;var Te=(c+(n=n+Math.imul(f,pe)|0)|0)+((8191&(i=(i=i+Math.imul(f,ge)|0)+Math.imul(d,pe)|0))<<13)|0;c=((o=o+Math.imul(d,ge)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(B,q),i=(i=Math.imul(B,V))+Math.imul(U,q)|0,o=Math.imul(U,V),n=n+Math.imul(L,Y)|0,i=(i=i+Math.imul(L,$)|0)+Math.imul(x,Y)|0,o=o+Math.imul(x,$)|0,n=n+Math.imul(N,Z)|0,i=(i=i+Math.imul(N,X)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,X)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,ee)|0,n=n+Math.imul(A,re)|0,i=(i=i+Math.imul(A,ne)|0)+Math.imul(M,re)|0,o=o+Math.imul(M,ne)|0,n=n+Math.imul(S,oe)|0,i=(i=i+Math.imul(S,ae)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,ae)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,ce)|0,n=n+Math.imul(y,fe)|0,i=(i=i+Math.imul(y,de)|0)+Math.imul(b,fe)|0,o=o+Math.imul(b,de)|0;var Ae=(c+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,ge)|0)+Math.imul(g,pe)|0))<<13)|0;c=((o=o+Math.imul(g,ge)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(B,Y),i=(i=Math.imul(B,$))+Math.imul(U,Y)|0,o=Math.imul(U,$),n=n+Math.imul(L,Z)|0,i=(i=i+Math.imul(L,X)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,X)|0,n=n+Math.imul(N,Q)|0,i=(i=i+Math.imul(N,ee)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,ee)|0,n=n+Math.imul(I,re)|0,i=(i=i+Math.imul(I,ne)|0)+Math.imul(j,re)|0,o=o+Math.imul(j,ne)|0,n=n+Math.imul(A,oe)|0,i=(i=i+Math.imul(A,ae)|0)+Math.imul(M,oe)|0,o=o+Math.imul(M,ae)|0,n=n+Math.imul(S,ue)|0,i=(i=i+Math.imul(S,ce)|0)+Math.imul(O,ue)|0,o=o+Math.imul(O,ce)|0,n=n+Math.imul(w,fe)|0,i=(i=i+Math.imul(w,de)|0)+Math.imul(v,fe)|0,o=o+Math.imul(v,de)|0;var Me=(c+(n=n+Math.imul(y,pe)|0)|0)+((8191&(i=(i=i+Math.imul(y,ge)|0)+Math.imul(b,pe)|0))<<13)|0;c=((o=o+Math.imul(b,ge)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(B,Z),i=(i=Math.imul(B,X))+Math.imul(U,Z)|0,o=Math.imul(U,X),n=n+Math.imul(L,Q)|0,i=(i=i+Math.imul(L,ee)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,ee)|0,n=n+Math.imul(N,re)|0,i=(i=i+Math.imul(N,ne)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ne)|0,n=n+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,ae)|0)+Math.imul(j,oe)|0,o=o+Math.imul(j,ae)|0,n=n+Math.imul(A,ue)|0,i=(i=i+Math.imul(A,ce)|0)+Math.imul(M,ue)|0,o=o+Math.imul(M,ce)|0,n=n+Math.imul(S,fe)|0,i=(i=i+Math.imul(S,de)|0)+Math.imul(O,fe)|0,o=o+Math.imul(O,de)|0;var De=(c+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,ge)|0)+Math.imul(v,pe)|0))<<13)|0;c=((o=o+Math.imul(v,ge)|0)+(i>>>13)|0)+(De>>>26)|0,De&=67108863,n=Math.imul(B,Q),i=(i=Math.imul(B,ee))+Math.imul(U,Q)|0,o=Math.imul(U,ee),n=n+Math.imul(L,re)|0,i=(i=i+Math.imul(L,ne)|0)+Math.imul(x,re)|0,o=o+Math.imul(x,ne)|0,n=n+Math.imul(N,oe)|0,i=(i=i+Math.imul(N,ae)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,ae)|0,n=n+Math.imul(I,ue)|0,i=(i=i+Math.imul(I,ce)|0)+Math.imul(j,ue)|0,o=o+Math.imul(j,ce)|0,n=n+Math.imul(A,fe)|0,i=(i=i+Math.imul(A,de)|0)+Math.imul(M,fe)|0,o=o+Math.imul(M,de)|0;var Ie=(c+(n=n+Math.imul(S,pe)|0)|0)+((8191&(i=(i=i+Math.imul(S,ge)|0)+Math.imul(O,pe)|0))<<13)|0;c=((o=o+Math.imul(O,ge)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(B,re),i=(i=Math.imul(B,ne))+Math.imul(U,re)|0,o=Math.imul(U,ne),n=n+Math.imul(L,oe)|0,i=(i=i+Math.imul(L,ae)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,ae)|0,n=n+Math.imul(N,ue)|0,i=(i=i+Math.imul(N,ce)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,ce)|0,n=n+Math.imul(I,fe)|0,i=(i=i+Math.imul(I,de)|0)+Math.imul(j,fe)|0,o=o+Math.imul(j,de)|0;var je=(c+(n=n+Math.imul(A,pe)|0)|0)+((8191&(i=(i=i+Math.imul(A,ge)|0)+Math.imul(M,pe)|0))<<13)|0;c=((o=o+Math.imul(M,ge)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,n=Math.imul(B,oe),i=(i=Math.imul(B,ae))+Math.imul(U,oe)|0,o=Math.imul(U,ae),n=n+Math.imul(L,ue)|0,i=(i=i+Math.imul(L,ce)|0)+Math.imul(x,ue)|0,o=o+Math.imul(x,ce)|0,n=n+Math.imul(N,fe)|0,i=(i=i+Math.imul(N,de)|0)+Math.imul(k,fe)|0,o=o+Math.imul(k,de)|0;var Re=(c+(n=n+Math.imul(I,pe)|0)|0)+((8191&(i=(i=i+Math.imul(I,ge)|0)+Math.imul(j,pe)|0))<<13)|0;c=((o=o+Math.imul(j,ge)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(B,ue),i=(i=Math.imul(B,ce))+Math.imul(U,ue)|0,o=Math.imul(U,ce),n=n+Math.imul(L,fe)|0,i=(i=i+Math.imul(L,de)|0)+Math.imul(x,fe)|0,o=o+Math.imul(x,de)|0;var Ne=(c+(n=n+Math.imul(N,pe)|0)|0)+((8191&(i=(i=i+Math.imul(N,ge)|0)+Math.imul(k,pe)|0))<<13)|0;c=((o=o+Math.imul(k,ge)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,n=Math.imul(B,fe),i=(i=Math.imul(B,de))+Math.imul(U,fe)|0,o=Math.imul(U,de);var ke=(c+(n=n+Math.imul(L,pe)|0)|0)+((8191&(i=(i=i+Math.imul(L,ge)|0)+Math.imul(x,pe)|0))<<13)|0;c=((o=o+Math.imul(x,ge)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863;var Ce=(c+(n=Math.imul(B,pe))|0)+((8191&(i=(i=Math.imul(B,ge))+Math.imul(U,pe)|0))<<13)|0;return c=((o=Math.imul(U,ge))+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,u[0]=me,u[1]=ye,u[2]=be,u[3]=_e,u[4]=we,u[5]=ve,u[6]=Ee,u[7]=Se,u[8]=Oe,u[9]=Te,u[10]=Ae,u[11]=Me,u[12]=De,u[13]=Ie,u[14]=je,u[15]=Re,u[16]=Ne,u[17]=ke,u[18]=Ce,0!==c&&(u[19]=c,r.length++),r};function y(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var a=i;i=0;for(var s=67108863&n,u=Math.min(o,t.length-1),c=Math.max(0,o-e.length+1);c<=u;c++){var l=o-c,f=(0|e.words[l])*(0|t.words[c]),d=67108863&f;s=67108863&(d=d+s|0),i+=(a=(a=a+(f/67108864|0)|0)+(d>>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function b(e,t,r){return y(e,t,r)}function _(e,t){this.x=e,this.y=t}Math.imul||(m=g),o.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?m(this,e,t):r<63?g(this,e,t):r<1024?y(this,e,t):b(this,e,t)},_.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},_.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},_.prototype.permute=function(e,t,r,n,i,o){for(var a=0;a<o;a++)n[a]=t[e[a]],i[a]=r[e[a]]},_.prototype.transform=function(e,t,r,n,i,o){this.permute(o,e,t,r,n,i);for(var a=1;a<i;a<<=1)for(var s=a<<1,u=Math.cos(2*Math.PI/s),c=Math.sin(2*Math.PI/s),l=0;l<i;l+=s)for(var f=u,d=c,h=0;h<a;h++){var p=r[l+h],g=n[l+h],m=r[l+h+a],y=n[l+h+a],b=f*m-d*y;y=f*y+d*m,m=b,r[l+h]=p+m,n[l+h]=g+y,r[l+h+a]=p-m,n[l+h+a]=g-y,h!==s&&(b=u*f-c*d,d=u*d+c*f,f=b)}},_.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},_.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},_.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e},_.prototype.convert13b=function(e,t,r,i){for(var o=0,a=0;a<t;a++)o+=0|e[a],r[2*a]=8191&o,o>>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*t;a<i;++a)r[a]=0;n(0===o),n(0==(-8192&o))},_.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},_.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),o=this.stub(n),a=new Array(n),s=new Array(n),u=new Array(n),c=new Array(n),l=new Array(n),f=new Array(n),d=r.words;d.length=n,this.convert13b(e.words,e.length,a,n),this.convert13b(t.words,t.length,c,n),this.transform(a,o,s,u,n,i),this.transform(c,o,l,f,n,i);for(var h=0;h<n;h++){var p=s[h]*l[h]-u[h]*f[h];u[h]=s[h]*f[h]+u[h]*l[h],s[h]=p}return this.conjugate(s,u,n),this.transform(s,u,d,o,n,i),this.conjugate(d,o,n),this.normalize13b(d,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r._strip()},o.prototype.mul=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),b(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function(e){var t=e<0;t&&(e=-e),n("number"==typeof e),n(e<67108864);for(var r=0,i=0;i<this.length;i++){var o=(0|this.words[i])*e,a=(67108863&o)+(67108863&r);r>>=26,r+=o/67108864|0,r+=a>>>26,this.words[i]=67108863&a}return 0!==r&&(this.words[i]=r,this.length++),t?this.ineg():this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=e.words[n]>>>i&1}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var i=r.sqr();n<t.length;n++,i=i.sqr())0!==t[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t<this.length;t++){var s=this.words[t]&o,u=(0|this.words[t])-s<<r;this.words[t]=u|a,a=s>>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this._strip()},o.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},o.prototype.iushrn=function(e,t,r){var i;n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<<o,u=r;if(i-=a,i=Math.max(0,i),u){for(var c=0;c<a;c++)u.words[c]=this.words[c];u.length=a}if(0===a);else if(this.length>a)for(this.length-=a,c=0;c<this.length;c++)this.words[c]=this.words[c+a];else this.words[0]=0,this.length=1;var l=0;for(c=this.length-1;c>=0&&(0!==l||c>=i);c--){var f=0|this.words[c];this.words[c]=l<<26-o|f>>>o,l=f&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<<t;return!(this.length<=r)&&!!(this.words[r]&i)},o.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this._strip()},o.prototype.maskn=function(e){return this.clone().imaskn(e)},o.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<=e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},o.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this._strip()},o.prototype.addn=function(e){return this.clone().iaddn(e)},o.prototype.subn=function(e){return this.clone().isubn(e)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(e,t,r){var i,o,a=e.length+r;this._expand(a);var s=0;for(i=0;i<e.length;i++){o=(0|this.words[i+r])+s;var u=(0|e.words[i])*t;s=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)s=(o=(0|this.words[i+r])+s)>>26,this.words[i+r]=67108863&o;if(0===s)return this._strip();for(n(-1===s),s=0,i=0;i<this.length;i++)s=(o=-(0|this.words[i])+s)>>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,a=0|i.words[i.length-1];0!==(r=26-this._countBits(a))&&(i=i.ushln(r),n.iushln(r),a=0|i.words[i.length-1]);var s,u=n.length-i.length;if("mod"!==t){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c<s.length;c++)s.words[c]=0}var l=n.clone()._ishlnsubmul(i,1,u);0===l.negative&&(n=l,s&&(s.words[u]=1));for(var f=u-1;f>=0;f--){var d=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]);for(d=Math.min(d/a|0,67108863),n._ishlnsubmul(i,d,f);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1);s&&(s.words[f]=d)}return s&&s._strip(),n._strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:i,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modrn(e.words[0]))}:this._wordDiv(e,t);var i,a,s},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=(1<<26)%e,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%e;return t?-i:i},o.prototype.modn=function(e){return this.modrn(e)},o.prototype.idivn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/e|0,r=o%e}return this._strip(),t?this.ineg():this},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var l=r.clone(),f=t.clone();!t.isZero();){for(var d=0,h=1;0==(t.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(l),a.isub(f)),i.iushrn(1),a.iushrn(1);for(var p=0,g=1;0==(r.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(f)),s.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(s),a.isub(u)):(r.isub(t),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,a=new o(1),s=new o(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,l=1;0==(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var f=0,d=1;0==(r.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(r.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s)):(r.isub(t),s.isub(a))}return(i=0===t.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,a=r;0!==o&&a<this.length;a++){var s=0|this.words[a];o=(s+=o)>>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},o.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},o.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new A(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var w={k256:null,p224:null,p192:null,p25519:null};function v(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function E(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function S(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function O(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function T(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function M(e){A.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},i(E,v),E.prototype.split=function(e,t){for(var r=Math.min(e.length,9),n=0;n<r;n++)t.words[n]=e.words[n];if(t.length=r,e.length<=9)return e.words[0]=0,void(e.length=1);var i=e.words[9];for(t.words[t.length++]=4194303&i,n=10;n<e.length;n++){var o=0|e.words[n];e.words[n-10]=(4194303&o)<<4|i>>>22,i=o}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},E.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(S,v),i(O,v),i(T,v),T.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(w[e])return w[e];var t;if("k256"===e)t=new E;else if("p224"===e)t=new S;else if("p192"===e)t=new O;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new T}return w[e]=t,t},A.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},A.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},A.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(l(e,e.umod(this.m)._forceRed(this)),e)},A.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},A.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},A.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},A.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},A.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},A.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},A.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},A.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},A.prototype.isqr=function(e){return this.imul(e,e.clone())},A.prototype.sqr=function(e){return this.mul(e,e)},A.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var f=this.pow(l,i),d=this.pow(e,i.addn(1).iushrn(1)),h=this.pow(e,i),p=a;0!==h.cmp(s);){for(var g=h,m=0;0!==g.cmp(s);m++)g=g.redSqr();n(m<p);var y=this.pow(f,new o(1).iushln(p-m-1));d=d.redMul(y),f=y.redSqr(),h=h.redMul(f),p=m}return d},A.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},A.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var i=r[0],a=0,s=0,u=t.bitLength()%26;for(0===u&&(u=26),n=t.length-1;n>=0;n--){for(var c=t.words[n],l=u-1;l>=0;l--){var f=c>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==a?(a<<=1,a|=f,(4===++s||0===n&&0===l)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}u=26}return i},A.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},A.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new M(e)},i(M,A),M.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},M.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},M.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},M.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},M.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,r(97)(e))},function(e,t,r){"use strict";const n=t;n.bignum=r(35),n.define=r(383).define,n.base=r(386),n.constants=r(387),n.decoders=r(232),n.encoders=r(230)},function(e,t,r){"use strict";const n=t;n.der=r(231),n.pem=r(384)},function(e,t,r){"use strict";const n=r(11),i=r(159).Buffer,o=r(160),a=r(162);function s(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new u,this.tree._init(e.body)}function u(e){o.call(this,"der",e)}function c(e){return e<10?"0"+e:e}e.exports=s,s.prototype.encode=function(e,t){return this.tree._encode(e,t).join()},n(u,o),u.prototype._encodeComposite=function(e,t,r,n){const o=function(e,t,r,n){let i;"seqof"===e?e="seq":"setof"===e&&(e="set");if(a.tagByName.hasOwnProperty(e))i=a.tagByName[e];else{if("number"!=typeof e||(0|e)!==e)return n.error("Unknown tag: "+e);i=e}if(i>=31)return n.error("Multi-octet tag encoding unsupported");t||(i|=32);return i|=a.tagClassByName[r||"universal"]<<6,i}(e,t,r,this.reporter);if(n.length<128){const e=i.alloc(2);return e[0]=o,e[1]=n.length,this._createEncoderBuffer([e,n])}let s=1;for(let e=n.length;e>=256;e>>=8)s++;const u=i.alloc(2+s);u[0]=o,u[1]=128|s;for(let e=1+s,t=n.length;t>0;e--,t>>=8)u[e]=255&t;return this._createEncoderBuffer([u,n])},u.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===t){const t=i.alloc(2*e.length);for(let r=0;r<e.length;r++)t.writeUInt16BE(e.charCodeAt(r),2*r);return this._createEncoderBuffer(t)}return"numstr"===t?this._isNumstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===t?this._isPrintstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(t)||"objDesc"===t?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: "+t+" unsupported")},u.prototype._encodeObjid=function(e,t,r){if("string"==typeof e){if(!t)return this.reporter.error("string objid given, but no values map found");if(!t.hasOwnProperty(e))return this.reporter.error("objid not found in values map");e=t[e].split(/[\s.]+/g);for(let t=0;t<e.length;t++)e[t]|=0}else if(Array.isArray(e)){e=e.slice();for(let t=0;t<e.length;t++)e[t]|=0}if(!Array.isArray(e))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(e));if(!r){if(e[1]>=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}let n=0;for(let t=0;t<e.length;t++){let r=e[t];for(n++;r>=128;r>>=7)n++}const o=i.alloc(n);let a=o.length-1;for(let t=e.length-1;t>=0;t--){let r=e[t];for(o[a--]=127&r;(r>>=7)>0;)o[a--]=128|127&r}return this._createEncoderBuffer(o)},u.prototype._encodeTime=function(e,t){let r;const n=new Date(e);return"gentime"===t?r=[c(n.getUTCFullYear()),c(n.getUTCMonth()+1),c(n.getUTCDate()),c(n.getUTCHours()),c(n.getUTCMinutes()),c(n.getUTCSeconds()),"Z"].join(""):"utctime"===t?r=[c(n.getUTCFullYear()%100),c(n.getUTCMonth()+1),c(n.getUTCDate()),c(n.getUTCHours()),c(n.getUTCMinutes()),c(n.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(r,"octstr")},u.prototype._encodeNull=function(){return this._createEncoderBuffer("")},u.prototype._encodeInt=function(e,t){if("string"==typeof e){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if("number"!=typeof e&&!i.isBuffer(e)){const t=e.toArray();!e.sign&&128&t[0]&&t.unshift(0),e=i.from(t)}if(i.isBuffer(e)){let t=e.length;0===e.length&&t++;const r=i.alloc(t);return e.copy(r),0===e.length&&(r[0]=0),this._createEncoderBuffer(r)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);let r=1;for(let t=e;t>=256;t>>=8)r++;const n=new Array(r);for(let t=n.length-1;t>=0;t--)n[t]=255&e,e>>=8;return 128&n[0]&&n.unshift(0),this._createEncoderBuffer(i.from(n))},u.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},u.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},u.prototype._skipDefault=function(e,t,r){const n=this._baseState;let i;if(null===n.default)return!1;const o=e.join();if(void 0===n.defaultBuffer&&(n.defaultBuffer=this._encodeValue(n.default,t,r).join()),o.length!==n.defaultBuffer.length)return!1;for(i=0;i<o.length;i++)if(o[i]!==n.defaultBuffer[i])return!1;return!0}},function(e,t,r){"use strict";const n=t;n.der=r(233),n.pem=r(385)},function(e,t,r){"use strict";const n=r(11),i=r(35),o=r(104).DecoderBuffer,a=r(160),s=r(162);function u(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new c,this.tree._init(e.body)}function c(e){a.call(this,"der",e)}function l(e,t){let r=e.readUInt8(t);if(e.isError(r))return r;const n=s.tagClass[r>>6],i=0==(32&r);if(31==(31&r)){let n=r;for(r=0;128==(128&n);){if(n=e.readUInt8(t),e.isError(n))return n;r<<=7,r|=127&n}}else r&=31;return{cls:n,primitive:i,tag:r,tagStr:s.tag[r]}}function f(e,t,r){let n=e.readUInt8(r);if(e.isError(n))return n;if(!t&&128===n)return null;if(0==(128&n))return n;const i=127&n;if(i>4)return e.error("length octect is too long");n=0;for(let t=0;t<i;t++){n<<=8;const t=e.readUInt8(r);if(e.isError(t))return t;n|=t}return n}e.exports=u,u.prototype.decode=function(e,t){return o.isDecoderBuffer(e)||(e=new o(e,t)),this.tree._decode(e,t)},n(c,a),c.prototype._peekTag=function(e,t,r){if(e.isEmpty())return!1;const n=e.save(),i=l(e,'Failed to peek tag: "'+t+'"');return e.isError(i)?i:(e.restore(n),i.tag===t||i.tagStr===t||i.tagStr+"of"===t||r)},c.prototype._decodeTag=function(e,t,r){const n=l(e,'Failed to decode tag of "'+t+'"');if(e.isError(n))return n;let i=f(e,n.primitive,'Failed to get length of "'+t+'"');if(e.isError(i))return i;if(!r&&n.tag!==t&&n.tagStr!==t&&n.tagStr+"of"!==t)return e.error('Failed to match tag: "'+t+'"');if(n.primitive||null!==i)return e.skip(i,'Failed to match body of: "'+t+'"');const o=e.save(),a=this._skipUntilEnd(e,'Failed to skip indefinite length body: "'+this.tag+'"');return e.isError(a)?a:(i=e.offset-o.offset,e.restore(o),e.skip(i,'Failed to match body of: "'+t+'"'))},c.prototype._skipUntilEnd=function(e,t){for(;;){const r=l(e,t);if(e.isError(r))return r;const n=f(e,r.primitive,t);if(e.isError(n))return n;let i;if(i=r.primitive||null!==n?e.skip(n):this._skipUntilEnd(e,t),e.isError(i))return i;if("end"===r.tagStr)break}},c.prototype._decodeList=function(e,t,r,n){const i=[];for(;!e.isEmpty();){const t=this._peekTag(e,"end");if(e.isError(t))return t;const o=r.decode(e,"der",n);if(e.isError(o)&&t)break;i.push(o)}return i},c.prototype._decodeStr=function(e,t){if("bitstr"===t){const t=e.readUInt8();return e.isError(t)?t:{unused:t,data:e.raw()}}if("bmpstr"===t){const t=e.raw();if(t.length%2==1)return e.error("Decoding of string type: bmpstr length mismatch");let r="";for(let e=0;e<t.length/2;e++)r+=String.fromCharCode(t.readUInt16BE(2*e));return r}if("numstr"===t){const t=e.raw().toString("ascii");return this._isNumstr(t)?t:e.error("Decoding of string type: numstr unsupported characters")}if("octstr"===t)return e.raw();if("objDesc"===t)return e.raw();if("printstr"===t){const t=e.raw().toString("ascii");return this._isPrintstr(t)?t:e.error("Decoding of string type: printstr unsupported characters")}return/str$/.test(t)?e.raw().toString():e.error("Decoding of string type: "+t+" unsupported")},c.prototype._decodeObjid=function(e,t,r){let n;const i=[];let o=0,a=0;for(;!e.isEmpty();)a=e.readUInt8(),o<<=7,o|=127&a,0==(128&a)&&(i.push(o),o=0);128&a&&i.push(o);const s=i[0]/40|0,u=i[0]%40;if(n=r?i:[s,u].concat(i.slice(1)),t){let e=t[n.join(" ")];void 0===e&&(e=t[n.join(".")]),void 0!==e&&(n=e)}return n},c.prototype._decodeTime=function(e,t){const r=e.raw().toString();let n,i,o,a,s,u;if("gentime"===t)n=0|r.slice(0,4),i=0|r.slice(4,6),o=0|r.slice(6,8),a=0|r.slice(8,10),s=0|r.slice(10,12),u=0|r.slice(12,14);else{if("utctime"!==t)return e.error("Decoding "+t+" time is not supported yet");n=0|r.slice(0,2),i=0|r.slice(2,4),o=0|r.slice(4,6),a=0|r.slice(6,8),s=0|r.slice(8,10),u=0|r.slice(10,12),n=n<70?2e3+n:1900+n}return Date.UTC(n,i-1,o,a,s,u,0)},c.prototype._decodeNull=function(){return null},c.prototype._decodeBool=function(e){const t=e.readUInt8();return e.isError(t)?t:0!==t},c.prototype._decodeInt=function(e,t){const r=e.raw();let n=new i(r);return t&&(n=t[n.toString(10)]||n),n},c.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getDecoder("der").tree}},function(e){e.exports=JSON.parse('{"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}')},function(e,t,r){var n=r(101),i=r(16).Buffer;function o(e){var t=i.allocUnsafe(4);return t.writeUInt32BE(e,0),t}e.exports=function(e,t){for(var r,a=i.alloc(0),s=0;a.length<t;)r=o(s++),a=i.concat([a,n("sha1").update(e).update(r).digest()]);return a.slice(0,t)}},function(e,t){e.exports=function(e,t){for(var r=e.length,n=-1;++n<r;)e[n]^=t[n];return e}},function(e,t,r){var n=r(35),i=r(16).Buffer;e.exports=function(e,t){return i.from(e.toRed(n.mont(t.modulus)).redPow(new n(t.publicExponent)).fromRed().toArray())}},function(e,t){var r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(r){var n=new Uint8Array(16);e.exports=function(){return r(n),n}}else{var i=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),i[t]=e>>>((3&t)<<3)&255;return i}}},function(e,t){for(var r=[],n=0;n<256;++n)r[n]=(n+256).toString(16).substr(1);e.exports=function(e,t){var n=t||0,i=r;return[i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]]].join("")}},function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(31);let i=r(163);async function o(){return(await n.a.randomBytes(12)).toString()}async function a(e){let t=new i.Message;t.setDataset(await o()),t.setRow(await o()),t.setColumn(await o()),t.setValue(await o());let r=t.serializeBinary();return await n.a.encrypt(r,e)}},function(e,t,r){"use strict";r.d(t,"a",(function(){return f}));var n=r(37),i=r(1),o=r(8),a=r(9),s=r.n(a),u=r(24),c=r(6);const l=r(52);async function f(e){if(!e){let e=await n.a(),t=e.valid,r=e.error;if(r)return{error:r};if(!t)return{error:{reason:"file-has-new-key"}}}let t=(await n.g(e)).error;if(t)return{error:t};if(await Object(c.runMutator)(async()=>{await i.execQuery("\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 i.loadClock()}),await o.d({groupId:null,lastSyncedTimestamp:null,lastUploaded:null}),e){let t=e.key,r=o.b().cloudFileId,n=JSON.parse(await s.a.getItem("encrypt-keys")||"{}");n[r]=t.serialize(),await s.a.setItem("encrypt-keys",JSON.stringify(n)),await o.d({encryptKeyId:t.getId()})}try{await n.h()}catch(e){return e.reason?{error:e}:(Object(u.captureException)(e),{error:{reason:"upload-failure"}})}finally{l.send("prefs-updated")}return{}}},function(e,t){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,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,FLG_ENC:0,FLG_COMP1:1,FLG_COMP2:2,FLG_DESC:4,FLG_ENH:8,FLG_STR:16,FLG_LNG:1024,FLG_MSK:4096,FILE:0,BUFFER:1,NONE:2,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}},function(e,t){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"}},function(e,t,r){(function(t){var n=r(105),i=r(245),o=n.Constants,a=r(417);e.exports=function(e){var r=new i.EntryHeader,s=t.alloc(0),u=t.alloc(0),c=!1,l=null,f=t.alloc(0);function d(){return e&&t.isBuffer(e)?(r.loadDataHeaderFromBinary(e),e.slice(r.realDataOffset,r.realDataOffset+r.compressedSize)):t.alloc(0)}function h(e){return 8==(8&r.flags)||n.crc32(e)===r.dataHeader.crc}function p(e,i,o){if(void 0===i&&"string"==typeof e&&(e,e=void 0),c)return e&&i&&i(t.alloc(0),n.Errors.DIRECTORY_CONTENT_ERROR),t.alloc(0);var u=d();if(0===u.length)return e&&i&&i(u,n.Errors.NO_DATA),u;var l=t.alloc(r.size);switch(r.method){case n.Constants.STORED:return u.copy(l),h(l)?(e&&i&&i(l),l):(e&&i&&i(l,n.Errors.BAD_CRC),n.Errors.BAD_CRC);case n.Constants.DEFLATED:var f=new a.Inflater(u);if(!e)return f.inflate(l).copy(l,0),h(l)||console.warn(n.Errors.BAD_CRC+" "+s.toString()),l;f.inflateAsync((function(e){e.copy(l,0),h(l)?i&&i(l):i&&i(l,n.Errors.BAD_CRC)}));break;default:return e&&i&&i(t.alloc(0),n.Errors.UNKNOWN_METHOD),n.Errors.UNKNOWN_METHOD}}function g(i,o){if((!l||!l.length)&&t.isBuffer(e))return i&&o&&o(d()),d();if(l.length&&!c){var s;switch(r.method){case n.Constants.STORED:return r.compressedSize=r.size,s=t.alloc(l.length),l.copy(s),i&&o&&o(s),s;default:case n.Constants.DEFLATED:var u=new a.Deflater(l);if(!i){var f=u.deflate();return r.compressedSize=f.length,f}u.deflateAsync((function(e){s=t.alloc(e.length),r.compressedSize=e.length,e.copy(s),o&&o(s)})),u=null}}else{if(!i||!o)return t.alloc(0);o(t.alloc(0))}}function m(e,t){return(e.readUInt32LE(t+4)<<4)+e.readUInt32LE(t)}function y(e){var t,n,i,a;e.length>=o.EF_ZIP64_SCOMP&&(t=m(e,o.EF_ZIP64_SUNCOMP),r.size===o.EF_ZIP64_OR_32&&(r.size=t)),e.length>=o.EF_ZIP64_RHO&&(n=m(e,o.EF_ZIP64_SCOMP),r.compressedSize===o.EF_ZIP64_OR_32&&(r.compressedSize=n)),e.length>=o.EF_ZIP64_DSN&&(i=m(e,o.EF_ZIP64_RHO),r.offset===o.EF_ZIP64_OR_32&&(r.offset=i)),e.length>=o.EF_ZIP64_DSN+4&&(a=e.readUInt32LE(o.EF_ZIP64_DSN),r.diskNumStart===o.EF_ZIP64_OR_16&&(r.diskNumStart=a))}return{get entryName(){return s.toString()},get rawEntryName(){return s},set entryName(e){var t=(s=n.toBuffer(e))[s.length-1];c=47===t||92===t,r.fileNameLength=s.length},get extra(){return f},set extra(e){f=e,r.extraLength=e.length,function(e){for(var t,r,n,i=0;i<e.length;)t=e.readUInt16LE(i),i+=2,r=e.readUInt16LE(i),i+=2,n=e.slice(i,i+r),i+=r,o.ID_ZIP64===t&&y(n)}(e)},get comment(){return u.toString()},set comment(e){u=n.toBuffer(e),r.commentLength=u.length},get name(){var e=s.toString();return c?e.substr(e.length-1).split("/").pop():e.split("/").pop()},get isDirectory(){return c},getCompressedData:function(){return g(!1,null)},getCompressedDataAsync:function(e){g(!0,e)},setData:function(e){l=n.toBuffer(e),!c&&l.length?(r.size=l.length,r.method=n.Constants.DEFLATED,r.crc=n.crc32(e),r.changed=!0):r.method=n.Constants.STORED},getData:function(e){return r.changed?l:p(!1,null)},getDataAsync:function(e,t){r.changed?e(l):p(!0,e)},set attr(e){r.attr=e},get attr(){return r.attr},set header(e){r.loadFromBinary(e)},get header(){return r},packHeader:function(){var e=r.entryHeaderToBinary();return s.copy(e,n.Constants.CENHDR),r.extraLength&&f.copy(e,n.Constants.CENHDR+s.length),r.commentLength&&u.copy(e,n.Constants.CENHDR+s.length+r.extraLength,u.length),e},toString:function(){return'{\n\t"entryName" : "'+s.toString()+'",\n\t"name" : "'+(c?s.toString().replace(/\/$/,"").split("/").pop():s.toString().split("/").pop())+'",\n\t"comment" : "'+u.toString()+'",\n\t"isDirectory" : '+c+',\n\t"header" : '+r.toString().replace(/\t/gm,"\t\t").replace(/}/gm,"\t}")+',\n\t"compressedData" : <'+(e&&e.length+" bytes buffer"||"null")+'>\n\t"data" : <'+(l&&l.length+" bytes buffer"||"null")+">\n}"}}}}).call(this,r(10).Buffer)},function(e,t,r){t.EntryHeader=r(415),t.MainHeader=r(416)},function(e,t,r){"use strict";e.exports=function(e,t,r,n){for(var i=65535&e|0,o=e>>>16&65535|0,a=0;0!==r;){r-=a=r>2e3?2e3:r;do{o=o+(i=i+t[n++]|0)|0}while(--a);i%=65521,o%=65521}return i|o<<16|0}},function(e,t,r){"use strict";var n=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,t,r,i){var o=n,a=i+r;e^=-1;for(var s=i;s<a;s++)e=e>>>8^o[255&(e^t[s])];return-1^e}},function(e,t){var r={utf8:{stringToBytes:function(e){return r.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(r.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=r},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(3),i=r(73);function o(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(n.a)(t);return Object(i.a)(e,-r)}},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(3),i=r(126);function o(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(n.a)(t);return Object(i.a)(e,-r)}},function(e,t){t.async_all=function(e,t,r){var n=e.length,i=null,o=[],a=function(e,t){e&&(i=i||[]).push(e),o.push(t),0==--n&&r(i,o)};if(0===n)r(i,o);else for(var s=0,u=e.length;s<u;s++)t(e[s],a)},t.ensure_timestamp=function(e){if(!(e instanceof Date||"number"==typeof e))throw new Error("`time` property must be a Date or Unix timestamp and is only required for `import` endpoint");return e instanceof Date?Math.floor(e.getTime()/1e3):e}},function(e,t,r){function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,i,o=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==r.return||r.return()}finally{if(s)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function o(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 a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach((function(t){s(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const u=r(251).ensure_timestamp;function c(e,t){return t&&(t.$ignore_alias&&(e.$ignore_alias=t.$ignore_alias),t.$ignore_time&&(e.$ignore_time=t.$ignore_time),t.hasOwnProperty("$ip")&&(e.$ip=t.$ip),t.hasOwnProperty("$time")&&(e.$time=u(t.$time))),e}t.merge_modifiers=c,t.ProfileHelpers=(e=Object)=>class extends e{get token(){return this.mixpanel.token}get config(){return this.mixpanel.config}_set(e,t,r,n,{identifiers:i,set_once:o=!1}){let s={};"object"==typeof e?("object"==typeof t?(n=r,r=t):n=t,s=e):(s[e]=t,"function"!=typeof r&&r||(n=r));let u=a({$token:this.token},i);u[o?"$set_once":"$set"]=s,"ip"in s&&(u.$ip=s.ip,delete s.ip),s.$ignore_time&&(u.$ignore_time=s.$ignore_time,delete s.$ignore_time),u=c(u,r),this.config.debug&&(console.log(`Sending the following data to Mixpanel (${this.endpoint}):`),console.log(u)),this.mixpanel.send_request({method:"GET",endpoint:this.endpoint,data:u},n)}_delete_profile({identifiers:e,modifiers:t,callback:r}){let n=a({$delete:"",$token:this.token},e);"function"==typeof t&&(r=t),n=c(n,t),this.config.debug&&console.log("Deleting profile "+JSON.stringify(e)),this.mixpanel.send_request({method:"GET",endpoint:this.endpoint,data:n},r)}_remove({identifiers:e,data:t,modifiers:r,callback:i}){let o={};if("object"!=typeof t||Array.isArray(t))this.config.debug&&console.error("Invalid value passed to #remove - data must be an object with scalar values");else{for(const e of Object.entries(t)){var s=n(e,2);const t=s[0],r=s[1];if("string"!=typeof r&&"number"!=typeof r)return void(this.config.debug&&(console.error("Invalid argument passed to #remove - values must be scalar"),console.error("Passed "+t+":",r)));o[t]=r}0!==Object.keys(o).length&&("function"==typeof r&&(i=r),t=c(t=a({$remove:o,$token:this.token},e),r),this.config.debug&&(console.log(`Sending the following data to Mixpanel (${this.endpoint}):`),console.log(t)),this.mixpanel.send_request({method:"GET",endpoint:this.endpoint,data:t},i))}}_union({identifiers:e,data:t,modifiers:r,callback:i}){let o={};if("object"!=typeof t||Array.isArray(t))this.config.debug&&console.error("Invalid value passed to #union - data must be an object with scalar or array values");else{for(const e of Object.entries(t)){var s=n(e,2);const t=s[0],r=s[1];if(Array.isArray(r)){var u=r.filter((function(e){return"string"==typeof e||"number"==typeof e}));u.length>0&&(o[t]=u)}else"string"==typeof r||"number"==typeof r?o[t]=[r]:this.config.debug&&(console.error("Invalid argument passed to #union - values must be a scalar value or array"),console.error("Passed "+t+":",r))}0!==Object.keys(o).length&&("function"==typeof r&&(i=r),t=c(t=a({$union:o,$token:this.token},e),r),this.config.debug&&(console.log(`Sending the following data to Mixpanel (${this.endpoint}):`),console.log(t)),this.mixpanel.send_request({method:"GET",endpoint:this.endpoint,data:t},i))}}_unset({identifiers:e,prop:t,modifiers:r,callback:n}){let i=[];if(Array.isArray(t))i=t;else{if("string"!=typeof t)return void(this.config.debug&&(console.error("Invalid argument passed to #unset - must be a string or array"),console.error("Passed: "+t)));i=[t]}let o=a({$unset:i,$token:this.token},e);"function"==typeof r&&(n=r),o=c(o,r),this.config.debug&&(console.log(`Sending the following data to Mixpanel (${this.endpoint}):`),console.log(o)),this.mixpanel.send_request({method:"GET",endpoint:this.endpoint,data:o},n)}}},function(e,t,r){"use strict";var n=Object.prototype.toString;e.exports=function(e){var t=n.call(e),r="[object Arguments]"===t;return r||(r="[object Array]"!==t&&null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Function]"===n.call(e.callee)),r}},function(e,t,r){"use strict";var n=r(72)(),i=r(54)("Object.prototype.toString"),o=function(e){return!(n&&e&&"object"==typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===i(e)},a=function(e){return!!o(e)||null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==i(e)&&"[object Function]"===i(e.callee)},s=function(){return o(arguments)}();o.isLegacyArguments=a,e.exports=s?o:a},function(e,t,r){"use strict";var n=function(e){return e!=e};e.exports=function(e,t){return 0===e&&0===t?1/e==1/t:e===t||!(!n(e)||!n(t))}},function(e,t,r){"use strict";var n=r(255);e.exports=function(){return"function"==typeof Object.is?Object.is:n}},function(e,t,r){"use strict";var n=Object,i=TypeError;e.exports=function(){if(null!=this&&this!==n(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.sticky&&(e+="y"),e}},function(e,t,r){"use strict";var n=r(257),i=r(81).supportsDescriptors,o=Object.getOwnPropertyDescriptor;e.exports=function(){if(i&&"gim"===/a/gim.flags){var e=o(RegExp.prototype,"flags");if(e&&"function"==typeof e.get&&"boolean"==typeof/a/.dotAll)return e.get}return n}},function(e,t,r){"use strict";var n=String.prototype.valueOf,i=Object.prototype.toString,o=r(72)();e.exports=function(e){return"string"==typeof e||"object"==typeof e&&(o?function(e){try{return n.call(e),!0}catch(e){return!1}}(e):"[object String]"===i.call(e))}},function(e,t,r){"use strict";var n,i="function"==typeof Map&&Map.prototype?Map:null,o="function"==typeof Set&&Set.prototype?Set:null;i||(n=function(e){return!1});var a=i?Map.prototype.has:null,s=o?Set.prototype.has:null;n||a||(n=function(e){return!1}),e.exports=n||function(e){if(!e||"object"!=typeof e)return!1;try{if(a.call(e),s)try{s.call(e)}catch(e){return!0}return e instanceof i}catch(e){}return!1}},function(e,t,r){"use strict";var n,i="function"==typeof Map&&Map.prototype?Map:null,o="function"==typeof Set&&Set.prototype?Set:null;o||(n=function(e){return!1});var a=i?Map.prototype.has:null,s=o?Set.prototype.has:null;n||s||(n=function(e){return!1}),e.exports=n||function(e){if(!e||"object"!=typeof e)return!1;try{if(s.call(e),a)try{a.call(e)}catch(e){return!0}return e instanceof o}catch(e){}return!1}},function(e,t){var r=Object.prototype.hasOwnProperty,n=Object.prototype.toString;e.exports=function(e,t,i){if("[object Function]"!==n.call(t))throw new TypeError("iterator must be a function");var o=e.length;if(o===+o)for(var a=0;a<o;a++)t.call(i,e[a],a,e);else for(var s in e)r.call(e,s)&&t.call(i,e[s],s,e)}},function(e,t,r){"use strict";(function(t){var r=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],n="undefined"==typeof globalThis?t:globalThis;e.exports=function(){for(var e=[],t=0;t<r.length;t++)"function"==typeof n[r[t]]&&(e[e.length]=r[t]);return e}}).call(this,r(23))},function(e,t,r){"use strict";var n=r(80)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(e){n=null}e.exports=n},function(e,t,r){"use strict";var n=r(165),i=function(e){return null!=e},o=r(122)(),a=r(54),s=Object,u=a("Array.prototype.push"),c=a("Object.prototype.propertyIsEnumerable"),l=o?Object.getOwnPropertySymbols:null;e.exports=function(e,t){if(!i(e))throw new TypeError("target must be an object");var r,a,f,d,h,p,g,m=s(e);for(r=1;r<arguments.length;++r){a=s(arguments[r]),d=n(a);var y=o&&(Object.getOwnPropertySymbols||l);if(y)for(h=y(a),f=0;f<h.length;++f)g=h[f],c(a,g)&&u(d,g);for(f=0;f<d.length;++f)p=a[g=d[f]],c(a,g)&&(m[g]=p)}return m}},function(e,t,r){"use strict";var n=r(265);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 i=Object.assign({},r),o="";for(var a in i)o+=a;return e!==o}()||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}},function(e,t,r){(function(e){t.require=function(){if("object"==typeof e&&e.versions&&e.versions.electron)try{const e=r(!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(83)}}).call(this,r(19))},function(e,t){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}},function(e,t,r){(function(t){var n=r(106),i=r(270),o=n.Constants,a=r(477);e.exports=function(e){var r=new i.EntryHeader,s=t.alloc(0),u=t.alloc(0),c=!1,l=null,f=t.alloc(0);function d(){return e&&t.isBuffer(e)?(r.loadDataHeaderFromBinary(e),e.slice(r.realDataOffset,r.realDataOffset+r.compressedSize)):t.alloc(0)}function h(e){return 8==(8&r.flags)||n.crc32(e)===r.dataHeader.crc}function p(e,i,o){if(void 0===i&&"string"==typeof e&&(o=e,e=void 0),c)return e&&i&&i(t.alloc(0),n.Errors.DIRECTORY_CONTENT_ERROR),t.alloc(0);var u=d();if(0===u.length)return e&&i&&i(u),u;if(r.encripted){if("string"!=typeof o&&!t.isBuffer(o))throw new Error("ADM-ZIP: Incompatible password parameter");u=a.ZipCrypto.decrypt(u,r,o)}var l=t.alloc(r.size);switch(r.method){case n.Constants.STORED:if(u.copy(l),h(l))return e&&i&&i(l),l;throw e&&i&&i(l,n.Errors.BAD_CRC),new Error(n.Errors.BAD_CRC);case n.Constants.DEFLATED:var f=new a.Inflater(u);if(!e){if(f.inflate(l).copy(l,0),!h(l))throw new Error(n.Errors.BAD_CRC+" "+s.toString());return l}f.inflateAsync((function(e){e.copy(e,0),i&&(h(e)?i(e):i(e,n.Errors.BAD_CRC))}));break;default:throw e&&i&&i(t.alloc(0),n.Errors.UNKNOWN_METHOD),new Error(n.Errors.UNKNOWN_METHOD)}}function g(i,o){if((!l||!l.length)&&t.isBuffer(e))return i&&o&&o(d()),d();if(l.length&&!c){var s;switch(r.method){case n.Constants.STORED:return r.compressedSize=r.size,s=t.alloc(l.length),l.copy(s),i&&o&&o(s),s;default:case n.Constants.DEFLATED:var u=new a.Deflater(l);if(!i){var f=u.deflate();return r.compressedSize=f.length,f}u.deflateAsync((function(e){s=t.alloc(e.length),r.compressedSize=e.length,e.copy(s),o&&o(s)})),u=null}}else{if(!i||!o)return t.alloc(0);o(t.alloc(0))}}function m(e,t){return(e.readUInt32LE(t+4)<<4)+e.readUInt32LE(t)}function y(e){var t,n,i,a;e.length>=o.EF_ZIP64_SCOMP&&(t=m(e,o.EF_ZIP64_SUNCOMP),r.size===o.EF_ZIP64_OR_32&&(r.size=t)),e.length>=o.EF_ZIP64_RHO&&(n=m(e,o.EF_ZIP64_SCOMP),r.compressedSize===o.EF_ZIP64_OR_32&&(r.compressedSize=n)),e.length>=o.EF_ZIP64_DSN&&(i=m(e,o.EF_ZIP64_RHO),r.offset===o.EF_ZIP64_OR_32&&(r.offset=i)),e.length>=o.EF_ZIP64_DSN+4&&(a=e.readUInt32LE(o.EF_ZIP64_DSN),r.diskNumStart===o.EF_ZIP64_OR_16&&(r.diskNumStart=a))}return{get entryName(){return s.toString()},get rawEntryName(){return s},set entryName(e){var t=(s=n.toBuffer(e))[s.length-1];c=47===t||92===t,r.fileNameLength=s.length},get extra(){return f},set extra(e){f=e,r.extraLength=e.length,function(e){for(var t,r,n,i=0;i<e.length;)t=e.readUInt16LE(i),i+=2,r=e.readUInt16LE(i),i+=2,n=e.slice(i,i+r),i+=r,o.ID_ZIP64===t&&y(n)}(e)},get comment(){return u.toString()},set comment(e){u=n.toBuffer(e),r.commentLength=u.length},get name(){var e=s.toString();return c?e.substr(e.length-1).split("/").pop():e.split("/").pop()},get isDirectory(){return c},getCompressedData:function(){return g(!1,null)},getCompressedDataAsync:function(e){g(!0,e)},setData:function(e){l=n.toBuffer(e),!c&&l.length?(r.size=l.length,r.method=n.Constants.DEFLATED,r.crc=n.crc32(e),r.changed=!0):r.method=n.Constants.STORED},getData:function(e){return r.changed?l:p(!1,null,e)},getDataAsync:function(e,t){r.changed?e(l):p(!0,e,t)},set attr(e){r.attr=e},get attr(){return r.attr},set header(e){r.loadFromBinary(e)},get header(){return r},packHeader:function(){var e=r.entryHeaderToBinary(),t=n.Constants.CENHDR;return s.copy(e,t),t+=s.length,r.extraLength&&(f.copy(e,t),t+=r.extraLength),r.commentLength&&u.copy(e,t),e},toJSON:function(){const t=function(e){return"<"+(e&&e.length+" bytes buffer"||"null")+">"};return{entryName:this.entryName,name:this.name,comment:this.comment,isDirectory:this.isDirectory,header:r.toJSON(),compressedData:t(e),data:t(l)}},toString:function(){return JSON.stringify(this.toJSON(),null,"\t")}}}}).call(this,r(10).Buffer)},function(e,t,r){t.EntryHeader=r(475),t.MainHeader=r(476)},function(e,t,r){const n=r(482),i=r(169);function o(e,t){return i.send(e,t)}e.exports={runImport:async function(e,t){await o("api/start-import",{budgetName:e});try{await t()}catch(e){throw await o("api/abort-import"),e}await o("api/finish-import")},runQuery:function(e){return o("api/query",{query:e.serialize()})},q:n,loadBudget:async function(e){return o("api/load-budget",{id:e})},batchBudgetUpdates:async function(e){await o("api/batch-budget-start");try{await e()}finally{await o("api/batch-budget-end")}},getBudgetMonths:function(){return o("api/budget-months")},getBudgetMonth:function(e){return o("api/budget-month",{month:e})},setBudgetAmount:function(e,t,r){return o("api/budget-set-amount",{month:e,categoryId:t,amount:r})},setBudgetCarryover:function(e,t,r){return o("api/budget-set-carryover",{month:e,categoryId:t,flag:r})},addTransactions:function(e,t){return o("api/transactions-add",{accountId:e,transactions:t})},importTransactions:function(e,t){return o("api/transactions-import",{accountId:e,transactions:t})},filterTransactions:function(e,t){return o("api/transactions-filter",{accountId:e,text:t})},getTransactions:function(e,t,r){return o("api/transactions-get",{accountId:e,startDate:t,endDate:r})},updateTransaction:function(e,t){return o("api/transaction-update",{id:e,fields:t})},deleteTransaction:function(e){return o("api/transaction-delete",{id:e})},getAccounts:function(){return o("api/accounts-get")},createAccount:function(e,t){return o("api/account-create",{account:e,initialBalance:t})},updateAccount:function(e,t){return o("api/account-update",{id:e,fields:t})},closeAccount:function(e,t,r){return o("api/account-close",{id:e,transferAccountId:t,transferCategoryId:r})},reopenAccount:function(e){return o("api/account-reopen",{id:e})},deleteAccount:function(e){return o("api/account-delete",{id:e})},getCategories:function(){return o("api/categories-get",{grouped:!1})},createCategoryGroup:function(e){return o("api/category-group-create",{group:e})},updateCategoryGroup:function(e,t){return o("api/category-group-update",{id:e,fields:t})},deleteCategoryGroup:function(e,t){return o("api/category-group-delete",{id:e,transferCategoryId:t})},createCategory:function(e){return o("api/category-create",{category:e})},updateCategory:function(e,t){return o("api/category-update",{id:e,fields:t})},deleteCategory:function(e,t){return o("api/category-delete",{id:e,transferCategoryId:t})},getPayees:function(){return o("api/payees-get")},createPayee:function(e){return o("api/payee-create",{payee:e})},updatePayee:function(e,t){return o("api/payee-update",{id:e,fields:t})},deletePayee:function(e){return o("api/payee-delete",{id:e})},getPayeeRules:function(e){return o("api/payee-rules-get",{payeeId:e})},createPayeeRule:function(e,t){return o("api/payee-rule-create",{payee_id:e,rule:t})},deletePayeeRule:function(e){return o("api/payee-rule-delete",{id:e})},updatePayeeRule:function(e,t){return o("api/payee-rule-update",{id:e,fields:t})}}},function(e,t,r){(function(e,t,n,i){var o=void 0,a=function(a){return o||(o=new Promise((function(o,s){var u,c=(u=void 0!==a?a:{}).onAbort;u.onAbort=function(e){s(new Error(e)),c&&c(e)},u.postRun=u.postRun||[],u.postRun.push((function(){o(u)})),e=void 0,u||(u=void 0!==u?u:{}),u.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=$(e)+1,this.hb=qe(t),null===this.hb)throw Error("Unable to allocate memory for the SQL string");Y(e,U,this.hb,t),this.sb=this.hb,this.eb=this.Mb=null}function r(e,{filename:t=!1}={}){!1===t?(this.filename="dbfile_"+(4294967295*Math.random()>>>0),this.Xc=!0,null!=e&&je.zb("/",this.filename,e,!0,!0)):this.filename=e,this.handleError(o(this.filename,n)),this.db=j(n,"i32"),ee(this.db),this.nb={},this.Xa={}}var n=Je(4),i=u.cwrap,o=i("sqlite3_open","number",["string","number"]),a=i("sqlite3_close_v2","number",["number"]),s=i("sqlite3_exec","number",["number","string","number","number","number"]),c=i("sqlite3_changes","number",["number"]),l=i("sqlite3_prepare_v2","number",["number","string","number","number","number"]),f=i("sqlite3_sql","string",["number"]),d=i("sqlite3_normalized_sql","string",["number"]),h=i("sqlite3_prepare_v2","number",["number","number","number","number","number"]),p=i("sqlite3_bind_text","number",["number","number","number","number","number"]),g=i("sqlite3_bind_blob","number",["number","number","number","number","number"]),m=i("sqlite3_bind_double","number",["number","number","number"]),y=i("sqlite3_bind_int","number",["number","number","number"]),b=i("sqlite3_bind_parameter_index","number",["number","string"]),_=i("sqlite3_step","number",["number"]),w=i("sqlite3_errmsg","string",["number"]),v=i("sqlite3_column_count","number",["number"]),E=i("sqlite3_data_count","number",["number"]),S=i("sqlite3_column_double","number",["number","number"]),O=i("sqlite3_column_text","string",["number","number"]),T=i("sqlite3_column_blob","number",["number","number"]),A=i("sqlite3_column_bytes","number",["number","number"]),R=i("sqlite3_column_type","number",["number","number"]),N=i("sqlite3_column_name","string",["number","number"]),k=i("sqlite3_reset","number",["number"]),C=i("sqlite3_clear_bindings","number",["number"]),L=i("sqlite3_finalize","number",["number"]),P=i("sqlite3_create_function_v2","number","number string number number number number number number number".split(" ")),F=i("sqlite3_value_type","number",["number"]),W=i("sqlite3_value_bytes","number",["number"]),H=i("sqlite3_value_text","string",["number"]),z=i("sqlite3_value_blob","number",["number"]),q=i("sqlite3_value_double","number",["number"]),V=i("sqlite3_result_double","",["number","number"]),K=i("sqlite3_result_null","",["number"]),Z=i("sqlite3_result_text","",["number","string","number","number"]),X=i("sqlite3_result_blob","",["number","number","number","number"]),J=i("sqlite3_result_int","",["number","number"]),Q=i("sqlite3_result_error","",["number","string","number"]),ee=i("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),O(this.Qa,e)},e.prototype.getBlob=function(e){null==e&&(e=this.Pa,this.Pa+=1);var t=A(this.Qa,e);e=T(this.Qa,e);for(var r=new Uint8Array(t),n=0;n<t;n+=1)r[n]=B[e+n];return r},e.prototype.get=function(e){null!=e&&this.bind(e)&&this.step(),e=[];for(var t=E(this.Qa),r=0;r<t;r+=1)switch(R(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=v(this.Qa),r=0;r<t;r+=1)e.push(N(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(g(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)?y:m)(this.Qa,t,e))},e.prototype.xc=function(e){null==e&&(e=this.Pa,this.Pa+=1),g(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===C(this.Qa)&&0===k(this.Qa)},e.prototype.freemem=function(){for(var e;void 0!==(e=this.wb.pop());)Ve(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=Ze(),r=Je(4);I(n),I(r);try{this.db.handleError(h(this.db.db,this.sb,-1,n,r)),this.sb=j(r,"i32");var i=j(n,"i32");return 0===i?(this.Bb(),{done:!0}):(this.eb=new e(i,this.db),this.db.nb[i]=this.eb,{value:this.eb,done:!1})}catch(e){throw this.Mb=G(this.sb),this.Bb(),e}finally{Xe(t)}},t.prototype.Bb=function(){Ve(this.hb),this.hb=null},t.prototype.getRemainingSQL=function(){return null!==this.Mb?this.Mb:G(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(s(this.db,e,0,0,n));return this},r.prototype.exec=function(t,r){if(!this.db)throw"Database closed";var i=Ze(),o=null;try{var a=$(t)+1,s=Je(a);Y(t,B,s,a);var u=s,c=Je(4);for(t=[];0!==j(u,"i8");){I(n),I(c),this.handleError(h(this.db,u,-1,n,c));var l=j(n,"i32");if(u=j(c,"i32"),0!==l){for(a=null,o=new e(l,this),null!=r&&o.bind(r);o.step();)null===a&&(a={columns:o.getColumnNames(),values:[]},t.push(a)),a.values.push(o.get());o.free()}}return t}catch(e){throw o&&o.free(),e}finally{Xe(i)}},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(I(n),this.handleError(l(this.db,t,-1,n,0)),0===(t=j(n,"i32")))throw"Nothing to prepare";var i=new e(t,this);return null!=r&&i.bind(r),this.nb[t]=i},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(M),this.Xa={},this.handleError(a(this.db));var e=je.readFile(this.filename,{encoding:"binary"});return this.handleError(o(this.filename,n)),this.db=j(n,"i32"),e},r.prototype.close=function(){null!==this.db&&(Object.values(this.nb).forEach((function(e){e.free()})),Object.values(this.Xa).forEach(M),this.Xa={},this.handleError(a(this.db)),this.Xc&&je.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 c(this.db)},r.prototype.create_function=function(e,t){Object.prototype.hasOwnProperty.call(this.Xa,e)&&(M(this.Xa[e]),delete this.Xa[e]);var r=D((function(e,r,n){for(var i,o=[],a=0;a<r;a+=1){var s=j(n+4*a,"i32"),u=F(s);if(1===u||2===u)s=q(s);else if(3===u)s=H(s);else if(4===u){s=W(u=s),u=z(u);for(var c=new Uint8Array(s),l=0;l<s;l+=1)c[l]=B[u+l];s=c}else s=null;o.push(s)}try{i=t.apply(null,o)}catch(t){return void Q(e,t,-1)}switch(typeof i){case"boolean":J(e,i?1:0);break;case"number":V(e,i);break;case"string":Z(e,i,-1,-1);break;case"object":null===i?K(e):null!=i.length?(r=x(i),X(e,r,i.length,-1),Ve(r)):Q(e,"Wrong API use : tried to return a value of an unknown type ("+i+").",-1);break;default:K(e)}}),"viii");return this.Xa[e]=r,this.handleError(P(this.db,e,t.length,1,0,r,0,0,0)),this},u.Database=r;var te=new Map;u.register_for_idb=e=>{let t=D((function(t,r){return t=te.get(t),e.lock(t,r)?0:5}),"iii"),r=D((function(t,r){return t=te.get(t),e.unlock(t,r),0}),"iii"),n=D((function(e,t){e=G(e),te.set(t,e)}),"vii");u._register_for_idb(t,r,n)},u.cleanup_file=e=>{let t=[...te.entries()].find(t=>t[1]===e);te.delete(t[0])},u.reset_filesystem=()=>{je.root=null,je.lc()}};var l,f={};for(l in u)u.hasOwnProperty(l)&&(f[l]=u[l]);var d,h,p,g,m,y="./this.program",b="object"==typeof window,_="function"==typeof importScripts,w="object"==typeof t&&"object"==typeof t.versions&&"string"==typeof t.versions.node,v="";w?(v=_?r(48).dirname(v)+"/":n+"/",d=function(e,t){return g||(g=r(83)),m||(m=r(48)),e=m.normalize(e),g.readFileSync(e,t?null:"utf8")},p=function(e){return(e=d(e,!0)).buffer||(e=new Uint8Array(e)),k(e.buffer),e},h=function(e,t,n){g||(g=r(83)),m||(m=r(48)),e=m.normalize(e),g.readFile(e,(function(e,r){e?n(e):t(r.buffer)}))},1<t.argv.length&&(y=t.argv[1].replace(/\\/g,"/")),t.argv.slice(2),e.exports=u,u.inspect=function(){return"[Emscripten Module object]"}):(b||_)&&(_?v=self.location.href:"undefined"!=typeof document&&document.currentScript&&(v=document.currentScript.src),v=0!==v.indexOf("blob:")?v.substr(0,v.lastIndexOf("/")+1):"",d=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},_&&(p=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),h=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=u.print||console.log.bind(console),S=u.printErr||console.warn.bind(console);for(l in f)f.hasOwnProperty(l)&&(u[l]=f[l]);f=null,u.thisProgram&&(y=u.thisProgram);var O,T,A=[];function M(e){O.delete(X.get(e)),A.push(e)}function D(e,t){if(!O){O=new WeakMap;for(var r=0;r<X.length;r++){var n=X.get(r);n&&O.set(n,r)}}if(O.has(e))e=O.get(e);else{if(A.length)r=A.pop();else{try{X.grow(1)}catch(e){if(!(e instanceof RangeError))throw e;throw"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH."}r=X.length-1}try{X.set(r,e)}catch(s){if(!(s instanceof TypeError))throw s;if("function"==typeof WebAssembly.Function){var i={i:"i32",j:"i64",f:"f32",d:"f64"},o={parameters:[],results:"v"==t[0]?[]:[i[t[0]]]};for(n=1;n<t.length;++n)o.parameters.push(i[t[n]]);t=new WebAssembly.Function(o,e)}else{i=[1,0,1,96],o=t.slice(0,1),t=t.slice(1);var a={i:127,j:126,f:125,d:124};for(i.push(t.length),n=0;n<t.length;++n)i.push(a[t[n]]);"v"==o?i.push(0):i=i.concat([1,a[o]]),i[1]=i.length-2,t=new Uint8Array([0,97,115,109,1,0,0,0].concat(i,[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}X.set(r,t)}O.set(e,r),e=r}return e}u.wasmBinary&&(T=u.wasmBinary);u.noExitRuntime;function I(e){var t="i32";switch("*"===t.charAt(t.length-1)&&(t="i32"),t){case"i1":case"i8":B[e>>0]=0;break;case"i16":F[e>>1]=0;break;case"i32":W[e>>2]=0;break;case"i64":ie=[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]=ie[0],W[e+4>>2]=ie[1];break;case"float":H[e>>2]=0;break;case"double":z[e>>3]=0;break;default:fe("invalid type for setValue: "+t)}}function j(e,t){switch("*"===(t=t||"i8").charAt(t.length-1)&&(t="i32"),t){case"i1":case"i8":return B[e>>0];case"i16":return F[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}"object"!=typeof WebAssembly&&fe("no native wasm support detected");var R,N=!1;function k(e,t){e||fe("Assertion failed: "+t)}function C(e){var t=u["_"+e];return k(t,"Cannot call unknown function "+e+", make sure it is exported"),t}function L(e,t,r,n){var i,o={string:function(e){var t=0;if(null!=e&&0!==e){var r=1+(e.length<<2);t=Je(r),Y(e,U,t,r)}return t},array:function(e){var t=Je(e.length);return B.set(e,t),t}},a=C(e),s=[];if(e=0,n)for(var u=0;u<n.length;u++){var c=o[r[u]];c?(0===e&&(e=Ze()),s[u]=c(n[u])):s[u]=n[u]}return r=a.apply(null,s),i=r,r="string"===t?G(i):"boolean"===t?!!i:i,0!==e&&Xe(e),r}function x(e){var t=qe(e.length);return e.subarray||e.slice?U.set(e,t):U.set(new Uint8Array(e),t),t}var P,B,U,F,W,H,z,q="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function V(e,t,r){var n=t+r;for(r=t;e[r]&&!(r>=n);)++r;if(16<r-t&&e.subarray&&q)return q.decode(e.subarray(t,r));for(n="";t<r;){var i=e[t++];if(128&i){var o=63&e[t++];if(192==(224&i))n+=String.fromCharCode((31&i)<<6|o);else{var a=63&e[t++];65536>(i=224==(240&i)?(15&i)<<12|o<<6|a:(7&i)<<18|o<<12|a<<6|63&e[t++])?n+=String.fromCharCode(i):(i-=65536,n+=String.fromCharCode(55296|i>>10,56320|1023&i))}}else n+=String.fromCharCode(i)}return n}function G(e,t){return e?V(U,e,t):""}function Y(e,t,r,n){if(!(0<n))return 0;var i=r;n=r+n-1;for(var o=0;o<e.length;++o){var a=e.charCodeAt(o);if(55296<=a&&57343>=a)a=65536+((1023&a)<<10)|1023&e.charCodeAt(++o);if(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-i}function $(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 K(e){var t=$(e)+1,r=qe(t);return r&&Y(e,B,r,t),r}function Z(){var e=R.buffer;P=e,u.HEAP8=B=new Int8Array(e),u.HEAP16=F=new Int16Array(e),u.HEAP32=W=new Int32Array(e),u.HEAPU8=U=new Uint8Array(e),u.HEAPU16=new Uint16Array(e),u.HEAPU32=new Uint32Array(e),u.HEAPF32=H=new Float32Array(e),u.HEAPF64=z=new Float64Array(e)}var X,J=[],Q=[],ee=[];function te(){var e=u.preRun.shift();J.unshift(e)}var re,ne,ie,oe,ae=0,se=null,ue=null;function ce(){ae++,u.monitorRunDependencies&&u.monitorRunDependencies(ae)}function le(){if(ae--,u.monitorRunDependencies&&u.monitorRunDependencies(ae),0==ae&&(null!==se&&(clearInterval(se),se=null),ue)){var e=ue;ue=null,e()}}function fe(e){throw u.onAbort&&u.onAbort(e),S(e),N=!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(u.preloadedImages={},u.preloadedAudios={},re="sql-wasm.wasm",!de()){var he=re;re=u.locateFile?u.locateFile(he,v):v+he}function pe(){var e=re;try{if(e==re&&T)return new Uint8Array(T);if(p)return p(e);throw"both async and sync fetching of the wasm failed"}catch(e){fe(e)}}function ge(e){for(;0<e.length;){var t=e.shift();if("function"==typeof t)t(u);else{var r=t.pd;"number"==typeof r?void 0===t.yb?X.get(r)():X.get(r)(t.yb):r(void 0===t.yb?null:t.yb)}}}function me(e,t){for(var r=0,n=e.length-1;0<=n;n--){var i=e[n];"."===i?e.splice(n,1):".."===i?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r;r--)e.unshift("..");return e}function ye(e){var t="/"===e.charAt(0),r="/"===e.substr(-1);return(e=me(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=ye(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)}function we(e,t){return ye(e+"/"+t)}function ve(){for(var e="",t=!1,r=arguments.length-1;-1<=r&&!t;r--){if("string"!=typeof(t=0<=r?arguments[r]:je.cwd()))throw new TypeError("Arguments to path.resolve must be strings");if(!t)return"";e=t+"/"+e,t="/"===t.charAt(0)}return(t?"/":"")+(e=me(e.split("/").filter((function(e){return!!e})),!t).join("/"))||"."}function Ee(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=ve(e).substr(1),t=ve(t).substr(1),e=r(e.split("/")),t=r(t.split("/"));for(var n=Math.min(e.length,t.length),i=n,o=0;o<n;o++)if(e[o]!==t[o]){i=o;break}for(n=[],o=i;o<e.length;o++)n.push("..");return(n=n.concat(t.slice(i))).join("/")}var Se=[];function Oe(e,t){Se[e]={input:[],output:[],gb:t},je.Qb(e,Te)}var Te={open:function(e){var t=Se[e.node.rdev];if(!t)throw new je.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 je.ErrnoError(60);for(var i=0,o=0;o<n;o++){try{var a=e.tty.gb.cc(e.tty)}catch(e){throw new je.ErrnoError(29)}if(void 0===a&&0===i)throw new je.ErrnoError(6);if(null==a)break;i++,t[r+o]=a}return i&&(e.node.timestamp=Date.now()),i},write:function(e,t,r,n){if(!e.tty||!e.tty.gb.Nb)throw new je.ErrnoError(60);try{for(var i=0;i<n;i++)e.tty.gb.Nb(e.tty,t[r+i])}catch(e){throw new je.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),i}},Ae={cc:function(e){if(!e.input.length){var r=null;if(w){var n=i.alloc(256),o=0;try{o=g.readSync(t.stdin.fd,n,0,256,null)}catch(e){if(!e.toString().includes("EOF"))throw e;o=0}r=0<o?n.slice(0,o).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(r=window.prompt("Input: "))&&(r+="\n"):"function"==typeof readline&&(null!==(r=readline())&&(r+="\n"));if(!r)return null;e.input=We(r,!0)}return e.input.shift()},Nb:function(e,t){null===t||10===t?(E(V(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&0<e.output.length&&(E(V(e.output,0)),e.output=[])}},Me={Nb:function(e,t){null===t||10===t?(S(V(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&0<e.output.length&&(S(V(e.output,0)),e.output=[])}};function De(e){e=65536*Math.ceil(e/65536);var t=Qe(65536,e);return t?(U.fill(0,t,t+e),t):0}var Ie={Va:null,mount:function(){return Ie.createNode(null,"/",16895,0)},createNode:function(e,t,r,n){if(je.Rc(r)||je.isFIFO(r))throw new je.ErrnoError(63);return Ie.Va||(Ie.Va={dir:{node:{getattr:Ie.node_ops.getattr,setattr:Ie.node_ops.setattr,lookup:Ie.node_ops.lookup,mknod:Ie.node_ops.mknod,rename:Ie.node_ops.rename,unlink:Ie.node_ops.unlink,rmdir:Ie.node_ops.rmdir,readdir:Ie.node_ops.readdir,symlink:Ie.node_ops.symlink},stream:{llseek:Ie.stream_ops.llseek}},file:{node:{getattr:Ie.node_ops.getattr,setattr:Ie.node_ops.setattr},stream:{llseek:Ie.stream_ops.llseek,read:Ie.stream_ops.read,write:Ie.stream_ops.write,allocate:Ie.stream_ops.allocate,mmap:Ie.stream_ops.mmap,msync:Ie.stream_ops.msync}},link:{node:{getattr:Ie.node_ops.getattr,setattr:Ie.node_ops.setattr,readlink:Ie.node_ops.readlink},stream:{}},Vb:{node:{getattr:Ie.node_ops.getattr,setattr:Ie.node_ops.setattr},stream:je.Cc}}),r=je.createNode(e,t,r,n),je.isDir(r.mode)?(r.node_ops=Ie.Va.dir.node,r.stream_ops=Ie.Va.dir.stream,r.Na={}):je.isFile(r.mode)?(r.node_ops=Ie.Va.file.node,r.stream_ops=Ie.Va.file.stream,r.Ra=0,r.Na=null):je.fb(r.mode)?(r.node_ops=Ie.Va.link.node,r.stream_ops=Ie.Va.link.stream):je.pb(r.mode)&&(r.node_ops=Ie.Va.Vb.node,r.stream_ops=Ie.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=je.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,je.isDir(e.mode)?t.size=4096:je.isFile(e.mode)?t.size=e.Ra:je.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&&Ie.gd(e,t.size)},lookup:function(){throw je.Db[44]},mknod:function(e,t,r,n){return Ie.createNode(e,t,r,n)},rename:function(e,t,r){if(je.isDir(e.mode)){try{var n=je.lookupNode(t,r)}catch(e){}if(n)for(var i in n.Na)throw new je.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=je.lookupNode(e,t);for(r in n.Na)throw new je.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=Ie.createNode(e,t,41471,0)).link=r,e},readlink:function(e){if(!je.fb(e.mode))throw new je.ErrnoError(28);return e.link}},stream_ops:{read:function(e,t,r,n,i){var o=e.node.Na;if(i>=e.node.Ra)return 0;if(8<(e=Math.min(e.node.Ra-i,n))&&o.subarray)t.set(o.subarray(i,i+e),r);else for(n=0;n<e;n++)t[r+n]=o[i+n];return e},write:function(e,t,r,n,i,o){if(t.buffer===B.buffer&&(o=!1),!n)return 0;if((e=e.node).timestamp=Date.now(),t.subarray&&(!e.Na||e.Na.subarray)){if(o)return e.Na=t.subarray(r,r+n),e.Ra=n;if(0===e.Ra&&0===i)return e.Na=t.slice(r,r+n),e.Ra=n;if(i+n<=e.Ra)return e.Na.set(t.subarray(r,r+n),i),n}if(Ie.Zb(e,i+n),e.Na.subarray&&t.subarray)e.Na.set(t.subarray(r,r+n),i);else for(o=0;o<n;o++)e.Na[i+o]=t[r+o];return e.Ra=Math.max(e.Ra,i+n),n},llseek:function(e,t,r){if(1===r?t+=e.position:2===r&&je.isFile(e.node.mode)&&(t+=e.node.Ra),0>t)throw new je.ErrnoError(28);return t},allocate:function(e,t,r){Ie.Zb(e.node,t+r),e.node.Ra=Math.max(e.node.Ra,t+r)},mmap:function(e,t,r,n,i,o){if(0!==t)throw new je.ErrnoError(28);if(!je.isFile(e.node.mode))throw new je.ErrnoError(43);if(e=e.node.Na,2&o||e.buffer!==P){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=De(r)))throw new je.ErrnoError(48);B.set(e,r)}else n=!1,r=e.byteOffset;return{ed:r,vb:n}},msync:function(e,t,r,n,i){if(!je.isFile(e.node.mode))throw new je.ErrnoError(43);return 2&i||Ie.stream_ops.write(e,t,0,n,r,!1),0}}};var je={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=ve(je.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 je.ErrnoError(32);e=me(e.split("/").filter((function(e){return!!e})),!1);var i=je.root;for(n="/",r=0;r<e.length;r++){var o=r===e.length-1;if(o&&t.parent)break;if(i=je.lookupNode(i,e[r]),n=we(n,e[r]),je.ab(i)&&(!o||o&&t.Cb)&&(i=i.lb.root),!o||t.Ta)for(o=0;je.fb(i.mode);)if(i=je.readlink(n),n=ve(be(n),i),i=je.lookupPath(n,{Pb:t.Pb}).node,40<o++)throw new je.ErrnoError(32)}return{path:n,node:i}},Ya:function(e){for(var t;;){if(je.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)%je.Ua.length},ec:function(e){var t=je.Gb(e.parent.id,e.name);e.cb=je.Ua[t],je.Ua[t]=e},fc:function(e){var t=je.Gb(e.parent.id,e.name);if(je.Ua[t]===e)je.Ua[t]=e.cb;else for(t=je.Ua[t];t;){if(t.cb===e){t.cb=e.cb;break}t=t.cb}},lookupNode:function(e,t){var r=je.Vc(e);if(r)throw new je.ErrnoError(r,e);for(r=je.Ua[je.Gb(e.id,t)];r;r=r.cb){var n=r.name;if(r.parent.id===e.id&&n===t)return r}return je.lookup(e,t)},createNode:function(e,t,r,n){return e=new je.FSNode(e,t,r,n),je.ec(e),e},Ab:function(e){je.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=je.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 je.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){var t=je.Za(e,"x");return t||(e.node_ops.lookup?0:2)},Lb:function(e,t){try{return je.lookupNode(e,t),20}catch(e){}return je.Za(e,"wx")},qb:function(e,t,r){try{var n=je.lookupNode(e,t)}catch(e){return e.Oa}if(e=je.Za(e,"wx"))return e;if(r){if(!je.isDir(n.mode))return 54;if(je.isRoot(n)||je.Ya(n)===je.cwd())return 10}else if(je.isDir(n.mode))return 31;return 0},Wc:function(e,t){return e?je.fb(e.mode)?32:je.isDir(e.mode)&&("r"!==je.$b(t)||512&t)?31:je.Za(e,je.$b(t)):44},oc:4096,$c:function(e,t){for(t=t||je.oc,e=e||0;e<=t;e++)if(!je.streams[e])return e;throw new je.ErrnoError(33)},$a:function(e){return je.streams[e]},Jc:function(e,t,r){je.ub||(je.ub=function(){},je.ub.prototype={object:{get:function(){return this.node},set:function(e){this.node=e}}});var n,i=new je.ub;for(n in e)i[n]=e[n];return e=i,t=je.$c(t,r),e.fd=t,je.streams[t]=e},Dc:function(e){je.streams[e]=null},Cc:{open:function(e){e.stream_ops=je.Oc(e.node.rdev).stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:function(){throw new je.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){je.Xb[e]={stream_ops:t}},Oc:function(e){return je.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 je.tb--,t(e)}function n(e){if(e){if(!n.Kc)return n.Kc=!0,r(e)}else++o>=i.length&&r(null)}"function"==typeof e&&(t=e,e=!1),je.tb++,1<je.tb&&S("warning: "+je.tb+" FS.syncfs operations in flight at once, probably just doing extra work");var i=je.bc(je.root.mount),o=0;i.forEach((function(t){if(!t.type.mc)return n(null);t.type.mc(t,e,n)}))},mount:function(e,t,r){var n="/"===r,i=!r;if(n&&je.root)throw new je.ErrnoError(10);if(!n&&!i){var o=je.lookupPath(r,{Cb:!1});if(r=o.path,o=o.node,je.ab(o))throw new je.ErrnoError(10);if(!je.isDir(o.mode))throw new je.ErrnoError(54)}return t={type:e,vd:t,jc:r,mb:[]},(e=e.mount(t)).mount=t,t.root=e,n?je.root=e:o&&(o.lb=t,o.mount&&o.mount.mb.push(t)),e},yd:function(e){if(e=je.lookupPath(e,{Cb:!1}),!je.ab(e.node))throw new je.ErrnoError(28);var t=(e=e.node).lb,r=je.bc(t);Object.keys(je.Ua).forEach((function(e){for(e=je.Ua[e];e;){var t=e.cb;r.includes(e.mount)&&je.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=je.lookupPath(e,{parent:!0}).node;if(!(e=_e(e))||"."===e||".."===e)throw new je.ErrnoError(28);var i=je.Lb(n,e);if(i)throw new je.ErrnoError(i);if(!n.node_ops.mknod)throw new je.ErrnoError(63);return n.node_ops.mknod(n,e,t,r)},create:function(e,t){return je.mknod(e,4095&(void 0!==t?t:438)|32768,0)},mkdir:function(e,t){return je.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{je.mkdir(r,t)}catch(e){if(20!=e.Oa)throw e}}},rb:function(e,t,r){return void 0===r&&(r=t,t=438),je.mknod(e,8192|t,r)},symlink:function(e,t){if(!ve(e))throw new je.ErrnoError(44);var r=je.lookupPath(t,{parent:!0}).node;if(!r)throw new je.ErrnoError(44);t=_e(t);var n=je.Lb(r,t);if(n)throw new je.ErrnoError(n);if(!r.node_ops.symlink)throw new je.ErrnoError(63);return r.node_ops.symlink(r,t,e)},rename:function(e,t){var r=be(e),n=be(t),i=_e(e),o=_e(t),a=je.lookupPath(e,{parent:!0}),s=a.node;if(a=(a=je.lookupPath(t,{parent:!0})).node,!s||!a)throw new je.ErrnoError(44);if(s.mount!==a.mount)throw new je.ErrnoError(75);var u=je.lookupNode(s,i);if("."!==(n=Ee(e,n)).charAt(0))throw new je.ErrnoError(28);if("."!==(n=Ee(t,r)).charAt(0))throw new je.ErrnoError(55);try{var c=je.lookupNode(a,o)}catch(e){}if(u!==c){if(r=je.isDir(u.mode),i=je.qb(s,i,r))throw new je.ErrnoError(i);if(i=c?je.qb(a,o,r):je.Lb(a,o))throw new je.ErrnoError(i);if(!s.node_ops.rename)throw new je.ErrnoError(63);if(je.ab(u)||c&&je.ab(c))throw new je.ErrnoError(10);if(a!==s&&(i=je.Za(s,"w")))throw new je.ErrnoError(i);try{je.Sa.willMovePath&&je.Sa.willMovePath(e,t)}catch(r){S("FS.trackingDelegate['willMovePath']('"+e+"', '"+t+"') threw an exception: "+r.message)}je.fc(u);try{s.node_ops.rename(u,a,o)}catch(e){throw e}finally{je.ec(u)}try{je.Sa.onMovePath&&je.Sa.onMovePath(e,t)}catch(r){S("FS.trackingDelegate['onMovePath']('"+e+"', '"+t+"') threw an exception: "+r.message)}}},rmdir:function(e){var t=je.lookupPath(e,{parent:!0}).node,r=_e(e),n=je.lookupNode(t,r),i=je.qb(t,r,!0);if(i)throw new je.ErrnoError(i);if(!t.node_ops.rmdir)throw new je.ErrnoError(63);if(je.ab(n))throw new je.ErrnoError(10);try{je.Sa.willDeletePath&&je.Sa.willDeletePath(e)}catch(t){S("FS.trackingDelegate['willDeletePath']('"+e+"') threw an exception: "+t.message)}t.node_ops.rmdir(t,r),je.Ab(n);try{je.Sa.onDeletePath&&je.Sa.onDeletePath(e)}catch(t){S("FS.trackingDelegate['onDeletePath']('"+e+"') threw an exception: "+t.message)}},readdir:function(e){if(!(e=je.lookupPath(e,{Ta:!0}).node).node_ops.readdir)throw new je.ErrnoError(54);return e.node_ops.readdir(e)},unlink:function(e){var t=je.lookupPath(e,{parent:!0}).node,r=_e(e),n=je.lookupNode(t,r),i=je.qb(t,r,!1);if(i)throw new je.ErrnoError(i);if(!t.node_ops.unlink)throw new je.ErrnoError(63);if(je.ab(n))throw new je.ErrnoError(10);try{je.Sa.willDeletePath&&je.Sa.willDeletePath(e)}catch(t){S("FS.trackingDelegate['willDeletePath']('"+e+"') threw an exception: "+t.message)}t.node_ops.unlink(t,r),je.Ab(n);try{je.Sa.onDeletePath&&je.Sa.onDeletePath(e)}catch(t){S("FS.trackingDelegate['onDeletePath']('"+e+"') threw an exception: "+t.message)}},readlink:function(e){if(!(e=je.lookupPath(e).node))throw new je.ErrnoError(44);if(!e.node_ops.readlink)throw new je.ErrnoError(28);return ve(je.Ya(e.parent),e.node_ops.readlink(e))},stat:function(e,t){if(!(e=je.lookupPath(e,{Ta:!t}).node))throw new je.ErrnoError(44);if(!e.node_ops.getattr)throw new je.ErrnoError(63);return e.node_ops.getattr(e)},lstat:function(e){return je.stat(e,!0)},chmod:function(e,t,r){if(!(e="string"==typeof e?je.lookupPath(e,{Ta:!r}).node:e).node_ops.setattr)throw new je.ErrnoError(63);e.node_ops.setattr(e,{mode:4095&t|-4096&e.mode,timestamp:Date.now()})},lchmod:function(e,t){je.chmod(e,t,!0)},fchmod:function(e,t){if(!(e=je.$a(e)))throw new je.ErrnoError(8);je.chmod(e.node,t)},chown:function(e,t,r,n){if(!(e="string"==typeof e?je.lookupPath(e,{Ta:!n}).node:e).node_ops.setattr)throw new je.ErrnoError(63);e.node_ops.setattr(e,{timestamp:Date.now()})},lchown:function(e,t,r){je.chown(e,t,r,!0)},fchown:function(e,t,r){if(!(e=je.$a(e)))throw new je.ErrnoError(8);je.chown(e.node,t,r)},truncate:function(e,t){if(0>t)throw new je.ErrnoError(28);if(!(e="string"==typeof e?je.lookupPath(e,{Ta:!0}).node:e).node_ops.setattr)throw new je.ErrnoError(63);if(je.isDir(e.mode))throw new je.ErrnoError(31);if(!je.isFile(e.mode))throw new je.ErrnoError(28);var r=je.Za(e,"w");if(r)throw new je.ErrnoError(r);e.node_ops.setattr(e,{size:t,timestamp:Date.now()})},Nc:function(e,t){if(!(e=je.$a(e)))throw new je.ErrnoError(8);if(0==(2097155&e.flags))throw new je.ErrnoError(28);je.truncate(e.node,t)},kd:function(e,t,r){(e=je.lookupPath(e,{Ta:!0}).node).node_ops.setattr(e,{timestamp:Math.max(t,r)})},open:function(e,t,r,n,i){if(""===e)throw new je.ErrnoError(44);if(r=64&(t="string"==typeof t?je.Yc(t):t)?4095&(void 0===r?438:r)|32768:0,"object"==typeof e)var o=e;else{e=ye(e);try{o=je.lookupPath(e,{Ta:!(131072&t)}).node}catch(e){}}var a=!1;if(64&t)if(o){if(128&t)throw new je.ErrnoError(20)}else o=je.mknod(e,r,0),a=!0;if(!o)throw new je.ErrnoError(44);if(je.pb(o.mode)&&(t&=-513),65536&t&&!je.isDir(o.mode))throw new je.ErrnoError(54);if(!a&&(r=je.Wc(o,t)))throw new je.ErrnoError(r);512&t&&je.truncate(o,0),t&=-131713,(n=je.Jc({node:o,path:je.Ya(o),flags:t,seekable:!0,position:0,stream_ops:o.stream_ops,jd:[],error:!1},n,i)).stream_ops.open&&n.stream_ops.open(n),!u.logReadFiles||1&t||(je.Ob||(je.Ob={}),e in je.Ob||(je.Ob[e]=1,S("FS.trackingDelegate error on read file: "+e)));try{je.Sa.onOpenFile&&(i=0,1!=(2097155&t)&&(i|=je.nc.kc.qc),0!=(2097155&t)&&(i|=je.nc.kc.rc),je.Sa.onOpenFile(e,i))}catch(t){S("FS.trackingDelegate['onOpenFile']('"+e+"', flags) threw an exception: "+t.message)}return n},close:function(e){if(je.kb(e))throw new je.ErrnoError(8);e.Fb&&(e.Fb=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{je.Dc(e.fd)}e.fd=null},kb:function(e){return null===e.fd},llseek:function(e,t,r){if(je.kb(e))throw new je.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new je.ErrnoError(70);if(0!=r&&1!=r&&2!=r)throw new je.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,r),e.jd=[],e.position},read:function(e,t,r,n,i){if(0>n||0>i)throw new je.ErrnoError(28);if(je.kb(e))throw new je.ErrnoError(8);if(1==(2097155&e.flags))throw new je.ErrnoError(8);if(je.isDir(e.node.mode))throw new je.ErrnoError(31);if(!e.stream_ops.read)throw new je.ErrnoError(28);var o=void 0!==i;if(o){if(!e.seekable)throw new je.ErrnoError(70)}else i=e.position;return t=e.stream_ops.read(e,t,r,n,i),o||(e.position+=t),t},write:function(e,t,r,n,i,o){if(0>n||0>i)throw new je.ErrnoError(28);if(je.kb(e))throw new je.ErrnoError(8);if(0==(2097155&e.flags))throw new je.ErrnoError(8);if(je.isDir(e.node.mode))throw new je.ErrnoError(31);if(!e.stream_ops.write)throw new je.ErrnoError(28);e.seekable&&1024&e.flags&&je.llseek(e,0,2);var a=void 0!==i;if(a){if(!e.seekable)throw new je.ErrnoError(70)}else i=e.position;t=e.stream_ops.write(e,t,r,n,i,o),a||(e.position+=t);try{e.path&&je.Sa.onWriteToFile&&je.Sa.onWriteToFile(e.path)}catch(t){S("FS.trackingDelegate['onWriteToFile']('"+e.path+"') threw an exception: "+t.message)}return t},allocate:function(e,t,r){if(je.kb(e))throw new je.ErrnoError(8);if(0>t||0>=r)throw new je.ErrnoError(28);if(0==(2097155&e.flags))throw new je.ErrnoError(8);if(!je.isFile(e.node.mode)&&!je.isDir(e.node.mode))throw new je.ErrnoError(43);if(!e.stream_ops.allocate)throw new je.ErrnoError(138);e.stream_ops.allocate(e,t,r)},mmap:function(e,t,r,n,i,o){if(0!=(2&i)&&0==(2&o)&&2!=(2097155&e.flags))throw new je.ErrnoError(2);if(1==(2097155&e.flags))throw new je.ErrnoError(2);if(!e.stream_ops.mmap)throw new je.ErrnoError(43);return e.stream_ops.mmap(e,t,r,n,i,o)},msync:function(e,t,r,n,i){return e&&e.stream_ops.msync?e.stream_ops.msync(e,t,r,n,i):0},ud:function(){return 0},ic:function(e,t,r){if(!e.stream_ops.ic)throw new je.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=je.open(e,t.flags);e=je.stat(e).size;var i=new Uint8Array(e);return je.read(n,i,0,e,0),"utf8"===t.encoding?r=V(i,0):"binary"===t.encoding&&(r=i),je.close(n),r},writeFile:function(e,t,r){if((r=r||{}).flags=r.flags||577,e=je.open(e,r.flags,r.mode),"string"==typeof t){var n=new Uint8Array($(t)+1);t=Y(t,n,0,n.length),je.write(e,n,0,t,void 0,r.Bc)}else{if(!ArrayBuffer.isView(t))throw Error("Unsupported data type");je.write(e,t,0,t.byteLength,void 0,r.Bc)}je.close(e)},cwd:function(){return je.Wb},chdir:function(e){if(null===(e=je.lookupPath(e,{Ta:!0})).node)throw new je.ErrnoError(44);if(!je.isDir(e.node.mode))throw new je.ErrnoError(54);var t=je.Za(e.node,"x");if(t)throw new je.ErrnoError(t);je.Wb=e.path},Fc:function(){je.mkdir("/tmp"),je.mkdir("/home"),je.mkdir("/home/web_user")},Ec:function(){je.mkdir("/dev"),je.Qb(je.bb(1,3),{read:function(){return 0},write:function(e,t,r,n){return n}}),je.rb("/dev/null",je.bb(1,3)),Oe(je.bb(5,0),Ae),Oe(je.bb(6,0),Me),je.rb("/dev/tty",je.bb(5,0)),je.rb("/dev/tty1",je.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(w)try{var t=r(190);return function(){return t.randomBytes(1)[0]}}catch(e){}return function(){fe("randomDevice")}}();je.Wa("/dev","random",e),je.Wa("/dev","urandom",e),je.mkdir("/dev/shm"),je.mkdir("/dev/shm/tmp")},Hc:function(){je.mkdir("/proc");var e=je.mkdir("/proc/self");je.mkdir("/proc/self/fd"),je.mount({mount:function(){var t=je.createNode(e,"fd",16895,73);return t.node_ops={lookup:function(e,t){var r=je.$a(+t);if(!r)throw new je.ErrnoError(8);return(e={parent:null,mount:{jc:"fake"},node_ops:{readlink:function(){return r.path}}}).parent=e}},t}},{},"/proc/self/fd")},Ic:function(){u.stdin?je.Wa("/dev","stdin",u.stdin):je.symlink("/dev/tty","/dev/stdin"),u.stdout?je.Wa("/dev","stdout",null,u.stdout):je.symlink("/dev/tty","/dev/stdout"),u.stderr?je.Wa("/dev","stderr",null,u.stderr):je.symlink("/dev/tty1","/dev/stderr"),je.open("/dev/stdin",0),je.open("/dev/stdout",1),je.open("/dev/stderr",1)},Yb:function(){je.ErrnoError||(je.ErrnoError=function(e,t){this.node=t,this.hd=function(e){this.Oa=e},this.hd(e),this.message="FS error"},je.ErrnoError.prototype=Error(),je.ErrnoError.prototype.constructor=je.ErrnoError,[44].forEach((function(e){je.Db[e]=new je.ErrnoError(e),je.Db[e].stack="<generic error, no stack>"})))},lc:function(){je.Yb(),je.Ua=Array(4096),je.mount(Ie,{},"/"),je.Fc(),je.Ec(),je.Hc(),je.Lc={MEMFS:Ie}},jb:function(e,t,r){je.jb.Hb=!0,je.Yb(),u.stdin=e||u.stdin,u.stdout=t||u.stdout,u.stderr=r||u.stderr,je.Ic()},wd:function(){je.jb.Hb=!1;var e=u._fflush;for(e&&e(0),e=0;e<je.streams.length;e++){var t=je.streams[e];t&&je.close(t)}},Eb:function(e,t){var r=0;return e&&(r|=365),t&&(r|=146),r},od:function(e,t){return(e=je.xb(e,t)).exists?e.object:null},xb:function(e,t){try{var r=je.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=je.lookupPath(e,{parent:!0}),n.ad=!0,n.cd=r.path,n.bd=r.node,n.name=_e(e),r=je.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:je.Ya(e),t=t.split("/").reverse();t.length;){var r=t.pop();if(r){var n=we(e,r);try{je.mkdir(n)}catch(e){}e=n}}return n},Gc:function(e,t,r,n,i){return e=we("string"==typeof e?e:je.Ya(e),t),je.create(e,je.Eb(n,i))},zb:function(e,t,r,n,i,o){if(e=t?we("string"==typeof e?e:je.Ya(e),t):e,n=je.Eb(n,i),i=je.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}je.chmod(i,146|n),e=je.open(i,577),je.write(e,r,0,r.length,0,o),je.close(e),je.chmod(i,n)}return i},Wa:function(e,t,r,n){e=we("string"==typeof e?e:je.Ya(e),t),t=je.Eb(!!r,!!n),je.Wa.Kb||(je.Wa.Kb=64);var i=je.bb(je.Wa.Kb++,0);return je.Qb(i,{open:function(e){e.seekable=!1},close:function(){n&&n.buffer&&n.buffer.length&&n(10)},read:function(e,t,n,i){for(var o=0,a=0;a<i;a++){try{var s=r()}catch(e){throw new je.ErrnoError(29)}if(void 0===s&&0===o)throw new je.ErrnoError(6);if(null==s)break;o++,t[n+a]=s}return o&&(e.node.timestamp=Date.now()),o},write:function(e,t,r,i){for(var o=0;o<i;o++)try{n(t[r+o])}catch(e){throw new je.ErrnoError(29)}return i&&(e.node.timestamp=Date.now()),o}}),je.rb(e,t,i)},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(!d)throw Error("Cannot load without read() or XMLHttpRequest.");try{e.Na=We(d(e.url),!0),e.Ra=e.Na.length}catch(e){throw new je.ErrnoError(29)}},ld:function(e,t,r,n,i){function o(){this.Jb=!1,this.ob=[]}if(o.prototype.get=function(e){if(!(e>this.length-1||0>e)){var t=e%this.chunkSize;return this.dc(e/this.chunkSize|0)[t]}},o.prototype.pc=function(e){this.dc=e},o.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")),i=(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t;e=(t=e.getResponseHeader("Content-Encoding"))&&"gzip"===t;var o=1048576;i||(o=n);var a=this;a.pc((function(e){var t=e*o,i=(e+1)*o-1;if(i=Math.min(i,n-1),void 0===a.ob[e]){var s=a.ob;if(t>i)throw Error("invalid range ("+t+", "+i+") or no bytes requested!");if(i>n-1)throw Error("only "+n+" bytes available! programmer error!");var u=new XMLHttpRequest;if(u.open("GET",r,!1),n!==o&&u.setRequestHeader("Range","bytes="+t+"-"+i),"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||(o=n=1,o=n=this.dc(0).length,E("LazyFiles on gzip forces download of the whole file when length is accessed")),this.tc=n,this.sc=o,this.Jb=!0},"undefined"!=typeof XMLHttpRequest){if(!_)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var a=new o;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=je.Gc(e,t,a,n,i);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 je.ac(s),t.apply(null,arguments)}})),u.read=function(e,t,r,n,i){if(je.ac(s),i>=(e=e.node.Na).length)return 0;if(n=Math.min(e.length-i,n),e.slice)for(var o=0;o<n;o++)t[r+o]=e[i+o];else for(o=0;o<n;o++)t[r+o]=e.get(i+o);return n},s.stream_ops=u,s},nd:function(e,t,r,n,i,o,a,s,c,l){function f(r){function f(r){l&&l(),s||je.zb(e,t,r,n,i,c),o&&o(),le()}var h=!1;u.preloadPlugins.forEach((function(e){!h&&e.canHandle(d)&&(e.handle(r,d,f,(function(){a&&a(),le()})),h=!0)})),h||f(r)}(void 0).jb();var d=t?ve(we(e,t)):e;ce(),"string"==typeof r?function(e,t,r){var n="al "+e;h(e,(function(r){k(r,'Loading data file "'+e+'" failed (no arrayBuffer).'),t(new Uint8Array(r)),n&&le()}),(function(){if(!r)throw'Loading data file "'+e+'" failed.';r()})),n&&ce()}(r,(function(e){f(e)}),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=je.indexedDB();try{var i=n.open(je.Rb(),je.Sb)}catch(e){return r(e)}i.onupgradeneeded=function(){E("creating db"),i.result.createObjectStore(je.ib)},i.onsuccess=function(){var n=i.result.transaction([je.ib],"readwrite"),o=n.objectStore(je.ib),a=0,s=0,u=e.length;e.forEach((function(e){(e=o.put(je.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},i.onerror=r},rd:function(e,t,r){t=t||function(){},r=r||function(){};var n=je.indexedDB();try{var i=n.open(je.Rb(),je.Sb)}catch(e){return r(e)}i.onupgradeneeded=r,i.onsuccess=function(){var n=i.result;try{var o=n.transaction([je.ib],"readonly")}catch(e){return void r(e)}var a=o.objectStore(je.ib),s=0,u=0,c=e.length;e.forEach((function(e){var n=a.get(e);n.onsuccess=function(){je.xb(e).exists&&je.unlink(e),je.zb(be(e),_e(e),n.result,!0,!0,!0),++s+u==c&&(0==u?t():r())},n.onerror=function(){u++,s+u==c&&(0==u?t():r())}})),o.onerror=r},i.onerror=r}},Re={};function Ne(e,t,r){try{var n=e(t)}catch(e){if(e&&e.node&&ye(t)!==ye(je.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,ie=[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]=ie[0],W[r+44>>2]=ie[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,ie=[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]=ie[0],W[r+84>>2]=ie[1],0}var ke,Ce=void 0;function Le(){return W[(Ce+=4)-4>>2]}function xe(e){if(!(e=je.$a(e)))throw new je.ErrnoError(8);return e}ke=w?function(){var e=t.hrtime();return 1e3*e[0]+e[1]/1e6}:function(){return performance.now()};var Pe,Be={};function Ue(){if(!Pe){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 Be)void 0===Be[e]?delete t[e]:t[e]=Be[e];var r=[];for(e in t)r.push(e+"="+t[e]);Pe=r}return Pe}function Fe(e,t,r,n){e||(e=this),this.parent=e,this.mount=e.mount,this.lb=null,this.id=je.Zc++,this.name=t,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=n}function We(e,t){var r=Array($(e)+1);return e=Y(e,r,0,r.length),t&&(r.length=e),r}Object.defineProperties(Fe.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 je.isDir(this.mode)}},Ib:{get:function(){return je.pb(this.mode)}}}),je.FSNode=Fe,je.lc();var He={a:function(e,t,r,n){fe("Assertion failed: "+G(e)+", at: "+[t?G(t):"unknown filename",r,n?G(n):"unknown function"])},u:function(e,t){!function(){function e(e){return(e=e.toTimeString().match(/\(([A-Za-z ]+)\)$/))?e[1]:"GMT"}if(!oe){oe=!0;var t=(new Date).getFullYear(),r=new Date(t,0,1),n=new Date(t,6,1);t=r.getTimezoneOffset();var i=n.getTimezoneOffset(),o=Math.max(t,i);W[Ke()>>2]=60*o,W[$e()>>2]=Number(t!=i),r=e(r),n=e(n),r=K(r),n=K(n),i<t?(W[Ye()>>2]=r,W[Ye()+4>>2]=n):(W[Ye()>>2]=n,W[Ye()+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[Ye()+(e?4:0)>>2],W[t+40>>2]=e,t},m:function(e,t){try{var r;if(e=G(e),-8&t)var n=-28;else(r=je.lookupPath(e,{Ta:!0}).node)?(e="",4&t&&(e+="r"),2&t&&(e+="w"),1&t&&(e+="x"),n=e&&je.Za(r,e)?-2:0):n=-44;return n}catch(e){return void 0!==je&&e instanceof je.ErrnoError||fe(e),-e.Oa}},A:function(e,t){try{return e=G(e),je.chmod(e,t),0}catch(e){return void 0!==je&&e instanceof je.ErrnoError||fe(e),-e.Oa}},H:function(e,t,r){try{return e=G(e),je.chown(e,t,r),0}catch(e){return void 0!==je&&e instanceof je.ErrnoError||fe(e),-e.Oa}},B:function(e,t){try{return je.fchmod(e,t),0}catch(e){return void 0!==je&&e instanceof je.ErrnoError||fe(e),-e.Oa}},I:function(e,t,r){try{return je.fchown(e,t,r),0}catch(e){return void 0!==je&&e instanceof je.ErrnoError||fe(e),-e.Oa}},b:function(e,t,r){Ce=r;try{var n=xe(e);switch(t){case 0:var i=Le();return 0>i?-28:je.open(n.path,n.flags,0,i).fd;case 1:case 2:return 0;case 3:return n.flags;case 4:return i=Le(),n.flags|=i,0;case 12:return i=Le(),F[i+0>>1]=2,0;case 13:case 14:return 0;case 16:case 8:return-28;case 9:return W[ze()>>2]=28,-1;default:return-28}}catch(e){return void 0!==je&&e instanceof je.ErrnoError||fe(e),-e.Oa}},E:function(e,t){try{var r=xe(e);return Ne(je.stat,r.path,t)}catch(e){return void 0!==je&&e instanceof je.ErrnoError||fe(e),-e.Oa}},n:function(e,t,r){try{return je.Nc(e,r),0}catch(e){return void 0!==je&&e instanceof je.ErrnoError||fe(e),-e.Oa}},l:function(e,t){try{if(0===t)return-28;var r=je.cwd();return t<$(r)+1?-68:(Y(r,U,e,t),e)}catch(e){return void 0!==je&&e instanceof je.ErrnoError||fe(e),-e.Oa}},G:function(){return 0},d:function(){return 42},z:function(e,t){try{return e=G(e),Ne(je.lstat,e,t)}catch(e){return void 0!==je&&e instanceof je.ErrnoError||fe(e),-e.Oa}},C:function(e,t){try{return"/"===(e=ye(e=G(e)))[e.length-1]&&(e=e.substr(0,e.length-1)),je.mkdir(e,t,0),0}catch(e){return void 0!==je&&e instanceof je.ErrnoError||fe(e),-e.Oa}},y:function(e,t,r,n,i,o){try{e:{o<<=12;var a=!1;if(0!=(16&n)&&0!=e%65536)var s=-28;else{if(0!=(32&n)){var u=De(t);if(!u){s=-48;break e}a=!0}else{var c=je.$a(i);if(!c){s=-8;break e}var l=je.mmap(c,e,t,o,r,n);u=l.ed,a=l.vb}Re[u]={Uc:u,Tc:t,vb:a,fd:i,dd:r,flags:n,offset:o},s=u}}return s}catch(e){return void 0!==je&&e instanceof je.ErrnoError||fe(e),-e.Oa}},x:function(e,t){try{var r=Re[e];if(0!==t&&r){if(t===r.Tc){var n=je.$a(r.fd);if(n&&2&r.dd){var i=r.flags,o=r.offset,a=U.slice(e,e+t);je.msync(n,a,o,t,i)}Re[e]=null,r.vb&&Ve(r.Uc)}var s=0}else s=-28;return s}catch(e){return void 0!==je&&e instanceof je.ErrnoError||fe(e),-e.Oa}},w:function(e,t,r){Ce=r;try{var n=G(e),i=r?Le():0;return je.open(n,t,i).fd}catch(e){return void 0!==je&&e instanceof je.ErrnoError||fe(e),-e.Oa}},J:function(e,t,r){try{if(e=G(e),0>=r)var n=-28;else{var i=je.readlink(e),o=Math.min(r,$(i)),a=B[t+o];Y(i,U,t,r+1),B[t+o]=a,n=o}return n}catch(e){return void 0!==je&&e instanceof je.ErrnoError||fe(e),-e.Oa}},F:function(e){try{return e=G(e),je.rmdir(e),0}catch(e){return void 0!==je&&e instanceof je.ErrnoError||fe(e),-e.Oa}},e:function(e,t){try{return e=G(e),Ne(je.stat,e,t)}catch(e){return void 0!==je&&e instanceof je.ErrnoError||fe(e),-e.Oa}},i:function(e){try{return e=G(e),je.unlink(e),0}catch(e){return void 0!==je&&e instanceof je.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{R.grow(Math.min(2147483648,n)-P.byteLength+65535>>>16),Z();var i=1;break e}catch(e){}i=void 0}if(i)return!0}return!1},t:function(e){for(var t=ke();ke()-t<e;);},r:function(e,t){try{var r=0;return Ue().forEach((function(n,i){var o=t+r;for(i=W[e+4*i>>2]=o,o=0;o<n.length;++o)B[i++>>0]=n.charCodeAt(o);B[i>>0]=0,r+=n.length+1})),0}catch(e){return void 0!==je&&e instanceof je.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!==je&&e instanceof je.ErrnoError||fe(e),e.Oa}},f:function(e){try{var t=xe(e);return je.close(t),0}catch(e){return void 0!==je&&e instanceof je.ErrnoError||fe(e),e.Oa}},q:function(e,t){try{var r=xe(e),n=r.tty?2:je.isDir(r.mode)?3:je.fb(r.mode)?7:4;return B[t>>0]=n,0}catch(e){return void 0!==je&&e instanceof je.ErrnoError||fe(e),e.Oa}},j:function(e,t,r,n){try{e:{for(var i=xe(e),o=e=0;o<r;o++){var a=W[t+(8*o+4)>>2],s=je.read(i,B,W[t+8*o>>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!==je&&e instanceof je.ErrnoError||fe(e),e.Oa}},o:function(e,t,r,n,i){try{var o=xe(e);return-9007199254740992>=(e=4294967296*r+(t>>>0))||9007199254740992<=e?-61:(je.llseek(o,e,n),ie=[o.position>>>0,(ne=o.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[i>>2]=ie[0],W[i+4>>2]=ie[1],o.Fb&&0===e&&0===n&&(o.Fb=null),0)}catch(e){return void 0!==je&&e instanceof je.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!==je&&e instanceof je.ErrnoError||fe(e),e.Oa}},g:function(e,t,r,n){try{e:{for(var i=xe(e),o=e=0;o<r;o++){var a=je.write(i,B,W[t+8*o>>2],W[t+(8*o+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!==je&&e instanceof je.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=G(e);try{je.kd(e,t,t);var n=0}catch(e){if(!(e instanceof je.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 u.extraStackTrace&&(n+="\n"+u.extraStackTrace()),e+" : "+(n=function(e){return e.replace(/\b_Z[\w\d_]+/g,(function(e){return e==e?e:e+" ["+e+"]"}))}(n))}n=e.Oa,W[ze()>>2]=n,n=-1}return n}};!function(){function e(e){u.asm=e.exports,R=u.asm.L,Z(),X=u.asm.Da,Q.unshift(u.asm.M),le()}function t(t){e(t.instance)}function r(e){return function(){if(!T&&(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(h)return new Promise((function(e,t){h(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){S("failed to asynchronously prepare wasm: "+e),fe(e)}))}var n={a:He};if(ce(),u.instantiateWasm)try{return u.instantiateWasm(n,e)}catch(e){return S("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 S("wasm streaming compile failed: "+e),S("falling back to ArrayBuffer instantiation"),r(t)}))}))}(),u.___wasm_call_ctors=function(){return(u.___wasm_call_ctors=u.asm.M).apply(null,arguments)},u._sqlite3_vfs_find=function(){return(u._sqlite3_vfs_find=u.asm.N).apply(null,arguments)},u._sqlite3_free=function(){return(u._sqlite3_free=u.asm.O).apply(null,arguments)};var ze=u.___errno_location=function(){return(ze=u.___errno_location=u.asm.P).apply(null,arguments)};u._sqlite3_finalize=function(){return(u._sqlite3_finalize=u.asm.Q).apply(null,arguments)},u._sqlite3_reset=function(){return(u._sqlite3_reset=u.asm.R).apply(null,arguments)},u._sqlite3_clear_bindings=function(){return(u._sqlite3_clear_bindings=u.asm.S).apply(null,arguments)},u._sqlite3_value_blob=function(){return(u._sqlite3_value_blob=u.asm.T).apply(null,arguments)},u._sqlite3_value_text=function(){return(u._sqlite3_value_text=u.asm.U).apply(null,arguments)},u._sqlite3_value_bytes=function(){return(u._sqlite3_value_bytes=u.asm.V).apply(null,arguments)},u._sqlite3_value_double=function(){return(u._sqlite3_value_double=u.asm.W).apply(null,arguments)},u._sqlite3_value_int=function(){return(u._sqlite3_value_int=u.asm.X).apply(null,arguments)},u._sqlite3_value_type=function(){return(u._sqlite3_value_type=u.asm.Y).apply(null,arguments)},u._sqlite3_result_blob=function(){return(u._sqlite3_result_blob=u.asm.Z).apply(null,arguments)},u._sqlite3_result_double=function(){return(u._sqlite3_result_double=u.asm._).apply(null,arguments)},u._sqlite3_result_error=function(){return(u._sqlite3_result_error=u.asm.$).apply(null,arguments)},u._sqlite3_result_int=function(){return(u._sqlite3_result_int=u.asm.aa).apply(null,arguments)},u._sqlite3_result_int64=function(){return(u._sqlite3_result_int64=u.asm.ba).apply(null,arguments)},u._sqlite3_result_null=function(){return(u._sqlite3_result_null=u.asm.ca).apply(null,arguments)},u._sqlite3_result_text=function(){return(u._sqlite3_result_text=u.asm.da).apply(null,arguments)},u._sqlite3_step=function(){return(u._sqlite3_step=u.asm.ea).apply(null,arguments)},u._sqlite3_column_count=function(){return(u._sqlite3_column_count=u.asm.fa).apply(null,arguments)},u._sqlite3_data_count=function(){return(u._sqlite3_data_count=u.asm.ga).apply(null,arguments)},u._sqlite3_column_blob=function(){return(u._sqlite3_column_blob=u.asm.ha).apply(null,arguments)},u._sqlite3_column_bytes=function(){return(u._sqlite3_column_bytes=u.asm.ia).apply(null,arguments)},u._sqlite3_column_double=function(){return(u._sqlite3_column_double=u.asm.ja).apply(null,arguments)},u._sqlite3_column_text=function(){return(u._sqlite3_column_text=u.asm.ka).apply(null,arguments)},u._sqlite3_column_type=function(){return(u._sqlite3_column_type=u.asm.la).apply(null,arguments)},u._sqlite3_column_name=function(){return(u._sqlite3_column_name=u.asm.ma).apply(null,arguments)},u._sqlite3_bind_blob=function(){return(u._sqlite3_bind_blob=u.asm.na).apply(null,arguments)},u._sqlite3_bind_double=function(){return(u._sqlite3_bind_double=u.asm.oa).apply(null,arguments)},u._sqlite3_bind_int=function(){return(u._sqlite3_bind_int=u.asm.pa).apply(null,arguments)},u._sqlite3_bind_text=function(){return(u._sqlite3_bind_text=u.asm.qa).apply(null,arguments)},u._sqlite3_bind_parameter_index=function(){return(u._sqlite3_bind_parameter_index=u.asm.ra).apply(null,arguments)},u._sqlite3_sql=function(){return(u._sqlite3_sql=u.asm.sa).apply(null,arguments)},u._sqlite3_normalized_sql=function(){return(u._sqlite3_normalized_sql=u.asm.ta).apply(null,arguments)},u._sqlite3_errmsg=function(){return(u._sqlite3_errmsg=u.asm.ua).apply(null,arguments)},u._sqlite3_exec=function(){return(u._sqlite3_exec=u.asm.va).apply(null,arguments)},u._sqlite3_prepare_v2=function(){return(u._sqlite3_prepare_v2=u.asm.wa).apply(null,arguments)},u._sqlite3_changes=function(){return(u._sqlite3_changes=u.asm.xa).apply(null,arguments)},u._sqlite3_close_v2=function(){return(u._sqlite3_close_v2=u.asm.ya).apply(null,arguments)},u._sqlite3_create_function_v2=function(){return(u._sqlite3_create_function_v2=u.asm.za).apply(null,arguments)},u._sqlite3_open=function(){return(u._sqlite3_open=u.asm.Aa).apply(null,arguments)};var qe=u._malloc=function(){return(qe=u._malloc=u.asm.Ba).apply(null,arguments)},Ve=u._free=function(){return(Ve=u._free=u.asm.Ca).apply(null,arguments)};u._RegisterExtensionFunctions=function(){return(u._RegisterExtensionFunctions=u.asm.Ea).apply(null,arguments)},u._register_for_idb=function(){return(u._register_for_idb=u.asm.Fa).apply(null,arguments)};var Ge,Ye=u.__get_tzname=function(){return(Ye=u.__get_tzname=u.asm.Ga).apply(null,arguments)},$e=u.__get_daylight=function(){return($e=u.__get_daylight=u.asm.Ha).apply(null,arguments)},Ke=u.__get_timezone=function(){return(Ke=u.__get_timezone=u.asm.Ia).apply(null,arguments)},Ze=u.stackSave=function(){return(Ze=u.stackSave=u.asm.Ja).apply(null,arguments)},Xe=u.stackRestore=function(){return(Xe=u.stackRestore=u.asm.Ka).apply(null,arguments)},Je=u.stackAlloc=function(){return(Je=u.stackAlloc=u.asm.La).apply(null,arguments)},Qe=u._memalign=function(){return(Qe=u._memalign=u.asm.Ma).apply(null,arguments)};function et(){function e(){if(!Ge&&(Ge=!0,u.calledRun=!0,!N)){if(u.noFSInit||je.jb.Hb||je.jb(),je.hc=!1,ge(Q),u.onRuntimeInitialized&&u.onRuntimeInitialized(),u.postRun)for("function"==typeof u.postRun&&(u.postRun=[u.postRun]);u.postRun.length;){var e=u.postRun.shift();ee.unshift(e)}ge(ee)}}if(!(0<ae)){if(u.preRun)for("function"==typeof u.preRun&&(u.preRun=[u.preRun]);u.preRun.length;)te();ge(J),0<ae||(u.setStatus?(u.setStatus("Running..."),setTimeout((function(){setTimeout((function(){u.setStatus("")}),1),e()}),1)):e())}}if(u.cwrap=function(e,t,r,n){var i=(r=r||[]).every((function(e){return"number"===e}));return"string"!==t&&i&&!n?C(e):function(){return L(e,t,r,arguments)}},u.UTF8ToString=G,u.FS=je,u.stackSave=Ze,u.stackRestore=Xe,u.stackAlloc=Je,ue=function e(){Ge||et(),Ge||(ue=e)},u.run=et,u.preInit)for("function"==typeof u.preInit&&(u.preInit=[u.preInit]);0<u.preInit.length;)u.preInit.pop()();return et(),u})))};e.exports=a,e.exports.default=a}).call(this,r(97)(e),r(19),"/",r(10).Buffer)},function(e,t,r){!function(){function t(e,t){var r,n,i,o,a,s,u,c;for(r=3&e.length,n=e.length-r,i=t,a=3432918353,s=461845907,c=0;c<n;)u=255&e.charCodeAt(c)|(255&e.charCodeAt(++c))<<8|(255&e.charCodeAt(++c))<<16|(255&e.charCodeAt(++c))<<24,++c,i=27492+(65535&(o=5*(65535&(i=(i^=u=(65535&(u=(u=(65535&u)*a+(((u>>>16)*a&65535)<<16)&4294967295)<<15|u>>>17))*s+(((u>>>16)*s&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(o>>>16)&65535)<<16);switch(u=0,r){case 3:u^=(255&e.charCodeAt(c+2))<<16;case 2:u^=(255&e.charCodeAt(c+1))<<8;case 1:i^=u=(65535&(u=(u=(65535&(u^=255&e.charCodeAt(c)))*a+(((u>>>16)*a&65535)<<16)&4294967295)<<15|u>>>17))*s+(((u>>>16)*s&65535)<<16)&4294967295}return i^=e.length,i=2246822507*(65535&(i^=i>>>16))+((2246822507*(i>>>16)&65535)<<16)&4294967295,i=3266489909*(65535&(i^=i>>>13))+((3266489909*(i>>>16)&65535)<<16)&4294967295,(i^=i>>>16)>>>0}var r=t;r.v2=function(e,t){for(var r,n=e.length,i=t^n,o=0;n>=4;)r=1540483477*(65535&(r=255&e.charCodeAt(o)|(255&e.charCodeAt(++o))<<8|(255&e.charCodeAt(++o))<<16|(255&e.charCodeAt(++o))<<24))+((1540483477*(r>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),n-=4,++o;switch(n){case 3:i^=(255&e.charCodeAt(o+2))<<16;case 2:i^=(255&e.charCodeAt(o+1))<<8;case 1:i=1540483477*(65535&(i^=255&e.charCodeAt(o)))+((1540483477*(i>>>16)&65535)<<16)}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0},r.v3=t,e.exports=r}()},function(e,t,r){var n,i,o,a,s;n=r(430),i=r(248).utf8,o=r(431),a=r(248).bin,(s=function(e,t){e.constructor==String?e=t&&"binary"===t.encoding?a.stringToBytes(e):i.stringToBytes(e):o(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,c=1732584193,l=-271733879,f=-1732584194,d=271733878,h=0;h<r.length;h++)r[h]=16711935&(r[h]<<8|r[h]>>>24)|4278255360&(r[h]<<24|r[h]>>>8);r[u>>>5]|=128<<u%32,r[14+(u+64>>>9<<4)]=u;var p=s._ff,g=s._gg,m=s._hh,y=s._ii;for(h=0;h<r.length;h+=16){var b=c,_=l,w=f,v=d;c=p(c,l,f,d,r[h+0],7,-680876936),d=p(d,c,l,f,r[h+1],12,-389564586),f=p(f,d,c,l,r[h+2],17,606105819),l=p(l,f,d,c,r[h+3],22,-1044525330),c=p(c,l,f,d,r[h+4],7,-176418897),d=p(d,c,l,f,r[h+5],12,1200080426),f=p(f,d,c,l,r[h+6],17,-1473231341),l=p(l,f,d,c,r[h+7],22,-45705983),c=p(c,l,f,d,r[h+8],7,1770035416),d=p(d,c,l,f,r[h+9],12,-1958414417),f=p(f,d,c,l,r[h+10],17,-42063),l=p(l,f,d,c,r[h+11],22,-1990404162),c=p(c,l,f,d,r[h+12],7,1804603682),d=p(d,c,l,f,r[h+13],12,-40341101),f=p(f,d,c,l,r[h+14],17,-1502002290),c=g(c,l=p(l,f,d,c,r[h+15],22,1236535329),f,d,r[h+1],5,-165796510),d=g(d,c,l,f,r[h+6],9,-1069501632),f=g(f,d,c,l,r[h+11],14,643717713),l=g(l,f,d,c,r[h+0],20,-373897302),c=g(c,l,f,d,r[h+5],5,-701558691),d=g(d,c,l,f,r[h+10],9,38016083),f=g(f,d,c,l,r[h+15],14,-660478335),l=g(l,f,d,c,r[h+4],20,-405537848),c=g(c,l,f,d,r[h+9],5,568446438),d=g(d,c,l,f,r[h+14],9,-1019803690),f=g(f,d,c,l,r[h+3],14,-187363961),l=g(l,f,d,c,r[h+8],20,1163531501),c=g(c,l,f,d,r[h+13],5,-1444681467),d=g(d,c,l,f,r[h+2],9,-51403784),f=g(f,d,c,l,r[h+7],14,1735328473),c=m(c,l=g(l,f,d,c,r[h+12],20,-1926607734),f,d,r[h+5],4,-378558),d=m(d,c,l,f,r[h+8],11,-2022574463),f=m(f,d,c,l,r[h+11],16,1839030562),l=m(l,f,d,c,r[h+14],23,-35309556),c=m(c,l,f,d,r[h+1],4,-1530992060),d=m(d,c,l,f,r[h+4],11,1272893353),f=m(f,d,c,l,r[h+7],16,-155497632),l=m(l,f,d,c,r[h+10],23,-1094730640),c=m(c,l,f,d,r[h+13],4,681279174),d=m(d,c,l,f,r[h+0],11,-358537222),f=m(f,d,c,l,r[h+3],16,-722521979),l=m(l,f,d,c,r[h+6],23,76029189),c=m(c,l,f,d,r[h+9],4,-640364487),d=m(d,c,l,f,r[h+12],11,-421815835),f=m(f,d,c,l,r[h+15],16,530742520),c=y(c,l=m(l,f,d,c,r[h+2],23,-995338651),f,d,r[h+0],6,-198630844),d=y(d,c,l,f,r[h+7],10,1126891415),f=y(f,d,c,l,r[h+14],15,-1416354905),l=y(l,f,d,c,r[h+5],21,-57434055),c=y(c,l,f,d,r[h+12],6,1700485571),d=y(d,c,l,f,r[h+3],10,-1894986606),f=y(f,d,c,l,r[h+10],15,-1051523),l=y(l,f,d,c,r[h+1],21,-2054922799),c=y(c,l,f,d,r[h+8],6,1873313359),d=y(d,c,l,f,r[h+15],10,-30611744),f=y(f,d,c,l,r[h+6],15,-1560198380),l=y(l,f,d,c,r[h+13],21,1309151649),c=y(c,l,f,d,r[h+4],6,-145523070),d=y(d,c,l,f,r[h+11],10,-1120210379),f=y(f,d,c,l,r[h+2],15,718787259),l=y(l,f,d,c,r[h+9],21,-343485551),c=c+b>>>0,l=l+_>>>0,f=f+w>>>0,d=d+v>>>0}return n.endian([c,l,f,d])})._ff=function(e,t,r,n,i,o,a){var s=e+(t&r|~t&n)+(i>>>0)+a;return(s<<o|s>>>32-o)+t},s._gg=function(e,t,r,n,i,o,a){var s=e+(t&n|r&~n)+(i>>>0)+a;return(s<<o|s>>>32-o)+t},s._hh=function(e,t,r,n,i,o,a){var s=e+(t^r^n)+(i>>>0)+a;return(s<<o|s>>>32-o)+t},s._ii=function(e,t,r,n,i,o,a){var s=e+(r^(t|~n))+(i>>>0)+a;return(s<<o|s>>>32-o)+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)}},function(e,t,r){const n=r(432),i=r(433);let o="[0-9A-Za-zªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶ-ͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԣԱ-Ֆՙա-ևא-תװ-ײء-يٮ-ٯٱ-ۓەۥ-ۦۮ-ۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴ-ߵߺऄ-हऽॐक़-ॡॱ-ॲॻ-ॿঅ-ঌএ-ঐও-নপ-রলশ-হঽৎড়-ঢ়য়-ৡৰ-ৱਅ-ਊਏ-ਐਓ-ਨਪ-ਰਲ-ਲ਼ਵ-ਸ਼ਸ-ਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલ-ળવ-હઽૐૠ-ૡଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଵ-ହଽଡ଼-ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கங-சஜஞ-டண-தந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘ-ౙౠ-ౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠ-ೡഅ-ഌഎ-ഐഒ-നപ-ഹഽൠ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะา-ำเ-ๆກ-ຂຄງ-ຈຊຍດ-ທນ-ຟມ-ຣລວສ-ຫອ-ະາ-ຳຽເ-ໄໆໜ-ໝༀཀ-ཇཉ-ཬྈ-ྋက-ဪဿၐ-ၕၚ-ၝၡၥ-ၦၮ-ၰၵ-ႁႎႠ-Ⴥა-ჺჼᄀ-ᅙᅟ-ᆢᆨ-ᇹሀ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙶᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦩᧁ-ᧇᨀ-ᨖᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮ-ᮯᰀ-ᰣᱍ-ᱏᱚ-ᱽᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₔℂℇℊ--ℝℤΩℨK--ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-Ɐⱱ-ⱽⲀ-ⳤⴀ-ⴥⴰ-ⵥⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆷㇰ-ㇿ㐀䶵一鿃ꀀ-ꒌꔀ-ꘌꘐ-ꘟꘪ-ꘫꙀ-ꙟꙢ-ꙮꙿ-ꚗꜗ-ꜟꜢ-ꞈꞋ-ꞌꟻ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꤊ-ꤥꤰ-ꥆꨀ-ꨨꩀ-ꩂꩄ-ꩋ가힣豈-鶴侮-頻並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּ-סּףּ-פּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA--zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]",a=new RegExp(`(?:(?:(\\s?(?:^|[.\\(\\)!?;:"-])\\s*)(${o}))|(${o}))(${o}*[']*${o}*)`,"g");e.exports=(e,t={})=>{e=e.toLowerCase().replace(a,(e,t="",r,i,o)=>{const a=function(e){const t=e[0];return/\s/.test(t)?e.substr(1):/[()]/.test(t)?null:e}(e);if(!a)return e;if(!r){const e=i+o;if(n.has(e))return a}return t+(i||r).toUpperCase()+o});const r=t.special||[];return(e=>e.map(e=>[new RegExp(`\\b${e}\\b`,"gi"),e]))([...i,...r]).forEach(([t,r])=>{e=e.replace(t,r)}),e}},function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n=r(7),i=r(13);function o(e,t){t.forEach((t,r)=>{if("transactions"===r){e.get(r);let o=[];t.forEach(e=>{if(1===e.isChild&&null==e.parent_id&&e.id.includes("/")){let t=e.id.split("/")[0];o.push({dataset:"transactions",row:e.id,column:"parent_id",value:t,timestamp:i.default.send()})}}),o.length>0&&Object(n.b)(o)}})}let a=null;function s(){a&&(a(),a=null),a=Object(n.a)(o)}},function(e,t,r){(function(t){const n=r(435);e.exports=function(e,r={}){"string"==typeof e&&(e=t.from(e));const i=r&&r.objname?{}:[],o=new n.Parser(r);o.push=function(e){null!==e&&(void 0===r.objname?i.push(e):i[e[0]]=e[1])};const a=o.__parse(e,!1);if(void 0!==a)throw a;const s=o.__parse(void 0,!0);if(void 0!==s)throw s;return i}}).call(this,r(10).Buffer)},function(e,t,r){"use strict";var n=r(40),i=r(39),o=r(77),a=r(1),s=r(5),u=r(8),c=r(2),l=(r(170),r(37)),f=r(7),d=r(12),h=r(13),p=r(6),g=r(26),m=r(25);function y(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 b(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?y(Object(r),!0).forEach((function(t){_(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):y(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}r(49).resolveName;const w=r(52);let v=!1;function E(e,t){return{type:"APIError",message:e,meta:t}}function S(e){return t=>Object(p.runMutator)(async()=>{let r=Object(h.getClock)().timestamp.toString(),n=await e(t),i=await a.all("SELECT DISTINCT dataset FROM messages_crdt WHERE timestamp > ?",[r]);return w.getNumClients()>1&&w.send("sync-event",{type:"success",tables:i.map(e=>e.dataset)}),n},{undoDisabled:!0})}let O={};async function T(e){if(!e.match(/^\d{4}-\d{2}$/))throw E("Invalid month format, use YYYY-MM: "+e);if(!v){let t=await O["get-budget-bounds"](),r=t.start,n=t.end;if(!c.n(r,n).includes(e))throw E("No budget exists for month: "+e)}}let A=null;O["api/batch-budget-start"]=async function(){if(A)throw E("Cannot start a batch process: batch already started");v?a.asyncTransaction(()=>new Promise((e,t)=>{A={resolve:e,reject:t}})):Object(f.c)(()=>new Promise((e,t)=>{A={resolve:e,reject:t}}))},O["api/batch-budget-end"]=async function(){if(!A)throw E("Cannot end a batch process: no batch started");A.resolve(),A=null},O["api/load-budget"]=async function({id:e}){if((u.b()||{}).id!==e){w.send("start-load");let t=(await O["load-budget"]({id:e})).error;if(t)throw w.send("show-budgets"),"out-of-sync-migrations"===t||"out-of-sync-data"===t?new Error("This budget cannot be loaded with this version of the app."):"budget-not-found"===t?new Error('Budget "'+e+'" not found. Check the id of your budget in the "Advanced" section of the settings page.'):new Error('We had an unknown problem opening "'+e+'".');w.send("finish-load")}},O["api/start-import"]=async function({budgetName:e}){await O["close-budget"](),await O["create-budget"]({budgetName:e,avoidUpload:!0}),await a.runQuery("DELETE FROM categories WHERE is_income = 0"),await a.runQuery("DELETE FROM category_groups WHERE is_income = 0"),Object(f.k)("import"),w.send("start-import"),v=!0},O["api/finish-import"]=async function(){s.b().markCacheDirty();let e=u.b().id;await O["close-budget"](),await O["load-budget"]({id:e}),await O["get-budget-bounds"](),await s.j(),await l.h().catch(e=>{}),w.send("finish-import"),v=!1},O["api/abort-import"]=async function(){if(v){let e=u.b().id;await O["close-budget"](),await O["delete-budget"]({id:e}),w.send("show-budgets")}v=!1},O["api/query"]=async function({query:e}){return Object(g.b)(e)},O["api/budget-months"]=async function(){let e=await O["get-budget-bounds"](),t=e.start,r=e.end;return c.n(t,r)},O["api/budget-month"]=async function({month:e}){await T(e);let t=await a.getCategoriesGrouped(),r=c.p(e);function n(e){let t=s.b().getCellValue(r,e);return""===t?0:t}return{month:e,incomeAvailable:n("available-funds"),lastMonthOverspent:n("last-month-overspent"),forNextMonth:n("buffered"),totalBudgeted:n("total-budgeted"),toBudget:n("to-budget"),fromLastMonth:n("from-last-month"),totalIncome:n("total-income"),totalSpent:n("total-spent"),totalBalance:n("total-leftover"),categoryGroups:t.map(e=>e.is_income?b(b({},i.b.toExternal(e)),{},{received:n("total-income"),categories:e.categories.map(e=>b(b({},i.c.toExternal(e)),{},{received:n("sum-amount-"+e.id)}))}):b(b({},i.b.toExternal(e)),{},{budgeted:n("group-budget-"+e.id),spent:n("group-sum-amount-"+e.id),balance:n("group-leftover-"+e.id),categories:e.categories.map(e=>b(b({},i.c.toExternal(e)),{},{budgeted:n("budget-"+e.id),spent:n("sum-amount-"+e.id),balance:n("leftover-"+e.id),carryover:n("carryover-"+e.id)}))}))}},O["api/budget-set-amount"]=S((async function({month:e,categoryId:t,amount:r}){return O["budget/budget-amount"]({month:e,category:t,amount:r})})),O["api/budget-set-carryover"]=S((async function({month:e,categoryId:t,flag:r}){return await T(e),await async function(e,t){if(null==t)throw E(e+": category id is required");let r=await a.first("SELECT is_income FROM categories WHERE id = ?",[t]);if(!r)throw E(`${e}: category "${t}" does not exist`);if(0!==r.is_income)throw E(`${e}: category "${t}" is not an expense category`)}("budget-set-carryover",t),O["budget/set-carryover"]({startMonth:e,category:t,flag:r})})),O["api/transactions-export"]=async function({transactions:e,categoryGroups:t,payees:r}){return O["transactions-export"]({transactions:e,categoryGroups:t,payees:r})},O["api/transactions-import"]=S((async function({accountId:e,transactions:t}){return O["transactions-import"]({accountId:e,transactions:t})})),O["api/transactions-add"]=S((async function({accountId:e,transactions:t}){return await Object(n.a)(e,t,{runTransfers:!1}),"ok"})),O["api/transactions-get"]=async function({accountId:e,startDate:t,endDate:r}){return(await Object(g.b)(Object(m.b)("transactions").filter({$and:[e&&{account:e},t&&{date:{$gte:t}},r&&{date:{$lte:r}}].filter(Boolean)}).select("*").options({splits:"grouped"}))).data},O["api/transactions-filter"]=async function({text:e,accountId:t}){throw new Error("`filterTransactions` is deprecated, use `runQuery` instead")},O["api/transaction-update"]=S((async function({id:e,fields:t}){let r=(await Object(g.b)(Object(m.b)("transactions").filter({id:e}).select("*").options({splits:"grouped"}))).data,n=Object(o.d)(r);if(0===n.length)return[];let i=Object(o.e)(n,t).diff;return O["transactions-batch-update"](i)})),O["api/transaction-delete"]=S((async function({id:e}){let t=(await Object(g.b)(Object(m.b)("transactions").filter({id:e}).select("*").options({splits:"grouped"}))).data,r=Object(o.d)(t);if(0===r.length)return[];let n=Object(o.a)(r,e).diff;return O["transactions-batch-update"](n)})),O["api/accounts-get"]=async function(){return(await a.getAccounts()).map(e=>i.a.toExternal(e))},O["api/account-create"]=S((async function({account:e,initialBalance:t=null}){return O["account-create"]({name:e.name,type:e.type,offBudget:e.offbudget,closed:e.closed,balance:null!=t?Object(d.k)(t):null})})),O["api/account-update"]=S((async function({id:e,fields:t}){return a.updateAccount(b({id:e},i.a.fromExternal(t)))})),O["api/account-close"]=S((async function({id:e,transferAccountId:t,transferCategoryId:r}){return O["account-close"]({id:e,transferAccountId:t,categoryId:r})})),O["api/account-reopen"]=S((async function({id:e}){return O["account-reopen"]({id:e})})),O["api/account-delete"]=S((async function({id:e}){return O["account-close"]({id:e,forced:!0})})),O["api/categories-get"]=async function({grouped:e}={}){let t=await O["get-categories"]();return e?t.grouped.map(i.b.toExternal):t.list.map(i.c.toExternal)},O["api/category-group-create"]=S((async function({group:e}){return O["category-group-create"]({name:e.name})})),O["api/category-group-update"]=S((async function({id:e,fields:t}){return O["category-group-update"](b({id:e},i.b.fromExternal(t)))})),O["api/category-group-delete"]=S((async function({id:e,transferCategoryId:t}){return O["category-group-delete"]({id:e,transferId:t})})),O["api/category-create"]=S((async function({category:e}){return O["category-create"]({name:e.name,groupId:e.group_id,isIncome:e.is_income})})),O["api/category-update"]=S((async function({id:e,fields:t}){return O["category-update"](b({id:e},i.c.fromExternal(t)))})),O["api/category-delete"]=S((async function({id:e,transferCategoryId:t}){return O["category-delete"]({id:e,transferId:t})})),O["api/payees-get"]=async function(){return(await O["payees-get"]()).map(i.d.toExternal)},O["api/payee-create"]=S((async function({payee:e}){return O["payee-create"]({name:e.name})})),O["api/payee-update"]=S((async function({id:e,fields:t}){return O["payees-batch-change"]({updated:[b({id:e},i.d.fromExternal(t))]})})),O["api/payee-delete"]=S((async function({id:e}){return O["payees-batch-change"]({deleted:[{id:e}]})})),O["api/payee-rules-get"]=async function({payeeId:e}){return(await O["payees-get-rules"]({id:e})).map(i.e.toExternal)},O["api/payee-rule-create"]=S((async function({payee_id:e,rule:t}){return O["payees-add-rule"]({payee_id:e,type:t.type,value:t.value||null})})),O["api/payee-rule-update"]=S((async function({id:e,fields:t}){return O["payees-update-rule"](b({id:e},i.e.fromExternal(t)))})),O["api/payee-rule-delete"]=S((async function({id:e}){return O["payees-delete-rule"]({id:e})})),t.a=function(e){return O=Object.assign({},e,O),O}},function(e,t,r){"use strict";r.d(t,"a",(function(){return D}));var n=r(2),i=r(5),o=r(61),a=r(1),s=r(8),u=r(32),c=r(26),l=r(7),f=r(6),d=r(40),h=r(25);function p(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 g(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?p(Object(r),!0).forEach((function(t){m(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function m(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function y(e){return e[(Math.random()*e.length|0)%e.length]}function b(e,t){return 0|function(e,t){return e+(t-e)*Math.random()}(e,t)}function _(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 w(e){return e.find(e=>"Starting Balances"===e.name).id}function v(e,t){let r=e.find(e=>"Deposit"===e.name),n=e.filter(e=>"Deposit"!==e.name&&"Starting Balance"!==e.name),i=t.find(e=>0===e.is_income),o=t.find(e=>1===e.is_income),a=i.categories.filter(e=>-1!==["Food","Restaurants","Entertainment","Clothing","General","Gift","Medical"].indexOf(e.name));return{incomePayee:r,expensePayees:n.filter(e=>!e.bill),incomeGroup:o,expenseCategories:a,billCategories:t.find(e=>"Bills"===e.name).categories,billPayees:n.filter(e=>e.bill)}}async function E(e,t,r,i){let o=v(r,i),a=o.incomePayee,s=o.expensePayees,u=o.incomeGroup,c=o.expenseCategories,l=o.billCategories,f=o.billPayees,h=b(100,200),p=[];for(let e=0;e<h;e++){let r,i,o;r=Math.random()<.09?a:y(s),i="Deposit"===r.name?u.categories.find(e=>"Income"===e.name):y(c),o="Deposit"===r.name?b(5e4,7e4):b(0,Math.random()<.05?-8e3:-700);let l={amount:o,payee:r.id,account:t.id,date:n.q(n.d(),e/3|0),category:i.id};if(p.push(l),Math.random()<.2){let e=l.amount/3|0,t=()=>r===a?u.categories.find(e=>"Income"===e.name).id:y(c).id;l.subtransactions=[{amount:e,category:t()},{amount:e,category:t()},{amount:l.amount-2*e,category:t()}]}}let g=n.k(p[p.length-1].date),m=n.o(g,n.e()),_=n.d();for(let e of m){let r=n.a(e,"12");n.j(r,_)&&p.push({amount:-1e4,payee:f.find(e=>e.name.toLowerCase().includes("power")).id,account:t.id,date:r,category:l.find(e=>"Power"===e.name).id}),r=n.a(e,"18"),n.j(r,_)&&p.push({amount:-9e3,payee:f.find(e=>e.name.toLowerCase().includes("water")).id,account:t.id,date:r,category:l.find(e=>"Water"===e.name).id}),r=n.a(e,"2"),n.j(r,_)&&p.push({amount:-12e4,payee:f.find(e=>e.name.toLowerCase().includes("housy")).id,account:t.id,date:r,category:l.find(e=>"Mortgage"===e.name).id}),r=n.a(e,"20"),n.j(r,_)&&p.push({amount:-6e3,payee:f.find(e=>e.name.toLowerCase().includes("internet")).id,account:t.id,date:r,category:l.find(e=>"Internet"===e.name).id}),r=n.a(e,"23"),n.j(r,_)&&p.push({amount:-7500,payee:f.find(e=>e.name.toLowerCase().includes("t-mobile")).id,account:t.id,date:r,category:l.find(e=>"Cell"===e.name).id})}let E=null;return p.forEach(e=>{(null==E||e.date<E)&&(E=e.date)}),p.unshift({amount:1e5,payee:r.find(e=>"Starting Balance"===e.name).id,account:t.id,date:E,category:w(u.categories),starting_balance_flag:!0}),Object(d.a)(t.id,p)}async function S(e,t,r,i){let o=v(r,i),a=o.incomePayee,s=o.expensePayees,u=o.incomeGroup,c=o.expenseCategories,l=b(20,40),f=[];for(let e=0;e<l;e++){let r,i;r=Math.random()<.04?a:y(s),i="Deposit"===r.name?u.categories.find(e=>"Income"===e.name):y(c);let o="Deposit"===r.name?b(5e4,7e4):b(0,-1e4);f.push({amount:o,payee:r.id,account:t.id,date:n.q(n.d(),2*e|0),category:i.id})}f.unshift({amount:b(9e4,12e4),payee:r.find(e=>"Starting Balance"===e.name).id,account:t.id,date:f[f.length-1].date,category:w(u.categories),starting_balance_flag:!0}),await e["transactions-batch-update"]({added:f,fastMode:!0})}async function O(e,t,r,i){let o=v(r,i),a=o.incomePayee,s=(o.expensePayees,o.incomeGroup),u=(o.expenseCategories,b(10,30)),c=[];for(let e=0;e<u;e++){let e=a,r=s.categories.find(e=>"Income"===e.name),i=b(1e4,2e4);c.push({amount:i,payee:e.id,account:t.id,date:n.q(n.d(),b(10,360)),category:r.id})}c.unshift({amount:b(1e4,2e4),payee:r.find(e=>"Starting Balance"===e.name).id,account:t.id,date:_(c,"date").date,category:w(s.categories),starting_balance_flag:!0}),await e["transactions-batch-update"]({added:c,fastMode:!0})}async function T(e,t,r,i){let o=v(r,i),a=o.incomePayee,s=o.expensePayees,u=o.incomeGroup,c=o.expenseCategories,l=b(15,40),f=[];for(let e=0;e<l;e++){let r;r=Math.random()<.3?a:y(s);let i=r===a?u.categories.find(e=>"Income"===e.name):y(c),o=r===a?b(1e4,8e4):b(-1e4,-2e3);f.push({amount:o,payee:r.id,account:t.id,date:n.q(n.d(),5*e|0),category:i.id})}f.unshift({amount:3e4,payee:r.find(e=>"Starting Balance"===e.name).id,account:t.id,date:f[f.length-1].date,category:w(u.categories),starting_balance_flag:!0}),await e["transactions-batch-update"]({added:f,fastMode:!0})}async function A(e,t,r,i){let o=v(r,i),a=o.incomePayee,s=(o.expensePayees,o.incomeGroup),u=(o.expenseCategories,b(7,10)),c=b(1e5,2e5),l=s.categories.find(e=>"Income"===e.name),f=[{amount:100*b(-3e3,-3500)*100,payee:r.find(e=>"Starting Balance"===e.name).id,account:t.id,date:n.r(n.d(),u)+"-02",category:w(s.categories),starting_balance_flag:!0}];for(let e=0;e<u;e++){let r=a;f.push({amount:c,payee:r.id,account:t.id,date:n.r(n.d(),e)+"-02",category:l.id,starting_balance_flag:!0})}await e["transactions-batch-update"]({added:f,fastMode:!0})}async function M(e,t,r,i){let o=v(r,i),a=o.incomePayee,s=(o.expensePayees,o.incomeGroup),u=(o.expenseCategories,b(3,6)),c=s.categories.find(e=>"Income"===e.name),l=[{amount:100*b(3250,3700)*100,payee:r.find(e=>"Starting Balance"===e.name).id,account:t.id,date:n.r(n.d(),u)+"-02",category:w(s.categories),starting_balance_flag:!0}];for(let e=0;e<u;e++){let r=a,i=100*b(4,9)*100;l.push({amount:i,payee:r.id,account:t.id,date:n.r(n.d(),e)+"-02",category:c.id})}await e["transactions-batch-update"]({added:l,fastMode:!0})}async function D(e){Object(l.k)("import"),await a.execQuery("PRAGMA journal_mode = OFF"),await a.runQuery("DELETE FROM categories;"),await a.runQuery("DELETE FROM category_groups");let t=[{name:"Bank of America",type:"checking"},{name:"Ally Savings",type:"savings"},{name:"Capital One Checking",type:"checking"},{name:"HSBC",type:"checking"},{name:"Vanguard 401k",type:"investment",offBudget:1},{name:"Mortgage",type:"mortgage",offBudget:1},{name:"House Asset",type:"other",offBudget:1},{name:"Roth IRA",type:"investment",offBudget:1}];await Object(f.runMutator)(()=>Object(l.c)(async()=>{for(let r of t)r.id=await e["account-create"](r)}));let r=[{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 Object(f.runMutator)(()=>Object(l.c)(async()=>{for(let t of r)t.id=await e["payee-create"]({name:t.name})}));let p=[{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 Object(f.runMutator)(async()=>{for(let t of p){t.id=await e["category-group-create"]({name:t.name,isIncome:t.is_income?1:0});for(let r of t.categories)r.id=await e["category-create"](g(g({},r),{},{isIncome:r.is_income?1:0,groupId:t.id}))}});let m=(await Object(f.runHandler)(e["get-categories"])).grouped;Object(l.k)("import"),await Object(f.runMutator)(()=>Object(l.c)(async()=>{for(let n of t)switch(n.type){case"checking":"Bank of America"===n.name?await E(0,n,r,m):await S(e,n,r,m);break;case"investment":await O(e,n,r,m);break;case"savings":await T(e,n,r,m);break;case"mortgage":await A(e,n,r,m);break;case"other":"House Asset"===n.name?await M(e,n,r,m):await S(e,n,r,m)}})),Object(l.k)("import");let y=t.find(e=>e.name="Bank of America"),_=(await Object(c.b)(Object(h.b)("transactions").filter({account:y.id}).calculate({$sum:"$amount"}).serialize())).data;if(_<0){let t=(await Object(c.b)(Object(h.b)("transactions").filter({account:y.id,amount:{$gt:0}}).limit(1).select(["id","amount"]).serialize())).data[0];await Object(f.runHandler)(e["transaction-update"],g(g({},t),{},{amount:t.amount+-_+b(1e4,2e4)}))}Object(l.k)("disabled"),await s.d({isCached:!1}),await i.g(a),await o.a(),await i.j(),await async function(e,t,r){let o=e.find(e=>e.name="Bank of America"),s=(await a.first("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,c=(await a.first("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",[o.id])).date,h=n.k(a.fromDateRepr(s)),p=n.e(),g=n.o(h,p);function m(e){for(let t of r){let r=t.categories.find(t=>t.name===e);if(r)return r}}function y(e,t,r){return u.i({month:e,category:t.id,amount:r})}function b(e,t){let r=i.d(n.p(e),"sum-amount-"+t.id);r<0&&y(e,t,-r)}await Object(f.runMutator)(()=>Object(l.c)(async()=>{for(let e of g)e>=n.k(a.fromDateRepr(c))?(y(e,m("Food"),4e4),y(e,m("Restaurants"),3e4),y(e,m("Entertainment"),1e4),y(e,m("Clothing"),3e3),y(e,m("General"),5e4),y(e,m("Gift"),7500),y(e,m("Medical"),1e4),y(e,m("Cell"),7500),y(e,m("Internet"),6e3),y(e,m("Mortgage"),12e4),y(e,m("Water"),9e3),y(e,m("Power"),1e4)):(b(e,m("Food")),b(e,m("Restaurants")),b(e,m("Entertainment")),b(e,m("Clothing")),b(e,m("General")),b(e,m("Gift")),b(e,m("Medical")),b(e,m("Cell")),b(e,m("Internet")),b(e,m("Mortgage")),b(e,m("Water")),b(e,m("Power")))})),await i.j(),await Object(f.runMutator)(()=>Object(l.c)(async()=>{let e=0;for(let t of g)if(t>=n.k(a.fromDateRepr(c))&&t<=n.e()){let r=n.p(t),o=i.d(r,"to-budget")-e;o-403e3>0?(y(t,m("Savings"),o-403e3),u.j(t,403e3),e+=o-403e3):o>0&&u.j(t,o)}})),await i.j();let _=n.p(n.e()),w=i.d(_,"to-budget");w<0&&await Object(d.a)(o.id,[{amount:-w,category:m("Income").id,date:n.e()+"-01"}]),await i.j()}(t,0,m)}},function(e,t,r){"use strict";var n=r(56),i=r(6),o=r(14),a=r(32);let s=Object(n.a)();s.method("budget/budget-amount",Object(i.mutator)(Object(o.e)(a.i))),s.method("budget/copy-previous-month",Object(i.mutator)(Object(o.e)(a.a))),s.method("budget/set-zero",Object(i.mutator)(Object(o.e)(a.l))),s.method("budget/set-3month-avg",Object(i.mutator)(Object(o.e)(a.g))),s.method("budget/set-all-future",Object(i.mutator)(Object(o.e)(a.h))),s.method("budget/hold-for-next-month",Object(i.mutator)(Object(o.e)(a.e))),s.method("budget/hold-for-future-months",Object(i.mutator)(Object(o.e)(a.d))),s.method("budget/reset-hold",Object(i.mutator)(Object(o.e)(a.f))),s.method("budget/cover-overspending",Object(i.mutator)(Object(o.e)(a.b))),s.method("budget/transfer-available",Object(i.mutator)(Object(o.e)(a.m))),s.method("budget/transfer-category",Object(i.mutator)(Object(o.e)(a.n))),s.method("budget/set-carryover",Object(i.mutator)(Object(o.e)(a.k))),t.a=s},function(e,t,r){"use strict";var n=r(56),i=r(1);let o=Object(n.a)();o.method("notes-save",async({id:e,note:t})=>{await i.update("notes",{id:e,note:t})}),t.a=o},function(e,t,r){"use strict";r(7);var n=r(6),i=r(56),o=r(1),a=r(68);let s=Object(i.a)();s.method("tools/fix-split-transactions",async()=>{let e=await o.all("\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 Object(n.runMutator)(async()=>{let t=e.map(e=>({id:e.id,payee:e.parentPayee}));await Object(a.a)({updated:t})});let t=await o.all("\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 Object(n.runMutator)(async()=>{let e=t.map(e=>({id:e.id,cleared:1===e.cleared}));await Object(a.a)({updated:e})});let r=await o.all("\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 Object(n.runMutator)(async()=>{let e=r.map(e=>({id:e.id,tombstone:1}));await Object(a.a)({updated:e})}),{numBlankPayees:e.length,numCleared:t.length,numDeleted:r.length}}),t.a=s},function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(4),i=r.n(n);var o=r(277),a=r.n(o),s=r(2),u=r(12);function c(e,t){let n=[],o=e.match(/\.[^.]*$/);if(o){switch(o[0].toLowerCase()){case".qif":return async function(e){let t,r=[],n=await i.a.readFile(e);try{t=function(e,t){var r=e.split("\n"),n=r.shift(),i=/!Type:([^$]*)$/.exec(n.trim()),o={},a=o.transactions=[],s={};if(t=t||{},!i||!i.length)throw new Error("File does not appear to be a valid qif file: "+n);o.type=i[1];for(var u={};n=r.shift();)if("^"!==(n=n.trim()))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(/&amp;/g,"&");break;case"L":var c=n.substring(1).split(":");s.category=c[0],void 0!==c[1]&&(s.subcategory=c[1]);break;case"C":s.clearedStatus=n.substring(1);break;case"S":var l=n.substring(1).split(":");u.category=l[0],void 0!==l[1]&&(u.subcategory=l[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),o.dateFormat=t.dateFormat,o}(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:r,transactions:t.transactions.map(e=>({amount:null!=e.amount?Object(u.m)(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,t={}){let r,n=[],o=await i.a.readFile(e);try{r=a()(o,{columns:!0,bom:!0,delimiter:t.delimiter||",",quote:'"',trim:!0,relax_column_count:!0})}catch(e){return n.push({message:"Failed parsing: "+e.message,internal:e.message}),{errors:n,transactions:[]}}return{errors:n,transactions:r}}(e,t);case".ofx":case".qfx":return async function(e){let t=await r.e("xfo").then(r.t.bind(null,488,7)),n=t.getOFXTransactions,o=t.initModule;await o();let a,u=[],c=await i.a.readFile(e);try{a=n(c)}catch(e){return u.push({message:"Failed importing file",internal:e.stack}),{errors:u}}return{errors:u,transactions:a.map(e=>({amount:e.amount,imported_id:e.fi_id,date:e.date?Object(s.f)(1e3*e.date):null,payee_name:e.name,imported_payee:e.name,notes:e.memo||null}))}}(e)}}return n.push({message:"Invalid file type",internal:""}),{errors:n}}},function(e,t,r){"use strict";var n=r(177),i=r.n(n),o=r(74),a=r(47),s=r(56),u=r(1),c=r(8),l=r(17),f=r(26),d=(r(58),r(33),r(2)),h=r(25),p=r(21),g=r(29),m=r(41),y=r(6),b=r(14),_=r(93),w=r(7),v=r(24),E=r(40),S=r(133),O=r(127),T=r(249),A=r(132),M=r(128),D=r(34),I=r(250),j=r(12),R=r(38);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 k(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){C(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 C(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const L=r(42);function x(e){return new _.a({rrules:Object(m.e)(e)}).occurrences({take:3}).toArray().map(e=>e.date)}async function P(e,t){return(await Object(f.b)(Object(h.b)("transactions").filter({account:t,schedule:null,"payee.transfer_acct":null,$and:[{date:{$gte:S.a(e,2)}},{date:{$lte:a.a(e,2)}}]}).select("*").options({splits:"none"}))).data}function B(e,t){return 1/(Math.abs(O.a(Object(d.l)(e),Object(d.l)(t)))+1)}function U(e,t,r=.5){let n=(e=[...e].reverse())[0],i=e.slice(1),o=[];for(let r of n.transactions){let a=Object(R.b)(r.amount),s=r.payee,u=(r.account,i.map(e=>{let t=e.transactions.find(e=>e.amount>=r.amount-a&&e.amount<=r.amount+a);return t=t&&t.payee===s?t:null,t?{trans:t,rank:B(e.date,t.date)}:null}));if(-1!==u.indexOf(null))continue;let c=u.reduce((e,t)=>e+t.rank,B(n.date,r.date)),l=u.reduce((e,t)=>e&&t.trans.amount===r.amount,!0);o.push({rank:c,amount:r.amount,account:r.account,payee:r.payee,date:t,exactDate:c===e.length,exactAmount:l})}return o}async function F(e,t,r,n,i){let o=[];for(let s=0;s<t;s++){let t,u=a.a(e,s);if("function"==typeof r){if(t=r(u),!1===t)continue}else t=k(k({},r),{},{start:u});t.start=Object(d.f)(t.start);let c=[],l=x(t);for(let e of l)c.push({date:Object(d.f)(e),transactions:await P(e,n)});o=o.concat(U(c,t,i))}return o}async function W(e,t){return F(T.a(Object(d.l)(e),4),14,{frequency:"weekly"},t)}async function H(e,t){return F(T.a(Object(d.l)(e),7),14,{frequency:"weekly",interval:2},t)}async function z(e,t){return F(A.a(Object(d.l)(e),4),62,e=>!(M.a(e)>28)&&{start:e,frequency:"monthly"},t)}async function q(e,t){let r=await F(A.a(Object(d.l)(e),3),1,{frequency:"monthly",patterns:[{type:"day",value:-1}]},t,.75),n=await F(A.a(Object(d.l)(e),4),1,{frequency:"monthly",patterns:[{type:"day",value:-1}]},t,.75);return r.concat(n)}async function V(e,t){return F(T.a(Object(d.l)(e),8),14,e=>{let t=D.a(new Date,"iiii").slice(0,2).toUpperCase();return{start:e,frequency:"monthly",patterns:[{type:t,value:1},{type:t,value:3}]}},t)}async function G(e,t){return F(A.a(Object(d.l)(e),8),14,e=>{let t=D.a(new Date,"iiii").slice(0,2).toUpperCase();return{start:e,frequency:"monthly",patterns:[{type:t,value:2},{type:t,value:4}]}},t)}async function Y(e){let t=e._conditions,r=t.find(e=>"date"===e.field).value;for(;;){let e=r;switch(r=k({},e),r.frequency){case"weekly":r.start=Object(d.f)(T.a(Object(d.l)(r.start),r.interval||1));break;case"monthly":r.start=Object(d.f)(A.a(Object(d.l)(r.start),r.interval||1));break;case"yearly":r.start=Object(d.f)(I.a(Object(d.l)(r.start),r.interval||1));break;default:throw new Error("findStartDate: invalid frequency")}let n=t.map(e=>"date"===e.field?k(k({},e),{},{value:r}):e),i=Object(p.b)(n,{recurDateBounds:1}),o=i.filters;if(i.errors.length>0){r=null;break}if(0===(await Object(f.b)(Object(h.b)("transactions").filter({$and:o}).select("*"))).data.length){r=e;break}}return r?k(k({},e),{},{date:r,_conditions:t.map(e=>"date"===e.field?k(k({},e),{},{value:r}):e)}):e}const $=["type"];function K(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function Z(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 X(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Z(Object(r),!0).forEach((function(t){J(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Z(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function J(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Q=r(52),ee=r(42);function te(e,t=new Date){t=o.a(t);let r=new g.b(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){let t=e[0].date;return Object(d.f)(t)}}return null}async function re(e){if(null==e)throw new Error("Schedule not attached to a rule");let t=(await Object(f.b)(Object(h.b)("schedules").filter({id:e}).calculate("rule"))).data;return Object(p.d)().find(e=>e.id===t)}async function ne({id:e,start:t,conditions:r,reset:n}){if(null==r){let t=await re(e);if(null==t)throw new Error("No rule found for schedule");r=t.serialize().conditions}let i=Object(m.a)(r).date,o=(await Object(f.b)(Object(h.b)("schedules").filter({id:e}).calculate("next_date"))).data;if(i){let r=te(i,t?t(o):new Date);if(r!==o){let t=await u.first("SELECT id, base_next_date_ts FROM schedules_next_date WHERE schedule_id = ?",[e]);await u.update("schedules_next_date",n?{id:t.id,base_next_date:Object(l.h)(r),base_next_date_ts:Date.now()}:{id:t.id,local_next_date:Object(l.h)(r),local_next_date_ts:t.base_next_date_ts})}}}async function ie({schedule:e,conditions:t,resetNextDate:r}){if(e.rule)throw new Error("You cannot change the rule of a schedule");let n;if(t){let r=Object(m.a)(t).date;if(r&&null==r.value)throw new Error("Date is required");n=await re(e.id),null==n&&(n=await async function(e){let t=(await Object(f.b)(Object(h.b)("schedules").filter({id:e}).calculate("rule"))).data;t&&await u.delete_("rules",t);let r=await Object(p.f)({stage:null,conditions:[{op:"isapprox",field:"date",value:Object(d.d)()},{op:"isapprox",field:"amount",value:0}],actions:[{op:"link-schedule",value:e}]});return await u.updateWithSchema("schedules",{id:e,rule:r}),Object(p.d)().find(e=>e.id===r)}(e.id))}await Object(w.c)(async()=>{if(t){let o=n.serialize().conditions,a=function(e,t){let r=Object(m.a)(e),n=Object(m.a)(t),i=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)),o=e.map(e=>{let t=i.find(t=>e===t[0]);return t&&t[1]?t[1]:e}),a=i.filter(e=>null==e[0]&&null!=e[1]).map(e=>e[1]);return o.concat(a)}(o,t);await Object(p.n)({id:n.id,conditions:a});let s=e=>{e.type;return K(e,$)};!r&&i()(o.find(e=>"account"===e.field),o.find(e=>"account"===e.field))&&i()(s(o.find(e=>"date"===e.field)),s(a.find(e=>"date"===e.field)))||await ne({id:e.id,conditions:a,reset:!0})}else r&&await ne({id:e.id,reset:!0});await u.updateWithSchema("schedules",e)})}function oe(e){let t=e instanceof g.c?e.serialize():p.j.toJS(e),r=t.actions,n=t.conditions;if(r&&r.find(e=>"link-schedule"===e.op)){let e=r.find(e=>"link-schedule"===e.op).value;if(e){let t=Object(m.a)(n),r=n.findIndex(e=>e===t.payee),i=n.findIndex(e=>e===t.account),o=n.findIndex(e=>e===t.amount),a=n.findIndex(e=>e===t.date);u.runQuery("INSERT OR REPLACE INTO schedules_json_paths (schedule_id, payee, account, amount, date) VALUES (?, ?, ?, ?, ?)",[e,-1===r?null:`$[${r}]`,-1===i?null:`$[${i}]`,-1===o?null:`$[${o}]`,-1===a?null:`$[${a}]`])}}}function ae(e,t){let r=!1;t.forEach((e,t)=>{"rules"===t&&(r=!0,e.forEach(e=>{oe(e)}))})}async function se({id:e}){let t=(await Object(f.b)(Object(h.b)("schedules").filter({id:e}).select("*"))).data[0];if(null==t||null==t._account)return;let r={payee:t._payee,account:t._account,amount:Object(m.c)(t._amount),date:t.next_date,schedule:t.id,cleared:!1};r.account&&await Object(E.a)(r.account,[r])}async function ue(e){let t=(await Object(f.b)(Object(h.b)("schedules").filter({completed:!1,"_account.closed":!1}).select("*"))).data,r=(await Object(f.b)(Object(m.b)(t))).data,n=new Set(r.filter(Boolean).map(e=>e.schedule)),i=[],o=!1;for(let r of t){let t=Object(m.d)(r.next_date,r.completed,n.has(r.id));if("paid"===t){if(r._date)if(r._date.frequency)try{await ne({id:r.id})}catch(e){}else r._date<Object(d.d)()&&await ie({schedule:{id:r.id,completed:!0}})}else("due"===t||"missed"===t)&&r.posts_transaction&&r._account&&(e?(await se({id:r.id}),o=!0):i.push(r._payee))}i.length>0?Q.send("schedules-offline",{payees:i}):o&&Q.send("sync-event",{type:"success",tables:["transactions"],syncDisabled:"false"})}let ce=Object(s.a)();ce.method("schedule/create",Object(y.mutator)(Object(b.e)((async function({schedule:e,conditions:t=[]}={}){let r=e&&e.id||ee.v4Sync(),n=Object(m.a)(t).date;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 i,o=te(n),a=o?Object(l.h)(o):null;i=await Object(p.f)({stage:null,conditions:t,actions:[{op:"link-schedule",value:r}]});let s=Date.now();return await u.insertWithUUID("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 u.insertWithSchema("schedules",X(X({},e),{},{id:r,rule:i})),r})))),ce.method("schedule/update",Object(y.mutator)(Object(b.e)(ie))),ce.method("schedule/delete",Object(y.mutator)(Object(b.e)((async function({id:e}){let t=(await Object(f.b)(Object(h.b)("schedules").filter({id:e}).calculate("rule"))).data;await Object(w.c)(async()=>{await u.delete_("rules",t),await u.delete_("schedules",e)})})))),ce.method("schedule/skip-next-date",Object(y.mutator)(Object(b.e)((async function({id:e}){return ne({id:e,start:e=>a.a(Object(d.l)(e),1)})})))),ce.method("schedule/post-transaction",Object(y.mutator)(Object(b.e)(se))),ce.method("schedule/force-run-service",Object(y.mutator)(()=>ue(!0))),ce.method("schedule/get-possible-transactions",(function({schedule:e}){})),ce.method("schedule/discover",(function(){return async function(){let e=(await Object(f.b)(Object(h.b)("accounts").filter({closed:!1}).select("*"))).data,t=[];for(let r of e){let e=await u.first("SELECT * FROM v_transactions WHERE account = ? AND parent_id IS NULL ORDER BY date DESC LIMIT 1",[r.id]);if(e){let n=Object(l.d)(e.date);t=t.concat(await W(n,r.id),await H(n,r.id),await z(n,r.id),await q(n,r.id),await V(n,r.id),await G(n,r.id))}}let r=[...Object(j.h)(t,"payee").entries()].map(([e,t])=>{t.sort((e,t)=>t.rank-e.rank);let r=t[0];return{id:L.v4Sync(),account:r.account,payee:r.payee,date:r.date,amount:r.amount,_conditions:[{op:"is",field:"account",value:r.account},{op:"is",field:"payee",value:r.payee},{op:r.exactDate?"is":"isapprox",field:"date",value:r.date},{op:r.exactAmount?"is":"isapprox",field:"amount",value:r.amount}]}}),n=[];for(let e of r)n.push(await Y(e));return n}()})),ce.method("schedule/get-upcoming-dates",(async function({config:e,count:t}){let r=Object(m.e)(e);try{return new _.a({rrules:r}).occurrences({start:o.a(new Date),take:t}).toArray().map(e=>Object(d.f)(e.date))}catch(t){throw Object(v.captureBreadcrumb)(e),t}})),ce.service((function(){return u.transaction(()=>{Object(p.d)().forEach(e=>{oe(e)})}),Object(w.a)(ae)})),ce.events.on("sync",({type:e,subtype:t})=>{if(("success"===e||"error"===e||"unauthorized"===e)&&c.b()){c.b().lastScheduleRun!==Object(d.d)()&&(Object(y.runMutator)(()=>ue("success"===e)),c.d({lastScheduleRun:Object(d.d)()}))}});t.a=ce},function(e,t,r){"use strict";r.r(t),function(e,n,i){r.d(t,"handlers",(function(){return ye})),r.d(t,"initApp",(function(){return Ee})),r.d(t,"init",(function(){return Se})),r.d(t,"lib",(function(){return Oe}));r(288);var o=r(9),a=r.n(o),s=r(24),u=r(8),c=r(4),l=r.n(c),f=r(15),d=r(69),h=r(43),p=r(1),g=r(5),m=r(14),y=r(170),b=r(29),_=r(21),w=r(110),v=r(68),E=r(38),S=r(95),O=r(12),T=r(2),A=r(134),M=r(61),D=r(40),I=r(138),j=r(174),R=r(6),N=r(13),k=r(75),C=r(7),L=r(276),x=r(135),P=r(283),B=r(175),U=r(20),F=r(278),W=r(169),H=r.n(W),z=r(37),q=r(31),V=r(96),G=r(30),Y=r(18),$=r(279),K=r(26),Z=r(25),X=r(28),J=r(284),Q=r(280),ee=r(281),te=r(282);function re(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,i,o=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==r.return||r.return()}finally{if(s)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return ne(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ne(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ne(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function ie(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 oe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ie(Object(r),!0).forEach((function(t){ae(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ie(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ae(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const se=r(469),ue=r(484),ce=r(42),le=r(52),fe=r(49),de=fe.resolveName,he=fe.unresolveName,pe=r(163);let ge;function me({names:e}){const t=e.map(e=>{let t=g.b()._getNode(e);return{name:t.name,value:t.value}});le.send("cells-changed",t)}let ye={};function be(e){function t(e,t){let r=e.map(e=>{try{t(e)}catch(e){if(e instanceof Y.RuleError)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 b.b(e.op,e.field,e.value,e.options,E.a)),n=t(e.actions,e=>new b.a(e.op,e.field,e.value,e.options,E.a));return r||n?{conditionErrors:r,actionErrors:n}:null}ye.undo=Object(R.mutator)((async function(){return Object(m.d)()})),ye.redo=Object(R.mutator)((function(){return Object(m.c)()})),ye["transactions-batch-update"]=Object(R.mutator)((async function({added:e,deleted:t,updated:r,learnCategories:n}){return Object(m.f)(async()=>(await Object(v.a)({added:e,updated:r,deleted:t,learnCategories:n})).updated)})),ye["transaction-add"]=Object(R.mutator)((async function(e){return await ye["transactions-batch-update"]({added:[e]}),{}})),ye["transaction-update"]=Object(R.mutator)((async function(e){return await ye["transactions-batch-update"]({updated:[e]}),{}})),ye["transaction-delete"]=Object(R.mutator)((async function(e){return await ye["transactions-batch-update"]({deleted:[e]}),{}})),ye["transactions-filter"]=async function({term:e,accountId:t,latestDate:r,count:n,notPaged:i,options:o={}}){return p.getTransactions(e,t,r,i?null:null==n?void 0:n,o)},ye["transactions-parse-file"]=async function({filepath:e,options:t}){return Object(P.a)(e,t)},ye["transactions-export"]=async function({transactions:e,accounts:t,categoryGroups:r,payees:n}){return Object(B.b)(e,t,r,n)},ye["transactions-export-query"]=async function({query:e}){return Object(B.a)(new Z.a(e))},ye["get-categories"]=async function(){return{grouped:await p.getCategoriesGrouped(),list:await p.getCategories()}},ye["get-earliest-transaction"]=async function(){return(await Object(K.b)(Object(Z.b)("transactions").options({splits:"none"}).orderBy({date:"asc"}).select("*").limit(1))).data[0]||null},ye["get-budget-bounds"]=async function(){return M.a()},ye["rollover-budget-month"]=async function({month:e}){let t=await p.getCategoriesGrouped(),r=T.p(e);function n(e){let t=g.d(r,e);return{value:""===t?0:t,name:de(r,e)}}let i=[n("available-funds"),n("last-month-overspent"),n("buffered"),n("total-budgeted"),n("to-budget"),n("from-last-month"),n("total-income"),n("total-spent"),n("total-leftover")];for(let e of t)if(e.is_income){i.push(n("total-income"));for(let t of e.categories)i.push(n("sum-amount-"+t.id))}else{i=i.concat([n("group-budget-"+e.id),n("group-sum-amount-"+e.id),n("group-leftover-"+e.id)]);for(let t of e.categories)i=i.concat([n("budget-"+t.id),n("sum-amount-"+t.id),n("leftover-"+t.id),n("carryover-"+t.id)])}return i},ye["report-budget-month"]=async function({month:e}){let t=await p.getCategoriesGrouped(),r=T.p(e);function n(e){let t=g.d(r,e);return{value:""===t?0:t,name:de(r,e)}}let i=[n("total-budgeted"),n("total-budget-income"),n("total-saved"),n("total-income"),n("total-spent"),n("real-saved"),n("total-leftover")];for(let e of t){i=i.concat([n("group-budget-"+e.id),n("group-sum-amount-"+e.id),n("group-leftover-"+e.id)]);for(let t of e.categories)i=i.concat([n("budget-"+t.id),n("sum-amount-"+t.id),n("leftover-"+t.id)]),e.is_income||i.push(n("carryover-"+t.id))}return i},ye["budget-set-type"]=async function({type:e}){if("rollover"!==e&&"report"!==e)throw new Error("Invalid budget type: "+e);if(e!==u.b().budgetType)return u.d({budgetType:e})},ye["category-create"]=Object(R.mutator)((async function({name:e,groupId:t,isIncome:r}){return Object(m.f)(async()=>{if(!t)throw Object(Y.APIError)("Creating a category: groupId is required");return p.insertCategory({name:e,cat_group:t,is_income:r?1:0})})})),ye["category-update"]=Object(R.mutator)((async function(e){return Object(m.f)(async()=>{try{await p.updateCategory(e)}catch(e){if(e.message.toLowerCase().includes("unique constraint"))return{error:{type:"category-exists"}};throw e}return{}})})),ye["category-move"]=Object(R.mutator)((async function({id:e,groupId:t,targetId:r}){return Object(m.f)(async()=>(await Object(C.c)(async()=>{await p.moveCategory(e,t,r)}),"ok"))})),ye["category-delete"]=Object(R.mutator)((async function({id:e,transferId:t}){return Object(m.f)(async()=>{let r={};return await Object(C.c)(async()=>{let n=await p.first("SELECT is_income FROM categories WHERE id = ?",[e]);if(!n)return void(r={error:"no-categories"});let i=t&&await p.first("SELECT is_income FROM categories WHERE id = ?",[t]);!n||t&&!i?r={error:"no-categories"}:t&&n.is_income!==i.is_income?r={error:"category-type"}:(0===n.is_income&&t&&await M.b([e],t),await p.deleteCategory({id:e},t))}),r})})),ye["category-group-create"]=Object(R.mutator)((async function({name:e,isIncome:t}){return Object(m.f)(async()=>p.insertCategoryGroup({name:e,is_income:t?1:0}))})),ye["category-group-update"]=Object(R.mutator)((async function(e){return Object(m.f)(async()=>p.updateCategoryGroup(e))})),ye["category-group-move"]=Object(R.mutator)((async function({id:e,targetId:t}){return Object(m.f)(async()=>(await Object(C.c)(async()=>{await p.moveCategoryGroup(e,t)}),"ok"))})),ye["category-group-delete"]=Object(R.mutator)((async function({id:e,transferId:t}){return Object(m.f)(async()=>{const r=await p.all("SELECT id FROM categories WHERE cat_group = ? AND tombstone = 0",[e]);return Object(C.c)(async()=>{t&&await M.b(r.map(e=>e.id),t),await p.deleteCategoryGroup({id:e},t)})})})),ye["must-category-transfer"]=async function({id:e}){return 0!==(await p.runQuery("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",[e],!0))[0].count||[...g.b().meta().createdMonths].some(t=>{const r=T.p(t);return 0!==g.b().getCellValue(r,"budget-"+e)})},ye["payee-create"]=Object(R.mutator)((async function({name:e}){return Object(m.f)(async()=>p.insertPayee({name:e}))})),ye["payees-get"]=async function(){return p.getPayees()},ye["payees-get-rule-counts"]=async function(){let e={};_.d();return _.g(_.d(),"payee",(t,r)=>{null==e[r]&&(e[r]=0),e[r]++}),e},ye["payees-merge"]=Object(R.mutator)((async function({targetId:e,mergeIds:t}){return Object(m.f)(async()=>p.mergePayees(e,t),{targetId:e,mergeIds:t})})),ye["payees-batch-change"]=Object(R.mutator)((async function({added:e,deleted:t,updated:r}){return Object(m.f)(async()=>Object(C.c)(async()=>{t&&await Promise.all(t.map(e=>p.deletePayee(e))),e&&await Promise.all(e.map(e=>p.insertPayee(e))),r&&await Promise.all(r.map(e=>p.updatePayee(e)))}))})),ye["payees-check-orphaned"]=async function({ids:e}){let t=new Set(await p.getOrphanedPayees());return e.filter(e=>t.has(e))},ye["payees-get-rules"]=async function({id:e}){return _.e(e).map(e=>e.serialize())},ye["payees-delete-rule"]=Object(R.mutator)((async function({id:e,payee_id:t}){return Object(m.f)(async()=>await p.deletePayeeRule({id:e}),{payeeId:t})})),ye["payees-update-rule"]=Object(R.mutator)((async function(e){return Object(m.f)(async()=>await p.updatePayeeRule(e),{payeeId:e.payee_id})})),ye["payees-add-rule"]=Object(R.mutator)((async function(e){return Object(m.f)(async()=>{let t=await p.insertPayeeRule(e);return oe(oe({},e),{},{id:t})},{payeeId:e.payee_id})})),ye["rule-validate"]=async function(e){return{error:be(e)}},ye["rule-add"]=Object(R.mutator)((async function(e){let t=be(e);return t?{error:t}:{id:await _.f(e)}})),ye["rule-update"]=Object(R.mutator)((async function(e){let t=be(e);return t?{error:t}:(await _.n(e),{})})),ye["rule-delete"]=Object(R.mutator)((async function(e){return _.c(e)})),ye["rule-delete-all"]=Object(R.mutator)((async function(e){let t=!1;return await Object(C.c)(async()=>{for(let r of e){!1===await _.c({id:r})&&(t=!0)}}),{someDeletionsFailed:t}})),ye["rule-apply-actions"]=Object(R.mutator)((async function({transactionIds:e,actions:t}){return _.a(e,t,ye)})),ye["rule-add-payee-rename"]=Object(R.mutator)((async function({fromNames:e,to:t}){return _.m(e,t)})),ye["rules-get"]=async function(){return Object(b.g)(_.d()).map(e=>e.serialize())},ye["rule-get"]=async function({id:e}){let t=_.d().find(t=>t.id===e);return t?t.serialize():null},ye["rules-run"]=async function({transaction:e}){return _.k(e)},ye["rules-migrate"]=async function(){await _.i()},ye["make-filters-from-conditions"]=async function({conditions:e}){return _.b(e)},ye.getCell=async function({sheetName:e,name:t}){let r=["name","value"],n=g.b()._getNode(de(e,t));if(r){let e={};return r.forEach(t=>{e[t]="run"===t?n._run?n._run.toString():null:n[t]}),e}return n},ye.getCells=async function({names:e}){return e.map(e=>({value:g.b()._getNode(e).value}))},ye.getCellNamesInSheet=async function({sheetName:e}){let t=[];for(let r of g.b().getNodes().keys()){let n=he(r),i=n.sheet,o=n.name;i===e&&t.push(o)}return t},ye.debugCell=async function({sheetName:e,name:t}){let r=g.b().getNode(de(e,t));return oe(oe({},r),{},{_run:r._run&&r._run.toString()})},ye["create-query"]=async function({sheetName:e,name:t,query:r}){return g.b().createQuery(e,t,r),"ok"},ye.query=async function(e){if(null==e.table)throw new Error("query has no table, did you forgot to call `.serialize`?");return Object(K.b)(e)},ye["bank-delete"]=async function({id:e}){const t=await p.runQuery("SELECT * FROM accounts WHERE bank = ?",[e],!0);return await p.delete_("banks",e),await Promise.all(t.map(async e=>{await p.runQuery("DELETE FROM transactions WHERE acct = ?",[e.id]),await p.delete_("accounts",e.id)})),"ok"},ye["account-update"]=Object(R.mutator)((async function({id:e,name:t}){return Object(m.f)(async()=>(await p.update("accounts",{id:e,name:t}),{}))})),ye["accounts-get"]=async function(){return p.getAccounts()},ye["account-properties"]=async function({id:e}){return{balance:(await p.first("SELECT sum(amount) as balance FROM transactions WHERE acct = ? AND isParent = 0 AND tombstone = 0",[e])).balance||0,numTransactions:(await p.first("SELECT count(id) as count FROM transactions WHERE acct = ? AND tombstone = 0",[e])).count}},ye["accounts-link"]=async function({institution:e,publicToken:t,accountId:r,upgradingId:n}){let i=await I.b(e,t),o=re(await a.a.multiGet(["user-id","user-key"]),2),s=re(o[0],2)[1],u=re(o[1],2)[1],c=(await D.b(s,u,i)).find(e=>e.account_id===r);return await p.update("accounts",{id:n,account_id:c.account_id,official_name:c.official_name,type:Object(A.a)(c.type),balance_current:Object(O.a)(c.balances.current),balance_available:Object(O.a)(c.balances.available),balance_limit:Object(O.a)(c.balances.limit),mask:c.mask,bank:i}),await D.d(s,u,n,c.account_id,i),le.send("sync-event",{type:"success",tables:["transactions"]}),"ok"},ye["accounts-connect"]=async function({institution:e,publicToken:t,accountIds:r,offbudgetIds:n}){let i=await I.b(e,t);return await I.a(i,r,n)},ye["account-create"]=Object(R.mutator)((async function({name:e,type:t,balance:r,offBudget:n,closed:i}){return Object(m.f)(async()=>{const o=await p.insertAccount({name:e,type:t,offbudget:n?1:0,closed:i?1:0});if(await p.insertPayee({name:"",transfer_acct:o}),null!=r){let e=await Object(x.a)();await p.insertTransaction({account:o,amount:Object(O.a)(r),category:n?null:e.category,payee:e.id,date:T.d(),cleared:!0,starting_balance_flag:!0})}return o})})),ye["account-close"]=Object(R.mutator)((async function({id:e,transferAccountId:t,categoryId:r,forced:n}){return await ye["account-unlink"]({id:e}),Object(m.f)(async()=>{let i=await p.first("SELECT * FROM accounts WHERE id = ? AND tombstone = 0",[e]);if(!i||1===i.closed)return;const o=await ye["account-properties"]({id:e}),a=o.balance;if(0===o.numTransactions)await p.deleteAccount({id:e});else if(n){let t=await p.runQuery("SELECT id, transfer_id FROM v_transactions WHERE account = ?",[e],!0),r=(await p.first("SELECT id FROM payees WHERE transfer_acct = ?",[e])).id;await Object(C.c)(()=>{t.forEach(e=>{e.transfer_id&&p.updateTransaction({id:e.transfer_id,payee:null,transfer_id:null}),p.deleteTransaction({id:e.id})}),p.deleteAccount({id:e}),p.deleteTransferPayee({id:r})})}else{if(0!==a&&null==t)throw Object(Y.APIError)("balance is non-zero: transferAccountId is required");if(await p.update("accounts",{id:e,closed:1}),0!==a){let n=(await p.first("SELECT id FROM payees WHERE transfer_acct = ?",[t])).id;await ye["transaction-add"]({id:ce.v4Sync(),payee:n,amount:-a,account:e,date:T.d(),notes:"Closing account",category:r||null})}}})})),ye["account-reopen"]=Object(R.mutator)((async function({id:e}){return Object(m.f)(async()=>{await p.update("accounts",{id:e,closed:0})})})),ye["account-move"]=Object(R.mutator)((async function({id:e,targetId:t}){return Object(m.f)(async()=>{await p.moveAccount(e,t)})}));let _e=!1;async function we(e,t,{showUpdate:r}={}){let n;try{n=l.a.getBudgetDir(e)}catch(e){return Object(s.captureException)(new Error("`getBudgetDir` failed in `loadBudget`: "+e.message)),{error:"budget-not-found"}}if(Object(s.captureBreadcrumb)({message:"Loading budget "+n}),!await l.a.exists(n))return Object(s.captureException)(new Error("budget directory does not exist")),{error:"budget-not-found"};try{await u.c(e),await p.openDatabase(e)}catch(t){return Object(s.captureBreadcrumb)({message:"Error loading budget "+e}),Object(s.captureException)(t),await ye["close-budget"](),{error:"opening-budget"}}if(!u.b().userId){let e=re(await a.a.multiGet(["user-token"]),1),t=re(e[0],2)[1];u.d({userId:t})}let o=u.b(),c=o.budgetVersion;o.budgetId;try{await Object(y.a)(c,r)}catch(t){let r;return console.warn("Error updating",t),t.message.includes("out-of-sync-migrations")?r={error:"out-of-sync-migrations"}:t.message.includes("out-of-sync-data")?r={error:"out-of-sync-data"}:(Object(s.captureException)(t),d.a.info("Error updating budget "+e,t),console.log("Error updating budget",t),r={error:"loading-budget"}),await ye["close-budget"](),r}await p.loadClock(),u.b().resetClock&&(N.getClock().timestamp.setNode(N.makeClientId()),await p.runQuery("INSERT OR REPLACE INTO messages_clock (id, clock) VALUES (1, ?)",[N.serializeClock(N.getClock())]),await u.d({resetClock:!1})),h.a.isWeb||h.a.isMobile||i.__TESTING__||Object(S.d)(e);try{await g.e(p,me)}catch(e){return Object(s.captureException)(e),await ye["close-budget"](),{error:"opening-budget"}}return g.b().meta().budgetType=u.b().budgetType,await M.a(),await w.b(),await _.h(),await L.a(),await X.a.startServices(),Object(m.b)(),i.__TESTING__||("_demo-budget"===e?Object(C.k)("disabled"):"_test-budget"===e?await a.a.setItem("lastBudget",e):(Object(C.k)("enabled"),await a.a.setItem("lastBudget",e),h.a.isMobile||await z.e())),X.a.events.emit("load-budget",{id:e}),{}}function ve(){return h.a.isMobile?"/documents":l.a.join("/documents","Actual")}async function Ee(t,r,n){ge=t,await f.init(),await Promise.all([a.a.init(),l.a.init()]),await V.a(),await async function(){async function e(e){await l.a.exists(e)||await l.a.mkdir(e)}let t=await a.a.getItem("document-dir");if(t)try{await e(t)}catch(e){t=null}t||(t=ve()),await e(t),l.a._setDocumentDir(t)}();let o=await a.a.getItem("encrypt-keys");if(o)try{let e=JSON.parse(o);await Promise.all(Object.keys(e).map(t=>q.a.loadKey(e[t])))}catch(e){throw console.log("Error loading key",e),new Error("load-key-error")}if(r){await a.a.getItem("lastBudget")}const s=await a.a.getItem("server-url");if(s&&Object(U.b)(s),le.init(n,X.a.handlers),V.c("app:init",{platform:h.a.isMobile?"mobile":h.a.isWeb?"web":"desktop"}),!r&&!h.a.isMobile&&!h.a.isWeb){let t=await a.a.getItem("auto-update");e.send({type:"shouldAutoUpdate",flag:null==t||"true"===t})}r&&(i.$send=(e,t)=>Object(R.runHandler)(X.a.handlers[e],t),i.$query=K.b,i.$q=Z.b,i.$db=p,i.$setSyncingMode=C.k)}async function Se({budgetId:t,config:r}){let n,i;return ge=ACTUAL_APP_VERSION,r?(n=r.dataDir,i=r.serverURL):(n="/",i=e.env.ACTUAL_SERVER_URL),await f.init(),await Promise.all([a.a.init({persist:!1}),l.a.init()]),l.a._setDocumentDir(n||e.cwd()),i?Object(U.b)(i):(Object(U.b)(null),X.a.events.on("load-budget",()=>{Object(C.k)("offline")})),t&&await Object(R.runHandler)(ye["load-budget"],{id:t}),Oe}ye["poll-web-token"]=async function({token:e}){let t=re(await a.a.multiGet(["user-id","user-key"]),2),r=re(t[0],2)[1],n=re(t[1],2)[1],i=Date.now();return _e=!1,new Promise(t=>{!async function t(o){if(_e)return;if(Date.now()-i>=6e5)return void o("timeout");let a=await Object(G.post)(Object(U.a)().PLAID_SERVER+"/get-web-token-contents",{userId:r,key:n,token:e});a?a.error?o("unknown"):o(null,a):setTimeout(()=>t(o),3e3)}((e,r)=>{t(e?{error:e}:{data:r})})})},ye["poll-web-token-stop"]=async function(){return _e=!0,"ok"},ye["accounts-sync"]=async function({id:e}){let t=re(await a.a.multiGet(["user-id","user-key"]),2),r=re(t[0],2)[1],n=re(t[1],2)[1],i=await p.runQuery("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);e&&(i=i.filter(t=>t.id===e));let o=[],c=[],l=[],f=[];u.b().groupId;for(var d=0;d<i.length;d++){const e=i[d];if(e.bankId)try{const t=await D.d(r,n,e.id,e.account_id,e.bankId);let i=t.added,o=t.updated;c=c.concat(i),l=l.concat(o),(i.length>0||o.length>0)&&(f=f.concat(e.id))}catch(t){"BankSyncError"===t.type?o.push({type:"SyncError",accountId:e.id,message:'Failed syncing account "'+e.name+'".',category:t.category,code:t.code}):t instanceof Y.PostError&&"internal"!==t.reason?o.push({accountId:e.id,message:`Account "${e.name}" is not linked properly. Please link it again`}):(o.push({accountId:e.id,message:"There was an internal error. Please email help@actualbudget.com for support.",internal:t.stack}),t.message="Failed syncing account: "+t.message,Object(s.captureException)(t))}}return f.length>0&&le.send("sync-event",{type:"success",tables:["transactions"]}),{errors:o,newTransactions:c,matchedTransactions:l,updatedAccounts:f}},ye["transactions-import"]=Object(R.mutator)((function({accountId:e,transactions:t}){return Object(m.f)(async()=>{if("string"!=typeof e)throw Object(Y.APIError)("transactions-import: accountId must be an id");try{return await D.c(e,t)}catch(e){if(e instanceof Y.TransactionError)return{errors:[{message:e.message}],added:[],updated:[]};throw e}})})),ye["account-unlink"]=Object(R.mutator)((async function({id:e}){let t=(await p.first("SELECT bank FROM accounts WHERE id = ?",[e])).bank;if(!t)return"ok";if(await p.updateAccount({id:e,account_id:null,bank:null,balance_current:null,balance_available:null,balance_limit:null}),0===(await p.first("SELECT COUNT(*) as count FROM accounts WHERE bank = ?",[t])).count){let e=re(await a.a.multiGet(["user-id","user-key"]),2),r=re(e[0],2)[1],n=re(e[1],2)[1];await Object(G.post)(Object(U.a)().PLAID_SERVER+"/remove-access-token",{userId:r,key:n,item_id:t})}return"ok"})),ye["make-plaid-public-token"]=async function({bankId:e}){let t=re(await a.a.multiGet(["user-id","user-key"]),2),r=re(t[0],2)[1],n=re(t[1],2)[1],i=await Object(G.post)(Object(U.a)().PLAID_SERVER+"/make-public-token",{userId:r,key:n,item_id:""+e});return i.error_code?{error:"",code:i.error_code,type:i.error_type}:{linkToken:i.link_token}},ye["save-global-prefs"]=async function(t){return"maxMonths"in t&&await a.a.setItem("max-months",""+t.maxMonths),"trackUsage"in t&&(V.b(t.trackUsage),await a.a.setItem("track-usage",""+t.trackUsage)),"autoUpdate"in t&&(await a.a.setItem("auto-update",""+t.autoUpdate),e.send({type:"shouldAutoUpdate",flag:t.autoUpdate})),"documentDir"in t&&await l.a.exists(t.documentDir)&&await a.a.setItem("document-dir",t.documentDir),"floatingSidebar"in t&&await a.a.setItem("floating-sidebar",""+t.floatingSidebar),"ok"},ye["load-global-prefs"]=async function(){let e=re(await a.a.multiGet(["floating-sidebar","seen-tutorial","max-months","track-usage","auto-update","document-dir","encrypt-key"]),7),t=re(e[0],2)[1],r=re(e[1],2)[1],n=re(e[2],2)[1],i=re(e[3],2)[1],o=re(e[4],2)[1],s=re(e[5],2)[1],u=re(e[6],2)[1];return{floatingSidebar:"true"===t,seenTutorial:"true"===r,maxMonths:Object(O.p)(n||""),trackUsage:null==i||"true"===i,autoUpdate:null==o||"true"===o,documentDir:s||ve(),keyId:u&&JSON.parse(u).id}},ye["save-prefs"]=async function(e){let t=u.b().cloudFileId;if(e.budgetName&&t){let r=await a.a.getItem("user-token");await Object(G.post)(Object(U.a)().SYNC_SERVER+"/update-user-filename",{token:r,fileId:t,name:e.budgetName})}return await u.d(e),"ok"},ye["load-prefs"]=async function(){return u.b()},ye["sync-reset"]=async function(){return await Object(C.i)()},ye["sync-repair"]=async function(){await Object(C.h)()},ye["key-make"]=async function({password:e}){if(!u.b())throw new Error("user-set-key must be called with file loaded");u.b().cloudFileId;let t=q.a.randomBytes(32).toString("base64"),r=ce.v4Sync(),n=await q.a.createKey({id:r,password:e,salt:t});await q.a.loadKey(n);let i=await Object(C.g)(n.getId());return await Object(C.i)({key:n,salt:t,testContent:JSON.stringify(oe(oe({},i),{},{value:i.value.toString("base64")}))})},ye["key-test"]=async function({fileId:e,password:t}){let r,i=await a.a.getItem("user-token");null==e&&(e=u.b().cloudFileId);try{r=await Object(G.post)(Object(U.a)().SYNC_SERVER+"/user-get-key",{token:i,fileId:e})}catch(e){return console.log(e),{error:{reason:"network"}}}let o=r,s=o.id,c=o.salt,l=o.test;if(null==l)return{error:{reason:"old-key-style"}};l=JSON.parse(l);let f=await q.a.createKey({id:s,password:t,salt:c});q.a.loadKey(f);try{await q.a.decrypt(n.from(l.value,"base64"),l.meta)}catch(e){return console.log(e),q.a.unloadKey(f),{error:{reason:"decrypt-failure"}}}let d=JSON.parse(await a.a.getItem("encrypt-keys")||"{}");return d[e]=f.serialize(),await a.a.setItem("encrypt-keys",JSON.stringify(d)),u.b()&&await u.d({encryptKeyId:f.getId()}),{}},ye["should-pitch-subscribe"]=async function(){return"true"!==await a.a.getItem("seenSubscribe")},ye["has-pitched-subscribe"]=async function(){return await a.a.setItem("seenSubscribe","true"),"ok"},ye["subscribe-needs-bootstrap"]=async function({url:e}={}){let t;try{t=await Object(G.get)(Object(U.a)(e).SIGNUP_SERVER+"/needs-bootstrap")}catch(e){return{error:"network-failure"}}try{t=JSON.parse(t)}catch(e){return{error:"parse-failure"}}return"error"===t.status?{error:t.reason}:{bootstrapped:t.data.bootstrapped}},ye["subscribe-bootstrap"]=async function({password:e}){let t;try{t=await Object(G.post)(Object(U.a)().SIGNUP_SERVER+"/bootstrap",{password:e})}catch(e){return{error:e.reason||"network-failure"}}return t.token?(await a.a.setItem("user-token",t.token),{}):{error:"internal"}},ye["subscribe-set-user"]=async function({token:e}){await a.a.setItem("user-token",e)},ye["subscribe-get-user"]=async function(){let e=await a.a.getItem("user-token");if(e)try{let t=await Object(G.get)(Object(U.a)().SIGNUP_SERVER+"/validate",{headers:{"X-ACTUAL-TOKEN":e}});return t=JSON.parse(t),"error"===t.status?"unauthorized"===t.reason?null:{offline:!0}:{offline:!1}}catch(e){return console.log(e),{offline:!0}}return null},ye["subscribe-change-password"]=async function({password:e}){let t,r=await a.a.getItem("user-token");try{t=await Object(G.post)(Object(U.a)().SIGNUP_SERVER+"/change-password",{token:r,password:e})}catch(e){return{error:e.reason||"network-failure"}}return{}},ye["subscribe-sign-in"]=async function({password:e}){let t=await Object(G.post)(Object(U.a)().SIGNUP_SERVER+"/login",{password:e});return t.token?(await a.a.setItem("user-token",t.token),{}):{error:"invalid-password"}},ye["subscribe-sign-out"]=async function(){return q.a.unloadAllKeys(),await a.a.multiRemove(["user-token","encrypt-keys","lastBudget","readOnly"]),"ok"},ye["get-server-url"]=async function(){return Object(U.a)()&&Object(U.a)().BASE_SERVER},ye["set-server-url"]=async function({url:e}){let t=(await Object(R.runHandler)(ye["subscribe-needs-bootstrap"],{url:e})).error;return t?{error:t}:(a.a.setItem("server-url",e),Object(U.b)(e),{})},ye.sync=async function(){return Object(C.e)()},ye["get-version"]=async function(){return{version:ge}},ye["get-budgets"]=async function(){const e=await l.a.listDir(l.a.getDocumentDir());return(await Promise.all(e.map(async e=>{const t=l.a.join(l.a.getDocumentDir(),e,"metadata.json");if(await l.a.exists(t)){let r;try{r=JSON.parse(await l.a.readFile(t))}catch(e){return void console.log("Error parsing metadata:",e.stack)}if("_demo-budget"!==e)return{id:e,cloudFileId:r.cloudFileId,groupId:r.groupId,name:r.budgetName||"(no name)"}}return null}))).filter(e=>e)},ye["get-ynab4-files"]=async function(){return se.findBudgets()},ye["get-remote-files"]=async function(){return z.d()},ye["reset-budget-cache"]=Object(R.mutator)((async function(){await g.f(p),g.b().recomputeAll(),await g.j()})),ye["upload-budget"]=async function({id:e}={}){if(e){if(u.b())throw new Error("upload-budget: id given but prefs already loaded");await u.c(e)}try{await z.h()}catch(e){return console.log(e),"FileUploadError"===e.type?{error:e}:(Object(s.captureException)(e),{error:{reason:"internal"}})}finally{e&&u.e()}return{}},ye["download-budget"]=async function({fileId:e,replace:t}){let r;try{r=await z.b(e,t)}catch(e){if("FileDownloadError"===e.type){if("file-exists"===e.reason&&e.meta.id){await u.c(e.meta.id);let t=u.b().budgetName;u.e(),e.meta=oe(oe({},e.meta),{},{name:t})}return{error:e}}return Object(s.captureException)(e),{error:{reason:"internal"}}}let n=r.id;return r=await we(r.id,ge,{showUpdate:!0}),r.error?{error:{reason:r.error}}:(Object(C.k)("enabled"),await Object(C.f)(),await ye["close-budget"](),{id:n})},ye["load-budget"]=async function({id:e}){let t=u.b();if(t){if(t.id===e)return{};await ye["close-budget"]()}let r=await we(e,ge,{showUpdate:!0});return async function(){let t=async t=>{let r=l.a.join(l.a.getBudgetDir(e),t);try{return await l.a.size(r)}catch(e){return null}};try{let e=await t("db.sqlite"),r=await t("cache.sqlite");V.c("app:load-budget",{size:e,cacheSize:r})}catch(e){console.warn(e)}}(),r},ye["create-demo-budget"]=async function(){return await a.a.setItem("readOnly",""),ye["create-budget"]({budgetName:"Demo Budget",testMode:!0,testBudgetId:"_demo-budget"})},ye["close-budget"]=async function(){Object(s.captureBreadcrumb)({message:"Closing budget"}),await g.j(),g.i(),Object(C.d)(),await X.a.stopServices(),await p.closeDatabase();try{await a.a.setItem("lastBudget","")}catch(e){}return u.e(),Object(S.e)(),"ok"},ye["delete-budget"]=async function({id:e,cloudFileId:t}){if(t&&await z.f(t).catch(e=>{}),e){let t=l.a.getBudgetDir(e);await l.a.removeDirRecursively(t)}return"ok"},ye["create-budget"]=async function({budgetName:e,avoidUpload:t,testMode:r,testBudgetId:n}={}){let i;if(r)e=e||"Test Budget",i=n||"_test-budget",await l.a.exists(l.a.getBudgetDir(i))&&await l.a.removeDirRecursively(l.a.getBudgetDir(i));else{if(!e){let t=await ye["get-budgets"]();e=await Object(j.b)(t)}i=await Object(j.a)(e)}let o=l.a.getBudgetDir(i);await l.a.mkdir(o),await l.a.copyFile(l.a.bundledDatabasePath,l.a.join(o,"db.sqlite")),await l.a.writeFile(l.a.join(o,"metadata.json"),JSON.stringify(u.a(i,e)));let a=(await we(i,ge)).error;if(a)return console.log("Error creating budget: "+a),{error:a};if(!t&&!r)try{await z.h()}catch(e){}return r&&await Object($.a)(ye),{}},ye["set-tutorial-seen"]=async function(){return await a.a.setItem("seen-tutorial","true"),"ok"},ye["import-budget"]=async function({filepath:e,type:t}){try{if(!await l.a.exists(e))throw new Error("File not found at the provided path: "+e);let r=n.from(await l.a.readFile(e,"binary"));switch(t){case"ynab4":try{await se.importBuffer(e,r)}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 t;try{t=JSON.parse(r.toString())}catch(e){return{error:"parse-error"}}try{await ue.importYNAB5(t)}catch(e){return{error:"not-ynab5"}}}}catch(e){return e.message="Error importing budget: "+e.message,Object(s.captureException)(e),{error:"internal-error"}}return{}},ye["export-budget"]=async function(){return await z.c()},ye["get-upgrade-notifications"]=async function(){let e=u.b().id;if("_test-budget"===e||"_demo-budget"===e)return[];let t=["schedules","repair-splits"],r=[];for(let e of t){let t="notifications."+e;null==u.b()[t]&&r.push(e)}return r},ye["seen-upgrade-notification"]=async function({type:e}){let t="notifications."+e;u.d({[t]:!0})},ye["upload-file-web"]=async function({filename:e,contents:t}){return h.a.isWeb?(await l.a.writeFile("/uploads/"+e,t),"ok"):null},ye["backups-get"]=async function({id:e}){return Object(S.a)(e)},ye["backup-load"]=async function({id:e,backupId:t}){await Object(S.b)(e,t)},ye["backup-make"]=async function({id:e}){await Object(S.c)(e)},ye["get-last-opened-backup"]=async function(){const e=await a.a.getItem("lastBudget");if(e&&""!==e){const t=l.a.getBudgetDir(e);if(await l.a.exists(t))return e}return null},ye["app-focused"]=async function(){u.b()&&u.b().id&&Object(C.e)()},ye.track=async function({name:e,props:t}){V.c(e,t)},ye=Object(F.a)(ye),H.a.send=(e,t)=>Object(R.runHandler)(X.a.handlers[e],t),X.a.handlers=ye,X.a.combine(J.a,Q.a,ee.a,te.a);const Oe={getDataDir:l.a.getDataDir,sendMessage:(e,t)=>le.send(e,t),send:async(e,t)=>await Object(R.runHandler)(X.a.handlers[e],t),on:(e,t)=>X.a.events.on(e,t),syncAndReceiveMessages:C.l,q:Z.b,db:p,merkle:k,timestamp:N,SyncProtoBuf:pe}}.call(this,r(19),r(10).Buffer,r(23))},function(e,t,r){"use strict";t.byteLength=function(e){var t=c(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,n=c(e),a=n[0],s=n[1],u=new o(function(e,t,r){return 3*(t+r)/4-r}(0,a,s)),l=0,f=s>0?a-4:a;for(r=0;r<f;r+=4)t=i[e.charCodeAt(r)]<<18|i[e.charCodeAt(r+1)]<<12|i[e.charCodeAt(r+2)]<<6|i[e.charCodeAt(r+3)],u[l++]=t>>16&255,u[l++]=t>>8&255,u[l++]=255&t;2===s&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,u[l++]=255&t);1===s&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t);return u},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,o=[],a=0,s=r-i;a<s;a+=16383)o.push(l(e,a,a+16383>s?s:a+16383));1===i?(t=e[r-1],o.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s<u;++s)n[s]=a[s],i[a.charCodeAt(s)]=s;function c(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 l(e,t,r){for(var i,o,a=[],s=t;s<r;s+=3)i=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),a.push(n[(o=i)>>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(e,t){
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
t.read=function(e,t,r,n,i){var o,a,s=8*i-n-1,u=(1<<s)-1,c=u>>1,l=-7,f=r?i-1:0,d=r?-1:1,h=e[t+f];for(f+=d,o=h&(1<<-l)-1,h>>=-l,l+=s;l>0;o=256*o+e[t+f],f+=d,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=n;l>0;a=256*a+e[t+f],f+=d,l-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,n),o-=c}return(h?-1:1)*a*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var a,s,u,c=8*o-i-1,l=(1<<c)-1,f=l>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:o-1,p=n?1:-1,g=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=l):(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>=l?(s=0,a=l):a+f>=1?(s=(t*u-1)*Math.pow(2,i),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;e[r+h]=255&s,h+=p,s/=256,i-=8);for(a=a<<i|s,c+=i;c>0;e[r+h]=255&a,h+=p,a/=256,c-=8);e[r+h-p]|=128*g}},function(e,t){},function(e,t,r){"use strict"},function(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,i=arguments.length;r<i;r++)t.push(arguments[r]);return t}function i(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 o(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++)o(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,i=this.head;null!==i;)r.push(e.call(t,i.value,this)),i=i.next;return r},n.prototype.mapReverse=function(e,t){t=t||this;for(var r=new n,i=this.tail;null!==i;)r.push(e.call(t,i.value,this)),i=i.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 i=0;null!==n;i++)r=e(r,n.value,i),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 i=this.length-1;null!==n;i--)r=e(r,n.value,i),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 i=0,o=this.head;null!==o&&i<e;i++)o=o.next;for(;null!==o&&i<t;i++,o=o.next)r.push(o.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 i=this.length,o=this.tail;null!==o&&i>t;i--)o=o.prev;for(;null!==o&&i>e;i--,o=o.prev)r.push(o.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 o=[];for(r=0;n&&r<t;r++)o.push(n.value),n=this.removeNode(n);null===n&&(n=this.tail),n!==this.head&&n!==this.tail&&(n=n.prev);for(r=2;r<arguments.length;r++)n=i(this,n,arguments[r]);return o},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(291)(n)}catch(e){}},function(e,t,r){"use strict";e.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}},function(e,t){"function"==typeof BigInt?t.default=BigInt:t.default=function(){throw new Error("BigInt is not supported in this environment.")}},function(e,t){e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},function(e,t,r){"use strict";var n,i=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])})(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)}),o=this&&this.__spreadArrays||function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),i=0;for(t=0;t<r;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)n[i]=o[a];return n};Object.defineProperty(t,"__esModule",{value:!0});var a,s,u=r(48),c=r(296),l=r(139),f=r(180),d=r(140),h=r(185),p=r(184),g=r(298),m=r(99),y=r(98),b=r(63),_=r(181),w=r(182),v=r(112),E=r(307),S=u.resolve,O=y.constants.O_RDONLY,T=y.constants.O_WRONLY,A=y.constants.O_RDWR,M=y.constants.O_CREAT,D=y.constants.O_EXCL,I=y.constants.O_TRUNC,j=y.constants.O_APPEND,R=y.constants.O_SYNC,N=y.constants.O_DIRECTORY,k=y.constants.F_OK,C=y.constants.COPYFILE_EXCL,L=y.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 P,B="win32"===p.default.platform,U="path must be a string or Buffer",F="fd must be a file descriptor",W="mode must be an int",H="callback must be a function",z="uid must be an unsigned int",q="gid must be an unsigned int",V="ENOENT";function G(e,t,r,n,i){void 0===t&&(t=""),void 0===r&&(r=""),void 0===n&&(n=""),void 0===i&&(i=Error);var o=new i(function(e,t,r,n){void 0===t&&(t=""),void 0===r&&(r=""),void 0===n&&(n="");var i="";switch(r&&(i=" '"+r+"'"),n&&(i+=" -> '"+n+"'"),e){case V:return"ENOENT: no such file or directory, "+t+i;case"EBADF":return"EBADF: bad file descriptor, "+t+i;case"EINVAL":return"EINVAL: invalid argument, "+t+i;case"EPERM":return"EPERM: operation not permitted, "+t+i;case"EPROTO":return"EPROTO: protocol error, "+t+i;case"EEXIST":return"EEXIST: file already exists, "+t+i;case"ENOTDIR":return"ENOTDIR: not a directory, "+t+i;case"EISDIR":return"EISDIR: illegal operation on a directory, "+t+i;case"EACCES":return"EACCES: permission denied, "+t+i;case"ENOTEMPTY":return"ENOTEMPTY: directory not empty, "+t+i;case"EMFILE":return"EMFILE: too many open files, "+t+i;case"ENOSYS":return"ENOSYS: function not implemented, "+t+i;default:return e+": error occurred, "+t+i}}(e,t,r,n));return o.code=e,o}function Y(e){if("number"==typeof e)return e;if("string"==typeof e){var t=P[e];if(void 0!==t)return t}throw new w.TypeError("ERR_INVALID_OPT_VALUE","flags",e)}function $(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(function(e){return"Expected options to be either an object or a string, but got "+e+" instead"}(n))}return"buffer"!==r.encoding&&_.assertEncoding(r.encoding),r}function K(e){return function(t){return $(e,t)}}function Z(e){if("function"!=typeof e)throw TypeError(H);return e}function X(e){return function(t,r){return"function"==typeof t?[e(),t]:[e(t),Z(r)]}}!function(e){e[e.r=O]="r",e[e["r+"]=A]="r+",e[e.rs=O|R]="rs",e[e.sr=e.rs]="sr",e[e["rs+"]=A|R]="rs+",e[e["sr+"]=e["rs+"]]="sr+",e[e.w=T|M|I]="w",e[e.wx=T|M|I|D]="wx",e[e.xw=e.wx]="xw",e[e["w+"]=A|M|I]="w+",e[e["wx+"]=A|M|I|D]="wx+",e[e["xw+"]=e["wx+"]]="xw+",e[e.a=T|j|M]="a",e[e.ax=T|j|M|D]="ax",e[e.xa=e.ax]="xa",e[e["a+"]=A|j|M]="a+",e[e["ax+"]=A|j|M|D]="ax+",e[e["xa+"]=e["ax+"]]="xa+"}(P=t.FLAGS||(t.FLAGS={})),t.flagsToNumber=Y;var J={encoding:"utf8"},Q=K(J),ee=X(Q),te=K({flag:"r"}),re={encoding:"utf8",mode:438,flag:P[P.w]},ne=K(re),ie={encoding:"utf8",mode:438,flag:P[P.a]},oe=K(ie),ae=X(oe),se=K(J),ue=X(se),ce={mode:511,recursive:!1},le=function(e){return"number"==typeof e?Object.assign({},ce,{mode:e}):Object.assign({},ce,e)},fe={recursive:!1},de=function(e){return Object.assign({},fe,e)},he=K({encoding:"utf8",withFileTypes:!1}),pe=X(he),ge={bigint:!1},me=function(e){return void 0===e&&(e={}),Object.assign({},ge,e)},ye=function(e,t){return"function"==typeof e?[me(),e]:[me(e),Z(t)]};function be(e){if("string"!=typeof e&&!d.Buffer.isBuffer(e)){try{if(!(e instanceof r(308).URL))throw new TypeError(U)}catch(e){throw new TypeError(U)}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 Ae(t),t}t.pathToFilename=be;var _e=function(e,t){return void 0===t&&(t=p.default.cwd()),S(t,e)};if(B){var we=_e,ve=r(314).unixify;_e=function(e,t){return ve(we(e,t))}}function Ee(e,t){var r=_e(e,t).substr(1);return r?r.split(a):[]}function Se(e){return Ee(be(e))}function Oe(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 Te(e,t){return t&&"buffer"!==t?e.toString(t):e}function Ae(e,t){if(-1!==(""+e).indexOf("\0")){var r=new Error("Path must be a string without null bytes");if(r.code=V,"function"!=typeof t)throw r;return p.default.nextTick(t,r),!1}return!0}function Me(e,t){var r=function(e,t){return"number"==typeof e?e:"string"==typeof e?parseInt(e,8):t?Me(t):void 0}(e,t);if("number"!=typeof r||isNaN(r))throw new TypeError(W);return r}function De(e){return e>>>0===e}function Ie(e){if(!De(e))throw TypeError(F)}function je(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 Re(e){if("number"!=typeof e)throw TypeError(z)}function Ne(e){if("number"!=typeof e)throw TypeError(q)}t.filenameToSteps=Ee,t.pathToSteps=Se,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=Oe,t.bufferToEncoding=Te,t.toUnixTimestamp=je;var ke=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=E.default(this),this.statWatchers={},this.props=Object.assign({Node:c.Node,Link:c.Link,File:c.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 i(t,e),t}(xe);var n=Pe;this.ReadStream=function(e){function t(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.apply(this,o([r],t))||this}return i(t,e),t}(n);var a=Ue;this.WriteStream=function(e){function t(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.apply(this,o([r],t))||this}return i(t,e),t}(a),this.FSWatcher=function(e){function t(){return e.call(this,r)||this}return i(t,e),t}(Fe),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(){var e=this.releasedInos.pop();return e||(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=Ee(e),n=this.getLink(r);if(!n)throw G(V,t,e);return n},e.prototype.getResolvedLink=function(e){for(var t="string"==typeof e?Ee(e):e,r=this.root,n=0;n<t.length;){var i=t[n];if(!(r=r.getChild(i)))return null;var o=r.getNode();o.isSymlink()?(t=o.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 G(V,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 G("ENOTDIR",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:Ee(e),n=this.getLinkParent(r);if(!n)throw G(V,t,a+r.join(a));if(!n.getNode().isDirectory())throw G("ENOTDIR",t,a+r.join(a));return n},e.prototype.getFileByFd=function(e){return this.fds[String(e)]},e.prototype.getFileByFdOrThrow=function(e,t){if(!De(e))throw TypeError(F);var r=this.getFileByFd(e);if(!r)throw G("EBADF",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 i=Se(e),o=this.getLink(i);if(o)return o.getNode();if(t&M){var a=this.getLinkParent(i);if(a){var s=i[i.length-1];return(o=this.createLink(a,s,!1,r)).getNode()}}throw G(V,"getNodeByIdOrCreate",be(e))},e.prototype.wrapAsync=function(e,t,r){var n=this;Z(r),h.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 i=!0,o=e.children;for(var a in e.getNode().isFile()&&((n={})[e.getName()]=e.parent.getChild(e.getName()),o=n,e=e.parent),o){i=!1;var u=e.getChild(a);if(!u)throw new Error("_toJSON: unexpected undefined");var c=u.getNode();if(c.isFile()){var l=u.getPath();r&&(l=s(r,l)),t[l]=c.getString()}else c.isDirectory()&&this._toJSON(u,t,r)}var f=e.getPath();return r&&(f=s(r,f)),f&&i&&(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 i=0,o=e;i<o.length;i++){var a=be(o[i]);(c=this.getResolvedLink(a))&&n.push(c)}}else n.push(this.root);if(!n.length)return t;for(var s=0,u=n;s<u.length;s++){var c=u[s];this._toJSON(c,t,r?c.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 i=Ee(r=_e(r,t));if(i.length>1){var o=a+i.slice(0,i.length-1).join(a);this.mkdirpBase(o,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 G("EMFILE","open",e.getPath());var n=e;if(r&&(n=this.resolveSymlinks(e)),!n)throw G(V,"open",e.getPath());var i=n.getNode();if(i.isDirectory()){if((t&(O|A|T))!==O)throw G("EISDIR","open",e.getPath())}else if(t&N)throw G("ENOTDIR","open",e.getPath());if(!(t&T||i.canRead()))throw G("EACCES","open",e.getPath());var o=new this.props.File(e,i,t,this.newFdNumber());return this.fds[o.fd]=o,this.openFiles++,t&I&&o.truncate(),o},e.prototype.openFile=function(e,t,r,n){void 0===n&&(n=!0);var i=Ee(e),o=n?this.getResolvedLink(i):this.getLink(i);if(!o&&t&M){var s=this.getResolvedLink(i.slice(0,i.length-1));if(!s)throw G(V,"open",a+i.join(a));t&M&&"number"==typeof r&&(o=this.createLink(s,i[i.length-1],!1,r))}if(o)return this.openLink(o,t,n);throw G(V,"open",e)},e.prototype.openBase=function(e,t,r,n){void 0===n&&(n=!0);var i=this.openFile(e,t,r,n);if(!i)throw G(V,"open",e);return i.fd},e.prototype.openSync=function(e,t,r){void 0===r&&(r=438);var n=Me(r),i=be(e),o=Y(t);return this.openBase(i,o,n)},e.prototype.open=function(e,t,r,n){var i=r,o=n;"function"==typeof r&&(i=438,o=r);var a=Me(i=i||438),s=be(e),u=Y(t);this.wrapAsync(this.openBase,[s,u,a],o)},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){Ie(e);var t=this.getFileByFdOrThrow(e,"close");this.closeFile(t)},e.prototype.close=function(e,t){Ie(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 G(V);return n}return this.openFile(be(e),t,r)},e.prototype.readBase=function(e,t,r,n,i){return this.getFileByFdOrThrow(e).read(t,Number(r),Number(n),i)},e.prototype.readSync=function(e,t,r,n,i){return Ie(e),this.readBase(e,t,r,n,i)},e.prototype.read=function(e,t,r,n,i,o){var a=this;if(Z(o),0===n)return p.default.nextTick((function(){o&&o(null,0,t)}));h.default((function(){try{var s=a.readBase(e,t,r,n,i);o(null,s,t)}catch(e){o(e)}}))},e.prototype.readFileBase=function(e,t,r){var n,i,o="number"==typeof e&&De(e);if(o)i=e;else{var a=Ee(be(e)),s=this.getResolvedLink(a);if(s)if(s.getNode().isDirectory())throw G("EISDIR","open",s.getPath());i=this.openSync(e,t)}try{n=Te(this.getFileByFdOrThrow(i).getBuffer(),r)}finally{o||this.closeSync(i)}return n},e.prototype.readFileSync=function(e,t){var r=te(t),n=Y(r.flag);return this.readFileBase(e,n,r.encoding)},e.prototype.readFile=function(e,t,r){var n=X(te)(t,r),i=n[0],o=n[1],a=Y(i.flag);this.wrapAsync(this.readFileBase,[e,a,i.encoding],o)},e.prototype.writeBase=function(e,t,r,n,i){return this.getFileByFdOrThrow(e,"write").write(t,r,n,i)},e.prototype.writeSync=function(e,t,r,n,i){var o,a,s,u;Ie(e);var c="string"!=typeof t;c?(a=0|(r||0),s=n,u=i):(u=r,o=n);var l=Oe(t,o);return c?void 0===s&&(s=l.length):(a=0,s=l.length),this.writeBase(e,l,a,s,u)},e.prototype.write=function(e,t,r,n,i,o){var a,s,u,c,l,f=this;Ie(e);var d=typeof t,p=typeof r,g=typeof n,m=typeof i;"string"!==d?"function"===p?l=r:"function"===g?(a=0|r,l=n):"function"===m?(a=0|r,s=n,l=i):(a=0|r,s=n,u=i,l=o):"function"===p?l=r:"function"===g?(u=r,l=n):"function"===m&&(u=r,c=n,l=i);var y=Oe(t,c);"string"!==d?void 0===s&&(s=y.length):(a=0,s=y.length);var b=Z(l);h.default((function(){try{var r=f.writeBase(e,y,a,s,u);b(null,r,"string"!==d?y:t)}catch(e){b(e)}}))},e.prototype.writeFileBase=function(e,t,r,n){var i,o="number"==typeof e;i=o?e:this.openBase(be(e),r,n);var a=0,s=t.length,u=r&j?void 0:0;try{for(;s>0;){var c=this.writeSync(i,t,a,s,u);a+=c,s-=c,void 0!==u&&(u+=c)}}finally{o||this.closeSync(i)}},e.prototype.writeFileSync=function(e,t,r){var n=ne(r),i=Y(n.flag),o=Me(n.mode),a=Oe(t,n.encoding);this.writeFileBase(e,a,i,o)},e.prototype.writeFile=function(e,t,r,n){var i=r,o=n;"function"==typeof r&&(i=re,o=r);var a=Z(o),s=ne(i),u=Y(s.flag),c=Me(s.mode),l=Oe(t,s.encoding);this.wrapAsync(this.writeFileBase,[e,l,u,c],a)},e.prototype.linkBase=function(e,t){var r=Ee(e),n=this.getLink(r);if(!n)throw G(V,"link",e,t);var i=Ee(t),o=this.getLinkParent(i);if(!o)throw G(V,"link",e,t);var a=i[i.length-1];if(o.getChild(a))throw G("EEXIST","link",e,t);var s=n.getNode();s.nlink++,o.createChild(a,s)},e.prototype.copyFileBase=function(e,t,r){var n=this.readFileSync(e);if(r&C&&this.existsSync(t))throw G("EEXIST","copyFile",e,t);if(r&L)throw G("ENOSYS","copyFile",e,t);this.writeFileBase(t,n,P.w,438)},e.prototype.copyFileSync=function(e,t,r){var n=be(e),i=be(t);return this.copyFileBase(n,i,0|(r||0))},e.prototype.copyFile=function(e,t,r,n){var i,o,a=be(e),s=be(t);"function"==typeof r?(i=0,o=r):(i=r,o=n),Z(o),this.wrapAsync(this.copyFileBase,[a,s,i],o)},e.prototype.linkSync=function(e,t){var r=be(e),n=be(t);this.linkBase(r,n)},e.prototype.link=function(e,t,r){var n=be(e),i=be(t);this.wrapAsync(this.linkBase,[n,i],r)},e.prototype.unlinkBase=function(e){var t=Ee(e),r=this.getLink(t);if(!r)throw G(V,"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=be(e);this.unlinkBase(t)},e.prototype.unlink=function(e,t){var r=be(e);this.wrapAsync(this.unlinkBase,[r],t)},e.prototype.symlinkBase=function(e,t){var r=Ee(t),n=this.getLinkParent(r);if(!n)throw G(V,"symlink",e,t);var i=r[r.length-1];if(n.getChild(i))throw G("EEXIST","symlink",e,t);var o=n.createChild(i);return o.getNode().makeSymlink(Ee(e)),o},e.prototype.symlinkSync=function(e,t,r){var n=be(e),i=be(t);this.symlinkBase(n,i)},e.prototype.symlink=function(e,t,r,n){var i=Z("function"==typeof r?r:n),o=be(e),a=be(t);this.wrapAsync(this.symlinkBase,[o,a],i)},e.prototype.realpathBase=function(e,t){var r=Ee(e),n=this.getResolvedLink(r);if(!n)throw G(V,"realpath",e);return _.strToEncoding(n.getPath(),t)},e.prototype.realpathSync=function(e,t){return this.realpathBase(be(e),se(t).encoding)},e.prototype.realpath=function(e,t,r){var n=ue(t,r),i=n[0],o=n[1],a=be(e);this.wrapAsync(this.realpathBase,[a,i.encoding],o)},e.prototype.lstatBase=function(e,t){void 0===t&&(t=!1);var r=this.getLink(Ee(e));if(!r)throw G(V,"lstat",e);return l.default.build(r.getNode(),t)},e.prototype.lstatSync=function(e,t){return this.lstatBase(be(e),me(t).bigint)},e.prototype.lstat=function(e,t,r){var n=ye(t,r),i=n[0],o=n[1];this.wrapAsync(this.lstatBase,[be(e),i.bigint],o)},e.prototype.statBase=function(e,t){void 0===t&&(t=!1);var r=this.getResolvedLink(Ee(e));if(!r)throw G(V,"stat",e);return l.default.build(r.getNode(),t)},e.prototype.statSync=function(e,t){return this.statBase(be(e),me(t).bigint)},e.prototype.stat=function(e,t,r){var n=ye(t,r),i=n[0],o=n[1];this.wrapAsync(this.statBase,[be(e),i.bigint],o)},e.prototype.fstatBase=function(e,t){void 0===t&&(t=!1);var r=this.getFileByFd(e);if(!r)throw G("EBADF","fstat");return l.default.build(r.node,t)},e.prototype.fstatSync=function(e,t){return this.fstatBase(e,me(t).bigint)},e.prototype.fstat=function(e,t,r){var n=ye(t,r),i=n[0],o=n[1];this.wrapAsync(this.fstatBase,[e,i.bigint],o)},e.prototype.renameBase=function(e,t){var r=this.getLink(Ee(e));if(!r)throw G(V,"rename",e,t);var n=Ee(t),i=this.getLinkParent(n);if(!i)throw G(V,"rename",e,t);var a=r.parent;a&&a.deleteChild(r);var s=n[n.length-1];r.steps=o(i.steps,[s]),i.setChild(r.getName(),r)},e.prototype.renameSync=function(e,t){var r=be(e),n=be(t);this.renameBase(r,n)},e.prototype.rename=function(e,t,r){var n=be(e),i=be(t);this.wrapAsync(this.renameBase,[n,i],r)},e.prototype.existsBase=function(e){return!!this.statBase(e)},e.prototype.existsSync=function(e){try{return this.existsBase(be(e))}catch(e){return!1}},e.prototype.exists=function(e,t){var r=this,n=be(e);if("function"!=typeof t)throw Error(H);h.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=k);var r=be(e);t|=0,this.accessBase(r,t)},e.prototype.access=function(e,t,r){var n,i=k;"function"!=typeof t?(i=0|t,n=Z(r)):n=t;var o=be(e);this.wrapAsync(this.accessBase,[o,i],n)},e.prototype.appendFileSync=function(e,t,r){void 0===r&&(r=ie);var n=oe(r);n.flag&&!De(e)||(n.flag="a"),this.writeFileSync(e,t,n)},e.prototype.appendFile=function(e,t,r,n){var i=ae(r,n),o=i[0],a=i[1];o.flag&&!De(e)||(o.flag="a"),this.writeFile(e,t,o,a)},e.prototype.readdirBase=function(e,t){var r=Ee(e),n=this.getResolvedLink(r);if(!n)throw G(V,"readdir",e);if(!n.getNode().isDirectory())throw G("ENOTDIR","scandir",e);if(t.withFileTypes){var i=[];for(var o in n.children){var a=n.getChild(o);a&&i.push(f.default.build(a,t.encoding))}return B||"buffer"===t.encoding||i.sort((function(e,t){return e.name<t.name?-1:e.name>t.name?1:0})),i}var s=[];for(var u in n.children)s.push(_.strToEncoding(u,t.encoding));return B||"buffer"===t.encoding||s.sort(),s},e.prototype.readdirSync=function(e,t){var r=he(t),n=be(e);return this.readdirBase(n,r)},e.prototype.readdir=function(e,t,r){var n=pe(t,r),i=n[0],o=n[1],a=be(e);this.wrapAsync(this.readdirBase,[a,i],o)},e.prototype.readlinkBase=function(e,t){var r=this.getLinkOrThrow(e,"readlink").getNode();if(!r.isSymlink())throw G("EINVAL","readlink",e);var n=a+r.symlink.join(a);return _.strToEncoding(n,t)},e.prototype.readlinkSync=function(e,t){var r=Q(t),n=be(e);return this.readlinkBase(n,r.encoding)},e.prototype.readlink=function(e,t,r){var n=ee(t,r),i=n[0],o=n[1],a=be(e);this.wrapAsync(this.readlinkBase,[a,i.encoding],o)},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,i=Z("number"==typeof t?r:t);this.wrapAsync(this.ftruncateBase,[e,n],i)},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(De(e))return this.ftruncateSync(e,t);this.truncateBase(e,t)},e.prototype.truncate=function(e,t,r){var n="number"==typeof t?t:0,i=Z("number"==typeof t?r:t);if(De(e))return this.ftruncate(e,n,i);this.wrapAsync(this.truncateBase,[e,n],i)},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,je(t),je(r))},e.prototype.futimes=function(e,t,r,n){this.wrapAsync(this.futimesBase,[e,je(t),je(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(be(e),je(t),je(r))},e.prototype.utimes=function(e,t,r,n){this.wrapAsync(this.utimesBase,[be(e),je(t),je(r)],n)},e.prototype.mkdirBase=function(e,t){var r=Ee(e);if(!r.length)throw G("EISDIR","mkdir",e);var n=this.getLinkParentAsDirOrThrow(e,"mkdir"),i=r[r.length-1];if(n.getChild(i))throw G("EEXIST","mkdir",e);n.createChild(i,this.createNode(!0,t))},e.prototype.mkdirpBase=function(e,t){for(var r=Ee(e),n=this.root,i=0;i<r.length;i++){var o=r[i];if(!n.getNode().isDirectory())throw G("ENOTDIR","mkdir",n.getPath());var a=n.getChild(o);if(a){if(!a.getNode().isDirectory())throw G("ENOTDIR","mkdir",a.getPath());n=a}else n=n.createChild(o,this.createNode(!0,t))}},e.prototype.mkdirSync=function(e,t){var r=le(t),n=Me(r.mode,511),i=be(e);r.recursive?this.mkdirpBase(i,n):this.mkdirBase(i,n)},e.prototype.mkdir=function(e,t,r){var n=le(t),i=Z("function"==typeof t?t:r),o=Me(n.mode,511),a=be(e);n.recursive?this.wrapAsync(this.mkdirpBase,[a,o],i):this.wrapAsync(this.mkdirBase,[a,o],i)},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,i=Z("function"==typeof t?t:r);this.mkdir(e,{mode:n,recursive:!0},i)},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("EEXIST"===n.code){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=Q(t).encoding;if(!e||"string"!=typeof e)throw new TypeError("filename prefix is required");return Ae(e),this.mkdtempBase(e,r)},e.prototype.mkdtemp=function(e,t,r){var n=ee(t,r),i=n[0].encoding,o=n[1];if(!e||"string"!=typeof e)throw new TypeError("filename prefix is required");Ae(e)&&this.wrapAsync(this.mkdtempBase,[e,i],o)},e.prototype.rmdirBase=function(e,t){var r=de(t),n=this.getLinkAsDirOrThrow(e,"rmdir");if(n.length&&!r.recursive)throw G("ENOTEMPTY","rmdir",e);this.deleteLink(n)},e.prototype.rmdirSync=function(e,t){this.rmdirBase(be(e),t)},e.prototype.rmdir=function(e,t,r){var n=de(t),i=Z("function"==typeof t?t:r);this.wrapAsync(this.rmdirBase,[be(e),n],i)},e.prototype.fchmodBase=function(e,t){this.getFileByFdOrThrow(e,"fchmod").chmod(t)},e.prototype.fchmodSync=function(e,t){this.fchmodBase(e,Me(t))},e.prototype.fchmod=function(e,t,r){this.wrapAsync(this.fchmodBase,[e,Me(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=Me(t),n=be(e);this.chmodBase(n,r)},e.prototype.chmod=function(e,t,r){var n=Me(t),i=be(e);this.wrapAsync(this.chmodBase,[i,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=Me(t),n=be(e);this.lchmodBase(n,r)},e.prototype.lchmod=function(e,t,r){var n=Me(t),i=be(e);this.wrapAsync(this.lchmodBase,[i,n],r)},e.prototype.fchownBase=function(e,t,r){this.getFileByFdOrThrow(e,"fchown").chown(t,r)},e.prototype.fchownSync=function(e,t,r){Re(t),Ne(r),this.fchownBase(e,t,r)},e.prototype.fchown=function(e,t,r,n){Re(t),Ne(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){Re(t),Ne(r),this.chownBase(be(e),t,r)},e.prototype.chown=function(e,t,r,n){Re(t),Ne(r),this.wrapAsync(this.chownBase,[be(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){Re(t),Ne(r),this.lchownBase(be(e),t,r)},e.prototype.lchown=function(e,t,r,n){Re(t),Ne(r),this.wrapAsync(this.lchownBase,[be(e),t,r],n)},e.prototype.watchFile=function(e,t,r){var n=be(e),i=t,o=r;if("function"==typeof i&&(o=t,i=null),"function"!=typeof o)throw Error('"watchFile()" requires a listener function');var a=5007,s=!0;i&&"object"==typeof i&&("number"==typeof i.interval&&(a=i.interval),"boolean"==typeof i.persistent&&(s=i.persistent));var u=this.statWatchers[n];return u||((u=new this.StatWatcher).start(n,s,a),this.statWatchers[n]=u),u.addListener("change",o),u},e.prototype.unwatchFile=function(e,t){var r=be(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=be(e),i=t;"function"==typeof t&&(r=t,i=null);var o=Q(i),a=o.persistent,s=o.recursive,u=o.encoding;void 0===a&&(a=!0),void 0===s&&(s=!1);var c=new this.FSWatcher;return c.start(n,a,s,u),r&&c.addListener("change",r),c},e.fd=2147483647,e}();function Ce(e){e.emit("stop")}t.Volume=ke;var Le,xe=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 i(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=be(e),this.setTimeout=t?setTimeout:g.default,this.interval=r,this.prev=this.vol.statSync(this.filename),this.loop()},t.prototype.stop=function(){clearTimeout(this.timeoutRef),p.default.nextTick(Ce,this)},t}(b.EventEmitter);function Pe(e,t,r){if(!(this instanceof Pe))return new Pe(e,t,r);if(this._vol=e,void 0===(r=Object.assign({},$(r,{}))).highWaterMark&&(r.highWaterMark=65536),m.Readable.call(this,r),this.path=be(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 Be(e){this.close()}function Ue(e,t,r){if(!(this instanceof Ue))return new Ue(e,t,r);if(this._vol=e,r=Object.assign({},$(r,{})),m.Writable.call(this,r),this.path=be(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=xe,v.inherits(Pe,m.Readable),t.ReadStream=Pe,Pe.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()}))},Pe.prototype._read=function(e){if("number"!=typeof this.fd)return this.once("open",(function(){this._read(e)}));if(!this.destroyed){var t;(!Le||Le.length-Le.used<128)&&(t=this._readableState.highWaterMark,(Le=d.bufferAllocUnsafe(t)).used=0);var r=Le,n=Math.min(Le.length-Le.used,e),i=Le.used;if(void 0!==this.pos&&(n=Math.min(this.end-this.pos+1,n)),n<=0)return this.push(null);var o=this;this._vol.read(this.fd,Le,Le.used,n,this.pos,(function(e,t){if(e)o.autoClose&&o.destroy&&o.destroy(),o.emit("error",e);else{var n=null;t>0&&(o.bytesRead+=t,n=r.slice(i,i+t)),o.push(n)}})),void 0!==this.pos&&(this.pos+=n),Le.used+=n}},Pe.prototype._destroy=function(e,t){this.close((function(r){t(e||r)}))},Pe.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",Be):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},v.inherits(Ue,m.Writable),t.WriteStream=Ue,Ue.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))},Ue.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)},Ue.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,i=new Array(n),o=0,a=0;a<n;a++){var s=e[a].chunk;i[a]=s,o+=s.length}var u=d.Buffer.concat(i);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+=o)},Ue.prototype._destroy=Pe.prototype._destroy,Ue.prototype.close=Pe.prototype.close,Ue.prototype.destroySoon=Ue.prototype.end;var Fe=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 i(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=be(e),this._steps=Ee(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 i=new Error("watch "+this._filename+" "+e.code);throw i.code=e.code,i.errno=e.code,i}this._link.getNode().on("change",this._onNodeChange),this._link.on("child:add",this._onNodeChange),this._link.on("child:delete",this._onNodeChange);var o=this._link.parent;o&&(o.setMaxListeners(o.getMaxListeners()+1),o.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=Fe},function(e,t,r){"use strict";var n,i=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])})(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 o=r(184),a=r(140),s=r(98),u=r(63),c=r(139),l=s.constants.S_IFMT,f=s.constants.S_IFDIR,d=s.constants.S_IFREG,h=s.constants.S_IFLNK,p=s.constants.O_APPEND;t.SEP="/";var g=function(e){function t(t,r){void 0===r&&(r=438);var n=e.call(this)||this;return n.uid=o.default.getuid(),n.gid=o.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 i(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&~l|e},t.prototype.setIsFile=function(){this.setModeProperty(d)},t.prototype.setIsDirectory=function(){this.setModeProperty(f)},t.prototype.setIsSymlink=function(){this.setModeProperty(h)},t.prototype.isFile=function(){return(this.mode&l)===d},t.prototype.isDirectory=function(){return(this.mode&l)===f},t.prototype.isSymlink=function(){return(this.mode&l)===h},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 i=a.bufferAllocUnsafe(n+r);this.buf.copy(i,0,0,this.buf.length),this.buf=i}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 i=r;return i>e.byteLength&&(i=e.byteLength),i+n>this.buf.length&&(i=this.buf.length-n),this.buf.copy(e,t,n,n+i),i},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=o.default.getuid()),void 0===t&&(t=o.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=o.default.getuid()),void 0===t&&(t=o.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=g;var m=function(e){function r(t,r,n){var i=e.call(this)||this;return i.children={},i.steps=[],i.ino=0,i.length=0,i.vol=t,i.parent=r,i.steps=r?r.steps.concat([n]):[n],i}return i(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],i=this.getChild(n);return i?i.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=m;var y=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 c.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 i=this.node.write(e,t,r,n);return this.position=n+i,i},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 i=this.node.read(e,t,r,n);return this.position=n+i,i},e.prototype.chmod=function(e){this.node.chmod(e)},e.prototype.chown=function(e,t){this.node.chown(e,t)},e}();t.File=y},function(e,t,r){(function(e,t){!function(e,r){"use strict";if(!e.setImmediate){var n,i,o,a,s,u=1,c={},l=!1,f=e.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(e);d=d&&d.setTimeout?d:e,"[object process]"==={}.toString.call(e.process)?n=function(e){t.nextTick((function(){p(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?e.MessageChannel?((o=new MessageChannel).port1.onmessage=function(e){p(e.data)},n=function(e){o.port2.postMessage(e)}):f&&"onreadystatechange"in f.createElement("script")?(i=f.documentElement,n=function(e){var t=f.createElement("script");t.onreadystatechange=function(){p(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):n=function(e){setTimeout(p,0,e)}:(a="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&p(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),n=function(t){e.postMessage(a+t,"*")}),d.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),r=0;r<t.length;r++)t[r]=arguments[r+1];var i={callback:e,args:t};return c[u]=i,n(u),u++},d.clearImmediate=h}function h(e){delete c[e]}function p(e){if(l)setTimeout(p,0,e);else{var t=c[e];if(t){l=!0;try{!function(e){var t=e.callback,r=e.args;switch(r.length){case 0:t();break;case 1:t(r[0]);break;case 2:t(r[0],r[1]);break;case 3:t(r[0],r[1],r[2]);break;default:t.apply(void 0,r)}}(t)}finally{h(e),l=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,r(23),r(19))},function(e,t,r){"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}},function(e,t){},function(e,t,r){"use strict";var n=r(143).Buffer,i=r(301);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}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=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}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},e.prototype.concat=function(e){if(0===this.length)return n.alloc(0);if(1===this.length)return this.head.data;for(var t,r,i,o=n.allocUnsafe(e>>>0),a=this.head,s=0;a;)t=a.data,r=o,i=s,t.copy(r,i),s+=a.data.length,a=a.next;return o},e}(),i&&i.inspect&&i.inspect.custom&&(e.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+" "+e})},function(e,t){},function(e,t,r){"use strict";e.exports=o;var n=r(189),i=Object.create(r(100));function o(e){if(!(this instanceof o))return new o(e);n.call(this,e)}i.inherits=r(11),i.inherits(o,n),o.prototype._transform=function(e,t,r){r(null,e)}},function(e,t,r){e.exports=r(144)},function(e,t,r){e.exports=r(79)},function(e,t,r){e.exports=r(142).Transform},function(e,t,r){e.exports=r(142).PassThrough},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),i=0;for(t=0;t<r;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)n[i]=o[a];return n};function i(e,t,r){return void 0===r&&(r=function(e){return e}),function(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];return new Promise((function(o,a){e[t].bind(e).apply(void 0,n(i,[function(e,t){return e?a(e):o(r(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 i(this.vol,"appendFile")(this.fd,e,t)},e.prototype.chmod=function(e){return i(this.vol,"fchmod")(this.fd,e)},e.prototype.chown=function(e,t){return i(this.vol,"fchown")(this.fd,e,t)},e.prototype.close=function(){return i(this.vol,"close")(this.fd)},e.prototype.datasync=function(){return i(this.vol,"fdatasync")(this.fd)},e.prototype.read=function(e,t,r,n){return i(this.vol,"read",(function(t){return{bytesRead:t,buffer:e}}))(this.fd,e,t,r,n)},e.prototype.readFile=function(e){return i(this.vol,"readFile")(this.fd,e)},e.prototype.stat=function(e){return i(this.vol,"fstat")(this.fd,e)},e.prototype.sync=function(){return i(this.vol,"fsync")(this.fd)},e.prototype.truncate=function(e){return i(this.vol,"ftruncate")(this.fd,e)},e.prototype.utimes=function(e,t){return i(this.vol,"futimes")(this.fd,e,t)},e.prototype.write=function(e,t,r,n){return i(this.vol,"write",(function(t){return{bytesWritten:t,buffer:e}}))(this.fd,e,t,r,n)},e.prototype.writeFile=function(e,t){return i(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 i(e,"access")(t,r)},appendFile:function(t,r,n){return i(e,"appendFile")(t instanceof o?t.fd:t,r,n)},chmod:function(t,r){return i(e,"chmod")(t,r)},chown:function(t,r,n){return i(e,"chown")(t,r,n)},copyFile:function(t,r,n){return i(e,"copyFile")(t,r,n)},lchmod:function(t,r){return i(e,"lchmod")(t,r)},lchown:function(t,r,n){return i(e,"lchown")(t,r,n)},link:function(t,r){return i(e,"link")(t,r)},lstat:function(t,r){return i(e,"lstat")(t,r)},mkdir:function(t,r){return i(e,"mkdir")(t,r)},mkdtemp:function(t,r){return i(e,"mkdtemp")(t,r)},open:function(t,r,n){return i(e,"open",(function(t){return new o(e,t)}))(t,r,n)},readdir:function(t,r){return i(e,"readdir")(t,r)},readFile:function(t,r){return i(e,"readFile")(t instanceof o?t.fd:t,r)},readlink:function(t,r){return i(e,"readlink")(t,r)},realpath:function(t,r){return i(e,"realpath")(t,r)},rename:function(t,r){return i(e,"rename")(t,r)},rmdir:function(t){return i(e,"rmdir")(t)},stat:function(t,r){return i(e,"stat")(t,r)},symlink:function(t,r,n){return i(e,"symlink")(t,r,n)},truncate:function(t,r){return i(e,"truncate")(t,r)},unlink:function(t){return i(e,"unlink")(t)},utimes:function(t,r,n){return i(e,"utimes")(t,r,n)},writeFile:function(t,r,n){return i(e,"writeFile")(t instanceof o?t.fd:t,r,n)}}}},function(e,t,r){"use strict";var n=r(309),i=r(310);function o(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}t.parse=_,t.resolve=function(e,t){return _(e,!1,!0).resolve(t)},t.resolveObject=function(e,t){return e?_(e,!1,!0).resolveObject(t):t},t.format=function(e){i.isString(e)&&(e=_(e));return e instanceof o?e.format():o.prototype.format.call(e)},t.Url=o;var a=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,u=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,c=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),l=["'"].concat(c),f=["%","/","?",";","#"].concat(l),d=["/","?","#"],h=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,g={javascript:!0,"javascript:":!0},m={javascript:!0,"javascript:":!0},y={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},b=r(311);function _(e,t,r){if(e&&i.isObject(e)&&e instanceof o)return e;var n=new o;return n.parse(e,t,r),n}o.prototype.parse=function(e,t,r){if(!i.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var o=e.indexOf("?"),s=-1!==o&&o<e.indexOf("#")?"?":"#",c=e.split(s);c[0]=c[0].replace(/\\/g,"/");var _=e=c.join(s);if(_=_.trim(),!r&&1===e.split("#").length){var w=u.exec(_);if(w)return this.path=_,this.href=_,this.pathname=w[1],w[2]?(this.search=w[2],this.query=t?b.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var v=a.exec(_);if(v){var E=(v=v[0]).toLowerCase();this.protocol=E,_=_.substr(v.length)}if(r||v||_.match(/^\/\/[^@\/]+@[^@\/]+/)){var S="//"===_.substr(0,2);!S||v&&m[v]||(_=_.substr(2),this.slashes=!0)}if(!m[v]&&(S||v&&!y[v])){for(var O,T,A=-1,M=0;M<d.length;M++){-1!==(D=_.indexOf(d[M]))&&(-1===A||D<A)&&(A=D)}-1!==(T=-1===A?_.lastIndexOf("@"):_.lastIndexOf("@",A))&&(O=_.slice(0,T),_=_.slice(T+1),this.auth=decodeURIComponent(O)),A=-1;for(M=0;M<f.length;M++){var D;-1!==(D=_.indexOf(f[M]))&&(-1===A||D<A)&&(A=D)}-1===A&&(A=_.length),this.host=_.slice(0,A),_=_.slice(A),this.parseHost(),this.hostname=this.hostname||"";var I="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!I)for(var j=this.hostname.split(/\./),R=(M=0,j.length);M<R;M++){var N=j[M];if(N&&!N.match(h)){for(var k="",C=0,L=N.length;C<L;C++)N.charCodeAt(C)>127?k+="x":k+=N[C];if(!k.match(h)){var x=j.slice(0,M),P=j.slice(M+1),B=N.match(p);B&&(x.push(B[1]),P.unshift(B[2])),P.length&&(_="/"+P.join(".")+_),this.hostname=x.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),I||(this.hostname=n.toASCII(this.hostname));var U=this.port?":"+this.port:"",F=this.hostname||"";this.host=F+U,this.href+=this.host,I&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==_[0]&&(_="/"+_))}if(!g[E])for(M=0,R=l.length;M<R;M++){var W=l[M];if(-1!==_.indexOf(W)){var H=encodeURIComponent(W);H===W&&(H=escape(W)),_=_.split(W).join(H)}}var z=_.indexOf("#");-1!==z&&(this.hash=_.substr(z),_=_.slice(0,z));var q=_.indexOf("?");if(-1!==q?(this.search=_.substr(q),this.query=_.substr(q+1),t&&(this.query=b.parse(this.query)),_=_.slice(0,q)):t&&(this.search="",this.query={}),_&&(this.pathname=_),y[E]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){U=this.pathname||"";var V=this.search||"";this.path=U+V}return this.href=this.format(),this},o.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",r=this.pathname||"",n=this.hash||"",o=!1,a="";this.host?o=e+this.host:this.hostname&&(o=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&i.isObject(this.query)&&Object.keys(this.query).length&&(a=b.stringify(this.query));var s=this.search||a&&"?"+a||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||y[t])&&!1!==o?(o="//"+(o||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):o||(o=""),n&&"#"!==n.charAt(0)&&(n="#"+n),s&&"?"!==s.charAt(0)&&(s="?"+s),t+o+(r=r.replace(/[?#]/g,(function(e){return encodeURIComponent(e)})))+(s=s.replace("#","%23"))+n},o.prototype.resolve=function(e){return this.resolveObject(_(e,!1,!0)).format()},o.prototype.resolveObject=function(e){if(i.isString(e)){var t=new o;t.parse(e,!1,!0),e=t}for(var r=new o,n=Object.keys(this),a=0;a<n.length;a++){var s=n[a];r[s]=this[s]}if(r.hash=e.hash,""===e.href)return r.href=r.format(),r;if(e.slashes&&!e.protocol){for(var u=Object.keys(e),c=0;c<u.length;c++){var l=u[c];"protocol"!==l&&(r[l]=e[l])}return y[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(e.protocol&&e.protocol!==r.protocol){if(!y[e.protocol]){for(var f=Object.keys(e),d=0;d<f.length;d++){var h=f[d];r[h]=e[h]}return r.href=r.format(),r}if(r.protocol=e.protocol,e.host||m[e.protocol])r.pathname=e.pathname;else{for(var p=(e.pathname||"").split("/");p.length&&!(e.host=p.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==p[0]&&p.unshift(""),p.length<2&&p.unshift(""),r.pathname=p.join("/")}if(r.search=e.search,r.query=e.query,r.host=e.host||"",r.auth=e.auth,r.hostname=e.hostname||e.host,r.port=e.port,r.pathname||r.search){var g=r.pathname||"",b=r.search||"";r.path=g+b}return r.slashes=r.slashes||e.slashes,r.href=r.format(),r}var _=r.pathname&&"/"===r.pathname.charAt(0),w=e.host||e.pathname&&"/"===e.pathname.charAt(0),v=w||_||r.host&&e.pathname,E=v,S=r.pathname&&r.pathname.split("/")||[],O=(p=e.pathname&&e.pathname.split("/")||[],r.protocol&&!y[r.protocol]);if(O&&(r.hostname="",r.port=null,r.host&&(""===S[0]?S[0]=r.host:S.unshift(r.host)),r.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===p[0]?p[0]=e.host:p.unshift(e.host)),e.host=null),v=v&&(""===p[0]||""===S[0])),w)r.host=e.host||""===e.host?e.host:r.host,r.hostname=e.hostname||""===e.hostname?e.hostname:r.hostname,r.search=e.search,r.query=e.query,S=p;else if(p.length)S||(S=[]),S.pop(),S=S.concat(p),r.search=e.search,r.query=e.query;else if(!i.isNullOrUndefined(e.search)){if(O)r.hostname=r.host=S.shift(),(I=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=I.shift(),r.host=r.hostname=I.shift());return r.search=e.search,r.query=e.query,i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!S.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var T=S.slice(-1)[0],A=(r.host||e.host||S.length>1)&&("."===T||".."===T)||""===T,M=0,D=S.length;D>=0;D--)"."===(T=S[D])?S.splice(D,1):".."===T?(S.splice(D,1),M++):M&&(S.splice(D,1),M--);if(!v&&!E)for(;M--;M)S.unshift("..");!v||""===S[0]||S[0]&&"/"===S[0].charAt(0)||S.unshift(""),A&&"/"!==S.join("/").substr(-1)&&S.push("");var I,j=""===S[0]||S[0]&&"/"===S[0].charAt(0);O&&(r.hostname=r.host=j?"":S.length?S.shift():"",(I=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=I.shift(),r.host=r.hostname=I.shift()));return(v=v||r.host&&S.length)&&!j&&S.unshift(""),S.length?r.pathname=S.join("/"):(r.pathname=null,r.path=null),i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},o.prototype.parseHost=function(){var e=this.host,t=s.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t,r){(function(e,n){var i;/*! https://mths.be/punycode v1.4.1 by @mathias */!function(o){t&&t.nodeType,e&&e.nodeType;var a="object"==typeof n&&n;a.global!==a&&a.window!==a&&a.self;var s,u=2147483647,c=/^xn--/,l=/[^\x20-\x7E]/,f=/[\x2E\u3002\uFF0E\uFF61]/g,d={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},h=Math.floor,p=String.fromCharCode;function g(e){throw new RangeError(d[e])}function m(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function y(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+m((e=e.replace(f,".")).split("."),t).join(".")}function b(e){for(var t,r,n=[],i=0,o=e.length;i<o;)(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<o?56320==(64512&(r=e.charCodeAt(i++)))?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),i--):n.push(t);return n}function _(e){return m(e,(function(e){var t="";return e>65535&&(t+=p((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=p(e)})).join("")}function w(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function v(e,t,r){var n=0;for(e=r?h(e/700):e>>1,e+=h(e/t);e>455;n+=36)e=h(e/35);return h(n+36*e/(e+38))}function E(e){var t,r,n,i,o,a,s,c,l,f,d,p=[],m=e.length,y=0,b=128,w=72;for((r=e.lastIndexOf("-"))<0&&(r=0),n=0;n<r;++n)e.charCodeAt(n)>=128&&g("not-basic"),p.push(e.charCodeAt(n));for(i=r>0?r+1:0;i<m;){for(o=y,a=1,s=36;i>=m&&g("invalid-input"),((c=(d=e.charCodeAt(i++))-48<10?d-22:d-65<26?d-65:d-97<26?d-97:36)>=36||c>h((u-y)/a))&&g("overflow"),y+=c*a,!(c<(l=s<=w?1:s>=w+26?26:s-w));s+=36)a>h(u/(f=36-l))&&g("overflow"),a*=f;w=v(y-o,t=p.length+1,0==o),h(y/t)>u-b&&g("overflow"),b+=h(y/t),y%=t,p.splice(y++,0,b)}return _(p)}function S(e){var t,r,n,i,o,a,s,c,l,f,d,m,y,_,E,S=[];for(m=(e=b(e)).length,t=128,r=0,o=72,a=0;a<m;++a)(d=e[a])<128&&S.push(p(d));for(n=i=S.length,i&&S.push("-");n<m;){for(s=u,a=0;a<m;++a)(d=e[a])>=t&&d<s&&(s=d);for(s-t>h((u-r)/(y=n+1))&&g("overflow"),r+=(s-t)*y,t=s,a=0;a<m;++a)if((d=e[a])<t&&++r>u&&g("overflow"),d==t){for(c=r,l=36;!(c<(f=l<=o?1:l>=o+26?26:l-o));l+=36)E=c-f,_=36-f,S.push(p(w(f+E%_,0))),c=h(E/_);S.push(p(w(c,0))),o=v(r,y,n==i),r=0,++n}++r,++t}return S.join("")}s={version:"1.4.1",ucs2:{decode:b,encode:_},decode:E,encode:S,toASCII:function(e){return y(e,(function(e){return l.test(e)?"xn--"+S(e):e}))},toUnicode:function(e){return y(e,(function(e){return c.test(e)?E(e.slice(4).toLowerCase()):e}))}},void 0===(i=function(){return s}.call(t,r,t,e))||(e.exports=i)}()}).call(this,r(97)(e),r(23))},function(e,t,r){"use strict";e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},function(e,t,r){"use strict";t.decode=t.parse=r(312),t.encode=t.stringify=r(313)},function(e,t,r){"use strict";function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,r,o){t=t||"&",r=r||"=";var a={};if("string"!=typeof e||0===e.length)return a;var s=/\+/g;e=e.split(t);var u=1e3;o&&"number"==typeof o.maxKeys&&(u=o.maxKeys);var c=e.length;u>0&&c>u&&(c=u);for(var l=0;l<c;++l){var f,d,h,p,g=e[l].replace(s,"%20"),m=g.indexOf(r);m>=0?(f=g.substr(0,m),d=g.substr(m+1)):(f=g,d=""),h=decodeURIComponent(f),p=decodeURIComponent(d),n(a,h)?i(a[h])?a[h].push(p):a[h]=[a[h],p]:a[h]=p}return a};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},function(e,t,r){"use strict";var n=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,r,s){return t=t||"&",r=r||"=",null===e&&(e=void 0),"object"==typeof e?o(a(e),(function(a){var s=encodeURIComponent(n(a))+r;return i(e[a])?o(e[a],(function(e){return s+encodeURIComponent(n(e))})).join(t):s+encodeURIComponent(n(e[a]))})).join(t):s?encodeURIComponent(n(s))+r+encodeURIComponent(n(e)):""};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function o(e,t){if(e.map)return e.map(t);for(var r=[],n=0;n<e.length;n++)r.push(t(e[n],n));return r}var a=Object.keys||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t}},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.unixify=o,t.correctPath=function(e){return o(e.replace(/^\\\\\?\\.:\\/,"\\"))};var r="win32"===e.platform;function n(e,t){var n=e[t];return t>0&&("/"===n||r&&"\\"===n)}function i(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(;n(e,t);)t--;return e.substr(0,t+1)}(e)),e}function o(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return r?(e=i(e,t)).replace(/^([a-zA-Z]+:|\.\/)/,""):e}}).call(this,r(19))},function(e,t,r){"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"]},function(e,t,r){(t=e.exports=r(192)).Stream=t,t.Readable=t,t.Writable=r(196),t.Duplex=r(86),t.Transform=r(197),t.PassThrough=r(322),t.finished=r(147),t.pipeline=r(323)},function(e,t){},function(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 i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(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)}}var a=r(10).Buffer,s=r(319).inspect,u=s&&s.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,c;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 a.alloc(0);for(var t,r,n,i=a.allocUnsafe(e>>>0),o=this.head,s=0;o;)t=o.data,r=i,n=s,a.prototype.copy.call(t,r,n),s+=o.data.length,o=o.next;return i}},{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 i=t.data,o=e>i.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0==(e-=o)){o===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=a.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0==(e-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,t}},{key:u,value:function(e,t){return s(this,function(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}({},t,{depth:0,customInspect:!1}))}}])&&o(t.prototype,r),c&&o(t,c),e}()},function(e,t){},function(e,t,r){"use strict";(function(t){var n;function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var o=r(147),a=Symbol("lastResolve"),s=Symbol("lastReject"),u=Symbol("error"),c=Symbol("ended"),l=Symbol("lastPromise"),f=Symbol("handlePromise"),d=Symbol("stream");function h(e,t){return{value:e,done:t}}function p(e){var t=e[a];if(null!==t){var r=e[d].read();null!==r&&(e[l]=null,e[a]=null,e[s]=null,t(h(r,!1)))}}function g(e){t.nextTick(p,e)}var m=Object.getPrototypeOf((function(){})),y=Object.setPrototypeOf((i(n={get stream(){return this[d]},next:function(){var e=this,r=this[u];if(null!==r)return Promise.reject(r);if(this[c])return Promise.resolve(h(void 0,!0));if(this[d].destroyed)return new Promise((function(r,n){t.nextTick((function(){e[u]?n(e[u]):r(h(void 0,!0))}))}));var n,i=this[l];if(i)n=new Promise(function(e,t){return function(r,n){e.then((function(){t[c]?r(h(void 0,!0)):t[f](r,n)}),n)}}(i,this));else{var o=this[d].read();if(null!==o)return Promise.resolve(h(o,!1));n=new Promise(this[f])}return this[l]=n,n}},Symbol.asyncIterator,(function(){return this})),i(n,"return",(function(){var e=this;return new Promise((function(t,r){e[d].destroy(null,(function(e){e?r(e):t(h(void 0,!0))}))}))})),n),m);e.exports=function(e){var t,r=Object.create(y,(i(t={},d,{value:e,writable:!0}),i(t,a,{value:null,writable:!0}),i(t,s,{value:null,writable:!0}),i(t,u,{value:null,writable:!0}),i(t,c,{value:e._readableState.endEmitted,writable:!0}),i(t,f,{value:function(e,t){var n=r[d].read();n?(r[l]=null,r[a]=null,r[s]=null,e(h(n,!1))):(r[a]=e,r[s]=t)},writable:!0}),t));return r[l]=null,o(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[s];return null!==t&&(r[l]=null,r[a]=null,r[s]=null,t(e)),void(r[u]=e)}var n=r[a];null!==n&&(r[l]=null,r[a]=null,r[s]=null,n(h(void 0,!0))),r[c]=!0})),e.on("readable",g.bind(null,r)),r}}).call(this,r(19))},function(e,t){e.exports=function(){throw new Error("Readable.from is not available in the browser")}},function(e,t,r){"use strict";e.exports=i;var n=r(197);function i(e){if(!(this instanceof i))return new i(e);n.call(this,e)}r(11)(i,n),i.prototype._transform=function(e,t,r){r(null,e)}},function(e,t,r){"use strict";var n;var i=r(85).codes,o=i.ERR_MISSING_ARGS,a=i.ERR_STREAM_DESTROYED;function s(e){if(e)throw e}function u(e,t,i,o){o=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(o);var s=!1;e.on("close",(function(){s=!0})),void 0===n&&(n=r(147)),n(e,{readable:t,writable:i},(function(e){if(e)return o(e);s=!0,o()}));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 o(t||new a("pipe"))}}function c(e){e()}function l(e,t){return e.pipe(t)}function f(e){return e.length?"function"!=typeof e[e.length-1]?s:e.pop():s}e.exports=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n,i=f(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new o("streams");var a=t.map((function(e,r){var o=r<t.length-1;return u(e,o,r>0,(function(e){n||(n=e),e&&a.forEach(c),o||(a.forEach(c),i(n))}))}));return t.reduce(l)}},function(e,t,r){var n=r(11),i=r(87),o=r(16).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function u(){this.init(),this._w=s,i.call(this,64,56)}function c(e){return e<<30|e>>>2}function l(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(u,i),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,u=0|this._e,f=0;f<16;++f)r[f]=e.readInt32BE(4*f);for(;f<80;++f)r[f]=r[f-3]^r[f-8]^r[f-14]^r[f-16];for(var d=0;d<80;++d){var h=~~(d/20),p=0|((t=n)<<5|t>>>27)+l(h,i,o,s)+u+r[d]+a[h];u=s,s=o,o=c(i),i=n,n=p}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=u},function(e,t,r){var n=r(11),i=r(87),o=r(16).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function u(){this.init(),this._w=s,i.call(this,64,56)}function c(e){return e<<5|e>>>27}function l(e){return e<<30|e>>>2}function f(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(u,i),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,u=0|this._e,d=0;d<16;++d)r[d]=e.readInt32BE(4*d);for(;d<80;++d)r[d]=(t=r[d-3]^r[d-8]^r[d-14]^r[d-16])<<1|t>>>31;for(var h=0;h<80;++h){var p=~~(h/20),g=c(n)+f(p,i,o,s)+u+r[h]+a[p]|0;u=s,s=o,o=l(i),i=n,n=g}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=u},function(e,t,r){var n=r(11),i=r(198),o=r(87),a=r(16).Buffer,s=new Array(64);function u(){this.init(),this._w=s,o.call(this,64,56)}n(u,i),u.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},u.prototype._hash=function(){var e=a.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},e.exports=u},function(e,t,r){var n=r(11),i=r(199),o=r(87),a=r(16).Buffer,s=new Array(160);function u(){this.init(),this._w=s,o.call(this,128,112)}n(u,i),u.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},u.prototype._hash=function(){var e=a.allocUnsafe(48);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e},e.exports=u},function(e,t,r){"use strict";var n=r(11),i=r(16).Buffer,o=r(71),a=i.alloc(128);function s(e,t){o.call(this,"digest"),"string"==typeof t&&(t=i.from(t)),this._alg=e,this._key=t,t.length>64?t=e(t):t.length<64&&(t=i.concat([t,a],64));for(var r=this._ipad=i.allocUnsafe(64),n=this._opad=i.allocUnsafe(64),s=0;s<64;s++)r[s]=54^t[s],n[s]=92^t[s];this._hash=[r]}n(s,o),s.prototype._update=function(e){this._hash.push(e)},s.prototype._final=function(){var e=this._alg(i.concat(this._hash));return this._alg(i.concat([this._opad,e]))},e.exports=s},function(e,t,r){e.exports=r(202)},function(e,t,r){(function(t){var n,i,o=r(16).Buffer,a=r(204),s=r(205),u=r(206),c=r(207),l=t.crypto&&t.crypto.subtle,f={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},d=[];function h(){return i||(i=t.process&&t.process.nextTick?t.process.nextTick:t.queueMicrotask?t.queueMicrotask:t.setImmediate?t.setImmediate:t.setTimeout)}function p(e,t,r,n,i){return l.importKey("raw",e,{name:"PBKDF2"},!1,["deriveBits"]).then((function(e){return l.deriveBits({name:"PBKDF2",salt:t,iterations:r,hash:{name:i}},e,n<<3)})).then((function(e){return o.from(e)}))}e.exports=function(e,r,i,g,m,y){"function"==typeof m&&(y=m,m=void 0);var b=f[(m=m||"sha1").toLowerCase()];if(b&&"function"==typeof t.Promise){if(a(i,g),e=c(e,s,"Password"),r=c(r,s,"Salt"),"function"!=typeof y)throw new Error("No callback provided to pbkdf2");!function(e,t){e.then((function(e){h()((function(){t(null,e)}))}),(function(e){h()((function(){t(e)}))}))}(function(e){if(t.process&&!t.process.browser)return Promise.resolve(!1);if(!l||!l.importKey||!l.deriveBits)return Promise.resolve(!1);if(void 0!==d[e])return d[e];var r=p(n=n||o.alloc(8),n,10,128,e).then((function(){return!0})).catch((function(){return!1}));return d[e]=r,r}(b).then((function(t){return t?p(e,r,i,g,b):u(e,r,i,g,m)})),y)}else h()((function(){var t;try{t=u(e,r,i,g,m)}catch(e){return y(e)}y(null,t)}))}}).call(this,r(23))},function(e,t,r){var n=r(332),i=r(151),o=r(152),a=r(345),s=r(116);function u(e,t,r){if(e=e.toLowerCase(),o[e])return i.createCipheriv(e,t,r);if(a[e])return new n({key:t,iv:r,mode:e});throw new TypeError("invalid suite type")}function c(e,t,r){if(e=e.toLowerCase(),o[e])return i.createDecipheriv(e,t,r);if(a[e])return new n({key:t,iv:r,mode:e,decrypt:!0});throw new TypeError("invalid suite type")}t.createCipher=t.Cipher=function(e,t){var r,n;if(e=e.toLowerCase(),o[e])r=o[e].key,n=o[e].iv;else{if(!a[e])throw new TypeError("invalid suite type");r=8*a[e].key,n=a[e].iv}var i=s(t,!1,r,n);return u(e,i.key,i.iv)},t.createCipheriv=t.Cipheriv=u,t.createDecipher=t.Decipher=function(e,t){var r,n;if(e=e.toLowerCase(),o[e])r=o[e].key,n=o[e].iv;else{if(!a[e])throw new TypeError("invalid suite type");r=8*a[e].key,n=a[e].iv}var i=s(t,!1,r,n);return c(e,i.key,i.iv)},t.createDecipheriv=t.Decipheriv=c,t.listCiphers=t.getCiphers=function(){return Object.keys(a).concat(i.getCiphers())}},function(e,t,r){var n=r(71),i=r(333),o=r(11),a=r(16).Buffer,s={"des-ede3-cbc":i.CBC.instantiate(i.EDE),"des-ede3":i.EDE,"des-ede-cbc":i.CBC.instantiate(i.EDE),"des-ede":i.EDE,"des-cbc":i.CBC.instantiate(i.DES),"des-ecb":i.DES};function u(e){n.call(this);var t,r=e.mode.toLowerCase(),i=s[r];t=e.decrypt?"decrypt":"encrypt";var o=e.key;a.isBuffer(o)||(o=a.from(o)),"des-ede"!==r&&"des-ede-cbc"!==r||(o=a.concat([o,o.slice(0,8)]));var u=e.iv;a.isBuffer(u)||(u=a.from(u)),this._des=i.create({key:o,iv:u,type:t})}s.des=s["des-cbc"],s.des3=s["des-ede3-cbc"],e.exports=u,o(u,n),u.prototype._update=function(e){return a.from(this._des.update(e))},u.prototype._final=function(){return a.from(this._des.final())}},function(e,t,r){"use strict";t.utils=r(208),t.Cipher=r(150),t.DES=r(209),t.CBC=r(334),t.EDE=r(335)},function(e,t,r){"use strict";var n=r(44),i=r(11),o={};function a(e){n.equal(e.length,8,"Invalid IV length"),this.iv=new Array(8);for(var t=0;t<this.iv.length;t++)this.iv[t]=e[t]}t.instantiate=function(e){function t(t){e.call(this,t),this._cbcInit()}i(t,e);for(var r=Object.keys(o),n=0;n<r.length;n++){var a=r[n];t.prototype[a]=o[a]}return t.create=function(e){return new t(e)},t},o._cbcInit=function(){var e=new a(this.options.iv);this._cbcState=e},o._update=function(e,t,r,n){var i=this._cbcState,o=this.constructor.super_.prototype,a=i.iv;if("encrypt"===this.type){for(var s=0;s<this.blockSize;s++)a[s]^=e[t+s];o._update.call(this,a,0,r,n);for(s=0;s<this.blockSize;s++)a[s]=r[n+s]}else{o._update.call(this,e,t,r,n);for(s=0;s<this.blockSize;s++)r[n+s]^=a[s];for(s=0;s<this.blockSize;s++)a[s]=e[t+s]}}},function(e,t,r){"use strict";var n=r(44),i=r(11),o=r(150),a=r(209);function s(e,t){n.equal(t.length,24,"Invalid key length");var r=t.slice(0,8),i=t.slice(8,16),o=t.slice(16,24);this.ciphers="encrypt"===e?[a.create({type:"encrypt",key:r}),a.create({type:"decrypt",key:i}),a.create({type:"encrypt",key:o})]:[a.create({type:"decrypt",key:o}),a.create({type:"encrypt",key:i}),a.create({type:"decrypt",key:r})]}function u(e){o.call(this,e);var t=new s(this.type,this.options.key);this._edeState=t}i(u,o),e.exports=u,u.create=function(e){return new u(e)},u.prototype._update=function(e,t,r,n){var i=this._edeState;i.ciphers[0]._update(e,t,r,n),i.ciphers[1]._update(r,n,r,n),i.ciphers[2]._update(r,n,r,n)},u.prototype._pad=a.prototype._pad,u.prototype._unpad=a.prototype._unpad},function(e,t,r){var n=r(152),i=r(213),o=r(16).Buffer,a=r(214),s=r(71),u=r(115),c=r(116);function l(e,t,r){s.call(this),this._cache=new d,this._cipher=new u.AES(t),this._prev=o.from(r),this._mode=e,this._autopadding=!0}r(11)(l,s),l.prototype._update=function(e){var t,r;this._cache.add(e);for(var n=[];t=this._cache.get();)r=this._mode.encrypt(this,t),n.push(r);return o.concat(n)};var f=o.alloc(16,16);function d(){this.cache=o.allocUnsafe(0)}function h(e,t,r){var s=n[e.toLowerCase()];if(!s)throw new TypeError("invalid suite type");if("string"==typeof t&&(t=o.from(t)),t.length!==s.key/8)throw new TypeError("invalid key length "+t.length);if("string"==typeof r&&(r=o.from(r)),"GCM"!==s.mode&&r.length!==s.iv)throw new TypeError("invalid iv length "+r.length);return"stream"===s.type?new a(s.module,t,r):"auth"===s.type?new i(s.module,t,r):new l(s.module,t,r)}l.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return e=this._mode.encrypt(this,e),this._cipher.scrub(),e;if(!e.equals(f))throw this._cipher.scrub(),new Error("data not multiple of block length")},l.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},d.prototype.add=function(e){this.cache=o.concat([this.cache,e])},d.prototype.get=function(){if(this.cache.length>15){var e=this.cache.slice(0,16);return this.cache=this.cache.slice(16),e}return null},d.prototype.flush=function(){for(var e=16-this.cache.length,t=o.allocUnsafe(e),r=-1;++r<e;)t.writeUInt8(e,r);return o.concat([this.cache,t])},t.createCipheriv=h,t.createCipher=function(e,t){var r=n[e.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var i=c(t,!1,r.key,r.iv);return h(e,i.key,i.iv)}},function(e,t){t.encrypt=function(e,t){return e._cipher.encryptBlock(t)},t.decrypt=function(e,t){return e._cipher.decryptBlock(t)}},function(e,t,r){var n=r(102);t.encrypt=function(e,t){var r=n(t,e._prev);return e._prev=e._cipher.encryptBlock(r),e._prev},t.decrypt=function(e,t){var r=e._prev;e._prev=t;var i=e._cipher.decryptBlock(t);return n(i,r)}},function(e,t,r){var n=r(16).Buffer,i=r(102);function o(e,t,r){var o=t.length,a=i(t,e._cache);return e._cache=e._cache.slice(o),e._prev=n.concat([e._prev,r?t:a]),a}t.encrypt=function(e,t,r){for(var i,a=n.allocUnsafe(0);t.length;){if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=n.allocUnsafe(0)),!(e._cache.length<=t.length)){a=n.concat([a,o(e,t,r)]);break}i=e._cache.length,a=n.concat([a,o(e,t.slice(0,i),r)]),t=t.slice(i)}return a}},function(e,t,r){var n=r(16).Buffer;function i(e,t,r){var i=e._cipher.encryptBlock(e._prev)[0]^t;return e._prev=n.concat([e._prev.slice(1),n.from([r?t:i])]),i}t.encrypt=function(e,t,r){for(var o=t.length,a=n.allocUnsafe(o),s=-1;++s<o;)a[s]=i(e,t[s],r);return a}},function(e,t,r){var n=r(16).Buffer;function i(e,t,r){for(var n,i,a=-1,s=0;++a<8;)n=t&1<<7-a?128:0,s+=(128&(i=e._cipher.encryptBlock(e._prev)[0]^n))>>a%8,e._prev=o(e._prev,r?n:i);return s}function o(e,t){var r=e.length,i=-1,o=n.allocUnsafe(e.length);for(e=n.concat([e,n.from([t])]);++i<r;)o[i]=e[i]<<1|e[i+1]>>7;return o}t.encrypt=function(e,t,r){for(var o=t.length,a=n.allocUnsafe(o),s=-1;++s<o;)a[s]=i(e,t[s],r);return a}},function(e,t,r){(function(e){var n=r(102);function i(e){return e._prev=e._cipher.encryptBlock(e._prev),e._prev}t.encrypt=function(t,r){for(;t._cache.length<r.length;)t._cache=e.concat([t._cache,i(t)]);var o=t._cache.slice(0,r.length);return t._cache=t._cache.slice(r.length),n(r,o)}}).call(this,r(10).Buffer)},function(e,t,r){var n=r(16).Buffer,i=n.alloc(16,0);function o(e){var t=n.allocUnsafe(16);return t.writeUInt32BE(e[0]>>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function a(e){this.h=e,this.state=n.alloc(16,0),this.cache=n.allocUnsafe(0)}a.prototype.ghash=function(e){for(var t=-1;++t<e.length;)this.state[t]^=e[t];this._multiply()},a.prototype._multiply=function(){for(var e,t,r,n=[(e=this.h).readUInt32BE(0),e.readUInt32BE(4),e.readUInt32BE(8),e.readUInt32BE(12)],i=[0,0,0,0],a=-1;++a<128;){for(0!=(this.state[~~(a/8)]&1<<7-a%8)&&(i[0]^=n[0],i[1]^=n[1],i[2]^=n[2],i[3]^=n[3]),r=0!=(1&n[3]),t=3;t>0;t--)n[t]=n[t]>>>1|(1&n[t-1])<<31;n[0]=n[0]>>>1,r&&(n[0]=n[0]^225<<24)}this.state=o(i)},a.prototype.update=function(e){var t;for(this.cache=n.concat([this.cache,e]);this.cache.length>=16;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},a.prototype.final=function(e,t){return this.cache.length&&this.ghash(n.concat([this.cache,i],16)),this.ghash(o([0,e,0,t])),this.state},e.exports=a},function(e,t,r){var n=r(213),i=r(16).Buffer,o=r(152),a=r(214),s=r(71),u=r(115),c=r(116);function l(e,t,r){s.call(this),this._cache=new f,this._last=void 0,this._cipher=new u.AES(t),this._prev=i.from(r),this._mode=e,this._autopadding=!0}function f(){this.cache=i.allocUnsafe(0)}function d(e,t,r){var s=o[e.toLowerCase()];if(!s)throw new TypeError("invalid suite type");if("string"==typeof r&&(r=i.from(r)),"GCM"!==s.mode&&r.length!==s.iv)throw new TypeError("invalid iv length "+r.length);if("string"==typeof t&&(t=i.from(t)),t.length!==s.key/8)throw new TypeError("invalid key length "+t.length);return"stream"===s.type?new a(s.module,t,r,!0):"auth"===s.type?new n(s.module,t,r,!0):new l(s.module,t,r)}r(11)(l,s),l.prototype._update=function(e){var t,r;this._cache.add(e);for(var n=[];t=this._cache.get(this._autopadding);)r=this._mode.decrypt(this,t),n.push(r);return i.concat(n)},l.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return function(e){var t=e[15];if(t<1||t>16)throw new Error("unable to decrypt data");var r=-1;for(;++r<t;)if(e[r+(16-t)]!==t)throw new Error("unable to decrypt data");if(16===t)return;return e.slice(0,16-t)}(this._mode.decrypt(this,e));if(e)throw new Error("data not multiple of block length")},l.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},f.prototype.add=function(e){this.cache=i.concat([this.cache,e])},f.prototype.get=function(e){var t;if(e){if(this.cache.length>16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t}else if(this.cache.length>=16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t;return null},f.prototype.flush=function(){if(this.cache.length)return this.cache},t.createDecipher=function(e,t){var r=o[e.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var n=c(t,!1,r.key,r.iv);return d(e,n.key,n.iv)},t.createDecipheriv=d},function(e,t){t["des-ecb"]={key:8,iv:0},t["des-cbc"]=t.des={key:8,iv:8},t["des-ede3-cbc"]=t.des3={key:24,iv:8},t["des-ede3"]={key:24,iv:0},t["des-ede-cbc"]={key:16,iv:8},t["des-ede"]={key:16,iv:0}},function(e,t,r){(function(e){var n=r(215),i=r(349),o=r(350);var a={binary:!0,hex:!0,base64:!0};t.DiffieHellmanGroup=t.createDiffieHellmanGroup=t.getDiffieHellman=function(t){var r=new e(i[t].prime,"hex"),n=new e(i[t].gen,"hex");return new o(r,n)},t.createDiffieHellman=t.DiffieHellman=function t(r,i,s,u){return e.isBuffer(i)||void 0===a[i]?t(r,"binary",i,s):(i=i||"binary",u=u||"binary",s=s||new e([2]),e.isBuffer(s)||(s=new e(s,u)),"number"==typeof r?new o(n(r,s),s,!0):(e.isBuffer(r)||(r=new e(r,i)),new o(r,s,!0)))}}).call(this,r(10).Buffer)},function(e,t){},function(e,t){},function(e){e.exports=JSON.parse('{"modp1":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},"modp2":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},"modp5":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},"modp14":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},"modp15":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},"modp16":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},"modp17":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},"modp18":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}')},function(e,t,r){(function(t){var n=r(35),i=new(r(216)),o=new n(24),a=new n(11),s=new n(10),u=new n(3),c=new n(7),l=r(215),f=r(84);function d(e,r){return r=r||"utf8",t.isBuffer(e)||(e=new t(e,r)),this._pub=new n(e),this}function h(e,r){return r=r||"utf8",t.isBuffer(e)||(e=new t(e,r)),this._priv=new n(e),this}e.exports=g;var p={};function g(e,t,r){this.setGenerator(t),this.__prime=new n(e),this._prime=n.mont(this.__prime),this._primeLen=e.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,r?(this.setPublicKey=d,this.setPrivateKey=h):this._primeCode=8}function m(e,r){var n=new t(e.toArray());return r?n.toString(r):n}Object.defineProperty(g.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=function(e,t){var r=t.toString("hex"),n=[r,e.toString(16)].join("_");if(n in p)return p[n];var f,d=0;if(e.isEven()||!l.simpleSieve||!l.fermatTest(e)||!i.test(e))return d+=1,d+="02"===r||"05"===r?8:4,p[n]=d,d;switch(i.test(e.shrn(1))||(d+=2),r){case"02":e.mod(o).cmp(a)&&(d+=8);break;case"05":(f=e.mod(s)).cmp(u)&&f.cmp(c)&&(d+=8);break;default:d+=4}return p[n]=d,d}(this.__prime,this.__gen)),this._primeCode}}),g.prototype.generateKeys=function(){return this._priv||(this._priv=new n(f(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},g.prototype.computeSecret=function(e){var r=(e=(e=new n(e)).toRed(this._prime)).redPow(this._priv).fromRed(),i=new t(r.toArray()),o=this.getPrime();if(i.length<o.length){var a=new t(o.length-i.length);a.fill(0),i=t.concat([a,i])}return i},g.prototype.getPublicKey=function(e){return m(this._pub,e)},g.prototype.getPrivateKey=function(e){return m(this._priv,e)},g.prototype.getPrime=function(e){return m(this.__prime,e)},g.prototype.getGenerator=function(e){return m(this._gen,e)},g.prototype.setGenerator=function(e,r){return r=r||"utf8",t.isBuffer(e)||(e=new t(e,r)),this.__gen=e,this._gen=new n(e),this}}).call(this,r(10).Buffer)},function(e,t,r){var n=r(16).Buffer,i=r(101),o=r(352),a=r(11),s=r(360),u=r(391),c=r(202);function l(e){o.Writable.call(this);var t=c[e];if(!t)throw new Error("Unknown message digest");this._hashType=t.hash,this._hash=i(t.hash),this._tag=t.id,this._signType=t.sign}function f(e){o.Writable.call(this);var t=c[e];if(!t)throw new Error("Unknown message digest");this._hash=i(t.hash),this._tag=t.id,this._signType=t.sign}function d(e){return new l(e)}function h(e){return new f(e)}Object.keys(c).forEach((function(e){c[e].id=n.from(c[e].id,"hex"),c[e.toLowerCase()]=c[e]})),a(l,o.Writable),l.prototype._write=function(e,t,r){this._hash.update(e),r()},l.prototype.update=function(e,t){return"string"==typeof e&&(e=n.from(e,t)),this._hash.update(e),this},l.prototype.sign=function(e,t){this.end();var r=this._hash.digest(),n=s(r,e,this._hashType,this._signType,this._tag);return t?n.toString(t):n},a(f,o.Writable),f.prototype._write=function(e,t,r){this._hash.update(e),r()},f.prototype.update=function(e,t){return"string"==typeof e&&(e=n.from(e,t)),this._hash.update(e),this},f.prototype.verify=function(e,t,r){"string"==typeof t&&(t=n.from(t,r)),this.end();var i=this._hash.digest();return u(t,i,e,this._signType,this._tag)},e.exports={Sign:d,Verify:h,createSign:d,createVerify:h}},function(e,t,r){(t=e.exports=r(217)).Stream=t,t.Readable=t,t.Writable=r(221),t.Duplex=r(89),t.Transform=r(222),t.PassThrough=r(358),t.finished=r(154),t.pipeline=r(359)},function(e,t){},function(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 i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(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)}}var a=r(10).Buffer,s=r(355).inspect,u=s&&s.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,c;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 a.alloc(0);for(var t,r,n,i=a.allocUnsafe(e>>>0),o=this.head,s=0;o;)t=o.data,r=i,n=s,a.prototype.copy.call(t,r,n),s+=o.data.length,o=o.next;return i}},{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 i=t.data,o=e>i.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0==(e-=o)){o===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=a.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0==(e-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,t}},{key:u,value:function(e,t){return s(this,function(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}({},t,{depth:0,customInspect:!1}))}}])&&o(t.prototype,r),c&&o(t,c),e}()},function(e,t){},function(e,t,r){"use strict";(function(t){var n;function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var o=r(154),a=Symbol("lastResolve"),s=Symbol("lastReject"),u=Symbol("error"),c=Symbol("ended"),l=Symbol("lastPromise"),f=Symbol("handlePromise"),d=Symbol("stream");function h(e,t){return{value:e,done:t}}function p(e){var t=e[a];if(null!==t){var r=e[d].read();null!==r&&(e[l]=null,e[a]=null,e[s]=null,t(h(r,!1)))}}function g(e){t.nextTick(p,e)}var m=Object.getPrototypeOf((function(){})),y=Object.setPrototypeOf((i(n={get stream(){return this[d]},next:function(){var e=this,r=this[u];if(null!==r)return Promise.reject(r);if(this[c])return Promise.resolve(h(void 0,!0));if(this[d].destroyed)return new Promise((function(r,n){t.nextTick((function(){e[u]?n(e[u]):r(h(void 0,!0))}))}));var n,i=this[l];if(i)n=new Promise(function(e,t){return function(r,n){e.then((function(){t[c]?r(h(void 0,!0)):t[f](r,n)}),n)}}(i,this));else{var o=this[d].read();if(null!==o)return Promise.resolve(h(o,!1));n=new Promise(this[f])}return this[l]=n,n}},Symbol.asyncIterator,(function(){return this})),i(n,"return",(function(){var e=this;return new Promise((function(t,r){e[d].destroy(null,(function(e){e?r(e):t(h(void 0,!0))}))}))})),n),m);e.exports=function(e){var t,r=Object.create(y,(i(t={},d,{value:e,writable:!0}),i(t,a,{value:null,writable:!0}),i(t,s,{value:null,writable:!0}),i(t,u,{value:null,writable:!0}),i(t,c,{value:e._readableState.endEmitted,writable:!0}),i(t,f,{value:function(e,t){var n=r[d].read();n?(r[l]=null,r[a]=null,r[s]=null,e(h(n,!1))):(r[a]=e,r[s]=t)},writable:!0}),t));return r[l]=null,o(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[s];return null!==t&&(r[l]=null,r[a]=null,r[s]=null,t(e)),void(r[u]=e)}var n=r[a];null!==n&&(r[l]=null,r[a]=null,r[s]=null,n(h(void 0,!0))),r[c]=!0})),e.on("readable",g.bind(null,r)),r}}).call(this,r(19))},function(e,t){e.exports=function(){throw new Error("Readable.from is not available in the browser")}},function(e,t,r){"use strict";e.exports=i;var n=r(222);function i(e){if(!(this instanceof i))return new i(e);n.call(this,e)}r(11)(i,n),i.prototype._transform=function(e,t,r){r(null,e)}},function(e,t,r){"use strict";var n;var i=r(88).codes,o=i.ERR_MISSING_ARGS,a=i.ERR_STREAM_DESTROYED;function s(e){if(e)throw e}function u(e,t,i,o){o=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(o);var s=!1;e.on("close",(function(){s=!0})),void 0===n&&(n=r(154)),n(e,{readable:t,writable:i},(function(e){if(e)return o(e);s=!0,o()}));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 o(t||new a("pipe"))}}function c(e){e()}function l(e,t){return e.pipe(t)}function f(e){return e.length?"function"!=typeof e[e.length-1]?s:e.pop():s}e.exports=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n,i=f(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new o("streams");var a=t.map((function(e,r){var o=r<t.length-1;return u(e,o,r>0,(function(e){n||(n=e),e&&a.forEach(c),o||(a.forEach(c),i(n))}))}));return t.reduce(l)}},function(e,t,r){var n=r(16).Buffer,i=r(200),o=r(155),a=r(156).ec,s=r(228),u=r(118),c=r(234);function l(e,t,r,o){if((e=n.from(e.toArray())).length<t.byteLength()){var a=n.alloc(t.byteLength()-e.length);e=n.concat([a,e])}var s=r.length,u=function(e,t){e=(e=f(e,t)).mod(t);var r=n.from(e.toArray());if(r.length<t.byteLength()){var i=n.alloc(t.byteLength()-r.length);r=n.concat([i,r])}return r}(r,t),c=n.alloc(s);c.fill(1);var l=n.alloc(s);return l=i(o,l).update(c).update(n.from([0])).update(e).update(u).digest(),c=i(o,l).update(c).digest(),{k:l=i(o,l).update(c).update(n.from([1])).update(e).update(u).digest(),v:c=i(o,l).update(c).digest()}}function f(e,t){var r=new s(e),n=(e.length<<3)-t.bitLength();return n>0&&r.ishrn(n),r}function d(e,t,r){var o,a;do{for(o=n.alloc(0);8*o.length<e.bitLength();)t.v=i(r,t.k).update(t.v).digest(),o=n.concat([o,t.v]);a=f(o,e),t.k=i(r,t.k).update(t.v).update(n.from([0])).digest(),t.v=i(r,t.k).update(t.v).digest()}while(-1!==a.cmp(e));return a}function h(e,t,r,n){return e.toRed(s.mont(r)).redPow(t).fromRed().mod(n)}e.exports=function(e,t,r,i,p){var g=u(t);if(g.curve){if("ecdsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong private key type");return function(e,t){var r=c[t.curve.join(".")];if(!r)throw new Error("unknown curve "+t.curve.join("."));var i=new a(r).keyFromPrivate(t.privateKey).sign(e);return n.from(i.toDER())}(e,g)}if("dsa"===g.type){if("dsa"!==i)throw new Error("wrong private key type");return function(e,t,r){var i,o=t.params.priv_key,a=t.params.p,u=t.params.q,c=t.params.g,p=new s(0),g=f(e,u).mod(u),m=!1,y=l(o,u,e,r);for(;!1===m;)i=d(u,y,r),p=h(c,i,a,u),0===(m=i.invm(u).imul(g.add(o.mul(p))).mod(u)).cmpn(0)&&(m=!1,p=new s(0));return function(e,t){e=e.toArray(),t=t.toArray(),128&e[0]&&(e=[0].concat(e));128&t[0]&&(t=[0].concat(t));var r=[48,e.length+t.length+4,2,e.length];return r=r.concat(e,[2,t.length],t),n.from(r)}(p,m)}(e,g,r)}if("rsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong private key type");e=n.concat([p,e]);for(var m=g.modulus.byteLength(),y=[0,1];e.length+y.length+1<m;)y.push(255);y.push(0);for(var b=-1;++b<e.length;)y.push(e[b]);return o(y,g)},e.exports.getKey=l,e.exports.makeKey=d},function(e,t,r){(function(e){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var a;"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{a="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(362).Buffer}catch(e){}function s(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+e)}function u(e,t,r){var n=s(e,r);return r-1>=t&&(n|=s(e,r-1)<<4),n}function c(e,t,r,i){for(var o=0,a=0,s=Math.min(e.length,r),u=t;u<s;u++){var c=e.charCodeAt(u)-48;o*=i,a=c>=49?c-49+10:c>=17?c-17+10:c,n(c>=0&&a<i,"Invalid character"),o+=a}return o}function l(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,r):(this._parseBase(e,t,i),"le"===r&&this._initArray(this.toArray(),t,r)))},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,a,s=0;if("be"===r)for(i=e.length-1,o=0;i>=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i<e.length;i+=3)a=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this._strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,a=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=u(e,t,n)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)i=u(e,t,n)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this._strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,a=o%n,s=Math.min(o,o-a)+r,u=0,l=r;l<s;l+=n)u=c(e,l,l+n,t),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==a){var f=1;for(u=c(e,l,e.length,t),l=0;l<a;l++)f*=t;this.imuln(f),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this._strip()},o.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype._move=function(e){l(e,this)},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch(e){o.prototype.inspect=f}else o.prototype.inspect=f;function f(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var d=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,a=0;a<this.length;a++){var s=this.words[a],u=(16777215&(s<<i|o)).toString(16);r=0!==(o=s>>>24-i&16777215)||a!==this.length-1?d[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=h[e],l=p[e];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var g=f.modrn(l).toString(e);r=(f=f.idivn(l)).isZero()?g+r:d[c-g.length]+g+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16,2)},a&&(o.prototype.toBuffer=function(e,t){return this.toArrayLike(a,e,t)}),o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function g(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var c=1;c<n;c++){for(var l=u>>>26,f=67108863&u,d=Math.min(c,t.length-1),h=Math.max(0,c-e.length+1);h<=d;h++){var p=c-h|0;l+=(a=(i=0|e.words[p])*(o=0|t.words[h])+f)/67108864|0,f=67108863&a}r.words[c]=0|f,u=0|l}return 0!==u?r.words[c]=0|u:r.length--,r._strip()}o.prototype.toArrayLike=function(e,t,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var a=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](a,i),a},o.prototype._toArrayLikeLE=function(e,t){for(var r=0,n=0,i=0,o=0;i<this.length;i++){var a=this.words[i]<<o|n;e[r++]=255&a,r<e.length&&(e[r++]=a>>8&255),r<e.length&&(e[r++]=a>>16&255),6===o?(r<e.length&&(e[r++]=a>>24&255),n=0,o=0):(n=a>>>24,o+=2)}if(r<e.length)for(e[r++]=n;r<e.length;)e[r++]=0},o.prototype._toArrayLikeBE=function(e,t){for(var r=e.length-1,n=0,i=0,o=0;i<this.length;i++){var a=this.words[i]<<o|n;e[r--]=255&a,r>=0&&(e[r--]=a>>8&255),r>=0&&(e[r--]=a>>16&255),6===o?(r>=0&&(e[r--]=a>>24&255),n=0,o=0):(n=a>>>24,o+=2)}if(r>=0)for(e[r--]=n;r>=0;)e[r--]=0},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this._strip()},o.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this._strip()},o.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this._strip()},o.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this._strip()},o.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o<n.length;o++)t=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&t,i=t>>>26;for(;0!==i&&o<r.length;o++)t=(0|r.words[o])+i,this.words[o]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,a=0;a<n.length;a++)o=(t=(0|r.words[a])-(0|n.words[a])+o)>>26,this.words[a]=67108863&t;for(;0!==o&&a<r.length;a++)o=(t=(0|r.words[a])+o)>>26,this.words[a]=67108863&t;if(0===o&&a<r.length&&r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=Math.max(this.length,a),r!==this&&(this.negative=1),this._strip()},o.prototype.sub=function(e){return this.clone().isub(e)};var m=function(e,t,r){var n,i,o,a=e.words,s=t.words,u=r.words,c=0,l=0|a[0],f=8191&l,d=l>>>13,h=0|a[1],p=8191&h,g=h>>>13,m=0|a[2],y=8191&m,b=m>>>13,_=0|a[3],w=8191&_,v=_>>>13,E=0|a[4],S=8191&E,O=E>>>13,T=0|a[5],A=8191&T,M=T>>>13,D=0|a[6],I=8191&D,j=D>>>13,R=0|a[7],N=8191&R,k=R>>>13,C=0|a[8],L=8191&C,x=C>>>13,P=0|a[9],B=8191&P,U=P>>>13,F=0|s[0],W=8191&F,H=F>>>13,z=0|s[1],q=8191&z,V=z>>>13,G=0|s[2],Y=8191&G,$=G>>>13,K=0|s[3],Z=8191&K,X=K>>>13,J=0|s[4],Q=8191&J,ee=J>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,le=0|s[8],fe=8191&le,de=le>>>13,he=0|s[9],pe=8191&he,ge=he>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(c+(n=Math.imul(f,W))|0)+((8191&(i=(i=Math.imul(f,H))+Math.imul(d,W)|0))<<13)|0;c=((o=Math.imul(d,H))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(p,W),i=(i=Math.imul(p,H))+Math.imul(g,W)|0,o=Math.imul(g,H);var ye=(c+(n=n+Math.imul(f,q)|0)|0)+((8191&(i=(i=i+Math.imul(f,V)|0)+Math.imul(d,q)|0))<<13)|0;c=((o=o+Math.imul(d,V)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,W),i=(i=Math.imul(y,H))+Math.imul(b,W)|0,o=Math.imul(b,H),n=n+Math.imul(p,q)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(g,q)|0,o=o+Math.imul(g,V)|0;var be=(c+(n=n+Math.imul(f,Y)|0)|0)+((8191&(i=(i=i+Math.imul(f,$)|0)+Math.imul(d,Y)|0))<<13)|0;c=((o=o+Math.imul(d,$)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(w,W),i=(i=Math.imul(w,H))+Math.imul(v,W)|0,o=Math.imul(v,H),n=n+Math.imul(y,q)|0,i=(i=i+Math.imul(y,V)|0)+Math.imul(b,q)|0,o=o+Math.imul(b,V)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(g,Y)|0,o=o+Math.imul(g,$)|0;var _e=(c+(n=n+Math.imul(f,Z)|0)|0)+((8191&(i=(i=i+Math.imul(f,X)|0)+Math.imul(d,Z)|0))<<13)|0;c=((o=o+Math.imul(d,X)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(S,W),i=(i=Math.imul(S,H))+Math.imul(O,W)|0,o=Math.imul(O,H),n=n+Math.imul(w,q)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(v,q)|0,o=o+Math.imul(v,V)|0,n=n+Math.imul(y,Y)|0,i=(i=i+Math.imul(y,$)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,$)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(g,Z)|0,o=o+Math.imul(g,X)|0;var we=(c+(n=n+Math.imul(f,Q)|0)|0)+((8191&(i=(i=i+Math.imul(f,ee)|0)+Math.imul(d,Q)|0))<<13)|0;c=((o=o+Math.imul(d,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(A,W),i=(i=Math.imul(A,H))+Math.imul(M,W)|0,o=Math.imul(M,H),n=n+Math.imul(S,q)|0,i=(i=i+Math.imul(S,V)|0)+Math.imul(O,q)|0,o=o+Math.imul(O,V)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,$)|0)+Math.imul(v,Y)|0,o=o+Math.imul(v,$)|0,n=n+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,X)|0)+Math.imul(b,Z)|0,o=o+Math.imul(b,X)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,ee)|0;var ve=(c+(n=n+Math.imul(f,re)|0)|0)+((8191&(i=(i=i+Math.imul(f,ne)|0)+Math.imul(d,re)|0))<<13)|0;c=((o=o+Math.imul(d,ne)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(I,W),i=(i=Math.imul(I,H))+Math.imul(j,W)|0,o=Math.imul(j,H),n=n+Math.imul(A,q)|0,i=(i=i+Math.imul(A,V)|0)+Math.imul(M,q)|0,o=o+Math.imul(M,V)|0,n=n+Math.imul(S,Y)|0,i=(i=i+Math.imul(S,$)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,$)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,X)|0,n=n+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(g,re)|0,o=o+Math.imul(g,ne)|0;var Ee=(c+(n=n+Math.imul(f,oe)|0)|0)+((8191&(i=(i=i+Math.imul(f,ae)|0)+Math.imul(d,oe)|0))<<13)|0;c=((o=o+Math.imul(d,ae)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(N,W),i=(i=Math.imul(N,H))+Math.imul(k,W)|0,o=Math.imul(k,H),n=n+Math.imul(I,q)|0,i=(i=i+Math.imul(I,V)|0)+Math.imul(j,q)|0,o=o+Math.imul(j,V)|0,n=n+Math.imul(A,Y)|0,i=(i=i+Math.imul(A,$)|0)+Math.imul(M,Y)|0,o=o+Math.imul(M,$)|0,n=n+Math.imul(S,Z)|0,i=(i=i+Math.imul(S,X)|0)+Math.imul(O,Z)|0,o=o+Math.imul(O,X)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,ee)|0,n=n+Math.imul(y,re)|0,i=(i=i+Math.imul(y,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(g,oe)|0,o=o+Math.imul(g,ae)|0;var Se=(c+(n=n+Math.imul(f,ue)|0)|0)+((8191&(i=(i=i+Math.imul(f,ce)|0)+Math.imul(d,ue)|0))<<13)|0;c=((o=o+Math.imul(d,ce)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(L,W),i=(i=Math.imul(L,H))+Math.imul(x,W)|0,o=Math.imul(x,H),n=n+Math.imul(N,q)|0,i=(i=i+Math.imul(N,V)|0)+Math.imul(k,q)|0,o=o+Math.imul(k,V)|0,n=n+Math.imul(I,Y)|0,i=(i=i+Math.imul(I,$)|0)+Math.imul(j,Y)|0,o=o+Math.imul(j,$)|0,n=n+Math.imul(A,Z)|0,i=(i=i+Math.imul(A,X)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,X)|0,n=n+Math.imul(S,Q)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(v,re)|0,o=o+Math.imul(v,ne)|0,n=n+Math.imul(y,oe)|0,i=(i=i+Math.imul(y,ae)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,ae)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(g,ue)|0,o=o+Math.imul(g,ce)|0;var Oe=(c+(n=n+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,de)|0)+Math.imul(d,fe)|0))<<13)|0;c=((o=o+Math.imul(d,de)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(B,W),i=(i=Math.imul(B,H))+Math.imul(U,W)|0,o=Math.imul(U,H),n=n+Math.imul(L,q)|0,i=(i=i+Math.imul(L,V)|0)+Math.imul(x,q)|0,o=o+Math.imul(x,V)|0,n=n+Math.imul(N,Y)|0,i=(i=i+Math.imul(N,$)|0)+Math.imul(k,Y)|0,o=o+Math.imul(k,$)|0,n=n+Math.imul(I,Z)|0,i=(i=i+Math.imul(I,X)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,X)|0,n=n+Math.imul(A,Q)|0,i=(i=i+Math.imul(A,ee)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,ee)|0,n=n+Math.imul(S,re)|0,i=(i=i+Math.imul(S,ne)|0)+Math.imul(O,re)|0,o=o+Math.imul(O,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,ae)|0,n=n+Math.imul(y,ue)|0,i=(i=i+Math.imul(y,ce)|0)+Math.imul(b,ue)|0,o=o+Math.imul(b,ce)|0,n=n+Math.imul(p,fe)|0,i=(i=i+Math.imul(p,de)|0)+Math.imul(g,fe)|0,o=o+Math.imul(g,de)|0;var Te=(c+(n=n+Math.imul(f,pe)|0)|0)+((8191&(i=(i=i+Math.imul(f,ge)|0)+Math.imul(d,pe)|0))<<13)|0;c=((o=o+Math.imul(d,ge)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(B,q),i=(i=Math.imul(B,V))+Math.imul(U,q)|0,o=Math.imul(U,V),n=n+Math.imul(L,Y)|0,i=(i=i+Math.imul(L,$)|0)+Math.imul(x,Y)|0,o=o+Math.imul(x,$)|0,n=n+Math.imul(N,Z)|0,i=(i=i+Math.imul(N,X)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,X)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,ee)|0,n=n+Math.imul(A,re)|0,i=(i=i+Math.imul(A,ne)|0)+Math.imul(M,re)|0,o=o+Math.imul(M,ne)|0,n=n+Math.imul(S,oe)|0,i=(i=i+Math.imul(S,ae)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,ae)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,ce)|0,n=n+Math.imul(y,fe)|0,i=(i=i+Math.imul(y,de)|0)+Math.imul(b,fe)|0,o=o+Math.imul(b,de)|0;var Ae=(c+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,ge)|0)+Math.imul(g,pe)|0))<<13)|0;c=((o=o+Math.imul(g,ge)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(B,Y),i=(i=Math.imul(B,$))+Math.imul(U,Y)|0,o=Math.imul(U,$),n=n+Math.imul(L,Z)|0,i=(i=i+Math.imul(L,X)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,X)|0,n=n+Math.imul(N,Q)|0,i=(i=i+Math.imul(N,ee)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,ee)|0,n=n+Math.imul(I,re)|0,i=(i=i+Math.imul(I,ne)|0)+Math.imul(j,re)|0,o=o+Math.imul(j,ne)|0,n=n+Math.imul(A,oe)|0,i=(i=i+Math.imul(A,ae)|0)+Math.imul(M,oe)|0,o=o+Math.imul(M,ae)|0,n=n+Math.imul(S,ue)|0,i=(i=i+Math.imul(S,ce)|0)+Math.imul(O,ue)|0,o=o+Math.imul(O,ce)|0,n=n+Math.imul(w,fe)|0,i=(i=i+Math.imul(w,de)|0)+Math.imul(v,fe)|0,o=o+Math.imul(v,de)|0;var Me=(c+(n=n+Math.imul(y,pe)|0)|0)+((8191&(i=(i=i+Math.imul(y,ge)|0)+Math.imul(b,pe)|0))<<13)|0;c=((o=o+Math.imul(b,ge)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(B,Z),i=(i=Math.imul(B,X))+Math.imul(U,Z)|0,o=Math.imul(U,X),n=n+Math.imul(L,Q)|0,i=(i=i+Math.imul(L,ee)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,ee)|0,n=n+Math.imul(N,re)|0,i=(i=i+Math.imul(N,ne)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ne)|0,n=n+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,ae)|0)+Math.imul(j,oe)|0,o=o+Math.imul(j,ae)|0,n=n+Math.imul(A,ue)|0,i=(i=i+Math.imul(A,ce)|0)+Math.imul(M,ue)|0,o=o+Math.imul(M,ce)|0,n=n+Math.imul(S,fe)|0,i=(i=i+Math.imul(S,de)|0)+Math.imul(O,fe)|0,o=o+Math.imul(O,de)|0;var De=(c+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,ge)|0)+Math.imul(v,pe)|0))<<13)|0;c=((o=o+Math.imul(v,ge)|0)+(i>>>13)|0)+(De>>>26)|0,De&=67108863,n=Math.imul(B,Q),i=(i=Math.imul(B,ee))+Math.imul(U,Q)|0,o=Math.imul(U,ee),n=n+Math.imul(L,re)|0,i=(i=i+Math.imul(L,ne)|0)+Math.imul(x,re)|0,o=o+Math.imul(x,ne)|0,n=n+Math.imul(N,oe)|0,i=(i=i+Math.imul(N,ae)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,ae)|0,n=n+Math.imul(I,ue)|0,i=(i=i+Math.imul(I,ce)|0)+Math.imul(j,ue)|0,o=o+Math.imul(j,ce)|0,n=n+Math.imul(A,fe)|0,i=(i=i+Math.imul(A,de)|0)+Math.imul(M,fe)|0,o=o+Math.imul(M,de)|0;var Ie=(c+(n=n+Math.imul(S,pe)|0)|0)+((8191&(i=(i=i+Math.imul(S,ge)|0)+Math.imul(O,pe)|0))<<13)|0;c=((o=o+Math.imul(O,ge)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(B,re),i=(i=Math.imul(B,ne))+Math.imul(U,re)|0,o=Math.imul(U,ne),n=n+Math.imul(L,oe)|0,i=(i=i+Math.imul(L,ae)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,ae)|0,n=n+Math.imul(N,ue)|0,i=(i=i+Math.imul(N,ce)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,ce)|0,n=n+Math.imul(I,fe)|0,i=(i=i+Math.imul(I,de)|0)+Math.imul(j,fe)|0,o=o+Math.imul(j,de)|0;var je=(c+(n=n+Math.imul(A,pe)|0)|0)+((8191&(i=(i=i+Math.imul(A,ge)|0)+Math.imul(M,pe)|0))<<13)|0;c=((o=o+Math.imul(M,ge)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,n=Math.imul(B,oe),i=(i=Math.imul(B,ae))+Math.imul(U,oe)|0,o=Math.imul(U,ae),n=n+Math.imul(L,ue)|0,i=(i=i+Math.imul(L,ce)|0)+Math.imul(x,ue)|0,o=o+Math.imul(x,ce)|0,n=n+Math.imul(N,fe)|0,i=(i=i+Math.imul(N,de)|0)+Math.imul(k,fe)|0,o=o+Math.imul(k,de)|0;var Re=(c+(n=n+Math.imul(I,pe)|0)|0)+((8191&(i=(i=i+Math.imul(I,ge)|0)+Math.imul(j,pe)|0))<<13)|0;c=((o=o+Math.imul(j,ge)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(B,ue),i=(i=Math.imul(B,ce))+Math.imul(U,ue)|0,o=Math.imul(U,ce),n=n+Math.imul(L,fe)|0,i=(i=i+Math.imul(L,de)|0)+Math.imul(x,fe)|0,o=o+Math.imul(x,de)|0;var Ne=(c+(n=n+Math.imul(N,pe)|0)|0)+((8191&(i=(i=i+Math.imul(N,ge)|0)+Math.imul(k,pe)|0))<<13)|0;c=((o=o+Math.imul(k,ge)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,n=Math.imul(B,fe),i=(i=Math.imul(B,de))+Math.imul(U,fe)|0,o=Math.imul(U,de);var ke=(c+(n=n+Math.imul(L,pe)|0)|0)+((8191&(i=(i=i+Math.imul(L,ge)|0)+Math.imul(x,pe)|0))<<13)|0;c=((o=o+Math.imul(x,ge)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863;var Ce=(c+(n=Math.imul(B,pe))|0)+((8191&(i=(i=Math.imul(B,ge))+Math.imul(U,pe)|0))<<13)|0;return c=((o=Math.imul(U,ge))+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,u[0]=me,u[1]=ye,u[2]=be,u[3]=_e,u[4]=we,u[5]=ve,u[6]=Ee,u[7]=Se,u[8]=Oe,u[9]=Te,u[10]=Ae,u[11]=Me,u[12]=De,u[13]=Ie,u[14]=je,u[15]=Re,u[16]=Ne,u[17]=ke,u[18]=Ce,0!==c&&(u[19]=c,r.length++),r};function y(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var a=i;i=0;for(var s=67108863&n,u=Math.min(o,t.length-1),c=Math.max(0,o-e.length+1);c<=u;c++){var l=o-c,f=(0|e.words[l])*(0|t.words[c]),d=67108863&f;s=67108863&(d=d+s|0),i+=(a=(a=a+(f/67108864|0)|0)+(d>>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function b(e,t,r){return y(e,t,r)}function _(e,t){this.x=e,this.y=t}Math.imul||(m=g),o.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?m(this,e,t):r<63?g(this,e,t):r<1024?y(this,e,t):b(this,e,t)},_.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},_.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},_.prototype.permute=function(e,t,r,n,i,o){for(var a=0;a<o;a++)n[a]=t[e[a]],i[a]=r[e[a]]},_.prototype.transform=function(e,t,r,n,i,o){this.permute(o,e,t,r,n,i);for(var a=1;a<i;a<<=1)for(var s=a<<1,u=Math.cos(2*Math.PI/s),c=Math.sin(2*Math.PI/s),l=0;l<i;l+=s)for(var f=u,d=c,h=0;h<a;h++){var p=r[l+h],g=n[l+h],m=r[l+h+a],y=n[l+h+a],b=f*m-d*y;y=f*y+d*m,m=b,r[l+h]=p+m,n[l+h]=g+y,r[l+h+a]=p-m,n[l+h+a]=g-y,h!==s&&(b=u*f-c*d,d=u*d+c*f,f=b)}},_.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},_.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},_.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e},_.prototype.convert13b=function(e,t,r,i){for(var o=0,a=0;a<t;a++)o+=0|e[a],r[2*a]=8191&o,o>>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*t;a<i;++a)r[a]=0;n(0===o),n(0==(-8192&o))},_.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},_.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),o=this.stub(n),a=new Array(n),s=new Array(n),u=new Array(n),c=new Array(n),l=new Array(n),f=new Array(n),d=r.words;d.length=n,this.convert13b(e.words,e.length,a,n),this.convert13b(t.words,t.length,c,n),this.transform(a,o,s,u,n,i),this.transform(c,o,l,f,n,i);for(var h=0;h<n;h++){var p=s[h]*l[h]-u[h]*f[h];u[h]=s[h]*f[h]+u[h]*l[h],s[h]=p}return this.conjugate(s,u,n),this.transform(s,u,d,o,n,i),this.conjugate(d,o,n),this.normalize13b(d,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r._strip()},o.prototype.mul=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),b(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function(e){var t=e<0;t&&(e=-e),n("number"==typeof e),n(e<67108864);for(var r=0,i=0;i<this.length;i++){var o=(0|this.words[i])*e,a=(67108863&o)+(67108863&r);r>>=26,r+=o/67108864|0,r+=a>>>26,this.words[i]=67108863&a}return 0!==r&&(this.words[i]=r,this.length++),t?this.ineg():this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=e.words[n]>>>i&1}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var i=r.sqr();n<t.length;n++,i=i.sqr())0!==t[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t<this.length;t++){var s=this.words[t]&o,u=(0|this.words[t])-s<<r;this.words[t]=u|a,a=s>>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this._strip()},o.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},o.prototype.iushrn=function(e,t,r){var i;n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<<o,u=r;if(i-=a,i=Math.max(0,i),u){for(var c=0;c<a;c++)u.words[c]=this.words[c];u.length=a}if(0===a);else if(this.length>a)for(this.length-=a,c=0;c<this.length;c++)this.words[c]=this.words[c+a];else this.words[0]=0,this.length=1;var l=0;for(c=this.length-1;c>=0&&(0!==l||c>=i);c--){var f=0|this.words[c];this.words[c]=l<<26-o|f>>>o,l=f&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<<t;return!(this.length<=r)&&!!(this.words[r]&i)},o.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this._strip()},o.prototype.maskn=function(e){return this.clone().imaskn(e)},o.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<=e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},o.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this._strip()},o.prototype.addn=function(e){return this.clone().iaddn(e)},o.prototype.subn=function(e){return this.clone().isubn(e)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(e,t,r){var i,o,a=e.length+r;this._expand(a);var s=0;for(i=0;i<e.length;i++){o=(0|this.words[i+r])+s;var u=(0|e.words[i])*t;s=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)s=(o=(0|this.words[i+r])+s)>>26,this.words[i+r]=67108863&o;if(0===s)return this._strip();for(n(-1===s),s=0,i=0;i<this.length;i++)s=(o=-(0|this.words[i])+s)>>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,a=0|i.words[i.length-1];0!==(r=26-this._countBits(a))&&(i=i.ushln(r),n.iushln(r),a=0|i.words[i.length-1]);var s,u=n.length-i.length;if("mod"!==t){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c<s.length;c++)s.words[c]=0}var l=n.clone()._ishlnsubmul(i,1,u);0===l.negative&&(n=l,s&&(s.words[u]=1));for(var f=u-1;f>=0;f--){var d=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]);for(d=Math.min(d/a|0,67108863),n._ishlnsubmul(i,d,f);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1);s&&(s.words[f]=d)}return s&&s._strip(),n._strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:i,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modrn(e.words[0]))}:this._wordDiv(e,t);var i,a,s},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=(1<<26)%e,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%e;return t?-i:i},o.prototype.modn=function(e){return this.modrn(e)},o.prototype.idivn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/e|0,r=o%e}return this._strip(),t?this.ineg():this},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var l=r.clone(),f=t.clone();!t.isZero();){for(var d=0,h=1;0==(t.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(l),a.isub(f)),i.iushrn(1),a.iushrn(1);for(var p=0,g=1;0==(r.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(f)),s.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(s),a.isub(u)):(r.isub(t),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,a=new o(1),s=new o(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,l=1;0==(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var f=0,d=1;0==(r.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(r.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s)):(r.isub(t),s.isub(a))}return(i=0===t.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,a=r;0!==o&&a<this.length;a++){var s=0|this.words[a];o=(s+=o)>>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},o.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},o.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new A(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var w={k256:null,p224:null,p192:null,p25519:null};function v(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function E(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function S(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function O(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function T(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function M(e){A.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},i(E,v),E.prototype.split=function(e,t){for(var r=Math.min(e.length,9),n=0;n<r;n++)t.words[n]=e.words[n];if(t.length=r,e.length<=9)return e.words[0]=0,void(e.length=1);var i=e.words[9];for(t.words[t.length++]=4194303&i,n=10;n<e.length;n++){var o=0|e.words[n];e.words[n-10]=(4194303&o)<<4|i>>>22,i=o}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},E.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(S,v),i(O,v),i(T,v),T.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(w[e])return w[e];var t;if("k256"===e)t=new E;else if("p224"===e)t=new S;else if("p192"===e)t=new O;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new T}return w[e]=t,t},A.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},A.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},A.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(l(e,e.umod(this.m)._forceRed(this)),e)},A.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},A.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},A.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},A.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},A.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},A.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},A.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},A.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},A.prototype.isqr=function(e){return this.imul(e,e.clone())},A.prototype.sqr=function(e){return this.mul(e,e)},A.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var f=this.pow(l,i),d=this.pow(e,i.addn(1).iushrn(1)),h=this.pow(e,i),p=a;0!==h.cmp(s);){for(var g=h,m=0;0!==g.cmp(s);m++)g=g.redSqr();n(m<p);var y=this.pow(f,new o(1).iushln(p-m-1));d=d.redMul(y),f=y.redSqr(),h=h.redMul(f),p=m}return d},A.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},A.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var i=r[0],a=0,s=0,u=t.bitLength()%26;for(0===u&&(u=26),n=t.length-1;n>=0;n--){for(var c=t.words[n],l=u-1;l>=0;l--){var f=c>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==a?(a<<=1,a|=f,(4===++s||0===n&&0===l)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}u=26}return i},A.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},A.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new M(e)},i(M,A),M.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},M.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},M.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},M.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},M.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,r(97)(e))},function(e,t){},function(e){e.exports=JSON.parse('{"name":"elliptic","version":"6.5.4","description":"EC cryptography","main":"lib/elliptic.js","files":["lib"],"scripts":{"lint":"eslint lib test","lint:fix":"npm run lint -- --fix","unit":"istanbul test _mocha --reporter=spec test/index.js","test":"npm run lint && npm run unit","version":"grunt dist && git add dist/"},"repository":{"type":"git","url":"git@github.com:indutny/elliptic"},"keywords":["EC","Elliptic","curve","Cryptography"],"author":"Fedor Indutny <fedor@indutny.com>","license":"MIT","bugs":{"url":"https://github.com/indutny/elliptic/issues"},"homepage":"https://github.com/indutny/elliptic","devDependencies":{"brfs":"^2.0.2","coveralls":"^3.1.0","eslint":"^7.6.0","grunt":"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1","istanbul":"^0.4.5","mocha":"^8.0.1"},"dependencies":{"bn.js":"^4.11.9","brorand":"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1","inherits":"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"}}')},function(e,t,r){"use strict";var n=r(45),i=r(35),o=r(11),a=r(117),s=n.assert;function u(e){a.call(this,"short",e),this.a=new i(e.a,16).toRed(this.red),this.b=new i(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function c(e,t,r,n){a.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new i(t,16),this.y=new i(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function l(e,t,r,n){a.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new i(0)):(this.x=new i(t,16),this.y=new i(r,16),this.z=new i(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}o(u,a),e.exports=u,u.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new i(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=(t=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(e.lambda)r=new i(e.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(t))?r=o[0]:(r=o[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map((function(e){return{a:new i(e.a,16),b:new i(e.b,16)}})):this._getEndoBasis(r)}}},u.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:i.mont(e),r=new i(2).toRed(t).redInvm(),n=r.redNeg(),o=new i(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(o).fromRed(),n.redSub(o).fromRed()]},u.prototype._getEndoBasis=function(e){for(var t,r,n,o,a,s,u,c,l,f=this.n.ushrn(Math.floor(this.n.bitLength()/2)),d=e,h=this.n.clone(),p=new i(1),g=new i(0),m=new i(0),y=new i(1),b=0;0!==d.cmpn(0);){var _=h.div(d);c=h.sub(_.mul(d)),l=m.sub(_.mul(p));var w=y.sub(_.mul(g));if(!n&&c.cmp(f)<0)t=u.neg(),r=p,n=c.neg(),o=l;else if(n&&2==++b)break;u=c,h=d,d=c,m=p,p=l,y=g,g=w}a=c.neg(),s=l;var v=n.sqr().add(o.sqr());return a.sqr().add(s.sqr()).cmp(v)>=0&&(a=t,s=r),n.negative&&(n=n.neg(),o=o.neg()),a.negative&&(a=a.neg(),s=s.neg()),[{a:n,b:o},{a:a,b:s}]},u.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),u=i.mul(r.b),c=o.mul(n.b);return{k1:e.sub(a).sub(s),k2:u.add(c).neg()}},u.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=n.fromRed().isOdd();return(t&&!o||!t&&o)&&(n=n.redNeg()),this.point(e,n)},u.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},u.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o<e.length;o++){var a=this._endoSplit(t[o]),s=e[o],u=s._getBeta();a.k1.negative&&(a.k1.ineg(),s=s.neg(!0)),a.k2.negative&&(a.k2.ineg(),u=u.neg(!0)),n[2*o]=s,n[2*o+1]=u,i[2*o]=a.k1,i[2*o+1]=a.k2}for(var c=this._wnafMulAdd(1,n,i,2*o,r),l=0;l<2*o;l++)n[l]=null,i[l]=null;return c},o(c,a.BasePoint),u.prototype.point=function(e,t,r){return new c(this,e,t,r)},u.prototype.pointFromJSON=function(e,t){return c.fromJSON(this,e,t)},c.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,n=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return t}},c.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},c.fromJSON=function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var n=e.point(t[0],t[1],r);if(!t[2])return n;function i(t){return e.point(t[0],t[1],r)}var o=t[2];return n.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[n].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[n].concat(o.naf.points.map(i))}},n},c.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},c.prototype.isInfinity=function(){return this.inf},c.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},c.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},c.prototype.getX=function(){return this.x.fromRed()},c.prototype.getY=function(){return this.y.fromRed()},c.prototype.mul=function(e){return e=new i(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},c.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},c.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},c.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},c.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},c.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(l,a.BasePoint),u.prototype.jpoint=function(e,t,r){return new l(this,e,t,r)},l.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},l.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},l.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(r.redMul(this.z)),s=n.redSub(i),u=o.redSub(a);if(0===s.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),l=c.redMul(s),f=n.redMul(c),d=u.redSqr().redIAdd(l).redISub(f).redISub(f),h=u.redMul(f.redISub(d)).redISub(o.redMul(l)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(d,h,p)},l.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),a=r.redSub(n),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),c=u.redMul(a),l=r.redMul(u),f=s.redSqr().redIAdd(c).redISub(l).redISub(l),d=s.redMul(l.redISub(f)).redISub(i.redMul(c)),h=this.z.redMul(a);return this.curve.jpoint(f,d,h)},l.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t<e;t++)r=r.dbl();return r}var n=this.curve.a,i=this.curve.tinv,o=this.x,a=this.y,s=this.z,u=s.redSqr().redSqr(),c=a.redAdd(a);for(t=0;t<e;t++){var l=o.redSqr(),f=c.redSqr(),d=f.redSqr(),h=l.redAdd(l).redIAdd(l).redIAdd(n.redMul(u)),p=o.redMul(f),g=h.redSqr().redISub(p.redAdd(p)),m=p.redISub(g),y=h.redMul(m);y=y.redIAdd(y).redISub(d);var b=c.redMul(s);t+1<e&&(u=u.redMul(d)),o=g,s=b,c=y}return this.curve.jpoint(o,c.redMul(i),s)},l.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},l.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(n).redISub(o);a=a.redIAdd(a);var s=n.redAdd(n).redIAdd(n),u=s.redSqr().redISub(a).redISub(a),c=o.redIAdd(o);c=(c=c.redIAdd(c)).redIAdd(c),e=u,t=s.redMul(a.redISub(u)).redISub(c),r=this.y.redAdd(this.y)}else{var l=this.x.redSqr(),f=this.y.redSqr(),d=f.redSqr(),h=this.x.redAdd(f).redSqr().redISub(l).redISub(d);h=h.redIAdd(h);var p=l.redAdd(l).redIAdd(l),g=p.redSqr(),m=d.redIAdd(d);m=(m=m.redIAdd(m)).redIAdd(m),e=g.redISub(h).redISub(h),t=p.redMul(h.redISub(e)).redISub(m),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},l.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(n).redISub(o);a=a.redIAdd(a);var s=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),u=s.redSqr().redISub(a).redISub(a);e=u;var c=o.redIAdd(o);c=(c=c.redIAdd(c)).redIAdd(c),t=s.redMul(a.redISub(u)).redISub(c),r=this.y.redAdd(this.y)}else{var l=this.z.redSqr(),f=this.y.redSqr(),d=this.x.redMul(f),h=this.x.redSub(l).redMul(this.x.redAdd(l));h=h.redAdd(h).redIAdd(h);var p=d.redIAdd(d),g=(p=p.redIAdd(p)).redAdd(p);e=h.redSqr().redISub(g),r=this.y.redAdd(this.z).redSqr().redISub(f).redISub(l);var m=f.redSqr();m=(m=(m=m.redIAdd(m)).redIAdd(m)).redIAdd(m),t=h.redMul(p.redISub(e)).redISub(m)}return this.curve.jpoint(e,t,r)},l.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),o=t.redSqr(),a=r.redSqr(),s=o.redAdd(o).redIAdd(o).redIAdd(e.redMul(i)),u=t.redAdd(t),c=(u=u.redIAdd(u)).redMul(a),l=s.redSqr().redISub(c.redAdd(c)),f=c.redISub(l),d=a.redSqr();d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var h=s.redMul(f).redISub(d),p=r.redAdd(r).redMul(n);return this.curve.jpoint(l,h,p)},l.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),n=t.redSqr(),i=e.redAdd(e).redIAdd(e),o=i.redSqr(),a=this.x.redAdd(t).redSqr().redISub(e).redISub(n),s=(a=(a=(a=a.redIAdd(a)).redAdd(a).redIAdd(a)).redISub(o)).redSqr(),u=n.redIAdd(n);u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var c=i.redIAdd(a).redSqr().redISub(o).redISub(s).redISub(u),l=t.redMul(c);l=(l=l.redIAdd(l)).redIAdd(l);var f=this.x.redMul(s).redISub(l);f=(f=f.redIAdd(f)).redIAdd(f);var d=this.y.redMul(c.redMul(u.redISub(c)).redISub(a.redMul(s)));d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var h=this.z.redAdd(a).redSqr().redISub(r).redISub(s);return this.curve.jpoint(f,d,h)},l.prototype.mul=function(e,t){return e=new i(e,t),this.curve._wnafMul(this,e)},l.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var n=t.redMul(this.z),i=r.redMul(e.z);return 0===this.y.redMul(i).redISub(e.y.redMul(n)).cmpn(0)},l.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var n=e.clone(),i=this.curve.redN.redMul(t);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},l.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},l.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},function(e,t,r){"use strict";var n=r(35),i=r(11),o=r(117),a=r(45);function s(e){o.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function u(e,t,r){o.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}i(s,o),e.exports=s,s.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},i(u,o.BasePoint),s.prototype.decodePoint=function(e,t){return this.point(a.toArray(e,t),1)},s.prototype.point=function(e,t){return new u(this,e,t)},s.prototype.pointFromJSON=function(e){return u.fromJSON(this,e)},u.prototype.precompute=function(){},u.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},u.fromJSON=function(e,t){return new u(e,t[0],t[1]||e.one)},u.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},u.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),i=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},u.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(r),a=i.redMul(n),s=t.z.redMul(o.redAdd(a).redSqr()),u=t.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,u)},u.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},u.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},u.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},function(e,t,r){"use strict";var n=r(45),i=r(35),o=r(11),a=r(117),s=n.assert;function u(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,a.call(this,"edwards",e),this.a=new i(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new i(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new i(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),s(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function c(e,t,r,n,o){a.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new i(t,16),this.y=new i(r,16),this.z=n?new i(n,16):this.curve.one,this.t=o&&new i(o,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}o(u,a),e.exports=u,u.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},u.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},u.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},u.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=this.c2.redSub(this.a.redMul(r)),o=this.one.redSub(this.c2.redMul(this.d).redMul(r)),a=n.redMul(o.redInvm()),s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");var u=s.fromRed().isOdd();return(t&&!u||!t&&u)&&(s=s.redNeg()),this.point(e,s)},u.prototype.pointFromY=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=r.redSub(this.c2),o=r.redMul(this.d).redMul(this.c2).redSub(this.a),a=n.redMul(o.redInvm());if(0===a.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");return s.fromRed().isOdd()!==t&&(s=s.redNeg()),this.point(s,e)},u.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(i)},o(c,a.BasePoint),u.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},u.prototype.point=function(e,t,r,n){return new c(this,e,t,r,n)},c.fromJSON=function(e,t){return new c(e,t[0],t[1],t[2])},c.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},c.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},c.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=n.redAdd(t),a=o.redSub(r),s=n.redSub(t),u=i.redMul(a),c=o.redMul(s),l=i.redMul(s),f=a.redMul(o);return this.curve.point(u,c,f,l)},c.prototype._projDbl=function(){var e,t,r,n,i,o,a=this.x.redAdd(this.y).redSqr(),s=this.x.redSqr(),u=this.y.redSqr();if(this.curve.twisted){var c=(n=this.curve._mulA(s)).redAdd(u);this.zOne?(e=a.redSub(s).redSub(u).redMul(c.redSub(this.curve.two)),t=c.redMul(n.redSub(u)),r=c.redSqr().redSub(c).redSub(c)):(i=this.z.redSqr(),o=c.redSub(i).redISub(i),e=a.redSub(s).redISub(u).redMul(o),t=c.redMul(n.redSub(u)),r=c.redMul(o))}else n=s.redAdd(u),i=this.curve._mulC(this.z).redSqr(),o=n.redSub(i).redSub(i),e=this.curve._mulC(a.redISub(n)).redMul(o),t=this.curve._mulC(n).redMul(s.redISub(u)),r=n.redMul(o);return this.curve.point(e,t,r)},c.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},c.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),o=r.redSub(t),a=i.redSub(n),s=i.redAdd(n),u=r.redAdd(t),c=o.redMul(a),l=s.redMul(u),f=o.redMul(u),d=a.redMul(s);return this.curve.point(c,l,d,f)},c.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),i=n.redSqr(),o=this.x.redMul(e.x),a=this.y.redMul(e.y),s=this.curve.d.redMul(o).redMul(a),u=i.redSub(s),c=i.redAdd(s),l=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(a),f=n.redMul(u).redMul(l);return this.curve.twisted?(t=n.redMul(c).redMul(a.redSub(this.curve._mulA(o))),r=u.redMul(c)):(t=n.redMul(c).redMul(a.redSub(o)),r=this.curve._mulC(u).redMul(c)),this.curve.point(f,t,r)},c.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},c.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},c.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},c.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},c.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},c.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()},c.prototype.getY=function(){return this.normalize(),this.y.fromRed()},c.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},c.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},c.prototype.toP=c.prototype.normalize,c.prototype.mixedAdd=c.prototype.add},function(e,t,r){"use strict";t.sha1=r(368),t.sha224=r(369),t.sha256=r(226),t.sha384=r(370),t.sha512=r(227)},function(e,t,r){"use strict";var n=r(53),i=r(103),o=r(225),a=n.rotl32,s=n.sum32,u=n.sum32_5,c=o.ft_1,l=i.BlockHash,f=[1518500249,1859775393,2400959708,3395469782];function d(){if(!(this instanceof d))return new d;l.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(d,l),e.exports=d,d.blockSize=512,d.outSize=160,d.hmacStrength=80,d.padLength=64,d.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=a(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],o=this.h[1],l=this.h[2],d=this.h[3],h=this.h[4];for(n=0;n<r.length;n++){var p=~~(n/20),g=u(a(i,5),c(p,o,l,d),h,r[n],f[p]);h=d,d=l,l=a(o,30),o=i,i=g}this.h[0]=s(this.h[0],i),this.h[1]=s(this.h[1],o),this.h[2]=s(this.h[2],l),this.h[3]=s(this.h[3],d),this.h[4]=s(this.h[4],h)},d.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},function(e,t,r){"use strict";var n=r(53),i=r(226);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(o,i),e.exports=o,o.blockSize=512,o.outSize=224,o.hmacStrength=192,o.padLength=64,o.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},function(e,t,r){"use strict";var n=r(53),i=r(227);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(o,i),e.exports=o,o.blockSize=1024,o.outSize=384,o.hmacStrength=192,o.padLength=128,o.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},function(e,t,r){"use strict";var n=r(53),i=r(103),o=n.rotl32,a=n.sum32,s=n.sum32_3,u=n.sum32_4,c=i.BlockHash;function l(){if(!(this instanceof l))return new l;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function f(e,t,r,n){return e<=15?t^r^n:e<=31?t&r|~t&n:e<=47?(t|~r)^n:e<=63?t&n|r&~n:t^(r|~n)}function d(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function h(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}n.inherits(l,c),t.ripemd160=l,l.blockSize=512,l.outSize=160,l.hmacStrength=192,l.padLength=64,l.prototype._update=function(e,t){for(var r=this.h[0],n=this.h[1],i=this.h[2],c=this.h[3],l=this.h[4],b=r,_=n,w=i,v=c,E=l,S=0;S<80;S++){var O=a(o(u(r,f(S,n,i,c),e[p[S]+t],d(S)),m[S]),l);r=l,l=c,c=o(i,10),i=n,n=O,O=a(o(u(b,f(79-S,_,w,v),e[g[S]+t],h(S)),y[S]),E),b=E,E=v,v=o(w,10),w=_,_=O}O=s(this.h[1],i,v),this.h[1]=s(this.h[2],c,E),this.h[2]=s(this.h[3],l,b),this.h[3]=s(this.h[4],r,_),this.h[4]=s(this.h[0],n,w),this.h[0]=O},l.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var p=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],g=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],m=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],y=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},function(e,t,r){"use strict";var n=r(53),i=r(44);function o(e,t,r){if(!(this instanceof o))return new o(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(t,r))}e.exports=o,o.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),i(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},o.prototype.update=function(e,t){return this.inner.update(e,t),this},o.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)}},function(e,t){e.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},function(e,t,r){"use strict";var n=r(35),i=r(375),o=r(45),a=r(157),s=r(153),u=o.assert,c=r(376),l=r(377);function f(e){if(!(this instanceof f))return new f(e);"string"==typeof e&&(u(Object.prototype.hasOwnProperty.call(a,e),"Unknown curve "+e),e=a[e]),e instanceof a.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}e.exports=f,f.prototype.keyPair=function(e){return new c(this,e)},f.prototype.keyFromPrivate=function(e,t){return c.fromPrivate(this,e,t)},f.prototype.keyFromPublic=function(e,t){return c.fromPublic(this,e,t)},f.prototype.genKeyPair=function(e){e||(e={});for(var t=new i({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||s(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),o=this.n.sub(new n(2));;){var a=new n(t.generate(r));if(!(a.cmp(o)>0))return a.iaddn(1),this.keyFromPrivate(a)}},f.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},f.prototype.sign=function(e,t,r,o){"object"==typeof r&&(o=r,r=null),o||(o={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new n(e,16));for(var a=this.n.byteLength(),s=t.getPrivate().toArray("be",a),u=e.toArray("be",a),c=new i({hash:this.hash,entropy:s,nonce:u,pers:o.pers,persEnc:o.persEnc||"utf8"}),f=this.n.sub(new n(1)),d=0;;d++){var h=o.k?o.k(d):new n(c.generate(this.n.byteLength()));if(!((h=this._truncateToN(h,!0)).cmpn(1)<=0||h.cmp(f)>=0)){var p=this.g.mul(h);if(!p.isInfinity()){var g=p.getX(),m=g.umod(this.n);if(0!==m.cmpn(0)){var y=h.invm(this.n).mul(m.mul(t.getPrivate()).iadd(e));if(0!==(y=y.umod(this.n)).cmpn(0)){var b=(p.getY().isOdd()?1:0)|(0!==g.cmp(m)?2:0);return o.canonical&&y.cmp(this.nh)>0&&(y=this.n.sub(y),b^=1),new l({r:m,s:y,recoveryParam:b})}}}}}},f.prototype.verify=function(e,t,r,i){e=this._truncateToN(new n(e,16)),r=this.keyFromPublic(r,i);var o=(t=new l(t,"hex")).r,a=t.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var s,u=a.invm(this.n),c=u.mul(e).umod(this.n),f=u.mul(o).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(c,r.getPublic(),f)).isInfinity()&&s.eqXToP(o):!(s=this.g.mulAdd(c,r.getPublic(),f)).isInfinity()&&0===s.getX().umod(this.n).cmp(o)},f.prototype.recoverPubKey=function(e,t,r,i){u((3&r)===r,"The recovery param is more than two bits"),t=new l(t,i);var o=this.n,a=new n(e),s=t.r,c=t.s,f=1&r,d=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&d)throw new Error("Unable to find sencond key candinate");s=d?this.curve.pointFromX(s.add(this.curve.n),f):this.curve.pointFromX(s,f);var h=t.r.invm(o),p=o.sub(a).mul(h).umod(o),g=c.mul(h).umod(o);return this.g.mulAdd(p,s,g)},f.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new l(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},function(e,t,r){"use strict";var n=r(158),i=r(223),o=r(44);function a(e){if(!(this instanceof a))return new a(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=i.toArray(e.entropy,e.entropyEnc||"hex"),r=i.toArray(e.nonce,e.nonceEnc||"hex"),n=i.toArray(e.pers,e.persEnc||"hex");o(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}e.exports=a,a.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},a.prototype._hmac=function(){return new n.hmac(this.hash,this.K)},a.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},a.prototype.reseed=function(e,t,r,n){"string"!=typeof t&&(n=r,r=t,t=null),e=i.toArray(e,t),r=i.toArray(r,n),o(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},a.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=i.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length<e;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var a=o.slice(0,e);return this._update(r),this._reseed++,i.encode(a,t)}},function(e,t,r){"use strict";var n=r(35),i=r(45).assert;function o(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}e.exports=o,o.fromPublic=function(e,t,r){return t instanceof o?t:new o(e,{pub:t,pubEnc:r})},o.fromPrivate=function(e,t,r){return t instanceof o?t:new o(e,{priv:t,privEnc:r})},o.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},o.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},o.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(e,t){this.priv=new n(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?i(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||i(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},o.prototype.derive=function(e){return e.validate()||i(e.validate(),"public point not validated"),e.mul(this.priv).getX()},o.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},o.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},o.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},function(e,t,r){"use strict";var n=r(35),i=r(45),o=i.assert;function a(e,t){if(e instanceof a)return e;this._importDER(e,t)||(o(e.r&&e.s,"Signature without r or s"),this.r=new n(e.r,16),this.s=new n(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function s(){this.place=0}function u(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,a=t.place;o<n;o++,a++)i<<=8,i|=e[a],i>>>=0;return!(i<=127)&&(t.place=a,i)}function c(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function l(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}e.exports=a,a.prototype._importDER=function(e,t){e=i.toArray(e,t);var r=new s;if(48!==e[r.place++])return!1;var o=u(e,r);if(!1===o)return!1;if(o+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var a=u(e,r);if(!1===a)return!1;var c=e.slice(r.place,a+r.place);if(r.place+=a,2!==e[r.place++])return!1;var l=u(e,r);if(!1===l)return!1;if(e.length!==l+r.place)return!1;var f=e.slice(r.place,l+r.place);if(0===c[0]){if(!(128&c[1]))return!1;c=c.slice(1)}if(0===f[0]){if(!(128&f[1]))return!1;f=f.slice(1)}return this.r=new n(c),this.s=new n(f),this.recoveryParam=null,!0},a.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=c(t),r=c(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];l(n,t.length),(n=n.concat(t)).push(2),l(n,r.length);var o=n.concat(r),a=[48];return l(a,o.length),a=a.concat(o),i.encode(a,e)}},function(e,t,r){"use strict";var n=r(158),i=r(157),o=r(45),a=o.assert,s=o.parseBytes,u=r(379),c=r(380);function l(e){if(a("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof l))return new l(e);e=i[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=n.sha512}e.exports=l,l.prototype.sign=function(e,t){e=s(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),i=this.g.mul(n),o=this.encodePoint(i),a=this.hashInt(o,r.pubBytes(),e).mul(r.priv()),u=n.add(a).umod(this.curve.n);return this.makeSignature({R:i,S:u,Rencoded:o})},l.prototype.verify=function(e,t,r){e=s(e),t=this.makeSignature(t);var n=this.keyFromPublic(r),i=this.hashInt(t.Rencoded(),n.pubBytes(),e),o=this.g.mul(t.S());return t.R().add(n.pub().mul(i)).eq(o)},l.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return o.intFromLE(e.digest()).umod(this.curve.n)},l.prototype.keyFromPublic=function(e){return u.fromPublic(this,e)},l.prototype.keyFromSecret=function(e){return u.fromSecret(this,e)},l.prototype.makeSignature=function(e){return e instanceof c?e:new c(this,e)},l.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},l.prototype.decodePoint=function(e){var t=(e=o.parseBytes(e)).length-1,r=e.slice(0,t).concat(-129&e[t]),n=0!=(128&e[t]),i=o.intFromLE(r);return this.curve.pointFromY(i,n)},l.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},l.prototype.decodeInt=function(e){return o.intFromLE(e)},l.prototype.isPoint=function(e){return e instanceof this.pointClass}},function(e,t,r){"use strict";var n=r(45),i=n.assert,o=n.parseBytes,a=n.cachedProperty;function s(e,t){this.eddsa=e,this._secret=o(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=o(t.pub)}s.fromPublic=function(e,t){return t instanceof s?t:new s(e,{pub:t})},s.fromSecret=function(e,t){return t instanceof s?t:new s(e,{secret:t})},s.prototype.secret=function(){return this._secret},a(s,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),a(s,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),a(s,"privBytes",(function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,n=t.slice(0,e.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n})),a(s,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),a(s,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),a(s,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),s.prototype.sign=function(e){return i(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},s.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},s.prototype.getSecret=function(e){return i(this._secret,"KeyPair is public only"),n.encode(this.secret(),e)},s.prototype.getPublic=function(e){return n.encode(this.pubBytes(),e)},e.exports=s},function(e,t,r){"use strict";var n=r(35),i=r(45),o=i.assert,a=i.cachedProperty,s=i.parseBytes;function u(e,t){this.eddsa=e,"object"!=typeof t&&(t=s(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),o(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof n&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}a(u,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),a(u,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),a(u,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),a(u,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),u.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},u.prototype.toHex=function(){return i.encode(this.toBytes(),"hex").toUpperCase()},e.exports=u},function(e,t){},function(e,t,r){"use strict";var n=r(229);t.certificate=r(388);var i=n.define("RSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())}));t.RSAPrivateKey=i;var o=n.define("RSAPublicKey",(function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())}));t.RSAPublicKey=o;var a=n.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(s),this.key("subjectPublicKey").bitstr())}));t.PublicKey=a;var s=n.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())})),u=n.define("PrivateKeyInfo",(function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(s),this.key("subjectPrivateKey").octstr())}));t.PrivateKey=u;var c=n.define("EncryptedPrivateKeyInfo",(function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())}));t.EncryptedPrivateKey=c;var l=n.define("DSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())}));t.DSAPrivateKey=l,t.DSAparam=n.define("DSAparam",(function(){this.int()}));var f=n.define("ECPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(d),this.key("publicKey").optional().explicit(1).bitstr())}));t.ECPrivateKey=f;var d=n.define("ECParameters",(function(){this.choice({namedCurve:this.objid()})}));t.signature=n.define("signature",(function(){this.seq().obj(this.key("r").int(),this.key("s").int())}))},function(e,t,r){"use strict";const n=r(230),i=r(232),o=r(11);function a(e,t){this.name=e,this.body=t,this.decoders={},this.encoders={}}t.define=function(e,t){return new a(e,t)},a.prototype._createNamed=function(e){const t=this.name;function r(e){this._initNamed(e,t)}return o(r,e),r.prototype._initNamed=function(t,r){e.call(this,t,r)},new r(this)},a.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(i[e])),this.decoders[e]},a.prototype.decode=function(e,t,r){return this._getDecoder(t).decode(e,r)},a.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(n[e])),this.encoders[e]},a.prototype.encode=function(e,t,r){return this._getEncoder(t).encode(e,r)}},function(e,t,r){"use strict";const n=r(11),i=r(231);function o(e){i.call(this,e),this.enc="pem"}n(o,i),e.exports=o,o.prototype.encode=function(e,t){const r=i.prototype.encode.call(this,e).toString("base64"),n=["-----BEGIN "+t.label+"-----"];for(let e=0;e<r.length;e+=64)n.push(r.slice(e,e+64));return n.push("-----END "+t.label+"-----"),n.join("\n")}},function(e,t,r){"use strict";const n=r(11),i=r(159).Buffer,o=r(233);function a(e){o.call(this,e),this.enc="pem"}n(a,o),e.exports=a,a.prototype.decode=function(e,t){const r=e.toString().split(/[\r\n]+/g),n=t.label.toUpperCase(),a=/^-----(BEGIN|END) ([^-]+)-----$/;let s=-1,u=-1;for(let e=0;e<r.length;e++){const t=r[e].match(a);if(null!==t&&t[2]===n){if(-1!==s){if("END"!==t[1])break;u=e;break}if("BEGIN"!==t[1])break;s=e}}if(-1===s||-1===u)throw new Error("PEM section not found for: "+n);const c=r.slice(s+1,u).join("");c.replace(/[^a-z0-9+/=]+/gi,"");const l=i.from(c,"base64");return o.prototype.decode.call(this,l,t)}},function(e,t,r){"use strict";const n=t;n.Reporter=r(161).Reporter,n.DecoderBuffer=r(104).DecoderBuffer,n.EncoderBuffer=r(104).EncoderBuffer,n.Node=r(160)},function(e,t,r){"use strict";const n=t;n._reverse=function(e){const t={};return Object.keys(e).forEach((function(r){(0|r)==r&&(r|=0);const n=e[r];t[n]=r})),t},n.der=r(162)},function(e,t,r){"use strict";var n=r(229),i=n.define("Time",(function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})})),o=n.define("AttributeTypeValue",(function(){this.seq().obj(this.key("type").objid(),this.key("value").any())})),a=n.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())})),s=n.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(a),this.key("subjectPublicKey").bitstr())})),u=n.define("RelativeDistinguishedName",(function(){this.setof(o)})),c=n.define("RDNSequence",(function(){this.seqof(u)})),l=n.define("Name",(function(){this.choice({rdnSequence:this.use(c)})})),f=n.define("Validity",(function(){this.seq().obj(this.key("notBefore").use(i),this.key("notAfter").use(i))})),d=n.define("Extension",(function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())})),h=n.define("TBSCertificate",(function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(a),this.key("issuer").use(l),this.key("validity").use(f),this.key("subject").use(l),this.key("subjectPublicKeyInfo").use(s),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(d).optional())})),p=n.define("X509Certificate",(function(){this.seq().obj(this.key("tbsCertificate").use(h),this.key("signatureAlgorithm").use(a),this.key("signatureValue").bitstr())}));e.exports=p},function(e){e.exports=JSON.parse('{"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}')},function(e,t,r){var n=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,i=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,o=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,a=r(116),s=r(151),u=r(16).Buffer;e.exports=function(e,t){var r,c=e.toString(),l=c.match(n);if(l){var f="aes"+l[1],d=u.from(l[2],"hex"),h=u.from(l[3].replace(/[\r\n]/g,""),"base64"),p=a(t,d.slice(0,8),parseInt(l[1],10)).key,g=[],m=s.createDecipheriv(f,p,d);g.push(m.update(h)),g.push(m.final()),r=u.concat(g)}else{var y=c.match(o);r=u.from(y[2].replace(/[\r\n]/g,""),"base64")}return{tag:c.match(i)[1],data:r}}},function(e,t,r){var n=r(16).Buffer,i=r(228),o=r(156).ec,a=r(118),s=r(234);function u(e,t){if(e.cmpn(0)<=0)throw new Error("invalid sig");if(e.cmp(t)>=t)throw new Error("invalid sig")}e.exports=function(e,t,r,c,l){var f=a(r);if("ec"===f.type){if("ecdsa"!==c&&"ecdsa/rsa"!==c)throw new Error("wrong public key type");return function(e,t,r){var n=s[r.data.algorithm.curve.join(".")];if(!n)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var i=new o(n),a=r.data.subjectPrivateKey.data;return i.verify(t,e,a)}(e,t,f)}if("dsa"===f.type){if("dsa"!==c)throw new Error("wrong public key type");return function(e,t,r){var n=r.data.p,o=r.data.q,s=r.data.g,c=r.data.pub_key,l=a.signature.decode(e,"der"),f=l.s,d=l.r;u(f,o),u(d,o);var h=i.mont(n),p=f.invm(o);return 0===s.toRed(h).redPow(new i(t).mul(p).mod(o)).fromRed().mul(c.toRed(h).redPow(d.mul(p).mod(o)).fromRed()).mod(n).mod(o).cmp(d)}(e,t,f)}if("rsa"!==c&&"ecdsa/rsa"!==c)throw new Error("wrong public key type");t=n.concat([l,t]);for(var d=f.modulus.byteLength(),h=[1],p=0;t.length+h.length+2<d;)h.push(255),p++;h.push(0);for(var g=-1;++g<t.length;)h.push(t[g]);h=n.from(h);var m=i.mont(f.modulus);e=(e=new i(e).toRed(m)).redPow(new i(f.publicExponent)),e=n.from(e.fromRed().toArray());var y=p<8?1:0;for(d=Math.min(e.length,h.length),e.length!==h.length&&(y=1),g=-1;++g<d;)y|=e[g]^h[g];return 0===y}},function(e,t,r){(function(t){var n=r(156),i=r(35);e.exports=function(e){return new a(e)};var o={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};function a(e){this.curveType=o[e],this.curveType||(this.curveType={name:e}),this.curve=new n.ec(this.curveType.name),this.keys=void 0}function s(e,r,n){Array.isArray(e)||(e=e.toArray());var i=new t(e);if(n&&i.length<n){var o=new t(n-i.length);o.fill(0),i=t.concat([o,i])}return r?i.toString(r):i}o.p224=o.secp224r1,o.p256=o.secp256r1=o.prime256v1,o.p192=o.secp192r1=o.prime192v1,o.p384=o.secp384r1,o.p521=o.secp521r1,a.prototype.generateKeys=function(e,t){return this.keys=this.curve.genKeyPair(),this.getPublicKey(e,t)},a.prototype.computeSecret=function(e,r,n){return r=r||"utf8",t.isBuffer(e)||(e=new t(e,r)),s(this.curve.keyFromPublic(e).getPublic().mul(this.keys.getPrivate()).getX(),n,this.curveType.byteLength)},a.prototype.getPublicKey=function(e,t){var r=this.keys.getPublic("compressed"===t,!0);return"hybrid"===t&&(r[r.length-1]%2?r[0]=7:r[0]=6),s(r,e)},a.prototype.getPrivateKey=function(e){return s(this.keys.getPrivate(),e)},a.prototype.setPublicKey=function(e,r){return r=r||"utf8",t.isBuffer(e)||(e=new t(e,r)),this.keys._importPublic(e),this},a.prototype.setPrivateKey=function(e,r){r=r||"utf8",t.isBuffer(e)||(e=new t(e,r));var n=new i(e);return n=n.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(n),this}}).call(this,r(10).Buffer)},function(e,t,r){t.publicEncrypt=r(394),t.privateDecrypt=r(395),t.privateEncrypt=function(e,r){return t.publicEncrypt(e,r,!0)},t.publicDecrypt=function(e,r){return t.privateDecrypt(e,r,!0)}},function(e,t,r){var n=r(118),i=r(84),o=r(101),a=r(235),s=r(236),u=r(35),c=r(237),l=r(155),f=r(16).Buffer;e.exports=function(e,t,r){var d;d=e.padding?e.padding:r?1:4;var h,p=n(e);if(4===d)h=function(e,t){var r=e.modulus.byteLength(),n=t.length,c=o("sha1").update(f.alloc(0)).digest(),l=c.length,d=2*l;if(n>r-d-2)throw new Error("message too long");var h=f.alloc(r-n-d-2),p=r-l-1,g=i(l),m=s(f.concat([c,h,f.alloc(1,1),t],p),a(g,p)),y=s(g,a(m,l));return new u(f.concat([f.alloc(1),y,m],r))}(p,t);else if(1===d)h=function(e,t,r){var n,o=t.length,a=e.modulus.byteLength();if(o>a-11)throw new Error("message too long");n=r?f.alloc(a-o-3,255):function(e){var t,r=f.allocUnsafe(e),n=0,o=i(2*e),a=0;for(;n<e;)a===o.length&&(o=i(2*e),a=0),(t=o[a++])&&(r[n++]=t);return r}(a-o-3);return new u(f.concat([f.from([0,r?1:2]),n,f.alloc(1),t],a))}(p,t,r);else{if(3!==d)throw new Error("unknown padding");if((h=new u(t)).cmp(p.modulus)>=0)throw new Error("data too long for modulus")}return r?l(h,p):c(h,p)}},function(e,t,r){var n=r(118),i=r(235),o=r(236),a=r(35),s=r(155),u=r(101),c=r(237),l=r(16).Buffer;e.exports=function(e,t,r){var f;f=e.padding?e.padding:r?1:4;var d,h=n(e),p=h.modulus.byteLength();if(t.length>p||new a(t).cmp(h.modulus)>=0)throw new Error("decryption error");d=r?c(new a(t),h):s(t,h);var g=l.alloc(p-d.length);if(d=l.concat([g,d],p),4===f)return function(e,t){var r=e.modulus.byteLength(),n=u("sha1").update(l.alloc(0)).digest(),a=n.length;if(0!==t[0])throw new Error("decryption error");var s=t.slice(1,a+1),c=t.slice(a+1),f=o(s,i(c,a)),d=o(c,i(f,r-a-1));if(function(e,t){e=l.from(e),t=l.from(t);var r=0,n=e.length;e.length!==t.length&&(r++,n=Math.min(e.length,t.length));var i=-1;for(;++i<n;)r+=e[i]^t[i];return r}(n,d.slice(0,a)))throw new Error("decryption error");var h=a;for(;0===d[h];)h++;if(1!==d[h++])throw new Error("decryption error");return d.slice(h)}(h,d);if(1===f)return function(e,t,r){var n=t.slice(0,2),i=2,o=0;for(;0!==t[i++];)if(i>=t.length){o++;break}var a=t.slice(2,i-1);("0002"!==n.toString("hex")&&!r||"0001"!==n.toString("hex")&&r)&&o++;a.length<8&&o++;if(o)throw new Error("decryption error");return t.slice(i)}(0,d,r);if(3===f)return d;throw new Error("unknown padding")}},function(e,t,r){"use strict";(function(e,n){function i(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var o=r(16),a=r(84),s=o.Buffer,u=o.kMaxLength,c=e.crypto||e.msCrypto,l=Math.pow(2,32)-1;function f(e,t){if("number"!=typeof e||e!=e)throw new TypeError("offset must be a number");if(e>l||e<0)throw new TypeError("offset must be a uint32");if(e>u||e>t)throw new RangeError("offset out of range")}function d(e,t,r){if("number"!=typeof e||e!=e)throw new TypeError("size must be a number");if(e>l||e<0)throw new TypeError("size must be a uint32");if(e+t>r||e>u)throw new RangeError("buffer too small")}function h(e,t,r,i){if(n.browser){var o=e.buffer,s=new Uint8Array(o,t,r);return c.getRandomValues(s),i?void n.nextTick((function(){i(null,e)})):e}if(!i)return a(r).copy(e,t),e;a(r,(function(r,n){if(r)return i(r);n.copy(e,t),i(null,e)}))}c&&c.getRandomValues||!n.browser?(t.randomFill=function(t,r,n,i){if(!(s.isBuffer(t)||t instanceof e.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof r)i=r,r=0,n=t.length;else if("function"==typeof n)i=n,n=t.length-r;else if("function"!=typeof i)throw new TypeError('"cb" argument must be a function');return f(r,t.length),d(n,r,t.length),h(t,r,n,i)},t.randomFillSync=function(t,r,n){void 0===r&&(r=0);if(!(s.isBuffer(t)||t instanceof e.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');f(r,t.length),void 0===n&&(n=t.length-r);return d(n,r,t.length),h(t,r,n)}):(t.randomFill=i,t.randomFillSync=i)}).call(this,r(23),r(19))},function(e,t,r){"use strict";r.r(t),r.d(t,"SQLiteFS",(function(){return o}));const n=63,i=44;const o=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(i)},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,i)=>e.node.contents.read(t,r,n,i),write:(e,t,r,n,i)=>e.node.contents.write(t,r,n,i),llseek:(t,r,n)=>{var i=r;if(1===n?i+=t.position:2===n&&e.isFile(t.node.mode)&&(i+=t.node.contents.getattr().size),i<0)throw new this.FS.ErrnoError(28);return i},allocate:(e,t,r)=>{e.node.contents.setattr({size:t+r})},mmap:(e,t,r,n,i,o)=>{throw new Error("mmap not implemented")},msync:(e,t,r,n,i)=>{throw new Error("msync not implemented")},fsync:(e,t,r,n,i)=>{e.node.contents.fsync()}}}mount(){return this.createNode(null,"/",16895,0)}lock(e,t){let r=this.FS.lookupPath(e).node;return!r||!r.contents||r.contents.lock(t)}unlock(e,t){let r=this.FS.lookupPath(e).node;return!r||!r.contents||r.contents.unlock(t)}createNode(e,t,r,i){if(!this.FS.isDir(r)&&!this.FS.isFile(r))throw new this.FS.ErrnoError(n);var o=this.FS.createNode(e,t,r,i);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}}},function(e,t,r){"use strict";r.r(t),function(e){let r=1,n=2;function i(e){return(e[16]<<8)+e[17]}function o(e,t,r){return function(e,t,r){let n=[];for(let i=e;i<=t;i+=r)n.push(i);return n}(t-t%e,r-1-(r-1)%e,e)}function a(e,t,r,n){let i=o(t,r,n),a=0;return i.map(i=>{let o=0,s=t;r>i&&r<i+t&&(o=r-i),n>i&&n<i+t&&(s=n-i);let u=s-o,c=new ArrayBuffer(t);if(r>i+t||n<=i)return null;let l=e.byteOffset+a,f=e.buffer.byteLength-l;if(f<=0)return null;let d=Math.min(u,f);return new Uint8Array(c).set(new Uint8Array(e.buffer,l,d),o),a+=d,{pos:i,data:c,offset:o,length:d}}).filter(Boolean)}class s{constructor(e,t,r=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 i=e.buffer;if(r<=0)return 0;if(n<0)return 0;if(n>=this.meta.size){let e=new Uint8Array(i,t);for(let t=0;t<r;t++)e[t]=0;return r}n=Math.max(n,0);let a=Math.min(r,this.meta.size-n),s=n,u=n+a,c=o(this.meta.blockSize,s,u),l=function(e,t,r){let n=new ArrayBuffer(r-t),i=new Uint8Array(n);for(let n=0;n<e.length;n++){let o=e[n];if("ArrayBuffer"!==o.data.constructor.name)throw new Error("Chunk data is not an ArrayBuffer");let a=0,s=o.data.byteLength;if(t>o.pos&&(a=t-o.pos),r<o.pos+o.data.byteLength&&(s=r-o.pos),a>o.data.byteLength||s<0)continue;let u=s-a;i.set(new Uint8Array(o.data,a,u),o.pos-t+a)}return n}(this.load(c),s,u);if(i.byteLength-t<l.byteLength)throw new Error("Buffer given to `read` is too small");let f=new Uint8Array(i);f.set(new Uint8Array(l),t);for(let e=a;e<r;e++)f[t+e]=0;return r}write(e,t,r,n){if(null==this.meta.blockSize){let r=i(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 s=a(new Uint8Array(o,t,r),this.meta.blockSize,n,n+r).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=s.partialWrites,c=s.fullWrites,l=[];u.length>0&&(l=this.load(u.map(e=>e.pos)));let f=c.concat(l.map(e=>{let t=u.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(f),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>=n&&(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=i(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,i=new ArrayBuffer(n),o=new Uint8Array(i);for(let e of r)o.set(new Uint8Array(e.data),e.pos);this.bufferChunks(a(o,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}}class u{constructor(e,{initialOffset:t=4,useAtomics:r=!0,stream:n=!0,debug:i,name:o}={}){this.buffer=e,this.atomicView=new Int32Array(e),this.offset=t,this.useAtomics=r,this.stream=n,this.debug=i,this.name=o}log(...e){this.debug&&console.log(`[reader: ${this.name}]`,...e)}waitWrite(e,t=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=3735928559===new DataView(this.buffer,this.offset).getUint32(0);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),i=[];for(let e=0;e<r;e++)i.push(n.getUint16(2*e));let o=String.fromCharCode.apply(null,i);return this.log("string",o),this.offset+=t,null==this.peekOffset&&this.flip(),o}_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 c{constructor(e,{initialOffset:t=4,useAtomics:r=!0,stream:n=!0,debug:i,name:o}={}){this.buffer=e,this.atomicView=new Int32Array(e),this.offset=t,this.useAtomics=r,this.stream=n,this.debug=i,this.name=o,this.useAtomics?Atomics.store(this.atomicView,0,0):this.atomicView[0]=0}log(...e){this.debug&&console.log(`[writer: ${this.name}]`,...e)}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,3735928559),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 l(e,t){return Math.round(e/t)}class f{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 e=t.name,i=t.positions,o=t.blockSize,a=[];for(let t of i){n.string("readBlock"),n.string(e),n.int32(l(t,o)),n.finalize();let i=r.bytes();r.done(),a.push({pos:t,data:0===i.byteLength?new ArrayBuffer(o):i})}return a}case"writeBlocks":{let e=t.name,i=t.writes,o=t.blockSize;n.string("writeBlocks"),n.string(e);for(let e of i)n.int32(l(e.pos,o)),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(),i=r.int32();return r.done(),-1===e?null:{size:e,blockSize:i}}case"writeMeta":{let e=t.name,i=t.meta;n.string("writeMeta"),n.string(e),n.int32(i.size),n.finalize();let o=r.int32();return r.done(),o}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 c(e,{name:"args (backend)",debug:!1});let t=new SharedArrayBuffer(36864);var r,n;this.reader=new u(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 d(e,t){return Math.round(e/t)}class h{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 i=r.openCursor(IDBKeyRange.lowerBound(-1));i.onerror=n,i.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"),i=n.objectStore("data");await new Promise((o,a)=>{let s=i.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)i.put(t.value,t.key);n.onsuccess=()=>o(),n.onerror=()=>a()},s.onerror=a})}}class p{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 h(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>r&&e===r&&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:i(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(d(n,t))});return r}writeBlocks(e,t){for(let r of e){let e=d(r.pos,t);this.blocks.set(e,r.data),this.queueWrite(e,r.data)}this.lockType<=r&&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>r),this.writeQueue=[]),this.cachedFirstBlock=null}}t.default=class{constructor(e){this.onFallbackFailure=e}createFile(t){let r;r="undefined"!=typeof SharedArrayBuffer?new f(t):new p(t,this.onFallbackFailure);let n=new s(t,r);return e.env.PERF_BUILD&&(null==this._files&&(this._files=new Set),this._files.add(n)),n}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()}}}}.call(this,r(19))},function(e,t,r){(function(t,n){const i=r(83),o=r(48);let a,s=o.join(t,"..","..","..","..");n.match("bundle")&&(s=o.join(t,"..")),e.exports={init:()=>{},getDataDir:()=>"/",_setDocumentDir:e=>a=e,getDocumentDir:()=>{if(!a)throw new Error("Document directory is not set");return a},getBudgetDir:t=>{if(!t)throw new Error("getDocumentDir: id is falsy: "+t);if(t.match(/[^A-Za-z0-9\-_]/))throw new Error(`Invalid budget id "${t}". Check the id of your budget in the "Advanced" section of the settings page.`);return o.join(e.exports.getDocumentDir(),t)},bundledDatabasePath:o.join(s,"default-db.sqlite"),migrationsPath:o.join(s,"migrations"),demoBudgetPath:o.join(s,"demo-budget"),join:o.join,basename:e=>o.basename(e),listDir:e=>new Promise((t,r)=>{i.readdir(e,(e,n)=>{e?r(e):t(n)})}),exists:e=>new Promise(t=>{i.access(e,i.constants.F_OK,e=>t(!e))}),mkdir:e=>new Promise((t,r)=>{i.mkdir(e,e=>{e?r(e):t()})}),size:e=>new Promise((t,r)=>{i.stat(e,(e,n)=>{e?r(e):t(n.size)})}),copyFile:(e,t)=>new Promise((r,n)=>{const o=i.createReadStream(e),a=i.createWriteStream(t);o.on("error",n),a.on("error",n),a.on("open",()=>o.pipe(a)),a.once("close",r)}),readFile:(e,t="utf8")=>("binary"===t&&(t=null),new Promise((r,n)=>{i.readFile(e,t,(e,t)=>{e?n(e):r(t)})})),writeFile:(e,t)=>new Promise((function(r,n){i.writeFile(e,t,"utf8",(function(e,t){return e?n(e):r()}))})),removeFile:e=>new Promise((function(t,r){i.unlink(e,e=>e?r(e):t())})),removeDir:e=>new Promise((function(t,r){i.rmdir(e,e=>e?r(e):t())})),removeDirRecursively:async t=>{const r=e.exports;if(await r.exists(t)){for(let e of await r.listDir(t)){const n=r.join(t,e);i.statSync(n).isDirectory()?await r.removeDirRecursively(n):await r.removeFile(n)}await r.removeDir(t)}},getModifiedTime:e=>new Promise((function(t,r){i.stat(e,(e,n)=>{e?r(e):t(new Date(n.mtime))})}))}}).call(this,"/","/index.js")},function(e,t){e.exports=function(...e){if(0===e.length)return".";let t;for(var r=0;r<e.length;++r){var n=e[r];n.length>0&&(void 0===t?t=n:t+="/"+n)}return void 0===t?".":function(e){if(0===e.length)return".";var t=47===e.charCodeAt(0),r=47===e.charCodeAt(e.length-1);return 0!==(e=function(e,t){for(var r,n="",i=0,o=-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(o===s-1||1===a);else if(o!==s-1&&2===a){if(n.length<2||2!==i||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="",i=0):i=(n=n.slice(0,u)).length-1-n.lastIndexOf("/"),o=s,a=0;continue}}else if(2===n.length||1===n.length){n="",i=0,o=s,a=0;continue}t&&(n.length>0?n+="/..":n="..",i=2)}else n.length>0?n+="/"+e.slice(o+1,s):n=e.slice(o+1,s),i=s-o-1;o=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}(t)}},function(e,t,r){var n=r(402),i=r(183),o=r(403),a=r(405),s=r(406),u={symbol:"",thousandsSeparator:",",decimalSeparator:".",symbolOnLeft:!0,spaceBetweenAmountAndSymbol:!1,decimalDigits:2},c={},l=[{symbolOnLeft:!0,spaceBetweenAmountAndSymbol:!1,format:{pos:"%s%v",neg:"-%s%v",zero:"%s%v"}},{symbolOnLeft:!0,spaceBetweenAmountAndSymbol:!0,format:{pos:"%s %v",neg:"-%s %v",zero:"%s %v"}},{symbolOnLeft:!1,spaceBetweenAmountAndSymbol:!1,format:{pos:"%v%s",neg:"-%v%s",zero:"%v%s"}},{symbolOnLeft:!1,spaceBetweenAmountAndSymbol:!0,format:{pos:"%v %s",neg:"-%v %s",zero:"%v %s"}}];function f(e){return a[e]}function d(e){return void 0===e}e.exports={defaultCurrency:u,get currencies(){return Object.keys(a).map((function(e){return a[e]}))},findCurrency:f,format:function(e,t){var r=t.code||t.locale&&o.getCurrency(t.locale),a=/^([a-z]+)([_-]([a-z]+))?$/i.exec(t.locale)||[],h=a[1],p=a[3],g=i({},c,s[h]||{},s[h+"-"+p]||{}),m=i({},u,f(r),g),y=m.symbolOnLeft,b=m.spaceBetweenAmountAndSymbol,_=l.filter((function(e){return e.symbolOnLeft==y&&e.spaceBetweenAmountAndSymbol==b}))[0].format;return n.formatMoney(e,{symbol:d(t.symbol)?m.symbol:t.symbol,decimal:d(t.decimal)?m.decimalSeparator:t.decimal,thousand:d(t.thousand)?m.thousandsSeparator:t.thousand,precision:"number"==typeof t.precision?t.precision:m.decimalDigits,format:["string","object"].indexOf(typeof t.format)>-1?t.format:_})},unformat:function(e,t){var r=t.code||t.locale&&o.getCurrency(t.locale),a=s[t.locale]||c,l=i({},u,f(r),a),h=d(t.decimal)?l.decimalSeparator:t.decimal;return n.unformat(e,h)}}},function(e,t,r){
/*!
* accounting.js v0.4.2
* Copyright 2014 Open Exchange Rates
*
* Freely distributable under the MIT license.
* Portions of accounting.js are inspired or borrowed from underscore.js
*
* Full details and documentation:
* http://openexchangerates.github.io/accounting.js/
*/
!function(r,n){var i={version:"0.4.2",settings:{currency:{symbol:"$",format:"%s%v",decimal:".",thousand:",",precision:2,grouping:3},number:{precision:0,grouping:3,thousand:",",decimal:"."}}},o=Array.prototype.map,a=Array.isArray,s=Object.prototype.toString;function u(e){return!!(""===e||e&&e.charCodeAt&&e.substr)}function c(e){return a?a(e):"[object Array]"===s.call(e)}function l(e){return e&&"[object Object]"===s.call(e)}function f(e,t){var r;for(r in e=e||{},t=t||{})t.hasOwnProperty(r)&&null==e[r]&&(e[r]=t[r]);return e}function d(e,t,r){var n,i,a=[];if(!e)return a;if(o&&e.map===o)return e.map(t,r);for(n=0,i=e.length;n<i;n++)a[n]=t.call(r,e[n],n,e);return a}function h(e,t){return e=Math.round(Math.abs(e)),isNaN(e)?t:e}function p(e){var t=i.settings.currency.format;return"function"==typeof e&&(e=e()),u(e)&&e.match("%v")?{pos:e,neg:e.replace("-","").replace("%v","-%v"),zero:e}:e&&e.pos&&e.pos.match("%v")?e:u(t)?i.settings.currency.format={pos:t,neg:t.replace("%v","-%v"),zero:t}:t}var g=i.unformat=i.parse=function(e,t){if(c(e))return d(e,(function(e){return g(e,t)}));if("number"==typeof(e=e||0))return e;t=t||i.settings.number.decimal;var r=new RegExp("[^0-9-"+t+"]",["g"]),n=parseFloat((""+e).replace(/\((?=\d+)(.*)\)/,"-$1").replace(r,"").replace(t,"."));return isNaN(n)?0:n},m=i.toFixed=function(e,t){t=h(t,i.settings.number.precision);var r=Number(i.unformat(e)+"e"+t),n=Math.round(r);return Number(n+"e-"+t).toFixed(t)},y=i.formatNumber=i.format=function(e,t,r,n){if(c(e))return d(e,(function(e){return y(e,t,r,n)}));e=g(e);var o=f(l(t)?t:{precision:t,thousand:r,decimal:n},i.settings.number),a=h(o.precision),s=e<0?"-":"",u=parseInt(m(Math.abs(e||0),a),10)+"",p=u.length>3?u.length%3:0;return s+(p?u.substr(0,p)+o.thousand:"")+u.substr(p).replace(/(\d{3})(?=\d)/g,"$1"+o.thousand)+(a?o.decimal+m(Math.abs(e),a).split(".")[1]:"")},b=i.formatMoney=function(e,t,r,n,o,a){if(c(e))return d(e,(function(e){return b(e,t,r,n,o,a)}));e=g(e);var s=f(l(t)?t:{symbol:t,precision:r,thousand:n,decimal:o,format:a},i.settings.currency),u=p(s.format);return(e>0?u.pos:e<0?u.neg:u.zero).replace("%s",s.symbol).replace("%v",y(Math.abs(e),h(s.precision),s.thousand,s.decimal))};i.formatColumn=function(e,t,r,n,o,a){if(!e||!c(e))return[];var s=f(l(t)?t:{symbol:t,precision:r,thousand:n,decimal:o,format:a},i.settings.currency),m=p(s.format),b=m.pos.indexOf("%s")<m.pos.indexOf("%v"),_=0,w=d(e,(function(e,t){if(c(e))return i.formatColumn(e,s);var r=((e=g(e))>0?m.pos:e<0?m.neg:m.zero).replace("%s",s.symbol).replace("%v",y(Math.abs(e),h(s.precision),s.thousand,s.decimal));return r.length>_&&(_=r.length),r}));return d(w,(function(e,t){return u(e)&&e.length<_?b?e.replace(s.symbol,s.symbol+new Array(_-e.length+1).join(" ")):new Array(_-e.length+1).join(" ")+e:e}))},e.exports&&(t=e.exports=i),t.accounting=i}()},function(e,t,r){var n=r(404);t.getCurrency=function(e){var t,r,i=(t=e,r=t.split("_"),2==r.length||2==(r=t.split("-")).length?r.pop():t).toUpperCase();return i in n?n[i]:null},t.getLocales=function(e){e=e.toUpperCase();var t=[];for(countryCode in n)n[countryCode]===e&&t.push(countryCode);return t}},function(e,t){e.exports={AD:"EUR",AE:"AED",AF:"AFN",AG:"XCD",AI:"XCD",AL:"ALL",AM:"AMD",AN:"ANG",AO:"AOA",AR:"ARS",AS:"USD",AT:"EUR",AU:"AUD",AW:"AWG",AX:"EUR",AZ:"AZN",BA:"BAM",BB:"BBD",BD:"BDT",BE:"EUR",BF:"XOF",BG:"BGN",BH:"BHD",BI:"BIF",BJ:"XOF",BL:"EUR",BM:"BMD",BN:"BND",BO:"BOB",BQ:"USD",BR:"BRL",BS:"BSD",BT:"BTN",BV:"NOK",BW:"BWP",BY:"BYR",BZ:"BZD",CA:"CAD",CC:"AUD",CD:"CDF",CF:"XAF",CG:"XAF",CH:"CHF",CI:"XOF",CK:"NZD",CL:"CLP",CM:"XAF",CN:"CNY",CO:"COP",CR:"CRC",CU:"CUP",CV:"CVE",CW:"ANG",CX:"AUD",CY:"EUR",CZ:"CZK",DE:"EUR",DJ:"DJF",DK:"DKK",DM:"XCD",DO:"DOP",DZ:"DZD",EC:"USD",EE:"EUR",EG:"EGP",EH:"MAD",ER:"ERN",ES:"EUR",ET:"ETB",FI:"EUR",FJ:"FJD",FK:"FKP",FM:"USD",FO:"DKK",FR:"EUR",GA:"XAF",GB:"GBP",GD:"XCD",GE:"GEL",GF:"EUR",GG:"GBP",GH:"GHS",GI:"GIP",GL:"DKK",GM:"GMD",GN:"GNF",GP:"EUR",GQ:"XAF",GR:"EUR",GS:"GBP",GT:"GTQ",GU:"USD",GW:"XOF",GY:"GYD",HK:"HKD",HM:"AUD",HN:"HNL",HR:"HRK",HT:"HTG",HU:"HUF",ID:"IDR",IE:"EUR",IL:"ILS",IM:"GBP",IN:"INR",IO:"USD",IQ:"IQD",IR:"IRR",IS:"ISK",IT:"EUR",JE:"GBP",JM:"JMD",JO:"JOD",JP:"JPY",KE:"KES",KG:"KGS",KH:"KHR",KI:"AUD",KM:"KMF",KN:"XCD",KP:"KPW",KR:"KRW",KW:"KWD",KY:"KYD",KZ:"KZT",LA:"LAK",LB:"LBP",LC:"XCD",LI:"CHF",LK:"LKR",LR:"LRD",LS:"LSL",LT:"LTL",LU:"EUR",LV:"LVL",LY:"LYD",MA:"MAD",MC:"EUR",MD:"MDL",ME:"EUR",MF:"EUR",MG:"MGA",MH:"USD",MK:"MKD",ML:"XOF",MM:"MMK",MN:"MNT",MO:"MOP",MP:"USD",MQ:"EUR",MR:"MRO",MS:"XCD",MT:"EUR",MU:"MUR",MV:"MVR",MW:"MWK",MX:"MXN",MY:"MYR",MZ:"MZN",NA:"NAD",NC:"XPF",NE:"XOF",NF:"AUD",NG:"NGN",NI:"NIO",NL:"EUR",NO:"NOK",NP:"NPR",NR:"AUD",NU:"NZD",NZ:"NZD",OM:"OMR",PA:"PAB",PE:"PEN",PF:"XPF",PG:"PGK",PH:"PHP",PK:"PKR",PL:"PLN",PM:"EUR",PN:"NZD",PR:"USD",PS:"ILS",PT:"EUR",PW:"USD",PY:"PYG",QA:"QAR",RE:"EUR",RO:"RON",RS:"RSD",RU:"RUB",RW:"RWF",SA:"SAR",SB:"SBD",SC:"SCR",SD:"SDG",SE:"SEK",SG:"SGD",SH:"SHP",SI:"EUR",SJ:"NOK",SK:"EUR",SL:"SLL",SM:"EUR",SN:"XOF",SO:"SOS",SR:"SRD",ST:"STD",SV:"SVC",SX:"ANG",SY:"SYP",SZ:"SZL",TC:"USD",TD:"XAF",TF:"EUR",TG:"XOF",TH:"THB",TJ:"TJS",TK:"NZD",TL:"USD",TM:"TMT",TN:"TND",TO:"TOP",TR:"TRY",TT:"TTD",TV:"AUD",TW:"TWD",TZ:"TZS",UA:"UAH",UG:"UGX",UM:"USD",US:"USD",UY:"UYU",UZ:"UZS",VA:"EUR",VC:"XCD",VE:"VEF",VG:"USD",VI:"USD",VN:"VND",VU:"VUV",WF:"XPF",WS:"WST",YE:"YER",YT:"EUR",ZA:"ZAR",ZM:"ZMK",ZW:"ZWL"}},function(e){e.exports=JSON.parse('{"AED":{"code":"AED","symbol":"د.إ.","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":true,"decimalDigits":2},"AFN":{"code":"AFN","symbol":"؋","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"ALL":{"code":"ALL","symbol":"Lek","thousandsSeparator":".","decimalSeparator":",","symbolOnLeft":false,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"AMD":{"code":"AMD","symbol":"֏","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":false,"spaceBetweenAmountAndSymbol":true,"decimalDigits":2},"ANG":{"code":"ANG","symbol":"ƒ","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"AOA":{"code":"AOA","symbol":"Kz","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"ARS":{"code":"ARS","symbol":"$","thousandsSeparator":".","decimalSeparator":",","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":true,"decimalDigits":2},"AUD":{"code":"AUD","symbol":"$","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"AWG":{"code":"AWG","symbol":"ƒ","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"AZN":{"code":"AZN","symbol":"₼","thousandsSeparator":" ","decimalSeparator":",","symbolOnLeft":false,"spaceBetweenAmountAndSymbol":true,"decimalDigits":2},"BAM":{"code":"BAM","symbol":"КМ","thousandsSeparator":".","decimalSeparator":",","symbolOnLeft":false,"spaceBetweenAmountAndSymbol":true,"decimalDigits":2},"BBD":{"code":"BBD","symbol":"$","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"BDT":{"code":"BDT","symbol":"৳","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":true,"decimalDigits":0},"BGN":{"code":"BGN","symbol":"лв.","thousandsSeparator":" ","decimalSeparator":",","symbolOnLeft":false,"spaceBetweenAmountAndSymbol":true,"decimalDigits":2},"BHD":{"code":"BHD","symbol":"د.ب.","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":true,"decimalDigits":3},"BIF":{"code":"BIF","symbol":"FBu","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":false,"spaceBetweenAmountAndSymbol":false,"decimalDigits":0},"BMD":{"code":"BMD","symbol":"$","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"BND":{"code":"BND","symbol":"$","thousandsSeparator":".","decimalSeparator":",","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":0},"BOB":{"code":"BOB","symbol":"Bs","thousandsSeparator":".","decimalSeparator":",","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":true,"decimalDigits":2},"BRL":{"code":"BRL","symbol":"R$","thousandsSeparator":".","decimalSeparator":",","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":true,"decimalDigits":2},"BSD":{"code":"BSD","symbol":"$","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"BTC":{"code":"BTC","symbol":"Ƀ","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":false,"spaceBetweenAmountAndSymbol":false,"decimalDigits":8},"BTN":{"code":"BTN","symbol":"Nu.","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":true,"decimalDigits":1},"BWP":{"code":"BWP","symbol":"P","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"BYR":{"code":"BYR","symbol":"р.","thousandsSeparator":" ","decimalSeparator":",","symbolOnLeft":false,"spaceBetweenAmountAndSymbol":true,"decimalDigits":2},"BZD":{"code":"BZD","symbol":"BZ$","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"CAD":{"code":"CAD","symbol":"$","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"CDF":{"code":"CDF","symbol":"FC","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":false,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"CHF":{"code":"CHF","symbol":"CHF","thousandsSeparator":"\'","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":true,"decimalDigits":2},"CLP":{"code":"CLP","symbol":"$","thousandsSeparator":".","decimalSeparator":",","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":true,"decimalDigits":2},"CNY":{"code":"CNY","symbol":"¥","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"COP":{"code":"COP","symbol":"$","thousandsSeparator":".","decimalSeparator":",","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":true,"decimalDigits":2},"CRC":{"code":"CRC","symbol":"₡","thousandsSeparator":".","decimalSeparator":",","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"CUC":{"code":"CUC","symbol":"CUC","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"CUP":{"code":"CUP","symbol":"$MN","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"CVE":{"code":"CVE","symbol":"$","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"CZK":{"code":"CZK","symbol":"Kč","thousandsSeparator":" ","decimalSeparator":",","symbolOnLeft":false,"spaceBetweenAmountAndSymbol":true,"decimalDigits":2},"DJF":{"code":"DJF","symbol":"Fdj","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":false,"spaceBetweenAmountAndSymbol":false,"decimalDigits":0},"DKK":{"code":"DKK","symbol":"kr.","thousandsSeparator":"","decimalSeparator":",","symbolOnLeft":false,"spaceBetweenAmountAndSymbol":true,"decimalDigits":2},"DOP":{"code":"DOP","symbol":"RD$","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"DZD":{"code":"DZD","symbol":"د.ج.","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":true,"decimalDigits":2},"EGP":{"code":"EGP","symbol":"ج.م.","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":true,"decimalDigits":2},"ERN":{"code":"ERN","symbol":"Nfk","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":false,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"ETB":{"code":"ETB","symbol":"ETB","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"EUR":{"code":"EUR","symbol":"€","thousandsSeparator":" ","decimalSeparator":",","symbolOnLeft":false,"spaceBetweenAmountAndSymbol":true,"decimalDigits":2},"FJD":{"code":"FJD","symbol":"$","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"FKP":{"code":"FKP","symbol":"£","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"GBP":{"code":"GBP","symbol":"£","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"GEL":{"code":"GEL","symbol":"Lari","thousandsSeparator":" ","decimalSeparator":",","symbolOnLeft":false,"spaceBetweenAmountAndSymbol":true,"decimalDigits":2},"GHS":{"code":"GHS","symbol":"₵","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"GIP":{"code":"GIP","symbol":"£","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"GMD":{"code":"GMD","symbol":"D","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":false,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"GNF":{"code":"GNF","symbol":"FG","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":false,"spaceBetweenAmountAndSymbol":false,"decimalDigits":0},"GTQ":{"code":"GTQ","symbol":"Q","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"GYD":{"code":"GYD","symbol":"$","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"HKD":{"code":"HKD","symbol":"HK$","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"HNL":{"code":"HNL","symbol":"L.","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":true,"decimalDigits":2},"HRK":{"code":"HRK","symbol":"kn","thousandsSeparator":".","decimalSeparator":",","symbolOnLeft":false,"spaceBetweenAmountAndSymbol":true,"decimalDigits":2},"HTG":{"code":"HTG","symbol":"G","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"HUF":{"code":"HUF","symbol":"Ft","thousandsSeparator":" ","decimalSeparator":",","symbolOnLeft":false,"spaceBetweenAmountAndSymbol":true,"decimalDigits":2},"IDR":{"code":"IDR","symbol":"Rp","thousandsSeparator":".","decimalSeparator":",","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":0},"ILS":{"code":"ILS","symbol":"₪","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":true,"decimalDigits":2},"INR":{"code":"INR","symbol":"₹","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"IQD":{"code":"IQD","symbol":"د.ع.","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":true,"decimalDigits":2},"IRR":{"code":"IRR","symbol":"﷼","thousandsSeparator":",","decimalSeparator":"/","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":true,"decimalDigits":2},"ISK":{"code":"ISK","symbol":"kr.","thousandsSeparator":".","decimalSeparator":",","symbolOnLeft":false,"spaceBetweenAmountAndSymbol":true,"decimalDigits":0},"JMD":{"code":"JMD","symbol":"J$","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"JOD":{"code":"JOD","symbol":"د.ا.","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":true,"decimalDigits":3},"JPY":{"code":"JPY","symbol":"¥","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":0},"KES":{"code":"KES","symbol":"KSh","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"KGS":{"code":"KGS","symbol":"сом","thousandsSeparator":" ","decimalSeparator":"-","symbolOnLeft":false,"spaceBetweenAmountAndSymbol":true,"decimalDigits":2},"KHR":{"code":"KHR","symbol":"៛","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":false,"spaceBetweenAmountAndSymbol":false,"decimalDigits":0},"KMF":{"code":"KMF","symbol":"CF","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":false,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"KPW":{"code":"KPW","symbol":"₩","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":0},"KRW":{"code":"KRW","symbol":"₩","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":0},"KWD":{"code":"KWD","symbol":"د.ك.","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":true,"decimalDigits":3},"KYD":{"code":"KYD","symbol":"$","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"KZT":{"code":"KZT","symbol":"₸","thousandsSeparator":" ","decimalSeparator":"-","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"LAK":{"code":"LAK","symbol":"₭","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":false,"spaceBetweenAmountAndSymbol":false,"decimalDigits":0},"LBP":{"code":"LBP","symbol":"ل.ل.","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":true,"decimalDigits":2},"LKR":{"code":"LKR","symbol":"₨","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":true,"decimalDigits":0},"LRD":{"code":"LRD","symbol":"$","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"LSL":{"code":"LSL","symbol":"M","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":false,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"LYD":{"code":"LYD","symbol":"د.ل.","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":3},"MAD":{"code":"MAD","symbol":"د.م.","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":true,"decimalDigits":2},"MDL":{"code":"MDL","symbol":"lei","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":false,"spaceBetweenAmountAndSymbol":true,"decimalDigits":2},"MGA":{"code":"MGA","symbol":"Ar","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":0},"MKD":{"code":"MKD","symbol":"ден.","thousandsSeparator":".","decimalSeparator":",","symbolOnLeft":false,"spaceBetweenAmountAndSymbol":true,"decimalDigits":2},"MMK":{"code":"MMK","symbol":"K","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"MNT":{"code":"MNT","symbol":"₮","thousandsSeparator":" ","decimalSeparator":",","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"MOP":{"code":"MOP","symbol":"MOP$","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"MRO":{"code":"MRO","symbol":"UM","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":false,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"MTL":{"code":"MTL","symbol":"₤","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"MUR":{"code":"MUR","symbol":"₨","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"MVR":{"code":"MVR","symbol":"MVR","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":false,"spaceBetweenAmountAndSymbol":true,"decimalDigits":1},"MWK":{"code":"MWK","symbol":"MK","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"MXN":{"code":"MXN","symbol":"$","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"MYR":{"code":"MYR","symbol":"RM","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"MZN":{"code":"MZN","symbol":"MT","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":0},"NAD":{"code":"NAD","symbol":"$","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"NGN":{"code":"NGN","symbol":"₦","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"NIO":{"code":"NIO","symbol":"C$","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":true,"decimalDigits":2},"NOK":{"code":"NOK","symbol":"kr","thousandsSeparator":" ","decimalSeparator":",","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":true,"decimalDigits":2},"NPR":{"code":"NPR","symbol":"₨","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"NZD":{"code":"NZD","symbol":"$","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"OMR":{"code":"OMR","symbol":"﷼","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":true,"decimalDigits":3},"PAB":{"code":"PAB","symbol":"B/.","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":true,"decimalDigits":2},"PEN":{"code":"PEN","symbol":"S/.","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":true,"decimalDigits":2},"PGK":{"code":"PGK","symbol":"K","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"PHP":{"code":"PHP","symbol":"₱","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"PKR":{"code":"PKR","symbol":"₨","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"PLN":{"code":"PLN","symbol":"zł","thousandsSeparator":" ","decimalSeparator":",","symbolOnLeft":false,"spaceBetweenAmountAndSymbol":true,"decimalDigits":2},"PYG":{"code":"PYG","symbol":"₲","thousandsSeparator":".","decimalSeparator":",","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":true,"decimalDigits":2},"QAR":{"code":"QAR","symbol":"﷼","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":true,"decimalDigits":2},"RON":{"code":"RON","symbol":"lei","thousandsSeparator":".","decimalSeparator":",","symbolOnLeft":false,"spaceBetweenAmountAndSymbol":true,"decimalDigits":2},"RSD":{"code":"RSD","symbol":"Дин.","thousandsSeparator":".","decimalSeparator":",","symbolOnLeft":false,"spaceBetweenAmountAndSymbol":true,"decimalDigits":2},"RUB":{"code":"RUB","symbol":"₽","thousandsSeparator":" ","decimalSeparator":",","symbolOnLeft":false,"spaceBetweenAmountAndSymbol":true,"decimalDigits":2},"RWF":{"code":"RWF","symbol":"RWF","thousandsSeparator":" ","decimalSeparator":",","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":true,"decimalDigits":2},"SAR":{"code":"SAR","symbol":"﷼","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":true,"decimalDigits":2},"SBD":{"code":"SBD","symbol":"$","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"SCR":{"code":"SCR","symbol":"₨","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"SDD":{"code":"SDD","symbol":"LSd","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":false,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"SDG":{"code":"SDG","symbol":"£‏","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"SEK":{"code":"SEK","symbol":"kr","thousandsSeparator":".","decimalSeparator":",","symbolOnLeft":false,"spaceBetweenAmountAndSymbol":true,"decimalDigits":2},"SGD":{"code":"SGD","symbol":"$","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"SHP":{"code":"SHP","symbol":"£","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"SLL":{"code":"SLL","symbol":"Le","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"SOS":{"code":"SOS","symbol":"S","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"SRD":{"code":"SRD","symbol":"$","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"STD":{"code":"STD","symbol":"Db","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"SVC":{"code":"SVC","symbol":"₡","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"SYP":{"code":"SYP","symbol":"£","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":true,"decimalDigits":2},"SZL":{"code":"SZL","symbol":"E","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"THB":{"code":"THB","symbol":"฿","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"TJS":{"code":"TJS","symbol":"TJS","thousandsSeparator":" ","decimalSeparator":";","symbolOnLeft":false,"spaceBetweenAmountAndSymbol":true,"decimalDigits":2},"TMT":{"code":"TMT","symbol":"m","thousandsSeparator":" ","decimalSeparator":",","symbolOnLeft":false,"spaceBetweenAmountAndSymbol":false,"decimalDigits":0},"TND":{"code":"TND","symbol":"د.ت.","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":true,"decimalDigits":3},"TOP":{"code":"TOP","symbol":"T$","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"TRY":{"code":"TRY","symbol":"₺","thousandsSeparator":".","decimalSeparator":",","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"TTD":{"code":"TTD","symbol":"TT$","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"TVD":{"code":"TVD","symbol":"$","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"TWD":{"code":"TWD","symbol":"NT$","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"TZS":{"code":"TZS","symbol":"TSh","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"UAH":{"code":"UAH","symbol":"₴","thousandsSeparator":" ","decimalSeparator":",","symbolOnLeft":false,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"UGX":{"code":"UGX","symbol":"USh","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"USD":{"code":"USD","symbol":"$","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"UYU":{"code":"UYU","symbol":"$U","thousandsSeparator":".","decimalSeparator":",","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":true,"decimalDigits":2},"UZS":{"code":"UZS","symbol":"сўм","thousandsSeparator":" ","decimalSeparator":",","symbolOnLeft":false,"spaceBetweenAmountAndSymbol":true,"decimalDigits":2},"VEB":{"code":"VEB","symbol":"Bs.","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"VEF":{"code":"VEF","symbol":"Bs. F.","thousandsSeparator":".","decimalSeparator":",","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":true,"decimalDigits":2},"VND":{"code":"VND","symbol":"₫","thousandsSeparator":".","decimalSeparator":".","symbolOnLeft":false,"spaceBetweenAmountAndSymbol":true,"decimalDigits":0},"VUV":{"code":"VUV","symbol":"VT","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":false,"spaceBetweenAmountAndSymbol":false,"decimalDigits":0},"WST":{"code":"WST","symbol":"WS$","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"XAF":{"code":"XAF","symbol":"F","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":false,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"XCD":{"code":"XCD","symbol":"$","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"XBT":{"code":"XBT","symbol":"Ƀ","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":false,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"XOF":{"code":"XOF","symbol":"F","thousandsSeparator":" ","decimalSeparator":",","symbolOnLeft":false,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"XPF":{"code":"XPF","symbol":"F","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":false,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"YER":{"code":"YER","symbol":"﷼","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":true,"decimalDigits":2},"ZAR":{"code":"ZAR","symbol":"R","thousandsSeparator":" ","decimalSeparator":",","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"ZMW":{"code":"ZMW","symbol":"ZK","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"WON":{"code":"WON","symbol":"₩","thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2}}')},function(e){e.exports=JSON.parse('{"de":{"thousandsSeparator":".","decimalSeparator":",","symbolOnLeft":false,"spaceBetweenAmountAndSymbol":true,"decimalDigits":2},"el":{"symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"thousandsSeparator":".","decimalSeparator":",","decimalDigits":2},"en-US":{"thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"en-IE":{"symbolOnLeft":true,"thousandsSeparator":",","decimalSeparator":".","spaceBetweenAmountAndSymbol":true,"decimalDigits":2},"zh-CN":{"thousandsSeparator":",","decimalSeparator":".","symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"decimalDigits":2},"es":{"thousandsSeparator":".","decimalSeparator":",","symbolOnLeft":false,"spaceBetweenAmountAndSymbol":true,"decimalDigits":2},"it":{"symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"thousandsSeparator":".","decimalSeparator":",","decimalDigits":2},"nl":{"symbolOnLeft":true,"spaceBetweenAmountAndSymbol":false,"thousandsSeparator":".","decimalSeparator":",","decimalDigits":2}}')},function(e,t,r){var n,i,o=r(238),a=r(239),s=0,u=0;e.exports=function(e,t,r){var c=t&&r||0,l=t||[],f=(e=e||{}).node||n,d=void 0!==e.clockseq?e.clockseq:i;if(null==f||null==d){var h=o();null==f&&(f=n=[1|h[0],h[1],h[2],h[3],h[4],h[5]]),null==d&&(d=i=16383&(h[6]<<8|h[7]))}var p=void 0!==e.msecs?e.msecs:(new Date).getTime(),g=void 0!==e.nsecs?e.nsecs:u+1,m=p-s+(g-u)/1e4;if(m<0&&void 0===e.clockseq&&(d=d+1&16383),(m<0||p>s)&&void 0===e.nsecs&&(g=0),g>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");s=p,u=g,i=d;var y=(1e4*(268435455&(p+=122192928e5))+g)%4294967296;l[c++]=y>>>24&255,l[c++]=y>>>16&255,l[c++]=y>>>8&255,l[c++]=255&y;var b=p/4294967296*1e4&268435455;l[c++]=b>>>8&255,l[c++]=255&b,l[c++]=b>>>24&15|16,l[c++]=b>>>16&255,l[c++]=d>>>8|128,l[c++]=255&d;for(var _=0;_<6;++_)l[c+_]=f[_];return t||a(l)}},function(e,t,r){var n=r(238),i=r(239);e.exports=function(e,t,r){var o=t&&r||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var a=(e=e||{}).random||(e.rng||n)();if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,t)for(var s=0;s<16;++s)t[o+s]=a[s];return t||i(a)}},function(e,t){e.exports=function(e){var t={addNode:i,removeNode:function(e){o(e),r.delete(e),n.delete(e)},adjacent:a,adjacentIncoming:s,addEdge:function(e,r){return i(e),i(r),a(e).add(r),s(r).add(e),t},removeEdge:u,removeIncomingEdges:o,topologicalSort:function(e){const t=new Set,r=[];return e.forEach(e=>{t.has(e)||function e(t,r,n){r.add(t);let i=a(t).values(),o=i.next();for(;!o.done;)r.has(o.value)||e(o.value,r,n),o=i.next();n.unshift(t)}(e,t,r)}),r},generateDOT:function(){let e=[];return r.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:r,incomingEdges:n}}},r=new Map,n=new Map;function i(e){return r.set(e,a(e)),n.set(e,s(e)),t}function o(e){const t=s(e);n.set(e,new Set);let r=t.values(),i=r.next();for(;!i.done;)u(i.value,e),i=r.next()}function a(e){return r.get(e)||new Set}function s(e){return n.get(e)||new Set}function u(e,i){return r.has(e)&&a(e).delete(i),n.has(i)&&s(i).delete(e),t}return t}},function(e,t,r){const n=r(119);e.exports={v4:function(){return Promise.resolve(n.v4())},v4Sync:function(){return n.v4()}}},function(module,exports,__webpack_require__){(function(global,Buffer){var $jscomp=$jscomp||{};$jscomp.scope={},$jscomp.findInternal=function(e,t,r){e instanceof String&&(e=String(e));for(var n=e.length,i=0;i<n;i++){var o=e[i];if(t.call(r,o,i,e))return{i:i,v:o}}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!==global&&null!=global?global: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 i=e[n];i in r||(r[i]={}),r=r[i]}(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,i=e.length;t=Math.max(0,Math.min(0|t,r.length));for(var o=0;o<i&&t<n;)if(r[t++]!=e[o++])return!1;return o>=i}}),"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.isDef=function(e){return void 0!==e},goog.isString=function(e){return"string"==typeof e},goog.isBoolean=function(e){return"boolean"==typeof e},goog.isNumber=function(e){return"number"==typeof e},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&&goog.isDef(t)?r[n]=t:r=r[n]&&r[n]!==Object.prototype[n]?r[n]:r[n]={}},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(!goog.isString(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]&&goog.isDefAndNotNull(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(t=t[e[r]],!goog.isDefAndNotNull(t))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(!goog.isString(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(!goog.isString(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 i=n.transpile;if(!i){var o=goog.basePath+goog.TRANSPILER,a=goog.loadFileSync_(o);if(a){if(function(){(0,eval)(a+"\n//# sourceURL="+o)}.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,i=(n=goog.global.$jscomp).transpile}}return i||(i=n.transpile=function(e,t){return goog.logToConsole_(t+" requires transpilation but no transpiler was found."),e}),i(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.isNull=function(e){return null===e},goog.isDefAndNotNull=function(e){return null!=e},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 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,"&lt;")),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 i=Array(arguments.length-2),o=2;o<arguments.length;o++)i[o-2]=arguments[o];return t.prototype[r].apply(e,i)}},goog.base=function(e,t,r){var n=arguments.callee.caller;if(goog.STRICT_MODE_COMPATIBLE||goog.DEBUG&&!n)throw Error("arguments.caller not defined. goog.base() cannot be used with strict mode code. See http://www.ecma-international.org/ecma-262/5.1/#sec-C");if(void 0!==n.superClass_){for(var i=Array(arguments.length-1),o=1;o<arguments.length;o++)i[o-1]=arguments[o];return n.superClass_.constructor.apply(e,i)}if("string"!=typeof t&&"symbol"!=typeof t)throw Error("method names provided to goog.base must be a string or a symbol");for(i=Array(arguments.length-2),o=2;o<arguments.length;o++)i[o-2]=arguments[o];o=!1;for(var a=e.constructor.prototype;a;a=Object.getPrototypeOf(a))if(a[t]===n)o=!0;else if(o)return a[t].apply(e,i);if(e[t]===n)return e.constructor.prototype[t].apply(e,i);throw Error("goog.base called from a method of one name to a method of a different name")},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(goog.isDef(goog.global.CLOSURE_BASE_PATH)&&goog.isString(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 i=0;i<e.length;i++){var o=this.getPathFromDeps_(e[i]);if(!o)throw Error("Unregonized namespace: "+e[i]);t.push(this.dependencies_[o])}o=goog.require;var a=0;for(i=0;i<e.length;i++)o(e[i]),t[i].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 i=t.getPathFromDeps_(e);if(!i)throw Error("Bad dependency path or symbol: "+e);if(!t.written_[i]){for(t.written_[i]=!0,e=t.dependencies_[i],i=0;i<e.requires.length;i++)goog.isProvided_(e.requires[i])||n(e.requires[i]);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(),i=!1;e.loading_(n);var o={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(i)throw Error("Double call to loaded.");i=!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(o)}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,i){this.path=e,this.relativePath=t,this.provides=r,this.requires=n,this.loadFlags=i,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=[],i=1;i<arguments.length;i++)n.push(arguments[i]);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 i=t.createElement("script");i.defer=goog.Dependency.defer_,i.async=!1,i.type="text/javascript",(n=goog.getScriptNonce())&&i.setAttribute("nonce",n),goog.DebugLoader_.IS_OLD_IE_?(e.pause(),i.onreadystatechange=function(){"loaded"!=i.readyState&&"complete"!=i.readyState||(e.loaded(),e.resume())}):i.onload=function(){i.onload=null,e.loaded()},i.src=goog.TRUSTED_TYPES_POLICY_?goog.TRUSTED_TYPES_POLICY_.createScriptURL(this.path):this.path,t.head.appendChild(i)}}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,i){goog.Dependency.call(this,e,t,r,n,i)},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 i=goog.getScriptNonce();i&&n.setAttribute("nonce",i),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 i=goog.Dependency.registerCallback_((function(){goog.Dependency.unregisterCallback_(i),e.setModuleState(goog.ModuleType.ES6)}));n(void 0,'goog.Dependency.callback_("'+i+'")'),n(this.path,void 0);var o=goog.Dependency.registerCallback_((function(t){goog.Dependency.unregisterCallback_(o),e.registerEs6ModuleExports(r.path,t,goog.moduleLoaderState_.moduleName)}));n(void 0,'import * as m from "'+this.path+'"; goog.Dependency.callback_("'+o+'", 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,i){goog.Dependency.call(this,e,t,r,n,i),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_){i&&e.setModuleState(goog.ModuleType.ES6);try{var r=n.contents_;if(n.contents_=null,goog.globalEval(r),i)var o=goog.moduleLoaderState_.moduleName}finally{i&&e.clearModuleState()}i&&goog.global.$jscomp.require.ensure([n.getPathName()],(function(){e.registerEs6ModuleExports(n.path,goog.global.$jscomp.require(n.getPathName()),o)})),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 i=this.loadFlags.module==goog.ModuleType.ES6;this.lazyFetch_||t();var o=1<e.pending().length,a=o&&goog.DebugLoader_.IS_OLD_IE_;if(o=goog.Dependency.defer_&&(o||goog.isDocumentLoading_()),a||o)e.defer((function(){r()}));else{var s=goog.global.document;if(a=goog.inHtmlDocument_()&&"ActiveXObject"in goog.global,i&&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,i,o){goog.TransformedDependency.call(this,e,t,r,n,i),this.transpiler=o},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,i){goog.TransformedDependency.call(this,e,t,r,n,i)},goog.inherits(goog.PreTranspiledEs6ModuleDependency,goog.TransformedDependency),goog.PreTranspiledEs6ModuleDependency.prototype.transform=function(e){return e},goog.GoogModuleDependency=function(e,t,r,n,i,o,a){goog.TransformedDependency.call(this,e,t,r,n,i),this.needsTranspile_=o,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&&goog.isDef(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 i=goog.normalizePath_(goog.basePath+e);for(n&&"boolean"!=typeof n||(n=n?{module:goog.ModuleType.GOOG}:{}),r=this.factory_.createDependency(i,e,t,r,n,goog.transpiler_.needsTranspile(n.lang||"es3",n.module)),this.dependencies_[i]=r,r=0;r<t.length;r++)this.idToPath_[t[r]]=i;this.idToPath_[e]=i},goog.DependencyFactory=function(e){this.transpiler=e},goog.DependencyFactory.prototype.createDependency=function(e,t,r,n,i,o){return i.module==goog.ModuleType.GOOG?new goog.GoogModuleDependency(e,t,r,n,i,o,this.transpiler):o?new goog.TranspiledDependency(e,t,r,n,i,this.transpiler):i.module==goog.ModuleType.ES6?"never"==goog.TRANSPILE&&goog.ASSUME_ES_MODULES_TRANSPILED?new goog.PreTranspiledEs6ModuleDependency(e,t,r,n,i):new goog.Es6ModuleDependency(e,t,r,n,i):new goog.Dependency(e,t,r,n,i)},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;if("undefined"==typeof TrustedTypes||!TrustedTypes.createPolicy)return t;try{t=TrustedTypes.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,i={};for(n in e)t.call(r,e[n],n,e)&&(i[n]=e[n]);return i},goog.object.map=function(e,t,r){var n,i={};for(n in e)i[n]=t.call(r,e[n],n,e);return i},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,i=1;i<arguments.length;i++){for(r in n=arguments[i])e[r]=n[r];for(var o=0;o<goog.object.PROTOTYPE_FIELDS_.length;o++)r=goog.object.PROTOTYPE_FIELDS_[o],Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}},goog.object.create=function(e){var t=arguments.length;if(1==t&&goog.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&&goog.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 i=Object.getOwnPropertyNames(e),o=0;o<i.length;o++)n[i[o]]=!0;e=Object.getPrototypeOf(e)}return goog.object.getKeys(n)},goog.object.getSuperClass=function(e){return(e=Object.getPrototypeOf(e.prototype))&&e.constructor},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,i=0;i<n;i++)r+=e[i]+(i<t.length?t[i]:"%s");return r+e[n]},goog.asserts.doAssertFailure_=function(e,t,r,n){var i="Assertion failed";if(r){i+=": "+r;var o=n}else e&&(i+=": "+e,o=t);e=new goog.asserts.AssertionError(""+i,o||[]),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&&!goog.isNumber(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&&!goog.isString(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&&!goog.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&&!goog.isBoolean(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};var jspb={BinaryConstants:{},ConstBinaryMessage:function(){},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.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,goog.isString(e))return goog.isString(t)&&1==t.length?e.indexOf(t,r):-1;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)),goog.isString(e))return goog.isString(t)&&1==t.length?e.lastIndexOf(t,r):-1;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,i=goog.isString(e)?e.split(""):e,o=0;o<n;o++)o in i&&t.call(r,i[o],o,e)},goog.array.forEachRight=function(e,t,r){var n=e.length,i=goog.isString(e)?e.split(""):e;for(--n;0<=n;--n)n in i&&t.call(r,i[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,i=[],o=0,a=goog.isString(e)?e.split(""):e,s=0;s<n;s++)if(s in a){var u=a[s];t.call(r,u,s,e)&&(i[o++]=u)}return i},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,i=Array(n),o=goog.isString(e)?e.split(""):e,a=0;a<n;a++)a in o&&(i[a]=t.call(r,o[a],a,e));return i},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 i=r;return goog.array.forEach(e,(function(r,o){i=t.call(n,i,r,o,e)})),i},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 i=r;return goog.array.forEachRight(e,(function(r,o){i=t.call(n,i,r,o,e)})),i},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,i=goog.isString(e)?e.split(""):e,o=0;o<n;o++)if(o in i&&t.call(r,i[o],o,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,i=goog.isString(e)?e.split(""):e,o=0;o<n;o++)if(o in i&&!t.call(r,i[o],o,e))return!1;return!0},goog.array.count=function(e,t,r){var n=0;return goog.array.forEach(e,(function(e,i,o){t.call(r,e,i,o)&&++n}),r),n},goog.array.find=function(e,t,r){return 0>(t=goog.array.findIndex(e,t,r))?null:goog.isString(e)?e.charAt(t):e[t]},goog.array.findIndex=function(e,t,r){for(var n=e.length,i=goog.isString(e)?e.split(""):e,o=0;o<n;o++)if(o in i&&t.call(r,i[o],o,e))return o;return-1},goog.array.findRight=function(e,t,r){return 0>(t=goog.array.findIndexRight(e,t,r))?null:goog.isString(e)?e.charAt(t):e[t]},goog.array.findIndexRight=function(e,t,r){var n=e.length,i=goog.isString(e)?e.split(""):e;for(--n;0<=n;n--)if(n in i&&t.call(r,i[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(!goog.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(i,o){t.call(r,i,o,e)&&goog.array.removeAt(e,o)&&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 i=e.length||0,o=n.length||0;e.length=i+o;for(var a=0;a<o;a++)e[i+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 i=0,o=0;o<e.length;){var a=e[o++],s=r(a);Object.prototype.hasOwnProperty.call(n,s)||(n[s]=!0,t[i++]=a)}t.length=i},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,i){for(var o,a=0,s=e.length;a<s;){var u=a+s>>1,c=r?t.call(i,e[u],u,e):t(n,e[u]);0<c?a=u+1:(s=u,o=!c)}return o?a:~a},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 i=t||goog.array.defaultCompare;for(goog.array.sort(r,(function(e,t){return i(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 i=t(e[n-1],e[n]);if(0<i||0==i&&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 i=0;i<n;i++)if(!r(e[i],t[i]))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),i=0;i<n;i++){var o=r(e[i],t[i]);if(0!=o)return o}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={},i=0;i<e.length;i++){var o=e[i],a=t.call(r,o,i,e);goog.isDef(a)&&(n[a]||(n[a]=[])).push(o)}return n},goog.array.toObject=function(e,t,r){var n={};return goog.array.forEach(e,(function(i,o){n[t.call(r,i,o,e)]=i})),n},goog.array.range=function(e,t,r){var n=[],i=0,o=e;if(void 0!==t&&(i=e,o=t),0>(r=r||1)*(o-i))return[];if(0<r)for(e=i;e<o;e+=r)n.push(e);else for(e=i;e>o;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(goog.isArray(n))for(var i=0;i<n.length;i+=8192){var o=goog.array.slice(n,i,i+8192);o=goog.array.flatten.apply(null,o);for(var a=0;a<o.length;a++)t.push(o[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 i=[],o=0;o<arguments.length;o++)i.push(arguments[o][n]);t.push(i)}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)),i=e[r];e[r]=e[n],e[n]=i}},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 i=e.charCodeAt(n);255<i&&(t[r++]=255&i,i>>=8),t[r++]=i}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 i=e.charCodeAt(n);128>i?t[r++]=i:(2048>i?t[r++]=i>>6|192:(55296==(64512&i)&&n+1<e.length&&56320==(64512&e.charCodeAt(n+1))?(i=65536+((1023&i)<<10)+(1023&e.charCodeAt(++n)),t[r++]=i>>18|240,t[r++]=i>>12&63|128):t[r++]=i>>12|224,t[r++]=i>>6&63|128),t[r++]=63&i|128)}return t},goog.crypt.utf8ByteArrayToString=function(e){for(var t=[],r=0,n=0;r<e.length;){var i=e[r++];if(128>i)t[n++]=String.fromCharCode(i);else if(191<i&&224>i){var o=e[r++];t[n++]=String.fromCharCode((31&i)<<6|63&o)}else if(239<i&&365>i){o=e[r++];var a=e[r++];i=((7&i)<<18|(63&o)<<12|(63&a)<<6|63&e[r++])-65536,t[n++]=String.fromCharCode(55296+(i>>10)),t[n++]=String.fromCharCode(56320+(1023&i))}else o=e[r++],a=e[r++],t[n++]=String.fromCharCode((15&i)<<12|(63&o)<<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(i){goog.global.clearTimeout(n);var o=arguments;n=goog.global.setTimeout((function(){e.apply(r,o)}),t)}},goog.functions.throttle=function(e,t,r){var n=0,i=!1,o=[],a=function(){n=0,i&&(i=!1,s())},s=function(){n=goog.global.setTimeout(a,t),e.apply(r,o)};return function(e){o=arguments,n?i=!0:s()}},goog.functions.rateLimit=function(e,t,r){var n=0,i=function(){n=0};return function(o){n||(n=goog.global.setTimeout(i,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.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.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 goog.isDef(goog.global.URL)&&goog.isDef(goog.global.URL.createObjectURL)?goog.global.URL:goog.isDef(goog.global.webkitURL)&&goog.isDef(goog.global.webkitURL.createObjectURL)?goog.global.webkitURL:goog.isDef(goog.global.createObjectURL)?goog.global:null},goog.fs.url.browserSupportsObjectUrls=function(){return null!=goog.fs.url.findUrlObject_()},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,i=!1;for(e=goog.i18n.bidi.stripHtmlIfNeeded_(e,t).split(goog.i18n.bidi.wordSeparatorRe_),t=0;t<e.length;t++){var o=e[t];goog.i18n.bidi.startsWithRtl(o)?(r++,n++):goog.i18n.bidi.isRequiredLtrRe_.test(o)?i=!0:goog.i18n.bidi.hasAnyLtr(o)?n++:goog.i18n.bidi.hasNumeralsRe_.test(o)&&(i=!0)}return 0==n?i?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(){this.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_="",this.trustedURL_=null,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.unwrapTrustedURL=function(e){return e.trustedURL_?e.trustedURL_:goog.html.TrustedResourceUrl.unwrap(e)},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.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_={},goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse=function(e){var t=new goog.html.TrustedResourceUrl;return t.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_=goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY?goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY.createScriptURL(e):e,goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY&&(t.trustedURL_=goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY.createURL(e)),t},goog.html.TrustedResourceUrl.stringifyParams_=function(e,t,r){if(null==r)return t;if(goog.isString(r))return r?e+encodeURIComponent(r):"";for(var n in r){var i=r[n];i=goog.isArray(i)?i:[i];for(var o=0;o<i.length;o++){var a=i[o];null!=a&&(t||(t=e),t+=(t.length>e.length?"&":"")+encodeURIComponent(n)+"="+encodeURIComponent(String(a)))}}return t},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_,"&amp;").replace(goog.string.internal.LT_RE_,"&lt;").replace(goog.string.internal.GT_RE_,"&gt;").replace(goog.string.internal.QUOT_RE_,"&quot;").replace(goog.string.internal.SINGLE_QUOTE_RE_,"&#39;").replace(goog.string.internal.NULL_RE_,"&#0;");else{if(!goog.string.internal.ALL_RE_.test(e))return e;-1!=e.indexOf("&")&&(e=e.replace(goog.string.internal.AMP_RE_,"&amp;")),-1!=e.indexOf("<")&&(e=e.replace(goog.string.internal.LT_RE_,"&lt;")),-1!=e.indexOf(">")&&(e=e.replace(goog.string.internal.GT_RE_,"&gt;")),-1!=e.indexOf('"')&&(e=e.replace(goog.string.internal.QUOT_RE_,"&quot;")),-1!=e.indexOf("'")&&(e=e.replace(goog.string.internal.SINGLE_QUOTE_RE_,"&#39;")),-1!=e.indexOf("\0")&&(e=e.replace(goog.string.internal.NULL_RE_,"&#0;"))}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," &#160;"),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),i=0;0==r&&i<n;i++){var o=e[i]||"",a=t[i]||"";do{if(o=/(\d*)(\D*)(.*)/.exec(o)||["","","",""],a=/(\d*)(\D*)(.*)/.exec(a)||["","","",""],0==o[0].length&&0==a[0].length)break;r=0==o[1].length?0:parseInt(o[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==o[2].length,0==a[2].length)||goog.string.internal.compareElements_(o[2],a[2]),o=o[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(){this.privateDoNotAccessOrElseSafeUrlWrappedValue_="",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 goog.html.SafeUrl.unwrapTrustedURL(e).toString()},goog.html.SafeUrl.unwrapTrustedURL=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-wav|wav|webm)|image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp|x-icon)|text\/csv|video\/(?:mpeg|mp4|ogg|webm|quicktime))(?:;\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.SAFE_MIME_TYPE_PATTERN_.test(e.type)?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.SAFE_MIME_TYPE_PATTERN_.test(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){var t=new goog.html.SafeUrl;return t.privateDoNotAccessOrElseSafeUrlWrappedValue_=goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY?goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY.createURL(e):e,t},goog.html.SafeUrl.ABOUT_BLANK=goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse("about:blank"),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=goog.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 i=e.charAt(n);"'"==i&&r?t=!t:'"'==i&&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 i=e.charAt(n);if("]"==i){if(t)return!1;t=!0}else if("["==i){if(!t)return!1;t=!1}else if(!t&&!r.test(i))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.FUNCTIONS_RE_=/\b(hsl|hsla|rgb|rgba|matrix|calc|minmax|fit-content|repeat|(rotate|scale|translate)(X|Y|Z|3d)?)\([-+*/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 i="";return r=r.replace(/^(['"])(.*)\1$/,(function(e,t,r){return i=t,r})),e=goog.html.SafeUrl.sanitize(r).getTypedStringValue(),t+i+e+i+n}))},goog.html.SafeStyle.concat=function(e){var t="",r=function(e){goog.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 i=e[n];if(t[i])r.push(t[i]);else if(goog.object.contains(t,i)&&r.pop()!=i)return!1}return 0==r.length},goog.html.SafeStyleSheet.concat=function(e){var t="",r=function(e){goog.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"]):(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.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.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("Invalid tag name <"+e+">.");if(e.toUpperCase()in goog.html.SafeHtml.NOT_ALLOWED_TAG_NAMES_)throw Error("Tag name <"+e+"> is not allowed for SafeHtml.")},goog.html.SafeHtml.createIframe=function(e,t,r,n){e&&goog.html.TrustedResourceUrl.unwrap(e);var i={};return i.src=e||null,i.srcdoc=t&&goog.html.SafeHtml.unwrap(t),e=goog.html.SafeHtml.combineAttributes(i,{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("The browser does not support sandboxed iframes.");var i={};return i.src=e?goog.html.SafeUrl.unwrap(goog.html.SafeUrl.sanitize(e)):null,i.srcdoc=t||null,i.sandbox="",e=goog.html.SafeHtml.combineAttributes(i,{},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('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())r=goog.html.SafeHtml.getStyleValue_(r);else{if(/^on/i.test(t))throw Error('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(!goog.isString(r))throw Error('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(goog.isString(r)||goog.isNumber(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('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=[],i=function(e){goog.isArray(e)?goog.array.forEach(e,i):(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,i),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,i="<"+e+goog.html.SafeHtml.stringifyAttributes(e,t);return goog.isDefAndNotNull(r)?goog.isArray(r)||(r=[r]):r=[],goog.dom.tags.isVoidTag(e.toLowerCase())?(goog.asserts.assert(!r.length,"Void tag <"+e+"> does not allow content."),i+=">"):(n=goog.html.SafeHtml.concat(r),i+=">"+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(i,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('Invalid attribute name "'+n+'".');var i=t[n];goog.isDefAndNotNull(i)&&(r+=" "+goog.html.SafeHtml.getAttrNameAndValue_(e,n,i))}return r},goog.html.SafeHtml.combineAttributes=function(e,t,r){var n,i={};for(n in e)goog.asserts.assert(n.toLowerCase()==n,"Must be lower case"),i[n]=e[n];for(n in t)goog.asserts.assert(n.toLowerCase()==n,"Must be lower case"),i[n]=t[n];for(n in r){var o=n.toLowerCase();if(o in e)throw Error('Cannot override "'+o+'" attribute, got "'+n+'" with value "'+r[n]+'"');o in t&&delete i[o],i[n]=r[n]}return i},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.unwrapTrustedURL(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.unwrapTrustedURL(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.unwrapTrustedURL(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.unwrapTrustedURL(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.unwrapTrustedURL(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.unwrapTrustedURL(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.unwrapTrustedURL(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.unwrapTrustedURL(t)},goog.dom.safe.setIframeSrc=function(e,t){goog.dom.asserts.assertIsHTMLIFrameElement(e),e.src=goog.html.TrustedResourceUrl.unwrapTrustedURL(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.unwrapTrustedURL(t)):e.href=t instanceof goog.html.TrustedResourceUrl?goog.html.TrustedResourceUrl.unwrapTrustedURL(t):t instanceof goog.html.SafeUrl?goog.html.SafeUrl.unwrapTrustedURL(t):goog.html.SafeUrl.unwrapTrustedURL(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.unwrapTrustedURL(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.unwrapTrustedURL(t))},goog.dom.safe.replaceLocation=function(e,t){goog.dom.asserts.assertIsLocation(e),t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),e.replace(goog.html.SafeUrl.unwrapTrustedURL(t))},goog.dom.safe.openInWindow=function(e,t,r,n,i){return e=e instanceof goog.html.SafeUrl?e:goog.html.SafeUrl.sanitizeAssertUnchanged(e),(t||goog.global).open(goog.html.SafeUrl.unwrapTrustedURL(e),r?goog.string.Const.unwrap(r):"",n,i)},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="",i=Array.prototype.slice.call(arguments,1);i.length&&1<r.length;)n+=r.shift()+i.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&&"<22>">=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),i=t.toLowerCase().match(r),o=Math.min(n.length,i.length),a=0;a<o;a++){r=n[a];var s=i[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!=i.length?n.length-i.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_,"&#101;")),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={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"'},n=t?t.createElement("div"):goog.global.document.createElement("div");return e.replace(goog.string.HTML_ENTITY_PATTERN_,(function(e,t){var i=r[e];return i||("#"==t.charAt(0)&&(t=Number("0"+t.substr(1)),isNaN(t)||(i=String.fromCharCode(t))),i||(goog.dom.safe.setInnerHtml(n,goog.html.uncheckedconversions.safeHtmlFromStringKnownToSatisfyTypeContract(goog.string.Const.from("Single HTML entity."),e+" ")),i=n.firstChild.nodeValue.slice(0,-1)),r[e]=i)}))},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," &#160;"),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 i=1==r?t:t.charAt(n);if(e.charAt(0)==i&&e.charAt(e.length-1)==i)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 i=e.length-n;e=e.substring(0,t-n)+"..."+e.substring(i)}else e.length>t&&(n=Math.floor(t/2),i=e.length-n,e=e.substring(0,n+t%2)+"..."+e.substring(i));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),i=n.charCodeAt(0);t[r+1]=goog.string.specialEscapeChars_[n]||(31<i&&127>i?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=goog.isDef(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=goog.isString(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)),goog.isString(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 i=e.lastIndexOf(t[n]);i>r&&(r=i)}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 i=0;i<t.length+1;i++)r[i]=i;for(i=0;i<e.length;i++){n[0]=i+1;for(var o=0;o<t.length;o++)n[o+1]=Math.min(n[o]+1,r[o+1]+1,r[o]+Number(e[i]!=t[o]));for(o=0;o<r.length;o++)r[o]=n[o]}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.isGo2Phone=function(){return goog.labs.userAgent.util.matchUserAgentIgnoreCase("GAFP")},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.ASSUME_GO2PHONE=!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.GO2PHONE=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_GO2PHONE:goog.labs.userAgent.platform.isGo2Phone(),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_()}(),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 i=e[n],o=n+1<e.length,a=o?e[n+1]:0,s=n+2<e.length,u=s?e[n+2]:0,c=i>>2;i=(3&i)<<4|a>>4,a=(15&a)<<2|u>>6,u&=63,s||(u=64,o||(a=64)),r.push(t[c],t[i],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),i=0;return goog.crypt.base64.decodeStringInternal_(e,(function(e){n[i++]=e})),n.subarray(0,i)},goog.crypt.base64.decodeStringInternal_=function(e,t){function r(t){for(;n<e.length;){var r=e.charAt(n++),i=goog.crypt.base64.charToByteMap_[r];if(null!=i)return i;if(!goog.string.isEmptyOrWhitespace(r))throw Error("Unknown base64 encoding at char: "+r)}return t}goog.crypt.base64.init_();for(var n=0;;){var i=r(-1),o=r(0),a=r(64),s=r(64);if(64===s&&-1===i)break;t(i<<2|o>>4),64!=a&&(t(o<<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 i=0;i<n.length;i++){var o=n[i],a=goog.crypt.base64.charToByteMap_[o];void 0===a?goog.crypt.base64.charToByteMap_[o]=i:goog.asserts.assert(a===i)}}}},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),i=e.charCodeAt(3),o=e.charCodeAt(4),a=e.charCodeAt(5),s=e.charCodeAt(6);e=e.charCodeAt(7),jspb.utils.split64Low=t+(r<<8)+(n<<16)+(i<<24)>>>0,jspb.utils.split64High=o+(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}goog.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],i=0;i<e.length;i++)t(10,e.charCodeAt(i)-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(),goog.asserts.assert(18==e.length),goog.asserts.assert("0"==e[0]),goog.asserts.assert("x"==e[1]);for(var t="",r=0;8>r;r++){var n=jspb.utils.fromHexCharCode_(e.charCodeAt(2*r+2)),i=jspb.utils.fromHexCharCode_(e.charCodeAt(2*r+3));t=String.fromCharCode(16*n+i)+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,i=t;i<r;i++)n+=e[i]>>7;return r-t-n},jspb.utils.countVarintFields=function(e,t,r,n){var i=0;if(128>(n=8*n+jspb.BinaryConstants.WireType.VARINT))for(;t<r&&e[t++]==n;)for(i++;;){var o=e[t++];if(0==(128&o))break}else for(;t<r;){for(o=n;128<o;){if(e[t]!=(127&o|128))return i;t++,o>>=7}if(e[t++]!=o)break;for(i++;0!=(128&(o=e[t++])););}return i},jspb.utils.countFixedFields_=function(e,t,r,n,i){var o=0;if(128>n)for(;t<r&&e[t++]==n;)o++,t+=i;else for(;t<r;){for(var a=n;128<a;){if(e[t++]!=(127&a|128))return o;a>>=7}if(e[t++]!=a)break;o++,t+=i}return o},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 i=0;for(n=8*n+jspb.BinaryConstants.WireType.DELIMITED;t<r;){for(var o=n;128<o;){if(e[t++]!=(127&o|128))return i;o>>=7}if(e[t++]!=o)break;i++;for(var a=0,s=1;a+=(127&(o=e[t++]))*s,s*=128,0!=(128&o););t+=a}return i},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||void 0!==Buffer&&e.constructor===Buffer||e.constructor===Array?new Uint8Array(e):e.constructor===String?goog.crypt.base64.decodeStringToUint8Array(e):(goog.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,goog.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,i=0;4>i&&128<=t;i++)r|=(127&(t=this.bytes_[this.cursor_++]))<<7*i;if(128<=t&&(r|=(127&(t=this.bytes_[this.cursor_++]))<<28,n|=(127&t)>>4),128<=t)for(i=0;5>i&&128<=t;i++)n|=(127&(t=this.bytes_[this.cursor_++]))<<7*i+3;if(128>t)return e(r>>>0,n>>>0);goog.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,i=0,o=r+7;o>=r;o--)n=n<<8|t[o],i=i<<8|t[o+4];return e(n,i)},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,goog.asserts.assert(this.cursor_<=this.end_),r):(r|=(127&(t=e[this.cursor_+1]))<<7,128>t?(this.cursor_+=2,goog.asserts.assert(this.cursor_<=this.end_),r):(r|=(127&(t=e[this.cursor_+2]))<<14,128>t?(this.cursor_+=3,goog.asserts.assert(this.cursor_<=this.end_),r):(r|=(127&(t=e[this.cursor_+3]))<<21,128>t?(this.cursor_+=4,goog.asserts.assert(this.cursor_<=this.end_),r):(r|=(15&(t=e[this.cursor_+4]))<<28,128>t?(this.cursor_+=5,goog.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_++]&&goog.asserts.assert(!1),goog.asserts.assert(this.cursor_<=this.end_),r)))))},jspb.BinaryDecoder.prototype.readSignedVarint32=jspb.BinaryDecoder.prototype.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,goog.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,goog.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,goog.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,goog.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,goog.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,goog.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=[],i="";r<e;){var o=t[r++];if(128>o)n.push(o);else{if(192>o)continue;if(224>o){var a=t[r++];n.push((31&o)<<6|63&a)}else if(240>o){a=t[r++];var s=t[r++];n.push((15&o)<<12|(63&a)<<6|63&s)}else if(248>o){o=(7&o)<<18|(63&(a=t[r++]))<<12|(63&(s=t[r++]))<<6|63&t[r++],o-=65536,n.push(55296+(o>>10&1023),56320+(1023&o))}}8192<=n.length&&(i+=String.fromCharCode.apply(null,n),n.length=0)}return i+=goog.crypt.byteArrayToString(n),this.cursor_=r,i},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,goog.asserts.fail("Invalid byte length!"),new Uint8Array(0);var t=this.bytes_.subarray(this.cursor_,this.cursor_+e);return this.cursor_+=e,goog.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],i=e[t+2],o=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,i,o,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_},jspb.BinaryReader.prototype.getWireType=function(){return this.nextWireType_},jspb.BinaryReader.prototype.isDelimited=function(){return this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED},jspb.BinaryReader.prototype.isEndGroup=function(){return this.nextWireType_==jspb.BinaryConstants.WireType.END_GROUP},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 goog.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?(goog.asserts.fail("Invalid wire type: %s (at position %s)",e,this.fieldCursor_),this.error_=!0,!1):(this.nextField_=t,this.nextWireType_=e,!0)},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?(goog.asserts.fail("Invalid wire type for skipVarintField"),this.skipField()):this.decoder_.skipVarint()},jspb.BinaryReader.prototype.skipDelimitedField=function(){if(this.nextWireType_!=jspb.BinaryConstants.WireType.DELIMITED)goog.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?(goog.asserts.fail("Invalid wire type for skipFixed32Field"),this.skipField()):this.decoder_.advance(4)},jspb.BinaryReader.prototype.skipFixed64Field=function(){this.nextWireType_!=jspb.BinaryConstants.WireType.FIXED64?(goog.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()){goog.asserts.fail("Unmatched start-group tag: stream EOF"),this.error_=!0;break}if(this.nextWireType_==jspb.BinaryConstants.WireType.END_GROUP){this.nextField_!=e&&(goog.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:goog.asserts.fail("Invalid wire encoding for field.")}},jspb.BinaryReader.prototype.registerReadCallback=function(e,t){null===this.readCallbacks_&&(this.readCallbacks_={}),goog.asserts.assert(!this.readCallbacks_[e]),this.readCallbacks_[e]=t},jspb.BinaryReader.prototype.runReadCallback=function(e){return goog.asserts.assert(null!==this.readCallbacks_),e=this.readCallbacks_[e],goog.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:goog.asserts.fail("Group field type not supported in readAny()");case t.MESSAGE:goog.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:goog.asserts.fail("Invalid field type in readAny()")}return 0},jspb.BinaryReader.prototype.readMessage=function(e,t){goog.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)},jspb.BinaryReader.prototype.readGroup=function(e,t,r){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.START_GROUP),goog.asserts.assert(this.nextField_==e),r(t,this),this.error_||this.nextWireType_==jspb.BinaryConstants.WireType.END_GROUP||(goog.asserts.fail("Group submessage did not end with an END_GROUP tag"),this.error_=!0)},jspb.BinaryReader.prototype.getFieldDecoder=function(){goog.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 goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint32()},jspb.BinaryReader.prototype.readInt32String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint32String()},jspb.BinaryReader.prototype.readInt64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint64()},jspb.BinaryReader.prototype.readInt64String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint64String()},jspb.BinaryReader.prototype.readUint32=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readUnsignedVarint32()},jspb.BinaryReader.prototype.readUint32String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readUnsignedVarint32String()},jspb.BinaryReader.prototype.readUint64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readUnsignedVarint64()},jspb.BinaryReader.prototype.readUint64String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readUnsignedVarint64String()},jspb.BinaryReader.prototype.readSint32=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readZigzagVarint32()},jspb.BinaryReader.prototype.readSint64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readZigzagVarint64()},jspb.BinaryReader.prototype.readSint64String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readZigzagVarint64String()},jspb.BinaryReader.prototype.readFixed32=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32),this.decoder_.readUint32()},jspb.BinaryReader.prototype.readFixed64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readUint64()},jspb.BinaryReader.prototype.readFixed64String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readUint64String()},jspb.BinaryReader.prototype.readSfixed32=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32),this.decoder_.readInt32()},jspb.BinaryReader.prototype.readSfixed32String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32),this.decoder_.readInt32().toString()},jspb.BinaryReader.prototype.readSfixed64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readInt64()},jspb.BinaryReader.prototype.readSfixed64String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readInt64String()},jspb.BinaryReader.prototype.readFloat=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32),this.decoder_.readFloat()},jspb.BinaryReader.prototype.readDouble=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readDouble()},jspb.BinaryReader.prototype.readBool=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),!!this.decoder_.readUnsignedVarint32()},jspb.BinaryReader.prototype.readEnum=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint64()},jspb.BinaryReader.prototype.readString=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var e=this.decoder_.readUnsignedVarint32();return this.decoder_.readString(e)},jspb.BinaryReader.prototype.readBytes=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var e=this.decoder_.readUnsignedVarint32();return this.decoder_.readBytes(e)},jspb.BinaryReader.prototype.readVarintHash64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readVarintHash64()},jspb.BinaryReader.prototype.readSintHash64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readZigzagVarintHash64()},jspb.BinaryReader.prototype.readSplitVarint64=function(e){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSplitVarint64(e)},jspb.BinaryReader.prototype.readSplitZigzagVarint64=function(e){return goog.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 goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readFixedHash64()},jspb.BinaryReader.prototype.readSplitFixed64=function(e){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readSplitFixed64(e)},jspb.BinaryReader.prototype.readPackedField_=function(e){goog.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)},jspb.BinaryReader.prototype.readPackedInt32String=function(){return this.readPackedField_(this.decoder_.readSignedVarint32String)},jspb.BinaryReader.prototype.readPackedInt64=function(){return this.readPackedField_(this.decoder_.readSignedVarint64)},jspb.BinaryReader.prototype.readPackedInt64String=function(){return this.readPackedField_(this.decoder_.readSignedVarint64String)},jspb.BinaryReader.prototype.readPackedUint32=function(){return this.readPackedField_(this.decoder_.readUnsignedVarint32)},jspb.BinaryReader.prototype.readPackedUint32String=function(){return this.readPackedField_(this.decoder_.readUnsignedVarint32String)},jspb.BinaryReader.prototype.readPackedUint64=function(){return this.readPackedField_(this.decoder_.readUnsignedVarint64)},jspb.BinaryReader.prototype.readPackedUint64String=function(){return this.readPackedField_(this.decoder_.readUnsignedVarint64String)},jspb.BinaryReader.prototype.readPackedSint32=function(){return this.readPackedField_(this.decoder_.readZigzagVarint32)},jspb.BinaryReader.prototype.readPackedSint64=function(){return this.readPackedField_(this.decoder_.readZigzagVarint64)},jspb.BinaryReader.prototype.readPackedSint64String=function(){return this.readPackedField_(this.decoder_.readZigzagVarint64String)},jspb.BinaryReader.prototype.readPackedFixed32=function(){return this.readPackedField_(this.decoder_.readUint32)},jspb.BinaryReader.prototype.readPackedFixed64=function(){return this.readPackedField_(this.decoder_.readUint64)},jspb.BinaryReader.prototype.readPackedFixed64String=function(){return this.readPackedField_(this.decoder_.readUint64String)},jspb.BinaryReader.prototype.readPackedSfixed32=function(){return this.readPackedField_(this.decoder_.readInt32)},jspb.BinaryReader.prototype.readPackedSfixed64=function(){return this.readPackedField_(this.decoder_.readInt64)},jspb.BinaryReader.prototype.readPackedSfixed64String=function(){return this.readPackedField_(this.decoder_.readInt64String)},jspb.BinaryReader.prototype.readPackedFloat=function(){return this.readPackedField_(this.decoder_.readFloat)},jspb.BinaryReader.prototype.readPackedDouble=function(){return this.readPackedField_(this.decoder_.readDouble)},jspb.BinaryReader.prototype.readPackedBool=function(){return this.readPackedField_(this.decoder_.readBool)},jspb.BinaryReader.prototype.readPackedEnum=function(){return this.readPackedField_(this.decoder_.readEnum)},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(goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(t==Math.floor(t)),goog.asserts.assert(0<=e&&e<jspb.BinaryConstants.TWO_TO_32),goog.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){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(t==Math.floor(t)),goog.asserts.assert(0<=e&&e<jspb.BinaryConstants.TWO_TO_32),goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_32),this.writeUint32(e),this.writeUint32(t)},jspb.BinaryEncoder.prototype.writeUnsignedVarint32=function(e){for(goog.asserts.assert(e==Math.floor(e)),goog.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(goog.asserts.assert(e==Math.floor(e)),goog.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){goog.asserts.assert(e==Math.floor(e)),goog.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){goog.asserts.assert(e==Math.floor(e)),goog.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){goog.asserts.assert(e==Math.floor(e)),goog.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){goog.asserts.assert(e==Math.floor(e)),goog.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){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(0<=e&&256>e),this.buffer_.push(e>>>0&255)},jspb.BinaryEncoder.prototype.writeUint16=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(0<=e&&65536>e),this.buffer_.push(e>>>0&255),this.buffer_.push(e>>>8&255)},jspb.BinaryEncoder.prototype.writeUint32=function(e){goog.asserts.assert(e==Math.floor(e)),goog.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){goog.asserts.assert(e==Math.floor(e)),goog.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){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(-128<=e&&128>e),this.buffer_.push(e>>>0&255)},jspb.BinaryEncoder.prototype.writeInt16=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(-32768<=e&&32768>e),this.buffer_.push(e>>>0&255),this.buffer_.push(e>>>8&255)},jspb.BinaryEncoder.prototype.writeInt32=function(e){goog.asserts.assert(e==Math.floor(e)),goog.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){goog.asserts.assert(e==Math.floor(e)),goog.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){goog.asserts.assert(e==Math.floor(e)),goog.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){goog.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){goog.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){goog.asserts.assert("boolean"==typeof e||"number"==typeof e),this.buffer_.push(e?1:0)},jspb.BinaryEncoder.prototype.writeEnum=function(e){goog.asserts.assert(e==Math.floor(e)),goog.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){for(var t=this.buffer_.length,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 i=e.charCodeAt(r+1);56320<=i&&57343>=i&&(n=1024*(n-55296)+i-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,i=t>>>16;for(t=r*n+65536*(r*i&65535)+65536*((e>>>=16)*n&65535),r=e*i+(r*i>>>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 i=parseInt(e[n],10);r.lo=i,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,goog.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(){goog.asserts.assert(0==this.bookmarks_.length);for(var e=new Uint8Array(this.totalLength_+this.encoder_.length()),t=this.blocks_,r=t.length,n=0,i=0;i<r;i++){var o=t[i];e.set(o,n),n+=o.length}return t=this.encoder_.end(),e.set(t,n),n+=t.length,goog.asserts.assert(n==e.length),this.blocks_=[e],e},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(){goog.asserts.assert(0<=this.bookmarks_.length),this.endDelimited_(this.bookmarks_.pop())},jspb.BinaryWriter.prototype.writeFieldHeader_=function(e,t){goog.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:goog.asserts.fail("Group field type not supported in writeAny()");break;case n.MESSAGE:goog.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:goog.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&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_31&&t<jspb.BinaryConstants.TWO_TO_31),this.writeSignedVarint32_(e,t))},jspb.BinaryWriter.prototype.writeInt32String=function(e,t){null!=t&&(t=parseInt(t,10),goog.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&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_63&&t<jspb.BinaryConstants.TWO_TO_63),this.writeSignedVarint64_(e,t))},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&&(goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_32),this.writeUnsignedVarint32_(e,t))},jspb.BinaryWriter.prototype.writeUint32String=function(e,t){null!=t&&(t=parseInt(t,10),goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_32),this.writeUnsignedVarint32_(e,t))},jspb.BinaryWriter.prototype.writeUint64=function(e,t){null!=t&&(goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_64),this.writeUnsignedVarint64_(e,t))},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&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_31&&t<jspb.BinaryConstants.TWO_TO_31),this.writeZigzagVarint32_(e,t))},jspb.BinaryWriter.prototype.writeSint64=function(e,t){null!=t&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_63&&t<jspb.BinaryConstants.TWO_TO_63),this.writeZigzagVarint64_(e,t))},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&&(goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_32),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED32),this.encoder_.writeUint32(t))},jspb.BinaryWriter.prototype.writeFixed64=function(e,t){null!=t&&(goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_64),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeUint64(t))},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&&(goog.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))},jspb.BinaryWriter.prototype.writeSfixed64=function(e,t){null!=t&&(goog.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))},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))},jspb.BinaryWriter.prototype.writeDouble=function(e,t){null!=t&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeDouble(t))},jspb.BinaryWriter.prototype.writeBool=function(e,t){null!=t&&(goog.asserts.assert("boolean"==typeof t||"number"==typeof t),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeBool(t))},jspb.BinaryWriter.prototype.writeEnum=function(e,t){null!=t&&(goog.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))},jspb.BinaryWriter.prototype.writeString=function(e,t){null!=t&&(e=this.beginDelimited_(e),this.encoder_.writeString(t),this.endDelimited_(e))},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))},jspb.BinaryWriter.prototype.writeMessage=function(e,t,r){null!=t&&(e=this.beginDelimited_(e),r(t,this),this.endDelimited_(e))},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))},jspb.BinaryWriter.prototype.writeFixedHash64=function(e,t){null!=t&&(goog.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&&(goog.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])},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])},jspb.BinaryWriter.prototype.writeRepeatedSplitFixed64=function(e,t,r,n){if(null!=t)for(var i=0;i<t.length;i++)this.writeSplitFixed64(e,r(t[i]),n(t[i]))},jspb.BinaryWriter.prototype.writeRepeatedSplitVarint64=function(e,t,r,n){if(null!=t)for(var i=0;i<t.length;i++)this.writeSplitVarint64(e,r(t[i]),n(t[i]))},jspb.BinaryWriter.prototype.writeRepeatedSplitZigzagVarint64=function(e,t,r,n){if(null!=t)for(var i=0;i<t.length;i++)this.writeSplitZigzagVarint64(e,r(t[i]),n(t[i]))},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])},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])},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])},jspb.BinaryWriter.prototype.writeRepeatedSint64=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.writeZigzagVarint64_(e,t[r])},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])},jspb.BinaryWriter.prototype.writeRepeatedFixed64=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.writeFixed64(e,t[r])},jspb.BinaryWriter.prototype.writeRepeatedFixed64String=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.writeFixed64String(e,t[r])},jspb.BinaryWriter.prototype.writeRepeatedSfixed32=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.writeSfixed32(e,t[r])},jspb.BinaryWriter.prototype.writeRepeatedSfixed64=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.writeSfixed64(e,t[r])},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])},jspb.BinaryWriter.prototype.writeRepeatedDouble=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.writeDouble(e,t[r])},jspb.BinaryWriter.prototype.writeRepeatedBool=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.writeBool(e,t[r])},jspb.BinaryWriter.prototype.writeRepeatedEnum=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.writeEnum(e,t[r])},jspb.BinaryWriter.prototype.writeRepeatedString=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.writeString(e,t[r])},jspb.BinaryWriter.prototype.writeRepeatedBytes=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.writeBytes(e,t[r])},jspb.BinaryWriter.prototype.writeRepeatedMessage=function(e,t,r){if(null!=t)for(var n=0;n<t.length;n++){var i=this.beginDelimited_(e);r(t[n],this),this.endDelimited_(i)}},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)},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)}},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)}},jspb.BinaryWriter.prototype.writePackedSplitFixed64=function(e,t,r,n){if(null!=t){e=this.beginDelimited_(e);for(var i=0;i<t.length;i++)this.encoder_.writeSplitFixed64(r(t[i]),n(t[i]));this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedSplitVarint64=function(e,t,r,n){if(null!=t){e=this.beginDelimited_(e);for(var i=0;i<t.length;i++)this.encoder_.writeSplitVarint64(r(t[i]),n(t[i]));this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedSplitZigzagVarint64=function(e,t,r,n){if(null!=t){e=this.beginDelimited_(e);for(var i=this.encoder_,o=0;o<t.length;o++)jspb.utils.toZigzag64(r(t[o]),n(t[o]),(function(e,t){i.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)}},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)}},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)}},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)}},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])},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])},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])},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])},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])},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])},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])},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)}},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_()},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_},jspb.Map.prototype.toObject=function(e,t){for(var r=this.toArray(),n=[],i=0;i<r.length;i++){var o=this.map_[r[i][0].toString()];this.wrapEntry_(o);var a=o.valueWrapper;a?(goog.asserts.assert(t),n.push([o.key,t(e,a)])):n.push([o.key,o.value])}return n},jspb.Map.fromObject=function(e,t,r){t=new jspb.Map([],t);for(var n=0;n<e.length;n++){var i=e[n][0],o=r(e[n][1]);t.set(i,o)}return t},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},jspb.Map.prototype.clear=function(){this.map_={},this.arrClean=!1},jspb.Map.prototype.del=function(e){e=e.toString();var t=this.map_.hasOwnProperty(e);return delete this.map_[e],this.arrClean=!1,t},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},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)},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)},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)},jspb.Map.prototype.forEach=function(e,t){var r=this.stringKeys_();r.sort();for(var n=0;n<r.length;n++){var i=this.map_[r[n]];e.call(t,this.wrapEntry_(i),i.key,this)}},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},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)},jspb.Map.prototype.has=function(e){return e.toString()in this.map_},jspb.Map.prototype.serializeBinary=function(e,t,r,n,i){var o=this.stringKeys_();o.sort();for(var a=0;a<o.length;a++){var s=this.map_[o[a]];t.beginSubMessage(e),r.call(t,1,s.key),this.valueCtor_?n.call(t,2,this.wrapEntry_(s),i):n.call(t,2,s.value),t.endSubMessage()}},jspb.Map.deserializeBinary=function(e,t,r,n,i,o,a){for(;t.nextField()&&!t.isEndGroup();){var s=t.getFieldNumber();1==s?o=r.call(t):2==s&&(e.valueCtor_?(goog.asserts.assert(i),a||(a=new e.valueCtor_),n.call(t,a,i)):a=n.call(t))}goog.asserts.assert(null!=o),goog.asserts.assert(null!=a),e.set(o,a)},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,i){this.fieldIndex=e,this.fieldName=t,this.ctor=r,this.toObjectFn=n,this.isRepeated=i},jspb.ExtensionFieldBinaryInfo=function(e,t,r,n,i,o){this.fieldInfo=e,this.binaryReaderFn=t,this.binaryWriterFn=r,this.binaryMessageSerializeFn=n,this.binaryMessageDeserializeFn=i,this.isPacked=o},jspb.ExtensionFieldInfo.prototype.isMessageType=function(){return!!this.ctor},jspb.Message=function(){},jspb.Message.GENERATE_TO_OBJECT=!0,jspb.Message.GENERATE_FROM_OBJECT=!goog.DISALLOW_TEST_ONLY_CODE,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_},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,i,o){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=i),i)for(t=0;t<i.length;t++)(r=i[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(o&&o.length)for(t=0;t<o.length;t++)jspb.Message.computeOneofCase(e,o[t])},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=[],i=0;i<e.length;i++)n[i]=t.call(e[i],r,e[i]);return n},jspb.Message.toObjectExtension=function(e,t,r,n,i){for(var o in r){var a=r[o],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,i):a.toObjectFn(i,s):s}}},jspb.Message.serializeBinaryExtensions=function(e,t,r,n){for(var i in r){var o=r[i],a=o.fieldInfo;if(!o.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(!o.binaryMessageSerializeFn)throw Error("Message extension present holding submessage without binary support enabled, and message is being serialized to binary format");o.binaryWriterFn.call(t,a.fieldIndex,s,o.binaryMessageSerializeFn)}else o.binaryWriterFn.call(t,a.fieldIndex,s)}},jspb.Message.readBinaryExtension=function(e,t,r,n,i){var o=r[t.getFieldNumber()];if(o){if(r=o.fieldInfo,!o.binaryReaderFn)throw Error("Deserializing extension whose generated code does not support binary format");if(r.isMessageType()){var a=new r.ctor;o.binaryReaderFn.call(t,a,o.binaryMessageDeserializeFn)}else a=o.binaryReaderFn.call(t);r.isRepeated&&!o.isPacked?(t=n.call(e,r))?t.push(a):i.call(e,r,[a]):i.call(e,r,a)}else t.skipField()},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},jspb.Message.getRepeatedField=function(e,t){return jspb.Message.getField(e,t)},jspb.Message.getOptionalFloatingPointField=function(e,t){return null==(e=jspb.Message.getField(e,t))?e:+e},jspb.Message.getBooleanField=function(e,t){return null==(e=jspb.Message.getField(e,t))?e:!!e},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},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},jspb.Message.bytesAsB64=function(e){return null==e||"string"==typeof e?e:jspb.Message.SUPPORTS_UINT8ARRAY_&&e instanceof Uint8Array?goog.crypt.base64.encodeByteArray(e):(goog.asserts.fail("Cannot coerce to b64 string: "+goog.typeOf(e)),null)},jspb.Message.bytesAsU8=function(e){return null==e||e instanceof Uint8Array?e:"string"==typeof e?goog.crypt.base64.decodeStringToUint8Array(e):(goog.asserts.fail("Cannot coerce to Uint8Array: "+goog.typeOf(e)),null)},jspb.Message.bytesListAsB64=function(e){return jspb.Message.assertConsistentTypes_(e),e.length&&"string"!=typeof e[0]?goog.array.map(e,jspb.Message.bytesAsB64):e},jspb.Message.bytesListAsU8=function(e){return jspb.Message.assertConsistentTypes_(e),!e.length||e[0]instanceof Uint8Array?e:goog.array.map(e,jspb.Message.bytesAsU8)},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&&goog.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},jspb.Message.getBooleanFieldWithDefault=function(e,t,r){return null==(e=jspb.Message.getBooleanField(e,t))?r:e},jspb.Message.getFloatingPointFieldWithDefault=function(e,t,r){return null==(e=jspb.Message.getOptionalFloatingPointField(e,t))?r:e},jspb.Message.getFieldProto3=jspb.Message.getFieldWithDefault,jspb.Message.getMapField=function(e,t,r,n){if(e.wrappers_||(e.wrappers_={}),t in e.wrappers_)return e.wrappers_[t];var i=jspb.Message.getField(e,t);if(!i){if(r)return;i=[],jspb.Message.setField(e,t,i)}return e.wrappers_[t]=new jspb.Map(i,n)},jspb.Message.setField=function(e,t,r){return goog.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},jspb.Message.setProto3IntField=function(e,t,r){return jspb.Message.setFieldIgnoringDefault_(e,t,r,0)},jspb.Message.setProto3FloatField=function(e,t,r){return jspb.Message.setFieldIgnoringDefault_(e,t,r,0)},jspb.Message.setProto3BooleanField=function(e,t,r){return jspb.Message.setFieldIgnoringDefault_(e,t,r,!1)},jspb.Message.setProto3StringField=function(e,t,r){return jspb.Message.setFieldIgnoringDefault_(e,t,r,"")},jspb.Message.setProto3BytesField=function(e,t,r){return jspb.Message.setFieldIgnoringDefault_(e,t,r,"")},jspb.Message.setProto3EnumField=function(e,t,r){return jspb.Message.setFieldIgnoringDefault_(e,t,r,0)},jspb.Message.setProto3StringIntField=function(e,t,r){return jspb.Message.setFieldIgnoringDefault_(e,t,r,"0")},jspb.Message.setFieldIgnoringDefault_=function(e,t,r,n){return goog.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 goog.asserts.assertInstanceof(e,jspb.Message),t=jspb.Message.getRepeatedField(e,t),null!=n?t.splice(n,0,r):t.push(r),e},jspb.Message.setOneofField=function(e,t,r,n){return goog.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)},jspb.Message.computeOneofCase=function(e,t){for(var r,n,i=0;i<t.length;i++){var o=t[i],a=jspb.Message.getField(e,o);null!=a&&(r=o,n=a,jspb.Message.setField(e,o,void 0))}return r?(jspb.Message.setField(e,r,n),r):0},jspb.Message.getWrapperField=function(e,t,r,n){if(e.wrappers_||(e.wrappers_={}),!e.wrappers_[r]){var i=jspb.Message.getField(e,r);(n||i)&&(e.wrappers_[r]=new t(i))}return e.wrappers_[r]},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},jspb.Message.wrapRepeatedField_=function(e,t,r){if(e.wrappers_||(e.wrappers_={}),!e.wrappers_[r]){for(var n=jspb.Message.getRepeatedField(e,r),i=[],o=0;o<n.length;o++)i[o]=new t(n[o]);e.wrappers_[r]=i}},jspb.Message.setWrapperField=function(e,t,r){goog.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)},jspb.Message.setOneofWrapperField=function(e,t,r,n){goog.asserts.assertInstanceof(e,jspb.Message),e.wrappers_||(e.wrappers_={});var i=n?n.toArray():n;return e.wrappers_[t]=n,jspb.Message.setOneofField(e,t,r,i)},jspb.Message.setRepeatedWrapperField=function(e,t,r){goog.asserts.assertInstanceof(e,jspb.Message),e.wrappers_||(e.wrappers_={}),r=r||[];for(var n=[],i=0;i<r.length;i++)n[i]=r[i].toArray();return e.wrappers_[t]=r,jspb.Message.setField(e,t,n)},jspb.Message.addToRepeatedWrapperField=function(e,t,r,n,i){jspb.Message.wrapRepeatedField_(e,n,t);var o=e.wrappers_[t];return o||(o=e.wrappers_[t]=[]),r=r||new n,e=jspb.Message.getRepeatedField(e,t),null!=i?(o.splice(i,0,r),e.splice(i,0,r.toArray())):(o.push(r),e.push(r.toArray())),r},jspb.Message.toMap=function(e,t,r,n){for(var i={},o=0;o<e.length;o++)i[t.call(e[o])]=r?r.call(e[o],n,e[o]):e[o];return i},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},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]}},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},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=[],i=0,o=r.length>t.length?r.length:t.length;for(e.getJsPbMessageId()&&(n[0]=e.getJsPbMessageId(),i=1);i<o;i++)jspb.Message.compareFields(r[i],t[i])||(n[i]=t[i]);return new e.constructor(n)},jspb.Message.equals=function(e,t){return e==t||!(!e||!t)&&e instanceof t.constructor&&jspb.Message.compareFields(e.toArray(),t.toArray())},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},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,i=void 0,o=Math.max(e.length,t.length);for(r=0;r<o;r++){var a=e[r],s=t[r];if(a&&a.constructor==Object&&(goog.asserts.assert(void 0===n),goog.asserts.assert(r===e.length-1),n=a,a=void 0),s&&s.constructor==Object&&(goog.asserts.assert(void 0===i),goog.asserts.assert(r===t.length-1),i=s,s=void 0),!jspb.Message.compareFields(a,s))return!1}return!n&&!i||(n=n||{},i=i||{},jspb.Message.compareExtensions(n,i))}if(e.constructor===Object)return jspb.Message.compareExtensions(e,t);throw Error("Invalid type in JSPB array")},jspb.Message.prototype.cloneMessage=function(){return jspb.Message.cloneMessage(this)},jspb.Message.prototype.clone=function(){return jspb.Message.cloneMessage(this)},jspb.Message.clone=function(e){return jspb.Message.cloneMessage(e)},jspb.Message.cloneMessage=function(e){return new e.constructor(jspb.Message.clone_(e.toArray()))},jspb.Message.copyInto=function(e,t){goog.asserts.assertInstanceof(e,jspb.Message),goog.asserts.assertInstanceof(t,jspb.Message),goog.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(),i=r.length=0;i<n.length;i++)r[i]=n[i];t.wrappers_=e.wrappers_,t.extensionObject_=e.extensionObject_},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_(goog.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_(goog.asserts.assert(n)):n);return t},jspb.Message.registerMessageType=function(e,t){t.messageId=e},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}).call(this,__webpack_require__(23),__webpack_require__(10).Buffer)},function(e,t,r){(function(t,n){var i=r(105),o=i.FileSystem.require(),a=r(48);o.existsSync=o.existsSync||a.existsSync;var s=r(244),u=r(429);/^win/.test(t.platform);e.exports=function(e){var t=void 0,r="";if(e&&"string"==typeof e){if(!o.existsSync(e))throw i.Errors.INVALID_FILENAME;r=e,t=new u(e,i.Constants.FILE)}else t=e&&n.isBuffer(e)?new u(e,i.Constants.BUFFER):new u(null,i.Constants.NONE);function c(e,t){e=a.resolve(a.normalize(e));for(var r=t.split("/"),n=0,i=r.length;n<i;n++){var o=a.normalize(a.join(e,r.slice(n,i).join(a.sep)));if(0===o.indexOf(e))return o}return a.normalize(a.join(e,a.basename(t)))}function l(e){var r;if(e&&t&&("string"==typeof e&&(r=t.getEntry(e)),"object"==typeof e&&void 0!==e.entryName&&void 0!==e.header&&(r=t.getEntry(e.entryName)),r))return r;return null}return{readFile:function(e){var t=l(e);return t&&t.getData()||null},readFileAsync:function(e,t){var r=l(e);r?r.getDataAsync(t):t(null,"getEntry failed for:"+e)},readAsText:function(e,t){var r=l(e);if(r){var n=r.getData();if(n&&n.length)return n.toString(t||"utf8")}return""},readAsTextAsync:function(e,t,r){var n=l(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 r=l(e);r&&t.deleteEntry(r.entryName)},addZipComment:function(e){t.comment=e},getZipComment:function(){return t.comment||""},addZipEntryComment:function(e,t){var r=l(e);r&&(r.comment=t)},getZipEntryComment:function(e){var t=l(e);return t&&t.comment||""},updateFile:function(e,t){var r=l(e);r&&r.setData(t)},addLocalFile:function(e,t,r){if(!o.existsSync(e))throw i.Errors.FILE_NOT_FOUND.replace("%s",e);t?"/"!==(t=t.split("\\").join("/")).charAt(t.length-1)&&(t+="/"):t="";var n=e.split("\\").join("/").split("/").pop();r?this.addFile(t+r,o.readFileSync(e),"",0):this.addFile(t+n,o.readFileSync(e),"",0)},addLocalFolder:function(e,t,r){if(void 0===r?r=function(){return!0}:r instanceof RegExp&&(r=function(e){return function(t){return e.test(t)}}(r)),t?"/"!==(t=t.split("\\").join("/")).charAt(t.length-1)&&(t+="/"):t="","/"!==(e=(e=a.normalize(e)).split("\\").join("/")).charAt(e.length-1)&&(e+="/"),!o.existsSync(e))throw i.Errors.FILE_NOT_FOUND.replace("%s",e);var s=i.findFiles(e),u=this;s.length&&s.forEach((function(i){var a=i.split("\\").join("/").replace(new RegExp(e.replace(/(\(|\))/g,"\\$1"),"i"),"");r(a)&&("/"!==a.charAt(a.length-1)?u.addFile(t+a,o.readFileSync(i),"",0):u.addFile(t+a,n.alloc(0),"",0))}))},addFile:function(e,r,n,i){var o=new s;o.entryName=e,o.comment=n||"",i||(i=o.isDirectory?1106051088:420<<16),o.attr=i,o.setData(r),t.setEntry(o)},getEntries:function(){return t?t.entries:[]},getEntry:function(e){return l(e)},extractEntryTo:function(e,r,n,s){s=s||!1,n=void 0===n||n;var u=l(e);if(!u)throw i.Errors.NO_ENTRY;var f=u.entryName,d=c(r,n?f:a.basename(f));if(u.isDirectory)return d=a.resolve(d,".."),t.getEntryChildren(u).forEach((function(e){if(!e.isDirectory){var t=e.getData();if(!t)throw i.Errors.CANT_EXTRACT_FILE;var o=c(r,n?e.entryName:a.basename(e.entryName));i.writeFileTo(o,t,s)}})),!0;var h=u.getData();if(!h)throw i.Errors.CANT_EXTRACT_FILE;if(o.existsSync(d)&&!s)throw i.Errors.CANT_OVERRIDE;return i.writeFileTo(d,h,s),!0},test:function(){if(!t)return!1;for(var e in t.entries)try{if(e.isDirectory)continue;if(!t.entries[e].getData())return!1}catch(e){return!1}return!0},extractAllTo:function(e,r){if(r=r||!1,!t)throw i.Errors.NO_ZIP;t.entries.forEach((function(t){var n=c(e,t.entryName.toString());if(t.isDirectory)i.makeDir(n);else{var a=t.getData();if(!a)throw i.Errors.CANT_EXTRACT_FILE;i.writeFileTo(n,a,r);try{o.utimesSync(n,t.header.time,t.header.time)}catch(e){throw i.Errors.CANT_EXTRACT_FILE}}}))},extractAllToAsync:function(e,r,n){if(n||(n=function(){}),r=r||!1,t){var s=t.entries,u=s.length;s.forEach((function(t){if(!(u<=0)){var s=a.normalize(t.entryName.toString());if(t.isDirectory)return i.makeDir(c(e,s)),void(0==--u&&n(void 0));t.getDataAsync((function(l,f){if(!(u<=0)){if(!f)return l?void i.writeFileToAsync(c(e,s),l,r,(function(r){try{o.utimesSync(a.resolve(e,s),t.header.time,t.header.time)}catch(e){n(new Error("Unable to set utimes"))}if(!(u<=0))return r?void(0==--u&&n(void 0)):(u=0,void n(new Error("Unable to write")))})):(u=0,void n(new Error(i.Errors.CANT_EXTRACT_FILE)));n(new Error(f))}}))}}))}else n(new Error(i.Errors.NO_ZIP))},writeZip:function(e,n){if(1===arguments.length&&"function"==typeof e&&(n=e,e=""),!e&&r&&(e=r),e){var o=t.compressToBuffer();if(o){var a=i.writeFileTo(e,o,!0);"function"==typeof n&&n(a?null:new Error("failed"),"")}}},toBuffer:function(e,r,n,i){return this.valueOf=2,"function"==typeof e?(t.toAsyncBuffer(e,r,n,i),null):t.compressToBuffer()}}}}).call(this,r(19),r(10).Buffer)},function(e,t,r){(function(t){var n=r(164).require(),i=r(48);n.existsSync=n.existsSync||i.existsSync,e.exports=function(){var e=[],o=r(242),a=r(243),s=i.sep;function u(e){var t=e.split(s)[0];e.split(s).forEach((function(e){if(e&&":"!==e.substr(-1,1)){var r;t+=s+e;try{r=n.statSync(t)}catch(e){n.mkdirSync(t)}if(r&&r.isFile())throw a.FILE_IN_THE_WAY.replace("%s",t)}}))}return{makeDir:function(e){u(e)},crc32:function(r){"string"==typeof r&&(r=t.alloc(r.length,r));var n=t.alloc(4);if(!e.length)for(var i=0;i<256;i++){for(var o=i,a=8;--a>=0;)0!=(1&o)?o=3988292384^o>>>1:o>>>=1;o<0&&(n.writeInt32LE(o,0),o=n.readUInt32LE(0)),e[i]=o}for(var s=0,u=0,c=r.length,l=~s;--c>=0;)l=e[255&(l^r[u++])]^l>>>8;return s=~l,n.writeInt32LE(4294967295&s,0),n.readUInt32LE(0)},methodToString:function(e){switch(e){case o.STORED:return"STORED ("+e+")";case o.DEFLATED:return"DEFLATED ("+e+")";default:return"UNSUPPORTED ("+e+")"}},writeFileTo:function(e,t,r,o){if(n.existsSync(e)){if(!r)return!1;if(n.statSync(e).isDirectory())return!1}var a,s=i.dirname(e);n.existsSync(s)||u(s);try{a=n.openSync(e,"w",438)}catch(t){n.chmodSync(e,438),a=n.openSync(e,"w",438)}if(a)try{n.writeSync(a,t,0,t.length,0)}catch(e){throw e}finally{n.closeSync(a)}return n.chmodSync(e,o||438),!0},writeFileToAsync:function(e,t,r,o,a){"function"==typeof o&&(a=o,o=void 0),n.exists(e,(function(s){if(s&&!r)return a(!1);n.stat(e,(function(r,c){if(s&&c.isDirectory())return a(!1);var l=i.dirname(e);n.exists(l,(function(r){r||u(l),n.open(e,"w",438,(function(r,i){r?n.chmod(e,438,(function(){n.open(e,"w",438,(function(r,i){n.write(i,t,0,t.length,0,(function(){n.close(i,(function(){n.chmod(e,o||438,(function(){a(!0)}))}))}))}))})):i?n.write(i,t,0,t.length,0,(function(){n.close(i,(function(){n.chmod(e,o||438,(function(){a(!0)}))}))})):n.chmod(e,o||438,(function(){a(!0)}))}))}))}))}))},findFiles:function(e){return function e(t,r,o){"boolean"==typeof r&&(o=r,r=void 0);var a=[];return n.readdirSync(t).forEach((function(u){var c=i.join(t,u);n.statSync(c).isDirectory()&&o&&(a=a.concat(e(c,r,o))),r&&!r.test(c)||a.push(i.normalize(c)+(n.statSync(c).isDirectory()?s:""))})),a}(e,!0)},getAttributes:function(e){},setAttributes:function(e){},toBuffer:function(e){return t.isBuffer(e)?e:0===e.length?t.alloc(0):t.from(e,"utf8")},Constants:o,Errors:a}}()}).call(this,r(10).Buffer)},function(e,t,r){var n=r(164).require(),i=r(48);n.existsSync=n.existsSync||i.existsSync,e.exports=function(e){var t=e||"",r={directory:!1,readonly:!1,hidden:!1,executable:!1,mtime:0,atime:0},o=null;return t&&n.existsSync(t)?(o=n.statSync(t),r.directory=o.isDirectory(),r.mtime=o.mtime,r.atime=o.atime,r.executable=!!(1&parseInt((o.mode&parseInt("777",8)).toString(8)[0])),r.readonly=!!(2&parseInt((o.mode&parseInt("777",8)).toString(8)[0])),r.hidden="."===i.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(e){},encodeAttributes:function(e){},toString:function(){return'{\n\t"path" : "'+t+',\n\t"isDirectory" : '+r.directory+',\n\t"isReadOnly" : '+r.readonly+',\n\t"isHidden" : '+r.hidden+',\n\t"isExecutable" : '+r.executable+',\n\t"mTime" : '+r.mtime+'\n\t"aTime" : '+r.atime+"\n}"}}}},function(e,t,r){(function(t){var n=r(105),i=n.Constants;e.exports=function(){var e=10,r=10,o=0,a=0,s=0,u=0,c=0,l=0,f=0,d=0,h=0,p=0,g=0,m=0,y=0,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 r},set version(e){r=e},get flags(){return o},set flags(e){o=e},get method(){return a},set method(e){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=e},get compressedSize(){return c},set compressedSize(e){c=e},get size(){return l},set size(e){l=e},get fileNameLength(){return f},set fileNameLength(e){f=e},get extraLength(){return d},set extraLength(e){d=e},get commentLength(){return h},set commentLength(e){h=e},get diskNumStart(){return p},set diskNumStart(e){p=e},get inAttr(){return g},set inAttr(e){g=e},get attr(){return m},set attr(e){m=e},get offset(){return y},set offset(e){y=e},get encripted(){return 1==(1&o)},get entryHeaderSize(){return i.CENHDR+f+d+h},get realDataOffset(){return y+i.LOCHDR+b.fnameLen+b.extraLen},get dataHeader(){return b},loadDataHeaderFromBinary:function(e){var t=e.slice(y,y+i.LOCHDR);if(t.readUInt32LE(0)!==i.LOCSIG)throw n.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(t){if(t.length!==i.CENHDR||t.readUInt32LE(0)!==i.CENSIG)throw n.Errors.INVALID_CEN;e=t.readUInt16LE(i.CENVEM),r=t.readUInt16LE(i.CENVER),o=t.readUInt16LE(i.CENFLG),a=t.readUInt16LE(i.CENHOW),s=t.readUInt32LE(i.CENTIM),u=t.readUInt32LE(i.CENCRC),c=t.readUInt32LE(i.CENSIZ),l=t.readUInt32LE(i.CENLEN),f=t.readUInt16LE(i.CENNAM),d=t.readUInt16LE(i.CENEXT),h=t.readUInt16LE(i.CENCOM),p=t.readUInt16LE(i.CENDSK),g=t.readUInt16LE(i.CENATT),m=t.readUInt32LE(i.CENATX),y=t.readUInt32LE(i.CENOFF)},dataHeaderToBinary:function(){var e=t.alloc(i.LOCHDR);return e.writeUInt32LE(i.LOCSIG,0),e.writeUInt16LE(r,i.LOCVER),e.writeUInt16LE(o,i.LOCFLG),e.writeUInt16LE(a,i.LOCHOW),e.writeUInt32LE(s,i.LOCTIM),e.writeUInt32LE(u,i.LOCCRC),e.writeUInt32LE(c,i.LOCSIZ),e.writeUInt32LE(l,i.LOCLEN),e.writeUInt16LE(f,i.LOCNAM),e.writeUInt16LE(d,i.LOCEXT),e},entryHeaderToBinary:function(){var n=t.alloc(i.CENHDR+f+d+h);return n.writeUInt32LE(i.CENSIG,0),n.writeUInt16LE(e,i.CENVEM),n.writeUInt16LE(r,i.CENVER),n.writeUInt16LE(o,i.CENFLG),n.writeUInt16LE(a,i.CENHOW),n.writeUInt32LE(s,i.CENTIM),n.writeUInt32LE(u,i.CENCRC),n.writeUInt32LE(c,i.CENSIZ),n.writeUInt32LE(l,i.CENLEN),n.writeUInt16LE(f,i.CENNAM),n.writeUInt16LE(d,i.CENEXT),n.writeUInt16LE(h,i.CENCOM),n.writeUInt16LE(p,i.CENDSK),n.writeUInt16LE(g,i.CENATT),n.writeUInt32LE(m,i.CENATX),n.writeUInt32LE(y,i.CENOFF),n.fill(0,i.CENHDR),n},toString:function(){return'{\n\t"made" : '+e+',\n\t"version" : '+r+',\n\t"flags" : '+o+',\n\t"method" : '+n.methodToString(a)+',\n\t"time" : '+this.time+',\n\t"crc" : 0x'+u.toString(16).toUpperCase()+',\n\t"compressedSize" : '+c+' bytes,\n\t"size" : '+l+' bytes,\n\t"fileNameLength" : '+f+',\n\t"extraLength" : '+d+' bytes,\n\t"commentLength" : '+h+' bytes,\n\t"diskNumStart" : '+p+',\n\t"inAttr" : '+g+',\n\t"attr" : '+m+',\n\t"offset" : '+y+',\n\t"entryHeaderSize" : '+(i.CENHDR+f+d+h)+" bytes\n}"}}}}).call(this,r(10).Buffer)},function(e,t,r){(function(t){var n=r(105),i=n.Constants;e.exports=function(){var e=0,r=0,o=0,a=0,s=0;return{get diskEntries(){return e},set diskEntries(t){e=r=t},get totalEntries(){return r},set totalEntries(t){r=e=t},get size(){return o},set size(e){o=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(t){if(t.length!==i.ENDHDR||t.readUInt32LE(0)!==i.ENDSIG)throw n.Errors.INVALID_END;e=t.readUInt16LE(i.ENDSUB),r=t.readUInt16LE(i.ENDTOT),o=t.readUInt32LE(i.ENDSIZ),a=t.readUInt32LE(i.ENDOFF),s=t.readUInt16LE(i.ENDCOM)},toBinary:function(){var n=t.alloc(i.ENDHDR+s);return n.writeUInt32LE(i.ENDSIG,0),n.writeUInt32LE(0,4),n.writeUInt16LE(e,i.ENDSUB),n.writeUInt16LE(r,i.ENDTOT),n.writeUInt32LE(o,i.ENDSIZ),n.writeUInt32LE(a,i.ENDOFF),n.writeUInt16LE(s,i.ENDCOM),n.fill(" ",i.ENDHDR),n},toString:function(){return'{\n\t"diskEntries" : '+e+',\n\t"totalEntries" : '+r+',\n\t"size" : '+o+' bytes,\n\t"offset" : 0x'+a.toString(16).toUpperCase()+',\n\t"commentLength" : 0x'+s+"\n}"}}}}).call(this,r(10).Buffer)},function(e,t,r){t.Deflater=r(418),t.Inflater=r(428)},function(e,t,r){(function(t){e.exports=function(e){var n=r(120),i={chunkSize:1024*(parseInt(e.length/1024)+1)};return{deflate:function(){return n.deflateRawSync(e,i)},deflateAsync:function(r){var o=n.createDeflateRaw(i),a=[],s=0;o.on("data",(function(e){a.push(e),s+=e.length})),o.on("end",(function(){var e=t.alloc(s),n=0;e.fill(0);for(var i=0;i<a.length;i++){var o=a[i];o.copy(e,n),n+=o.length}r&&r(e)})),o.end(e)}}}}).call(this,r(10).Buffer)},function(e,t,r){"use strict";(function(e,n){var i=r(141),o=r(420),a=r(421),s=r(424),u=r(427);for(var c in u)t[c]=u[c];t.NONE=0,t.DEFLATE=1,t.INFLATE=2,t.GZIP=3,t.GUNZIP=4,t.DEFLATERAW=5,t.INFLATERAW=6,t.UNZIP=7;function l(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}l.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?a.deflateEnd(this.strm):this.mode!==t.INFLATE&&this.mode!==t.GUNZIP&&this.mode!==t.INFLATERAW&&this.mode!==t.UNZIP||s.inflateEnd(this.strm),this.mode=t.NONE,this.dictionary=null)},l.prototype.write=function(e,t,r,n,i,o,a){return this._write(!0,e,t,r,n,i,o,a)},l.prototype.writeSync=function(e,t,r,n,i,o,a){return this._write(!1,e,t,r,n,i,o,a)},l.prototype._write=function(r,o,a,s,u,c,l,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===o,"must provide flush value"),this.write_in_progress=!0,o!==t.Z_NO_FLUSH&&o!==t.Z_PARTIAL_FLUSH&&o!==t.Z_SYNC_FLUSH&&o!==t.Z_FULL_FLUSH&&o!==t.Z_FINISH&&o!==t.Z_BLOCK)throw new Error("Invalid flush value");if(null==a&&(a=e.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=c,this.strm.next_out=l,this.flush=o,!r)return this._process(),this._checkError()?this._afterSync():void 0;var d=this;return n.nextTick((function(){d._process(),d._after()})),this},l.prototype._afterSync=function(){var e=this.strm.avail_out,t=this.strm.avail_in;return this.write_in_progress=!1,[t,e]},l.prototype._process=function(){var e=null;switch(this.mode){case t.DEFLATE:case t.GZIP:case t.DEFLATERAW:this.err=a.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=s.inflate(this.strm,this.flush),this.err===t.Z_NEED_DICT&&this.dictionary&&(this.err=s.inflateSetDictionary(this.strm,this.dictionary),this.err===t.Z_OK?this.err=s.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=s.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}},l.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},l.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()}},l.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()},l.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()},l.prototype.params=function(){throw new Error("deflateParams Not supported")},l.prototype.reset=function(){this._reset(),this._setDictionary()},l.prototype._init=function(e,r,n,i,u){switch(this.level=e,this.windowBits=r,this.memLevel=n,this.strategy=i,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 o,this.mode){case t.DEFLATE:case t.GZIP:case t.DEFLATERAW:this.err=a.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=s.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=u,this.write_in_progress=!1,this.init_done=!0},l.prototype._setDictionary=function(){if(null!=this.dictionary){switch(this.err=t.Z_OK,this.mode){case t.DEFLATE:case t.DEFLATERAW:this.err=a.deflateSetDictionary(this.strm,this.dictionary)}this.err!==t.Z_OK&&this._error("Failed to set dictionary")}},l.prototype._reset=function(){switch(this.err=t.Z_OK,this.mode){case t.DEFLATE:case t.DEFLATERAW:case t.GZIP:this.err=a.deflateReset(this.strm);break;case t.INFLATE:case t.INFLATERAW:case t.GUNZIP:this.err=s.inflateReset(this.strm)}this.err!==t.Z_OK&&this._error("Failed to reset stream")},t.Zlib=l}).call(this,r(10).Buffer,r(19))},function(e,t,r){"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}},function(e,t,r){"use strict";var n,i=r(121),o=r(422),a=r(246),s=r(247),u=r(423);function c(e,t){return e.msg=u[t],t}function l(e){return(e<<1)-(e>4?9:0)}function f(e){for(var t=e.length;--t>=0;)e[t]=0}function d(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(i.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 h(e,t){o._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,d(e.strm)}function p(e,t){e.pending_buf[e.pending++]=t}function g(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function m(e,t){var r,n,i=e.max_chain_length,o=e.strstart,a=e.prev_length,s=e.nice_match,u=e.strstart>e.w_size-262?e.strstart-(e.w_size-262):0,c=e.window,l=e.w_mask,f=e.prev,d=e.strstart+258,h=c[o+a-1],p=c[o+a];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(c[(r=t)+a]===p&&c[r+a-1]===h&&c[r]===c[o]&&c[++r]===c[o+1]){o+=2,r++;do{}while(c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&o<d);if(n=258-(d-o),o=d-258,n>a){if(e.match_start=t,a=n,n>=s)break;h=c[o+a-1],p=c[o+a]}}}while((t=f[t&l])>u&&0!=--i);return a<=e.lookahead?a:e.lookahead}function y(e){var t,r,n,o,u,c,l,f,d,h,p=e.w_size;do{if(o=e.window_size-e.lookahead-e.strstart,e.strstart>=p+(p-262)){i.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);o+=p}if(0===e.strm.avail_in)break;if(c=e.strm,l=e.window,f=e.strstart+e.lookahead,d=o,h=void 0,(h=c.avail_in)>d&&(h=d),r=0===h?0:(c.avail_in-=h,i.arraySet(l,c.input,c.next_in,h,f),1===c.state.wrap?c.adler=a(c.adler,l,h,f):2===c.state.wrap&&(c.adler=s(c.adler,l,h,f)),c.next_in+=h,c.total_in+=h,h),e.lookahead+=r,e.lookahead+e.insert>=3)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+3-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<3)););}while(e.lookahead<262&&0!==e.strm.avail_in)}function b(e,t){for(var r,n;;){if(e.lookahead<262){if(y(e),e.lookahead<262&&0===t)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-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-262&&(e.match_length=m(e,r)),e.match_length>=3)if(n=o._tr_tally(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-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=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(h(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,4===t?(h(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(h(e,!1),0===e.strm.avail_out)?1:2}function _(e,t){for(var r,n,i;;){if(e.lookahead<262){if(y(e),e.lookahead<262&&0===t)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-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=2,0!==r&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-262&&(e.match_length=m(e,r),e.match_length<=5&&(1===e.strategy||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-3,n=o._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-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=2,e.strstart++,n&&(h(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if((n=o._tr_tally(e,0,e.window[e.strstart-1]))&&h(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=o._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,4===t?(h(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(h(e,!1),0===e.strm.avail_out)?1:2}function w(e,t,r,n,i){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=i}function v(){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=8,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 i.Buf16(1146),this.dyn_dtree=new i.Buf16(122),this.bl_tree=new i.Buf16(78),f(this.dyn_ltree),f(this.dyn_dtree),f(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new i.Buf16(16),this.heap=new i.Buf16(573),f(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(573),f(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 E(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=2,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?42:113,e.adler=2===t.wrap?0:1,t.last_flush=0,o._tr_init(t),0):c(e,-2)}function S(e){var t,r=E(e);return 0===r&&((t=e.state).window_size=2*t.w_size,f(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=2,t.match_available=0,t.ins_h=0),r}function O(e,t,r,n,o,a){if(!e)return-2;var s=1;if(-1===t&&(t=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),o<1||o>9||8!==r||n<8||n>15||t<0||t>9||a<0||a>4)return c(e,-2);8===n&&(n=9);var u=new v;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=o+7,u.hash_size=1<<u.hash_bits,u.hash_mask=u.hash_size-1,u.hash_shift=~~((u.hash_bits+3-1)/3),u.window=new i.Buf8(2*u.w_size),u.head=new i.Buf16(u.hash_size),u.prev=new i.Buf16(u.w_size),u.lit_bufsize=1<<o+6,u.pending_buf_size=4*u.lit_bufsize,u.pending_buf=new i.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,S(e)}n=[new w(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(y(e),0===e.lookahead&&0===t)return 1;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,h(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-262&&(h(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(h(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(h(e,!1),e.strm.avail_out),1)})),new w(4,4,8,4,b),new w(4,5,16,8,b),new w(4,6,32,32,b),new w(4,4,16,16,_),new w(8,16,32,32,_),new w(8,16,128,128,_),new w(8,32,128,256,_),new w(32,128,258,1024,_),new w(32,258,258,4096,_)],t.deflateInit=function(e,t){return O(e,t,8,15,8,0)},t.deflateInit2=O,t.deflateReset=S,t.deflateResetKeep=E,t.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?-2:(e.state.gzhead=t,0):-2},t.deflate=function(e,t){var r,i,a,u;if(!e||!e.state||t>5||t<0)return e?c(e,-2):-2;if(i=e.state,!e.output||!e.input&&0!==e.avail_in||666===i.status&&4!==t)return c(e,0===e.avail_out?-5:-2);if(i.strm=e,r=i.last_flush,i.last_flush=t,42===i.status)if(2===i.wrap)e.adler=0,p(i,31),p(i,139),p(i,8),i.gzhead?(p(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),p(i,255&i.gzhead.time),p(i,i.gzhead.time>>8&255),p(i,i.gzhead.time>>16&255),p(i,i.gzhead.time>>24&255),p(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),p(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(p(i,255&i.gzhead.extra.length),p(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=s(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(p(i,0),p(i,0),p(i,0),p(i,0),p(i,0),p(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),p(i,3),i.status=113);else{var m=8+(i.w_bits-8<<4)<<8;m|=(i.strategy>=2||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(m|=32),m+=31-m%31,i.status=113,g(i,m),0!==i.strstart&&(g(i,e.adler>>>16),g(i,65535&e.adler)),e.adler=1}if(69===i.status)if(i.gzhead.extra){for(a=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),d(e),a=i.pending,i.pending!==i.pending_buf_size));)p(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),d(e),a=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,p(i,u)}while(0!==u);i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),0===u&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),d(e),a=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,p(i,u)}while(0!==u);i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),0===u&&(i.status=103)}else i.status=103;if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&d(e),i.pending+2<=i.pending_buf_size&&(p(i,255&e.adler),p(i,e.adler>>8&255),e.adler=0,i.status=113)):i.status=113),0!==i.pending){if(d(e),0===e.avail_out)return i.last_flush=-1,0}else if(0===e.avail_in&&l(t)<=l(r)&&4!==t)return c(e,-5);if(666===i.status&&0!==e.avail_in)return c(e,-5);if(0!==e.avail_in||0!==i.lookahead||0!==t&&666!==i.status){var b=2===i.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(y(e),0===e.lookahead)){if(0===t)return 1;break}if(e.match_length=0,r=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(h(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(h(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(h(e,!1),0===e.strm.avail_out)?1:2}(i,t):3===i.strategy?function(e,t){for(var r,n,i,a,s=e.window;;){if(e.lookahead<=258){if(y(e),e.lookahead<=258&&0===t)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(n=s[i=e.strstart-1])===s[++i]&&n===s[++i]&&n===s[++i]){a=e.strstart+258;do{}while(n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&i<a);e.match_length=258-(a-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(r=o._tr_tally(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(h(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(h(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(h(e,!1),0===e.strm.avail_out)?1:2}(i,t):n[i.level].func(i,t);if(3!==b&&4!==b||(i.status=666),1===b||3===b)return 0===e.avail_out&&(i.last_flush=-1),0;if(2===b&&(1===t?o._tr_align(i):5!==t&&(o._tr_stored_block(i,0,0,!1),3===t&&(f(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),d(e),0===e.avail_out))return i.last_flush=-1,0}return 4!==t?0:i.wrap<=0?1:(2===i.wrap?(p(i,255&e.adler),p(i,e.adler>>8&255),p(i,e.adler>>16&255),p(i,e.adler>>24&255),p(i,255&e.total_in),p(i,e.total_in>>8&255),p(i,e.total_in>>16&255),p(i,e.total_in>>24&255)):(g(i,e.adler>>>16),g(i,65535&e.adler)),d(e),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?0:1)},t.deflateEnd=function(e){var t;return e&&e.state?42!==(t=e.state.status)&&69!==t&&73!==t&&91!==t&&103!==t&&113!==t&&666!==t?c(e,-2):(e.state=null,113===t?c(e,-3):0):-2},t.deflateSetDictionary=function(e,t){var r,n,o,s,u,c,l,d,h=t.length;if(!e||!e.state)return-2;if(2===(s=(r=e.state).wrap)||1===s&&42!==r.status||r.lookahead)return-2;for(1===s&&(e.adler=a(e.adler,t,h,0)),r.wrap=0,h>=r.w_size&&(0===s&&(f(r.head),r.strstart=0,r.block_start=0,r.insert=0),d=new i.Buf8(r.w_size),i.arraySet(d,t,h-r.w_size,r.w_size,0),t=d,h=r.w_size),u=e.avail_in,c=e.next_in,l=e.input,e.avail_in=h,e.next_in=0,e.input=t,y(r);r.lookahead>=3;){n=r.strstart,o=r.lookahead-2;do{r.ins_h=(r.ins_h<<r.hash_shift^r.window[n+3-1])&r.hash_mask,r.prev[n&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=n,n++}while(--o);r.strstart=n,r.lookahead=2,y(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,e.next_in=c,e.input=l,e.avail_in=u,r.wrap=s,0},t.deflateInfo="pako deflate (from Nodeca project)"},function(e,t,r){"use strict";var n=r(121);function i(e){for(var t=e.length;--t>=0;)e[t]=0}var o=[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],a=[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],s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],u=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],c=new Array(576);i(c);var l=new Array(60);i(l);var f=new Array(512);i(f);var d=new Array(256);i(d);var h=new Array(29);i(h);var p,g,m,y=new Array(30);function b(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}function _(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function w(e){return e<256?f[e]:f[256+(e>>>7)]}function v(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function E(e,t,r){e.bi_valid>16-r?(e.bi_buf|=t<<e.bi_valid&65535,v(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=r-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)}function S(e,t,r){E(e,r[2*t],r[2*t+1])}function O(e,t){var r=0;do{r|=1&e,e>>>=1,r<<=1}while(--t>0);return r>>>1}function T(e,t,r){var n,i,o=new Array(16),a=0;for(n=1;n<=15;n++)o[n]=a=a+r[n-1]<<1;for(i=0;i<=t;i++){var s=e[2*i+1];0!==s&&(e[2*i]=O(o[s]++,s))}}function A(e){var t;for(t=0;t<286;t++)e.dyn_ltree[2*t]=0;for(t=0;t<30;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function M(e){e.bi_valid>8?v(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 D(e,t,r,n){var i=2*t,o=2*r;return e[i]<e[o]||e[i]===e[o]&&n[t]<=n[r]}function I(e,t,r){for(var n=e.heap[r],i=r<<1;i<=e.heap_len&&(i<e.heap_len&&D(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!D(t,n,e.heap[i],e.depth));)e.heap[r]=e.heap[i],r=i,i<<=1;e.heap[r]=n}function j(e,t,r){var n,i,s,u,c=0;if(0!==e.last_lit)do{n=e.pending_buf[e.d_buf+2*c]<<8|e.pending_buf[e.d_buf+2*c+1],i=e.pending_buf[e.l_buf+c],c++,0===n?S(e,i,t):(S(e,(s=d[i])+256+1,t),0!==(u=o[s])&&E(e,i-=h[s],u),S(e,s=w(--n),r),0!==(u=a[s])&&E(e,n-=y[s],u))}while(c<e.last_lit);S(e,256,t)}function R(e,t){var r,n,i,o=t.dyn_tree,a=t.stat_desc.static_tree,s=t.stat_desc.has_stree,u=t.stat_desc.elems,c=-1;for(e.heap_len=0,e.heap_max=573,r=0;r<u;r++)0!==o[2*r]?(e.heap[++e.heap_len]=c=r,e.depth[r]=0):o[2*r+1]=0;for(;e.heap_len<2;)o[2*(i=e.heap[++e.heap_len]=c<2?++c:0)]=1,e.depth[i]=0,e.opt_len--,s&&(e.static_len-=a[2*i+1]);for(t.max_code=c,r=e.heap_len>>1;r>=1;r--)I(e,o,r);i=u;do{r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],I(e,o,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,o[2*i]=o[2*r]+o[2*n],e.depth[i]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,o[2*r+1]=o[2*n+1]=i,e.heap[1]=i++,I(e,o,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,n,i,o,a,s,u=t.dyn_tree,c=t.max_code,l=t.stat_desc.static_tree,f=t.stat_desc.has_stree,d=t.stat_desc.extra_bits,h=t.stat_desc.extra_base,p=t.stat_desc.max_length,g=0;for(o=0;o<=15;o++)e.bl_count[o]=0;for(u[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r<573;r++)(o=u[2*u[2*(n=e.heap[r])+1]+1]+1)>p&&(o=p,g++),u[2*n+1]=o,n>c||(e.bl_count[o]++,a=0,n>=h&&(a=d[n-h]),s=u[2*n],e.opt_len+=s*(o+a),f&&(e.static_len+=s*(l[2*n+1]+a)));if(0!==g){do{for(o=p-1;0===e.bl_count[o];)o--;e.bl_count[o]--,e.bl_count[o+1]+=2,e.bl_count[p]--,g-=2}while(g>0);for(o=p;0!==o;o--)for(n=e.bl_count[o];0!==n;)(i=e.heap[--r])>c||(u[2*i+1]!==o&&(e.opt_len+=(o-u[2*i+1])*u[2*i],u[2*i+1]=o),n--)}}(e,t),T(o,c,e.bl_count)}function N(e,t,r){var n,i,o=-1,a=t[1],s=0,u=7,c=4;for(0===a&&(u=138,c=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=a,a=t[2*(n+1)+1],++s<u&&i===a||(s<c?e.bl_tree[2*i]+=s:0!==i?(i!==o&&e.bl_tree[2*i]++,e.bl_tree[32]++):s<=10?e.bl_tree[34]++:e.bl_tree[36]++,s=0,o=i,0===a?(u=138,c=3):i===a?(u=6,c=3):(u=7,c=4))}function k(e,t,r){var n,i,o=-1,a=t[1],s=0,u=7,c=4;for(0===a&&(u=138,c=3),n=0;n<=r;n++)if(i=a,a=t[2*(n+1)+1],!(++s<u&&i===a)){if(s<c)do{S(e,i,e.bl_tree)}while(0!=--s);else 0!==i?(i!==o&&(S(e,i,e.bl_tree),s--),S(e,16,e.bl_tree),E(e,s-3,2)):s<=10?(S(e,17,e.bl_tree),E(e,s-3,3)):(S(e,18,e.bl_tree),E(e,s-11,7));s=0,o=i,0===a?(u=138,c=3):i===a?(u=6,c=3):(u=7,c=4)}}i(y);var C=!1;function L(e,t,r,i){E(e,0+(i?1:0),3),function(e,t,r,i){M(e),i&&(v(e,r),v(e,~r)),n.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}(e,t,r,!0)}t._tr_init=function(e){C||(!function(){var e,t,r,n,i,u=new Array(16);for(r=0,n=0;n<28;n++)for(h[n]=r,e=0;e<1<<o[n];e++)d[r++]=n;for(d[r-1]=n,i=0,n=0;n<16;n++)for(y[n]=i,e=0;e<1<<a[n];e++)f[i++]=n;for(i>>=7;n<30;n++)for(y[n]=i<<7,e=0;e<1<<a[n]-7;e++)f[256+i++]=n;for(t=0;t<=15;t++)u[t]=0;for(e=0;e<=143;)c[2*e+1]=8,e++,u[8]++;for(;e<=255;)c[2*e+1]=9,e++,u[9]++;for(;e<=279;)c[2*e+1]=7,e++,u[7]++;for(;e<=287;)c[2*e+1]=8,e++,u[8]++;for(T(c,287,u),e=0;e<30;e++)l[2*e+1]=5,l[2*e]=O(e,5);p=new b(c,o,257,286,15),g=new b(l,a,0,30,15),m=new b(new Array(0),s,0,19,7)}(),C=!0),e.l_desc=new _(e.dyn_ltree,p),e.d_desc=new _(e.dyn_dtree,g),e.bl_desc=new _(e.bl_tree,m),e.bi_buf=0,e.bi_valid=0,A(e)},t._tr_stored_block=L,t._tr_flush_block=function(e,t,r,n){var i,o,a=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<256;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0}(e)),R(e,e.l_desc),R(e,e.d_desc),a=function(e){var t;for(N(e,e.dyn_ltree,e.l_desc.max_code),N(e,e.dyn_dtree,e.d_desc.max_code),R(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*u[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),i=e.opt_len+3+7>>>3,(o=e.static_len+3+7>>>3)<=i&&(i=o)):i=o=r+5,r+4<=i&&-1!==t?L(e,t,r,n):4===e.strategy||o===i?(E(e,2+(n?1:0),3),j(e,c,l)):(E(e,4+(n?1:0),3),function(e,t,r,n){var i;for(E(e,t-257,5),E(e,r-1,5),E(e,n-4,4),i=0;i<n;i++)E(e,e.bl_tree[2*u[i]+1],3);k(e,e.dyn_ltree,t-1),k(e,e.dyn_dtree,r-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),j(e,e.dyn_ltree,e.dyn_dtree)),A(e),n&&M(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*(d[r]+256+1)]++,e.dyn_dtree[2*w(t)]++),e.last_lit===e.lit_bufsize-1},t._tr_align=function(e){E(e,2,3),S(e,256,c),function(e){16===e.bi_valid?(v(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)}},function(e,t,r){"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"}},function(e,t,r){"use strict";var n=r(121),i=r(246),o=r(247),a=r(425),s=r(426);function u(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function c(){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 l(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=1,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(852),t.distcode=t.distdyn=new n.Buf32(592),t.sane=1,t.back=-1,0):-2}function f(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,l(e)):-2}function d(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)?-2:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,f(e))):-2}function h(e,t){var r,n;return e?(n=new c,e.state=n,n.window=null,0!==(r=d(e,t))&&(e.state=null),r):-2}var p,g,m=!0;function y(e){if(m){var t;for(p=new n.Buf32(512),g=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(1,e.lens,0,288,p,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;s(2,e.lens,0,32,g,0,e.work,{bits:5}),m=!1}e.lencode=p,e.lenbits=9,e.distcode=g,e.distbits=5}function b(e,t,r,i){var o,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)),i>=a.wsize?(n.arraySet(a.window,t,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):((o=a.wsize-a.wnext)>i&&(o=i),n.arraySet(a.window,t,r-i,o,a.wnext),(i-=o)?(n.arraySet(a.window,t,r-i,i,0),a.wnext=i,a.whave=a.wsize):(a.wnext+=o,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=o))),0}t.inflateReset=f,t.inflateReset2=d,t.inflateResetKeep=l,t.inflateInit=function(e){return h(e,15)},t.inflateInit2=h,t.inflate=function(e,t){var r,c,l,f,d,h,p,g,m,_,w,v,E,S,O,T,A,M,D,I,j,R,N,k,C=0,L=new n.Buf8(4),x=[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-2;12===(r=e.state).mode&&(r.mode=13),d=e.next_out,l=e.output,p=e.avail_out,f=e.next_in,c=e.input,h=e.avail_in,g=r.hold,m=r.bits,_=h,w=p,R=0;e:for(;;)switch(r.mode){case 1:if(0===r.wrap){r.mode=13;break}for(;m<16;){if(0===h)break e;h--,g+=c[f++]<<m,m+=8}if(2&r.wrap&&35615===g){r.check=0,L[0]=255&g,L[1]=g>>>8&255,r.check=o(r.check,L,2,0),g=0,m=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&g)<<8)+(g>>8))%31){e.msg="incorrect header check",r.mode=30;break}if(8!=(15&g)){e.msg="unknown compression method",r.mode=30;break}if(m-=4,j=8+(15&(g>>>=4)),0===r.wbits)r.wbits=j;else if(j>r.wbits){e.msg="invalid window size",r.mode=30;break}r.dmax=1<<j,e.adler=r.check=1,r.mode=512&g?10:12,g=0,m=0;break;case 2:for(;m<16;){if(0===h)break e;h--,g+=c[f++]<<m,m+=8}if(r.flags=g,8!=(255&r.flags)){e.msg="unknown compression method",r.mode=30;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=30;break}r.head&&(r.head.text=g>>8&1),512&r.flags&&(L[0]=255&g,L[1]=g>>>8&255,r.check=o(r.check,L,2,0)),g=0,m=0,r.mode=3;case 3:for(;m<32;){if(0===h)break e;h--,g+=c[f++]<<m,m+=8}r.head&&(r.head.time=g),512&r.flags&&(L[0]=255&g,L[1]=g>>>8&255,L[2]=g>>>16&255,L[3]=g>>>24&255,r.check=o(r.check,L,4,0)),g=0,m=0,r.mode=4;case 4:for(;m<16;){if(0===h)break e;h--,g+=c[f++]<<m,m+=8}r.head&&(r.head.xflags=255&g,r.head.os=g>>8),512&r.flags&&(L[0]=255&g,L[1]=g>>>8&255,r.check=o(r.check,L,2,0)),g=0,m=0,r.mode=5;case 5:if(1024&r.flags){for(;m<16;){if(0===h)break e;h--,g+=c[f++]<<m,m+=8}r.length=g,r.head&&(r.head.extra_len=g),512&r.flags&&(L[0]=255&g,L[1]=g>>>8&255,r.check=o(r.check,L,2,0)),g=0,m=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((v=r.length)>h&&(v=h),v&&(r.head&&(j=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),n.arraySet(r.head.extra,c,f,v,j)),512&r.flags&&(r.check=o(r.check,c,v,f)),h-=v,f+=v,r.length-=v),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===h)break e;v=0;do{j=c[f+v++],r.head&&j&&r.length<65536&&(r.head.name+=String.fromCharCode(j))}while(j&&v<h);if(512&r.flags&&(r.check=o(r.check,c,v,f)),h-=v,f+=v,j)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=8;case 8:if(4096&r.flags){if(0===h)break e;v=0;do{j=c[f+v++],r.head&&j&&r.length<65536&&(r.head.comment+=String.fromCharCode(j))}while(j&&v<h);if(512&r.flags&&(r.check=o(r.check,c,v,f)),h-=v,f+=v,j)break e}else r.head&&(r.head.comment=null);r.mode=9;case 9:if(512&r.flags){for(;m<16;){if(0===h)break e;h--,g+=c[f++]<<m,m+=8}if(g!==(65535&r.check)){e.msg="header crc mismatch",r.mode=30;break}g=0,m=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=12;break;case 10:for(;m<32;){if(0===h)break e;h--,g+=c[f++]<<m,m+=8}e.adler=r.check=u(g),g=0,m=0,r.mode=11;case 11:if(0===r.havedict)return e.next_out=d,e.avail_out=p,e.next_in=f,e.avail_in=h,r.hold=g,r.bits=m,2;e.adler=r.check=1,r.mode=12;case 12:if(5===t||6===t)break e;case 13:if(r.last){g>>>=7&m,m-=7&m,r.mode=27;break}for(;m<3;){if(0===h)break e;h--,g+=c[f++]<<m,m+=8}switch(r.last=1&g,m-=1,3&(g>>>=1)){case 0:r.mode=14;break;case 1:if(y(r),r.mode=20,6===t){g>>>=2,m-=2;break e}break;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=30}g>>>=2,m-=2;break;case 14:for(g>>>=7&m,m-=7&m;m<32;){if(0===h)break e;h--,g+=c[f++]<<m,m+=8}if((65535&g)!=(g>>>16^65535)){e.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&g,g=0,m=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(v=r.length){if(v>h&&(v=h),v>p&&(v=p),0===v)break e;n.arraySet(l,c,f,v,d),h-=v,f+=v,p-=v,d+=v,r.length-=v;break}r.mode=12;break;case 17:for(;m<14;){if(0===h)break e;h--,g+=c[f++]<<m,m+=8}if(r.nlen=257+(31&g),g>>>=5,m-=5,r.ndist=1+(31&g),g>>>=5,m-=5,r.ncode=4+(15&g),g>>>=4,m-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=30;break}r.have=0,r.mode=18;case 18:for(;r.have<r.ncode;){for(;m<3;){if(0===h)break e;h--,g+=c[f++]<<m,m+=8}r.lens[x[r.have++]]=7&g,g>>>=3,m-=3}for(;r.have<19;)r.lens[x[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,N={bits:r.lenbits},R=s(0,r.lens,0,19,r.lencode,0,r.work,N),r.lenbits=N.bits,R){e.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have<r.nlen+r.ndist;){for(;T=(C=r.lencode[g&(1<<r.lenbits)-1])>>>16&255,A=65535&C,!((O=C>>>24)<=m);){if(0===h)break e;h--,g+=c[f++]<<m,m+=8}if(A<16)g>>>=O,m-=O,r.lens[r.have++]=A;else{if(16===A){for(k=O+2;m<k;){if(0===h)break e;h--,g+=c[f++]<<m,m+=8}if(g>>>=O,m-=O,0===r.have){e.msg="invalid bit length repeat",r.mode=30;break}j=r.lens[r.have-1],v=3+(3&g),g>>>=2,m-=2}else if(17===A){for(k=O+3;m<k;){if(0===h)break e;h--,g+=c[f++]<<m,m+=8}m-=O,j=0,v=3+(7&(g>>>=O)),g>>>=3,m-=3}else{for(k=O+7;m<k;){if(0===h)break e;h--,g+=c[f++]<<m,m+=8}m-=O,j=0,v=11+(127&(g>>>=O)),g>>>=7,m-=7}if(r.have+v>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=30;break}for(;v--;)r.lens[r.have++]=j}}if(30===r.mode)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,N={bits:r.lenbits},R=s(1,r.lens,0,r.nlen,r.lencode,0,r.work,N),r.lenbits=N.bits,R){e.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,N={bits:r.distbits},R=s(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,N),r.distbits=N.bits,R){e.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(h>=6&&p>=258){e.next_out=d,e.avail_out=p,e.next_in=f,e.avail_in=h,r.hold=g,r.bits=m,a(e,w),d=e.next_out,l=e.output,p=e.avail_out,f=e.next_in,c=e.input,h=e.avail_in,g=r.hold,m=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;T=(C=r.lencode[g&(1<<r.lenbits)-1])>>>16&255,A=65535&C,!((O=C>>>24)<=m);){if(0===h)break e;h--,g+=c[f++]<<m,m+=8}if(T&&0==(240&T)){for(M=O,D=T,I=A;T=(C=r.lencode[I+((g&(1<<M+D)-1)>>M)])>>>16&255,A=65535&C,!(M+(O=C>>>24)<=m);){if(0===h)break e;h--,g+=c[f++]<<m,m+=8}g>>>=M,m-=M,r.back+=M}if(g>>>=O,m-=O,r.back+=O,r.length=A,0===T){r.mode=26;break}if(32&T){r.back=-1,r.mode=12;break}if(64&T){e.msg="invalid literal/length code",r.mode=30;break}r.extra=15&T,r.mode=22;case 22:if(r.extra){for(k=r.extra;m<k;){if(0===h)break e;h--,g+=c[f++]<<m,m+=8}r.length+=g&(1<<r.extra)-1,g>>>=r.extra,m-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;T=(C=r.distcode[g&(1<<r.distbits)-1])>>>16&255,A=65535&C,!((O=C>>>24)<=m);){if(0===h)break e;h--,g+=c[f++]<<m,m+=8}if(0==(240&T)){for(M=O,D=T,I=A;T=(C=r.distcode[I+((g&(1<<M+D)-1)>>M)])>>>16&255,A=65535&C,!(M+(O=C>>>24)<=m);){if(0===h)break e;h--,g+=c[f++]<<m,m+=8}g>>>=M,m-=M,r.back+=M}if(g>>>=O,m-=O,r.back+=O,64&T){e.msg="invalid distance code",r.mode=30;break}r.offset=A,r.extra=15&T,r.mode=24;case 24:if(r.extra){for(k=r.extra;m<k;){if(0===h)break e;h--,g+=c[f++]<<m,m+=8}r.offset+=g&(1<<r.extra)-1,g>>>=r.extra,m-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===p)break e;if(v=w-p,r.offset>v){if((v=r.offset-v)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=30;break}v>r.wnext?(v-=r.wnext,E=r.wsize-v):E=r.wnext-v,v>r.length&&(v=r.length),S=r.window}else S=l,E=d-r.offset,v=r.length;v>p&&(v=p),p-=v,r.length-=v;do{l[d++]=S[E++]}while(--v);0===r.length&&(r.mode=21);break;case 26:if(0===p)break e;l[d++]=r.length,p--,r.mode=21;break;case 27:if(r.wrap){for(;m<32;){if(0===h)break e;h--,g|=c[f++]<<m,m+=8}if(w-=p,e.total_out+=w,r.total+=w,w&&(e.adler=r.check=r.flags?o(r.check,l,w,d-w):i(r.check,l,w,d-w)),w=p,(r.flags?g:u(g))!==r.check){e.msg="incorrect data check",r.mode=30;break}g=0,m=0}r.mode=28;case 28:if(r.wrap&&r.flags){for(;m<32;){if(0===h)break e;h--,g+=c[f++]<<m,m+=8}if(g!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=30;break}g=0,m=0}r.mode=29;case 29:R=1;break e;case 30:R=-3;break e;case 31:return-4;case 32:default:return-2}return e.next_out=d,e.avail_out=p,e.next_in=f,e.avail_in=h,r.hold=g,r.bits=m,(r.wsize||w!==e.avail_out&&r.mode<30&&(r.mode<27||4!==t))&&b(e,e.output,e.next_out,w-e.avail_out)?(r.mode=31,-4):(_-=e.avail_in,w-=e.avail_out,e.total_in+=_,e.total_out+=w,r.total+=w,r.wrap&&w&&(e.adler=r.check=r.flags?o(r.check,l,w,e.next_out-w):i(r.check,l,w,e.next_out-w)),e.data_type=r.bits+(r.last?64:0)+(12===r.mode?128:0)+(20===r.mode||15===r.mode?256:0),(0===_&&0===w||4===t)&&0===R&&(R=-5),R)},t.inflateEnd=function(e){if(!e||!e.state)return-2;var t=e.state;return t.window&&(t.window=null),e.state=null,0},t.inflateGetHeader=function(e,t){var r;return e&&e.state?0==(2&(r=e.state).wrap)?-2:(r.head=t,t.done=!1,0):-2},t.inflateSetDictionary=function(e,t){var r,n=t.length;return e&&e.state?0!==(r=e.state).wrap&&11!==r.mode?-2:11===r.mode&&i(1,t,n,0)!==r.check?-3:b(e,t,n,n)?(r.mode=31,-4):(r.havedict=1,0):-2},t.inflateInfo="pako inflate (from Nodeca project)"},function(e,t,r){"use strict";e.exports=function(e,t){var r,n,i,o,a,s,u,c,l,f,d,h,p,g,m,y,b,_,w,v,E,S,O,T,A;r=e.state,n=e.next_in,T=e.input,i=n+(e.avail_in-5),o=e.next_out,A=e.output,a=o-(t-e.avail_out),s=o+(e.avail_out-257),u=r.dmax,c=r.wsize,l=r.whave,f=r.wnext,d=r.window,h=r.hold,p=r.bits,g=r.lencode,m=r.distcode,y=(1<<r.lenbits)-1,b=(1<<r.distbits)-1;e:do{p<15&&(h+=T[n++]<<p,p+=8,h+=T[n++]<<p,p+=8),_=g[h&y];t:for(;;){if(h>>>=w=_>>>24,p-=w,0===(w=_>>>16&255))A[o++]=65535&_;else{if(!(16&w)){if(0==(64&w)){_=g[(65535&_)+(h&(1<<w)-1)];continue t}if(32&w){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}v=65535&_,(w&=15)&&(p<w&&(h+=T[n++]<<p,p+=8),v+=h&(1<<w)-1,h>>>=w,p-=w),p<15&&(h+=T[n++]<<p,p+=8,h+=T[n++]<<p,p+=8),_=m[h&b];r:for(;;){if(h>>>=w=_>>>24,p-=w,!(16&(w=_>>>16&255))){if(0==(64&w)){_=m[(65535&_)+(h&(1<<w)-1)];continue r}e.msg="invalid distance code",r.mode=30;break e}if(E=65535&_,p<(w&=15)&&(h+=T[n++]<<p,(p+=8)<w&&(h+=T[n++]<<p,p+=8)),(E+=h&(1<<w)-1)>u){e.msg="invalid distance too far back",r.mode=30;break e}if(h>>>=w,p-=w,E>(w=o-a)){if((w=E-w)>l&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(S=0,O=d,0===f){if(S+=c-w,w<v){v-=w;do{A[o++]=d[S++]}while(--w);S=o-E,O=A}}else if(f<w){if(S+=c+f-w,(w-=f)<v){v-=w;do{A[o++]=d[S++]}while(--w);if(S=0,f<v){v-=w=f;do{A[o++]=d[S++]}while(--w);S=o-E,O=A}}}else if(S+=f-w,w<v){v-=w;do{A[o++]=d[S++]}while(--w);S=o-E,O=A}for(;v>2;)A[o++]=O[S++],A[o++]=O[S++],A[o++]=O[S++],v-=3;v&&(A[o++]=O[S++],v>1&&(A[o++]=O[S++]))}else{S=o-E;do{A[o++]=A[S++],A[o++]=A[S++],A[o++]=A[S++],v-=3}while(v>2);v&&(A[o++]=A[S++],v>1&&(A[o++]=A[S++]))}break}}break}}while(n<i&&o<s);n-=v=p>>3,h&=(1<<(p-=v<<3))-1,e.next_in=n,e.next_out=o,e.avail_in=n<i?i-n+5:5-(n-i),e.avail_out=o<s?s-o+257:257-(o-s),r.hold=h,r.bits=p}},function(e,t,r){"use strict";var n=r(121),i=[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],o=[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,c,l,f,d){var h,p,g,m,y,b,_,w,v,E=d.bits,S=0,O=0,T=0,A=0,M=0,D=0,I=0,j=0,R=0,N=0,k=null,C=0,L=new n.Buf16(16),x=new n.Buf16(16),P=null,B=0;for(S=0;S<=15;S++)L[S]=0;for(O=0;O<u;O++)L[t[r+O]]++;for(M=E,A=15;A>=1&&0===L[A];A--);if(M>A&&(M=A),0===A)return c[l++]=20971520,c[l++]=20971520,d.bits=1,0;for(T=1;T<A&&0===L[T];T++);for(M<T&&(M=T),j=1,S=1;S<=15;S++)if(j<<=1,(j-=L[S])<0)return-1;if(j>0&&(0===e||1!==A))return-1;for(x[1]=0,S=1;S<15;S++)x[S+1]=x[S]+L[S];for(O=0;O<u;O++)0!==t[r+O]&&(f[x[t[r+O]]++]=O);if(0===e?(k=P=f,b=19):1===e?(k=i,C-=257,P=o,B-=257,b=256):(k=a,P=s,b=-1),N=0,O=0,S=T,y=l,D=M,I=0,g=-1,m=(R=1<<M)-1,1===e&&R>852||2===e&&R>592)return 1;for(;;){_=S-I,f[O]<b?(w=0,v=f[O]):f[O]>b?(w=P[B+f[O]],v=k[C+f[O]]):(w=96,v=0),h=1<<S-I,T=p=1<<D;do{c[y+(N>>I)+(p-=h)]=_<<24|w<<16|v|0}while(0!==p);for(h=1<<S-1;N&h;)h>>=1;if(0!==h?(N&=h-1,N+=h):N=0,O++,0==--L[S]){if(S===A)break;S=t[r+f[O]]}if(S>M&&(N&m)!==g){for(0===I&&(I=M),y+=T,j=1<<(D=S-I);D+I<A&&!((j-=L[D+I])<=0);)D++,j<<=1;if(R+=1<<D,1===e&&R>852||2===e&&R>592)return 1;c[g=N&m]=M<<24|D<<16|y-l|0}}return 0!==N&&(c[y+N]=S-I<<24|64<<16|0),d.bits=M,0}},function(e,t,r){"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}},function(e,t,r){(function(t){e.exports=function(e){var n=r(120);return{inflate:function(){return n.inflateRawSync(e)},inflateAsync:function(r){var i=n.createInflateRaw(),o=[],a=0;i.on("data",(function(e){o.push(e),a+=e.length})),i.on("end",(function(){var e=t.alloc(a),n=0;e.fill(0);for(var i=0;i<o.length;i++){var s=o[i];s.copy(e,n),n+=s.length}r&&r(e)})),i.end(e)}}}}).call(this,r(10).Buffer)},function(e,t,r){(function(t){var n=r(244),i=r(245),o=r(105);e.exports=function(e,r){var a=[],s={},u=t.alloc(0),c="",l=o.FileSystem.require(),f=null,d=new i.MainHeader;function h(){for(var e=f.length-o.Constants.ENDHDR,t=Math.max(0,e-65535),r=-1;e>=t;e--)if(80===f[e]&&f.readUInt32LE(e)===o.Constants.ENDSIG){r=e;break}if(!~r)throw o.Errors.INVALID_FORMAT;d.loadFromBinary(f.slice(r,r+o.Constants.ENDHDR)),d.commentLength&&(u=f.slice(r+o.Constants.ENDHDR)),function(){s={},a=new Array(d.diskEntries);for(var e=d.offset,t=0;t<a.length;t++){var r=e,i=new n(f);i.header=f.slice(r,r+=o.Constants.CENHDR),i.entryName=f.slice(r,r+=i.header.fileNameLength),i.header.extraLength&&(i.extra=f.slice(r,r+=i.header.extraLength)),i.header.commentLength&&(i.comment=f.slice(r,r+i.header.commentLength)),e+=i.header.entryHeaderSize,a[t]=i,s[i.entryName]=i}}()}return r===o.Constants.FILE?(c=e,f=l.readFileSync(c),h()):r===o.Constants.BUFFER&&(f=e,h()),{get entries(){return a},get comment(){return u.toString()},set comment(e){d.commentLength=e.length,u=e},getEntry:function(e){return s[e]||null},setEntry:function(e){a.push(e),s[e.entryName]=e,d.totalEntries=a.length},deleteEntry:function(e){var t=s[e];if(t&&t.isDirectory){var r=this;this.getEntryChildren(t).forEach((function(t){t.entryName!==e&&r.deleteEntry(t.entryName)}))}a.splice(a.indexOf(t),1),delete s[e],d.totalEntries=a.length},getEntryChildren:function(e){if(e.isDirectory){var t=[],r=e.entryName,n=r.length;return a.forEach((function(e){e.entryName.substr(0,n)===r&&t.push(e)})),t}return[]},compressToBuffer:function(){a.length>1&&a.sort((function(e,t){var r=e.entryName.toLowerCase(),n=t.entryName.toLowerCase();return r<n?-1:r>n?1:0}));var e=0,r=[],n=[],i=0;d.size=0,d.offset=0,a.forEach((function(o){var a=o.getCompressedData();o.header.offset=i;var s=o.header.dataHeaderToBinary(),u=o.rawEntryName.length,c=o.extra.toString(),l=t.alloc(u+c.length);o.rawEntryName.copy(l,0),l.fill(c,u);var f=s.length+l.length+a.length;i+=f,r.push(s),r.push(l),r.push(a);var h=o.packHeader();n.push(h),d.size+=h.length,e+=f+h.length})),e+=d.mainHeaderSize,d.offset=i,i=0;var s=t.alloc(e);r.forEach((function(e){e.copy(s,i),i+=e.length})),n.forEach((function(e){e.copy(s,i),i+=e.length}));var c=d.toBinary();return u&&u.copy(c,o.Constants.ENDHDR),c.copy(s,i),s},toAsyncBuffer:function(e,r,n,i){a.length>1&&a.sort((function(e,t){var r=e.entryName.toLowerCase(),n=t.entryName.toLowerCase();return r>n?-1:r<n?1:0}));var s=0,c=[],l=[],f=0;d.size=0,d.offset=0;!function(r){var a=arguments.callee;if(r.length){var h=r.pop(),p=h.entryName+h.extra.toString();n&&n(p),h.getCompressedDataAsync((function(n){i&&i(p),h.header.offset=f;var g,m=h.header.dataHeaderToBinary();try{g=t.alloc(p.length,p)}catch(e){g=new t(p)}var y=m.length+g.length+n.length;f+=y,c.push(m),c.push(g),c.push(n);var b=h.packHeader();if(l.push(b),d.size+=b.length,s+=y+b.length,r.length)a(r);else{s+=d.mainHeaderSize,d.offset=f,f=0;var _=t.alloc(s);c.forEach((function(e){e.copy(_,f),f+=e.length})),l.forEach((function(e){e.copy(_,f),f+=e.length}));var w=d.toBinary();u&&u.copy(w,o.Constants.ENDHDR),w.copy(_,f),e(_)}}))}}(a)}}}}).call(this,r(10).Buffer)},function(e,t){var r,n;r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={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&n.rotl(e,8)|4278255360&n.rotl(e,24);for(var t=0;t<e.length;t++)e[t]=n.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 t=[],n=0;n<e.length;n+=3)for(var i=e[n]<<16|e[n+1]<<8|e[n+2],o=0;o<4;o++)8*n+6*o<=8*e.length?t.push(r.charAt(i>>>6*(3-o)&63)):t.push("=");return t.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var t=[],n=0,i=0;n<e.length;i=++n%4)0!=i&&t.push((r.indexOf(e.charAt(n-1))&Math.pow(2,-2*i+8)-1)<<2*i|r.indexOf(e.charAt(n))>>>6-2*i);return t}},e.exports=n},function(e,t){function r(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}
/*!
* Determine if an object is a Buffer
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/
e.exports=function(e){return null!=e&&(r(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&r(e.slice(0,0))}(e)||!!e._isBuffer)}},function(e,t){e.exports=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"])},function(e,t){e.exports=["CLI","API","HTTP","HTTPS","JSX","DNS","URL","CI","CDN","GitHub","CSS","JS","JavaScript","TypeScript","HTML","WordPress","JavaScript","Next.js","Node.js"]},function(e,t){e.exports=function(e,t,r){var n,i,o,a,s,u,c=e.length,l=t.length,f=[];r=(r||(l>c?l:c))+1;for(var d=0;d<r;d++)f[d]=[d],f[d].length=r;for(d=0;d<r;d++)f[0][d]=d;if(Math.abs(c-l)>(r||100))return h(r||100);if(0===c)return h(l);if(0===l)return h(c);for(d=1;d<=c;++d)for(i=e[d-1],n=1;n<=l;++n){if(d===n&&f[d][n]>4)return h(c);a=i===(o=t[n-1])?0:1,s=f[d-1][n]+1,(u=f[d][n-1]+1)<s&&(s=u),(u=f[d-1][n-1]+a)<s&&(s=u),f[d][n]=d>1&&n>1&&i===t[n-2]&&e[d-2]===o&&(u=f[d-2][n-2]+a)<s?u:s}return h(f[c][l]);function h(e){var t=Math.max(c,l),r=0===t?0:e/t;return{steps:e,relative:r,similarity:1-r}}}},function(e,t,r){(function(t,n){function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,i,o=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==r.return||r.return()}finally{if(s)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return o(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function a(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 s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){u(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function u(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const c=r(99).Transform,l=r(436),f={utf8:t.from([239,187,191]),utf16le:t.from([255,254])};class d extends c{constructor(e={}){super(s(s(s({},{readableObjectMode:!0}),e),{},{encoding:null})),this.__originalOptions=e,this.__normalizeOptions(e)}__normalizeOptions(e){const r={};for(let t in e)r[g(t)]=e[t];if(void 0===r.encoding||!0===r.encoding)r.encoding="utf8";else if(null===r.encoding||!1===r.encoding)r.encoding=null;else if("string"!=typeof r.encoding&&null!==r.encoding)throw new p("CSV_INVALID_OPTION_ENCODING",["Invalid option encoding:","encoding must be a string or null to return a buffer,","got "+JSON.stringify(r.encoding)],r);if(void 0===r.bom||null===r.bom||!1===r.bom)r.bom=!1;else if(!0!==r.bom)throw new p("CSV_INVALID_OPTION_BOM",["Invalid option bom:","bom must be true,","got "+JSON.stringify(r.bom)],r);let n=null;if(void 0===r.cast||null===r.cast||!1===r.cast||""===r.cast)r.cast=void 0;else if("function"==typeof r.cast)n=r.cast,r.cast=!0;else if(!0!==r.cast)throw new p("CSV_INVALID_OPTION_CAST",["Invalid option cast:","cast must be true or a function,","got "+JSON.stringify(r.cast)],r);if(void 0===r.cast_date||null===r.cast_date||!1===r.cast_date||""===r.cast_date)r.cast_date=!1;else{if(!0!==r.cast_date)throw new p("CSV_INVALID_OPTION_CAST_DATE",["Invalid option cast_date:","cast_date must be true or a function,","got "+JSON.stringify(r.cast_date)],r);r.cast_date=function(e){const t=Date.parse(e);return isNaN(t)?e:new Date(t)}}let i=null;if(!0===r.columns)i=void 0;else if("function"==typeof r.columns)i=r.columns,r.columns=!0;else if(Array.isArray(r.columns))r.columns=b(r.columns);else{if(void 0!==r.columns&&null!==r.columns&&!1!==r.columns)throw new p("CSV_INVALID_OPTION_COLUMNS",["Invalid option columns:","expect an array, a function or true,","got "+JSON.stringify(r.columns)],r);r.columns=!1}if(void 0===r.columns_duplicates_to_array||null===r.columns_duplicates_to_array||!1===r.columns_duplicates_to_array)r.columns_duplicates_to_array=!1;else{if(!0!==r.columns_duplicates_to_array)throw new p("CSV_INVALID_OPTION_COLUMNS_DUPLICATES_TO_ARRAY",["Invalid option columns_duplicates_to_array:","expect an boolean,","got "+JSON.stringify(r.columns_duplicates_to_array)],r);if(!1===r.columns)throw new p("CSV_INVALID_OPTION_COLUMNS_DUPLICATES_TO_ARRAY",["Invalid option columns_duplicates_to_array:","the `columns` mode must be activated."],r)}if(void 0===r.comment||null===r.comment||!1===r.comment||""===r.comment)r.comment=null;else if("string"==typeof r.comment&&(r.comment=t.from(r.comment,r.encoding)),!t.isBuffer(r.comment))throw new p("CSV_INVALID_OPTION_COMMENT",["Invalid option comment:","comment must be a buffer or a string,","got "+JSON.stringify(r.comment)],r);const o=JSON.stringify(r.delimiter);if(Array.isArray(r.delimiter)||(r.delimiter=[r.delimiter]),0===r.delimiter.length)throw new p("CSV_INVALID_OPTION_DELIMITER",["Invalid option delimiter:","delimiter must be a non empty string or buffer or array of string|buffer,","got "+o],r);if(r.delimiter=r.delimiter.map((function(e){if(null==e||!1===e)return t.from(",",r.encoding);if("string"==typeof e&&(e=t.from(e,r.encoding)),!t.isBuffer(e)||0===e.length)throw new p("CSV_INVALID_OPTION_DELIMITER",["Invalid option delimiter:","delimiter must be a non empty string or buffer or array of string|buffer,","got "+o],r);return e})),void 0===r.escape||!0===r.escape?r.escape=t.from('"',r.encoding):"string"==typeof r.escape?r.escape=t.from(r.escape,r.encoding):null!==r.escape&&!1!==r.escape||(r.escape=null),null!==r.escape&&!t.isBuffer(r.escape))throw new Error("Invalid Option: escape must be a buffer, a string or a boolean, got "+JSON.stringify(r.escape));if(void 0===r.from||null===r.from)r.from=1;else{if("string"==typeof r.from&&/\d+/.test(r.from)&&(r.from=parseInt(r.from)),!Number.isInteger(r.from))throw new Error("Invalid Option: from must be an integer, got "+JSON.stringify(r.from));if(r.from<0)throw new Error("Invalid Option: from must be a positive integer, got "+JSON.stringify(e.from))}if(void 0===r.from_line||null===r.from_line)r.from_line=1;else{if("string"==typeof r.from_line&&/\d+/.test(r.from_line)&&(r.from_line=parseInt(r.from_line)),!Number.isInteger(r.from_line))throw new Error("Invalid Option: from_line must be an integer, got "+JSON.stringify(e.from_line));if(r.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===r.ignore_last_delimiters||null===r.ignore_last_delimiters)r.ignore_last_delimiters=!1;else if("number"==typeof r.ignore_last_delimiters)r.ignore_last_delimiters=Math.floor(r.ignore_last_delimiters),0===r.ignore_last_delimiters&&(r.ignore_last_delimiters=!1);else if("boolean"!=typeof r.ignore_last_delimiters)throw new p("CSV_INVALID_OPTION_IGNORE_LAST_DELIMITERS",["Invalid option `ignore_last_delimiters`:","the value must be a boolean value or an integer,","got "+JSON.stringify(r.ignore_last_delimiters)],r);if(!0===r.ignore_last_delimiters&&!1===r.columns)throw new p("CSV_IGNORE_LAST_DELIMITERS_REQUIRES_COLUMNS",["The option `ignore_last_delimiters`","requires the activation of the `columns` option"],r);if(void 0===r.info||null===r.info||!1===r.info)r.info=!1;else if(!0!==r.info)throw new Error("Invalid Option: info must be true, got "+JSON.stringify(r.info));if(void 0===r.max_record_size||null===r.max_record_size||!1===r.max_record_size)r.max_record_size=0;else if(Number.isInteger(r.max_record_size)&&r.max_record_size>=0);else{if("string"!=typeof r.max_record_size||!/\d+/.test(r.max_record_size))throw new Error("Invalid Option: max_record_size must be a positive integer, got "+JSON.stringify(r.max_record_size));r.max_record_size=parseInt(r.max_record_size)}if(void 0===r.objname||null===r.objname||!1===r.objname)r.objname=void 0;else if(t.isBuffer(r.objname)){if(0===r.objname.length)throw new Error("Invalid Option: objname must be a non empty buffer");null===r.encoding||(r.objname=r.objname.toString(r.encoding))}else{if("string"!=typeof r.objname)throw new Error("Invalid Option: objname must be a string or a buffer, got "+r.objname);if(0===r.objname.length)throw new Error("Invalid Option: objname must be a non empty string")}if(void 0===r.on_record||null===r.on_record)r.on_record=void 0;else if("function"!=typeof r.on_record)throw new p("CSV_INVALID_OPTION_ON_RECORD",["Invalid option `on_record`:","expect a function,","got "+JSON.stringify(r.on_record)],r);if(null===r.quote||!1===r.quote||""===r.quote)r.quote=null;else if(void 0===r.quote||!0===r.quote?r.quote=t.from('"',r.encoding):"string"==typeof r.quote&&(r.quote=t.from(r.quote,r.encoding)),!t.isBuffer(r.quote))throw new Error("Invalid Option: quote must be a buffer or a string, got "+JSON.stringify(r.quote));if(void 0===r.raw||null===r.raw||!1===r.raw)r.raw=!1;else if(!0!==r.raw)throw new Error("Invalid Option: raw must be true, got "+JSON.stringify(r.raw));if(r.record_delimiter?Array.isArray(r.record_delimiter)||(r.record_delimiter=[r.record_delimiter]):r.record_delimiter=[],r.record_delimiter=r.record_delimiter.map((function(e){return"string"==typeof e&&(e=t.from(e,r.encoding)),e})),"boolean"==typeof r.relax);else{if(void 0!==r.relax&&null!==r.relax)throw new Error("Invalid Option: relax must be a boolean, got "+JSON.stringify(r.relax));r.relax=!1}if("boolean"==typeof r.relax_column_count);else{if(void 0!==r.relax_column_count&&null!==r.relax_column_count)throw new Error("Invalid Option: relax_column_count must be a boolean, got "+JSON.stringify(r.relax_column_count));r.relax_column_count=!1}if("boolean"==typeof r.relax_column_count_less);else{if(void 0!==r.relax_column_count_less&&null!==r.relax_column_count_less)throw new Error("Invalid Option: relax_column_count_less must be a boolean, got "+JSON.stringify(r.relax_column_count_less));r.relax_column_count_less=!1}if("boolean"==typeof r.relax_column_count_more);else{if(void 0!==r.relax_column_count_more&&null!==r.relax_column_count_more)throw new Error("Invalid Option: relax_column_count_more must be a boolean, got "+JSON.stringify(r.relax_column_count_more));r.relax_column_count_more=!1}if("boolean"==typeof r.skip_empty_lines);else{if(void 0!==r.skip_empty_lines&&null!==r.skip_empty_lines)throw new Error("Invalid Option: skip_empty_lines must be a boolean, got "+JSON.stringify(r.skip_empty_lines));r.skip_empty_lines=!1}if("boolean"==typeof r.skip_lines_with_empty_values);else{if(void 0!==r.skip_lines_with_empty_values&&null!==r.skip_lines_with_empty_values)throw new Error("Invalid Option: skip_lines_with_empty_values must be a boolean, got "+JSON.stringify(r.skip_lines_with_empty_values));r.skip_lines_with_empty_values=!1}if("boolean"==typeof r.skip_lines_with_error);else{if(void 0!==r.skip_lines_with_error&&null!==r.skip_lines_with_error)throw new Error("Invalid Option: skip_lines_with_error must be a boolean, got "+JSON.stringify(r.skip_lines_with_error));r.skip_lines_with_error=!1}if(void 0===r.rtrim||null===r.rtrim||!1===r.rtrim)r.rtrim=!1;else if(!0!==r.rtrim)throw new Error("Invalid Option: rtrim must be a boolean, got "+JSON.stringify(r.rtrim));if(void 0===r.ltrim||null===r.ltrim||!1===r.ltrim)r.ltrim=!1;else if(!0!==r.ltrim)throw new Error("Invalid Option: ltrim must be a boolean, got "+JSON.stringify(r.ltrim));if(void 0===r.trim||null===r.trim||!1===r.trim)r.trim=!1;else if(!0!==r.trim)throw new Error("Invalid Option: trim must be a boolean, got "+JSON.stringify(r.trim));if(!0===r.trim&&!1!==e.ltrim?r.ltrim=!0:!0!==r.ltrim&&(r.ltrim=!1),!0===r.trim&&!1!==e.rtrim?r.rtrim=!0:!0!==r.rtrim&&(r.rtrim=!1),void 0===r.to||null===r.to)r.to=-1;else{if("string"==typeof r.to&&/\d+/.test(r.to)&&(r.to=parseInt(r.to)),!Number.isInteger(r.to))throw new Error("Invalid Option: to must be an integer, got "+JSON.stringify(e.to));if(r.to<=0)throw new Error("Invalid Option: to must be a positive integer greater than 0, got "+JSON.stringify(e.to))}if(void 0===r.to_line||null===r.to_line)r.to_line=-1;else{if("string"==typeof r.to_line&&/\d+/.test(r.to_line)&&(r.to_line=parseInt(r.to_line)),!Number.isInteger(r.to_line))throw new Error("Invalid Option: to_line must be an integer, got "+JSON.stringify(e.to_line));if(r.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=r,this.state={bomSkipped:!1,bufBytesStart:0,castField:n,commenting:!1,error:void 0,enabled:1===r.from_line,escaping:!1,escapeIsQuote:t.isBuffer(r.escape)&&t.isBuffer(r.quote)&&0===t.compare(r.escape,r.quote),expectedRecordLength:Array.isArray(r.columns)?r.columns.length:void 0,field:new l(20),firstLineToHeaders:i,needMoreDataSize:Math.max(null!==r.comment?r.comment.length:0,...r.delimiter.map(e=>e.length),null!==r.quote?r.quote.length:0),previousBuf:void 0,quoting:!1,stop:!1,rawBuffer:new l(100),record:[],recordHasError:!1,record_length:0,recordDelimiterMaxLength:0===r.record_delimiter.length?2:Math.max(...r.record_delimiter.map(e=>e.length)),trimChars:[t.from(" ",r.encoding)[0],t.from("\t",r.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){if(!0===this.state.stop)return;e(this.__parse(void 0,!0))}__parse(e,r){const n=this.options,i=n.bom,o=n.comment,a=n.escape,u=n.from_line,c=n.ltrim,l=n.max_record_size,d=n.quote,h=n.raw,g=n.relax,m=n.rtrim,y=n.skip_empty_lines,b=n.to,_=n.to_line;let w=this.options.record_delimiter;const v=this.state,E=v.bomSkipped,S=v.previousBuf,O=v.rawBuffer,T=v.escapeIsQuote;let A;if(void 0===S){if(void 0===e)return void this.push(null);A=e}else A=void 0!==S&&void 0===e?S:t.concat([S,e]);if(!1===E)if(!1===i)this.state.bomSkipped=!0;else if(A.length<3){if(!1===r)return void(this.state.previousBuf=A)}else{for(let e in f)if(0===f[e].compare(A,0,f[e].length)){let t=f[e].length;this.state.bufBytesStart+=t,A=A.slice(t),this.__normalizeOptions(s(s({},this.__originalOptions),{},{encoding:e}));break}this.state.bomSkipped=!0}const M=A.length;let D;for(D=0;D<M&&!this.__needMoreData(D,M,r);D++){if(!0===this.state.wasRowDelimiter&&(this.info.lines++,this.state.wasRowDelimiter=!1),-1!==_&&this.info.lines>_)return this.state.stop=!0,void this.push(null);if(!1===this.state.quoting&&0===w.length){this.__autoDiscoverRecordDelimiter(A,D)&&(w=this.options.record_delimiter)}const e=A[D];if(!0===h&&O.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!==a&&!0===this.state.quoting&&this.__isEscape(A,D,e)&&D+a.length<M){if(!T){this.state.escaping=!0,D+=a.length-1;continue}if(this.__isQuote(A,D+a.length)){this.state.escaping=!0,D+=a.length-1;continue}}if(!1===this.state.commenting&&this.__isQuote(A,D))if(!0===this.state.quoting){const t=A[D+d.length],r=m&&this.__isCharTrimable(t),n=null!==o&&this.__compareBytes(o,A,D+d.length,t),i=this.__isDelimiter(A,D+d.length,t),s=0===w.length?this.__autoDiscoverRecordDelimiter(A,D+d.length):this.__isRecordDelimiter(t,A,D+d.length);if(null!==a&&this.__isEscape(A,D,e)&&this.__isQuote(A,D+a.length))D+=a.length-1;else{if(!t||i||s||n||r){this.state.quoting=!1,this.state.wasQuoting=!0,D+=d.length-1;continue}if(!1===g){const e=this.__error(new p("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(d),D+=d.length-1}}else{if(0===this.state.field.length){this.state.quoting=!0,D+=d.length-1;continue}if(!1===g){const e=this.__error(new p("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,A,D);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)>=u){this.state.enabled=!0,this.__resetField(),this.__resetRecord(),D+=t-1;continue}if(!0===y&&!1===this.state.wasQuoting&&0===this.state.record.length&&0===this.state.field.length){this.info.empty_lines++,D+=t-1;continue}this.info.bytes=this.state.bufBytesStart+D;const e=this.__onField();if(void 0!==e)return e;this.info.bytes=this.state.bufBytesStart+D+t;const r=this.__onRecord();if(void 0!==r)return r;if(-1!==b&&this.info.records>=b)return this.state.stop=!0,void this.push(null)}this.state.commenting=!1,D+=t-1;continue}if(this.state.commenting)continue;if(0!==(null===o?0:this.__compareBytes(o,A,D,e))){this.state.commenting=!0;continue}let r=this.__isDelimiter(A,D,e);if(0!==r){this.info.bytes=this.state.bufBytesStart+D;const e=this.__onField();if(void 0!==e)return e;D+=r-1;continue}}}if(!1===this.state.commenting&&0!==l&&this.state.record_length+this.state.field.length>l){const e=this.__error(new p("CSV_MAX_RECORD_SIZE",["Max Record Size:","record exceed the maximum number of tolerated bytes","of "+l,"at line "+this.info.lines],this.options,this.__infoField()));if(void 0!==e)return e}const t=!1===c||!0===this.state.quoting||0!==this.state.field.length||!this.__isCharTrimable(e),r=!1===m||!1===this.state.wasQuoting;if(!0===t&&!0===r)this.state.field.append(e);else if(!0===m&&!this.__isCharTrimable(e)){const e=this.__error(new p("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===r)if(!0===this.state.quoting){const e=this.__error(new p("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+D;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+=D,this.state.previousBuf=A.slice(D);!0===this.state.wasRowDelimiter&&(this.info.lines++,this.state.wasRowDelimiter=!1)}__onRecord(){const e=this.options,t=e.columns,r=e.columns_duplicates_to_array,n=e.encoding,i=e.info,o=e.from,a=e.relax_column_count,s=e.relax_column_count_less,u=e.relax_column_count_more,c=e.raw,l=e.skip_lines_with_empty_values,f=this.state,d=f.enabled,h=f.record;if(!1===d)return this.__resetRecord();const g=h.length;if(!0===t)return!0===l&&y(h)?void this.__resetRecord():this.__firstLineToColumns(h);if(!1===t&&0===this.info.records&&(this.state.expectedRecordLength=g),g!==this.state.expectedRecordLength){const e=!1===t?new p("CSV_INCONSISTENT_RECORD_LENGTH",["Invalid Record Length:",`expect ${this.state.expectedRecordLength},`,`got ${g} on line ${this.info.lines}`],this.options,this.__infoField(),{record:h}):new p("CSV_RECORD_DONT_MATCH_COLUMNS_LENGTH",["Invalid Record Length:",`columns length is ${t.length},`,`got ${g} on line ${this.info.lines}`],this.options,this.__infoField(),{record:h});if(!0===a||!0===s&&g<this.state.expectedRecordLength||!0===u&&g>this.state.expectedRecordLength)this.info.invalid_field_length++,this.state.error=e;else{const t=this.__error(e);if(t)return t}}if(!0===l&&y(h))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!==t){const e={};for(let n=0,i=h.length;n<i;n++)void 0===t[n]||t[n].disabled||(!0===r&&void 0!==e[t[n].name]?Array.isArray(e[t[n].name])?e[t[n].name]=e[t[n].name].concat(h[n]):e[t[n].name]=[e[t[n].name],h[n]]:e[t[n].name]=h[n]);const o=this.options.objname;if(void 0===o)if(!0===c||!0===i){const t=this.__push(Object.assign({record:e},!0===c?{raw:this.state.rawBuffer.toString(n)}:{},!0===i?{info:this.__infoRecord()}:{}));if(t)return t}else{const t=this.__push(e);if(t)return t}else if(!0===c||!0===i){const t=this.__push(Object.assign({record:[e[o],e]},!0===c?{raw:this.state.rawBuffer.toString(n)}:{},!0===i?{info:this.__infoRecord()}:{}));if(t)return t}else{const t=this.__push([e[o],e]);if(t)return t}}else if(!0===c||!0===i){const e=this.__push(Object.assign({record:h},!0===c?{raw:this.state.rawBuffer.toString(n)}:{},!0===i?{info:this.__infoRecord()}:{}));if(e)return e}else{const e=this.__push(h);if(e)return e}this.__resetRecord()}}__firstLineToColumns(e){const t=this.state.firstLineToHeaders;try{const r=void 0===t?e:t.call(null,e);if(!Array.isArray(r))return this.__error(new p("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=b(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 e=this.options,t=e.cast,r=e.encoding,n=e.rtrim,o=e.max_record_size,a=this.state,s=a.enabled,u=a.wasQuoting;if(!1===s)return this.__resetField();let c=this.state.field.toString(r);if(!0===n&&!1===u&&(c=c.trimRight()),!0===t){const e=i(this.__cast(c),2),t=e[0],r=e[1];if(void 0!==t)return t;c=r}this.state.record.push(c),0!==o&&"string"==typeof c&&(this.state.record_length+=c.length),this.__resetField()}__resetField(){this.state.field.reset(),this.state.wasQuoting=!1}__push(e){const t=this.options.on_record;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 t=this.options,r=t.columns,n=t.relax_column_count;if(!0===Array.isArray(r)&&n&&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 i=e.length;for(let n=1;n<i;n++)if(e[n]!==t[r+n])return 0;return i}__needMoreData(e,t,r){if(r)return!1;const n=this.options.quote,i=this.state,o=i.quoting,a=i.needMoreDataSize,s=i.recordDelimiterMaxLength;return t-e-1<Math.max(a,s,o?n.length+s:0)}__isDelimiter(e,t,r){const n=this.options,i=n.delimiter,o=n.ignore_last_delimiters;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 n=0;n<i.length;n++){const o=i[n];if(o[0]===r){for(let r=1;r<o.length;r++)if(o[r]!==e[t+r])continue e;return o.length}}return 0}__isRecordDelimiter(e,t,r){const n=this.options.record_delimiter,i=n.length;e:for(let o=0;o<i;o++){const i=n[o],a=i.length;if(i[0]===e){for(let e=1;e<a;e++)if(i[e]!==t[r+e])continue e;return i.length}}return 0}__isEscape(e,t,r){const n=this.options.escape;if(null===n)return!1;const i=n.length;if(n[0]===r){for(let r=0;r<i;r++)if(n[r]!==e[t+r])return!1;return!0}return!1}__isQuote(e,t){const r=this.options.quote;if(null===r)return!1;const n=r.length;for(let i=0;i<n;i++)if(r[i]!==e[t+i])return!1;return!0}__autoDiscoverRecordDelimiter(e,r){const n=this.options.encoding,i=e[r];return 13===i?10===e[r+1]?(this.options.record_delimiter.push(t.from("\r\n",n)),this.state.recordDelimiterMaxLength=2,2):(this.options.record_delimiter.push(t.from("\r",n)),this.state.recordDelimiterMaxLength=1,1):10===i?(this.options.record_delimiter.push(t.from("\n",n)),this.state.recordDelimiterMaxLength=1,1):0}__error(e){const t=this.options.skip_lines_with_error,r="string"==typeof e?new Error(e):e;return t?(this.state.recordHasError=!0,void this.emit("skip",r)):r}__infoDataSet(){return s(s({},this.info),{},{columns:this.options.columns})}__infoRecord(){const e=this.options.columns;return s(s({},this.__infoDataSet()),{},{error:this.state.error,header:!0===e,index:this.state.record.length})}__infoField(){const e=this.options.columns,t=Array.isArray(e);return s(s({},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 h=function(){let e,r,i;for(let n in arguments){const o=arguments[n],a=typeof o;if(void 0!==e||"string"!=typeof o&&!t.isBuffer(o))if(void 0===r&&m(o))r=o;else{if(void 0!==i||"function"!==a)throw new p("CSV_INVALID_ARGUMENT",["Invalid argument:",`got ${JSON.stringify(o)} at index ${n}`],r||{});i=o}else e=o}const o=new d(r);if(i){const e=void 0===r||void 0===r.objname?[]:{};o.on("readable",(function(){let t;for(;null!==(t=this.read());)void 0===r||void 0===r.objname?e.push(t):e[t[0]]=t[1]})),o.on("error",(function(e){i(e,void 0,o.__infoDataSet())})),o.on("end",(function(){i(void 0,e,o.__infoDataSet())}))}return void 0!==e&&("function"==typeof n?n((function(){o.write(e),o.end()})):(o.write(e),o.end())),o};class p extends Error{constructor(e,r,n,...i){Array.isArray(r)&&(r=r.join(" ")),super(r),void 0!==Error.captureStackTrace&&Error.captureStackTrace(this,p),this.code=e;for(const e of i)for(const r in e){const i=e[r];this[r]=t.isBuffer(i)?i.toString(n.encoding):null==i?i:JSON.parse(JSON.stringify(i))}}}h.Parser=d,h.CsvError=p,e.exports=h;const g=function(e){return e.replace(/([A-Z])/g,(function(e,t){return"_"+t.toLowerCase()}))},m=function(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)},y=function(e){return e.every(e=>null==e||e.toString&&""===e.toString().trim())},b=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(!m(n))throw new p("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 p("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}}).call(this,r(10).Buffer,r(113).setImmediate)},function(e,t,r){(function(t){e.exports=class{constructor(e=100){this.size=e,this.length=0,this.buf=t.alloc(e)}prepend(e){if(t.isBuffer(e)){const r=this.length+e.length;if(r>=this.size&&(this.resize(),r>=this.size))throw Error("INVALID_BUFFER_STATE");const n=this.buf;this.buf=t.alloc(this.size),e.copy(this.buf,0),n.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 t.from(this.buf.slice(0,this.length))}resize(){const e=this.length;this.size=2*this.size;const r=t.alloc(this.size);this.buf.copy(r,0,0,e),this.buf=r}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}}}).call(this,r(10).Buffer)},function(e,t,r){(function(t,n){function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,i,o=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==r.return||r.return()}finally{if(s)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return a(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return a(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function s(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 u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){c(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function c(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const l=r(99).Transform,f=t.from([239,187,191]);class d extends l{constructor(e={}){super(u(u({},{writableObjectMode:!0}),e));const t={};let r;for(let r in e)t[m(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 p("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(t.isBuffer(e.delimiter))e.delimiter=e.delimiter.toString();else if("string"!=typeof e.delimiter)return new p("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(t.isBuffer(e.quote))e.quote=e.quote.toString();else if("string"!=typeof e.quote)return new p("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(t.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(t.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,t=!1){if("object"!=typeof e)return e;const r=this.options,n=r.columns,a=(r.header,[]);if(Array.isArray(e)){n&&e.splice(n.length);for(let r=0;r<e.length;r++){const n=e[r],i=o(this.__cast(n,{index:r,column:r,records:this.info.records,header:t}),2),s=i[0],u=i[1];if(s)return void this.emit("error",s);a[r]=[u,n]}}else if(n)for(let r=0;r<n.length;r++){const i=T(e,n[r].key),s=o(this.__cast(i,{index:r,column:n[r].key,records:this.info.records,header:t}),2),u=s[0],c=s[1];if(u)return void this.emit("error",u);a[r]=[c,i]}else for(let r of e){const s=e[r],u=o(this.__cast(s,{index:i,column:n[i].key,records:this.info.records,header:t}),2),c=u[0],l=u[1];if(c)return void this.emit("error",c);a.push([l,s])}let s="";for(let e=0;e<a.length;e++){let t,r,n=o(a[e],2),i=n[0],c=n[1];if("string"==typeof i)t=this.options;else if(g(i)){if(t=i,i=t.value,delete t.value,"string"!=typeof i&&null!=i)return void this.emit("error",Error("Invalid Casting Value: returned value must return a string, null or undefined, got "+JSON.stringify(i)));if(t=u(u({},this.options),t),r=this.normalize(t))return void this.emit("error",r)}else{if(null!=i)return void this.emit("error",Error("Invalid Casting Value: returned value must return a string, an object, null or undefined, got "+JSON.stringify(i)));t=this.options}const l=t,f=l.delimiter,d=l.escape,h=l.quote,p=l.quoted,m=l.quoted_empty,y=l.quoted_string,b=l.quoted_match,_=l.record_delimiter;if(i){if("string"!=typeof i)return this.emit("error",Error("Formatter must return a string, null or undefined, got "+JSON.stringify(i))),null;const e=f.length&&i.indexOf(f)>=0,t=""!==h&&i.indexOf(h)>=0,r=i.indexOf(d)>=0&&d!==h,n=i.indexOf(_)>=0,o=y&&"string"==typeof c;let a=b&&b.filter(e=>"string"==typeof e?-1!==i.indexOf(e):e.test(i));a=a&&a.length>0;const u=!0===t||e||n||p||o||a;if(!0===u&&!0===r){const e="\\"===d?new RegExp(d+d,"g"):new RegExp(d,"g");i=i.replace(e,d+d)}if(!0===t){const e=new RegExp(h,"g");i=i.replace(e,d+h)}!0===u&&(i=h+i+h),s+=i}else(!0===m||""===c&&!0===y&&!1!==m)&&(s+=h+h);e!==a.length-1&&(s+=f)}return s}bom(){!0===this.options.bom&&this.push(f)}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 h=function(){let e,t,r;for(let n in arguments){const i=arguments[n],o=typeof i;if(void 0===e&&Array.isArray(i))e=i;else if(void 0===t&&g(i))t=i;else{if(void 0!==r||"function"!==o)throw new p("CSV_INVALID_ARGUMENT",["Invalid argument:",`got ${JSON.stringify(i)} at index ${n}`]);r=i}}const i=new d(t);if(r){const e=[];i.on("readable",(function(){let t;for(;null!==(t=this.read());)e.push(t)})),i.on("error",(function(e){r(e)})),i.on("end",(function(){r(void 0,e.join(""))}))}if(void 0!==e)if("function"==typeof n)n((function(){for(let t of e)i.write(t);i.end()}));else{for(let t of e)i.write(t);i.end()}return i};class p extends Error{constructor(e,r,...n){Array.isArray(r)&&(r=r.join(" ")),super(r),void 0!==Error.captureStackTrace&&Error.captureStackTrace(this,p),this.code=e;for(const e of n)for(const r in e){const n=e[r];this[r]=t.isBuffer(n)?n.toString():null==n?n:JSON.parse(JSON.stringify(n))}}}h.Stringifier=d,h.CsvError=p,e.exports=h;const g=function(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)},m=function(e){return e.replace(/([A-Z])/g,(function(e,t){return"_"+t.toLowerCase()}))},y=".".charCodeAt(0),b=/\\(\\)?/g,_=RegExp("[^.[\\]]+|\\[(?:([^\"'][^[]*)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))","g"),w=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,v=/^\w*$/,E=function(e){const t=typeof e;return"symbol"===t||"object"===t&&e&&"[object Symbol]"===function(e){return Object.prototype.toString.call(e)}(e)},S=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&&!E(e))||(v.test(e)||!w.test(e)||null!=t&&e in Object(t))}(e,t)?[e]:function(e){const t=[];return e.charCodeAt(0)===y&&t.push(""),e.replace(_,(function(e,r,n,i){let o=e;n?o=i.replace(b,"$1"):r&&(o=r.trim()),t.push(o)})),t}(e)},O=function(e){if("string"==typeof e||E(e))return e;const t=""+e;return"0"==t&&1/e==-INFINITY?"-0":t},T=function(e,t){let r=0;const n=(t=S(t,e)).length;for(;null!=e&&r<n;)e=e[O(t[r++])];return r&&r===n?e:void 0}}).call(this,r(10).Buffer,r(113).setImmediate)},function(e,t,r){(function(t){function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,i,o=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==r.return||r.return()}finally{if(s)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function o(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 a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach((function(t){s(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const u=r(251),c=u.async_all,l=u.ensure_timestamp,f=r(439).MixpanelGroups,d=r(440).MixpanelPeople,h={test:!1,debug:!1,verbose:!1,host:"api.mixpanel.com",protocol:"https",path:""};function p(e){return"undefined"!=typeof btoa?btoa(e):t.from(e).toString("base64")}var g=function(e,t){if(!e)throw new Error("The Mixpanel Client needs a Mixpanel token: `init(token)`");const r={token:e,config:a({},h),send_request:function(e,t){t=t||function(){};let n=p(JSON.stringify(e.data));const i=e.endpoint,o=(e.method||"GET").toUpperCase();let a={ip:0,verbose:r.config.verbose?1:0};const s=r.config.key,u=r.config.secret;let c={headers:{}},l=`${r.config.protocol}://${r.config.host}`;if(r.config.port&&(l+=":"+r.config.port),"POST"===o?(n="data="+n,c.headers["Content-Type"]="application/x-www-form-urlencoded",c.headers["Content-Length"]=n.length):"GET"===o&&(a.data=n),u){if("https"!==r.config.protocol)throw new Error("Must use HTTPS if authenticating with API Secret");const e=p(u+":");c.headers.Authorization="Basic "+e}else if(s)a.api_key=s;else if("/import"===i)throw new Error("The Mixpanel Client needs a Mixpanel API Secret when importing old events: `init(token, { secret: ... })`");r.config.test&&(a.test=1),c.path=r.config.path+i+"?"+new URLSearchParams(a).toString(),fetch(l+c.path,{method:o,headers:c.headers,body:"GET"!==o?n:null}).then(e=>e.text()).then(e=>{var n;if(r.config.verbose)try{var i=JSON.parse(e);1!=i.status&&(n=new Error("Mixpanel Server Error: "+i.error))}catch(e){n=new Error("Could not parse response from Mixpanel")}else n="1"!==e?new Error("Mixpanel Server Error: "+e):void 0;t(n)}).catch(e=>{console.log("error",e),r.config.debug&&console.log("Got Error: "+e.message),t(e)})},send_event_request:function(e,t,n,i){n.token=r.token,n.mp_lib="node";var o={event:t,properties:n};r.config.debug&&console.log("Sending the following event to Mixpanel:\n",o),r.send_request({method:"GET",endpoint:e,data:o},i)}};var i=function(e,t){for(var r=[],n=0,i=e.length;n<i;)r.push(e.slice(n,n+=t));return r},o=function(e,t){var n=e.event_list,o=e.endpoint,a=e.max_batch_size?Math.min(50,e.max_batch_size):50,s=e.max_concurrent_requests||e.max_batch_size>50&&Math.ceil(e.max_batch_size/50),u=i(n,a),f=s?i(u,s):[u],d=u.length,h=f.length;function p(e,t){e.length>0&&(e=e.map((function(e){e.properties;return("/import"===o||e.properties.time)&&(e.properties.time=l(e.properties.time)),e.properties.token=e.properties.token||r.token,e})),r.send_request({method:"POST",endpoint:o,data:e},t))}!function e(r){var n=f[r];c(n,p,(function(n,i){(r+=1)===h?t&&t(n,i):e(r)}))}(0),r.config.debug&&console.log("Sending "+n.length+" events to Mixpanel in "+d+" batches of events and "+h+" batches of requests")};return r.track=function(e,t,n){if(t&&"function"!=typeof t||(n=t,t={}),t.time&&(t.time=l(t.time),t.time<Date.now()/1e3-432e3))throw new Error("`track` not allowed for event more than 5 days old; use `mixpanel.import()`");r.send_event_request("/track",e,t,n)},r.track_batch=function(e,t,r){"function"==typeof(t=t||{})&&(r=t,t={});var n={event_list:e,endpoint:"/track",max_concurrent_requests:t.max_concurrent_requests,max_batch_size:t.max_batch_size};o(n,r)},r.import=function(e,t,n,i){n&&"function"!=typeof n||(i=n,n={}),n.time=l(t),r.send_event_request("/import",e,n,i)},r.import_batch=function(e,t,r){var n;"function"!=typeof t&&t||(r=t,t={}),n={event_list:e,endpoint:"/import",max_concurrent_requests:t.max_concurrent_requests,max_batch_size:t.max_batch_size},o(n,r)},r.alias=function(e,t,n){var i={distinct_id:e,alias:t};r.track("$create_alias",i,n)},r.identify=function(e,t,n){var i={distinct_id:e,$identified_id:e,$anon_id:t};r.track("$identify",i,n)},r.groups=new f(r),r.people=new d(r),r.set_config=function(e){if(Object.assign(r.config,e),e.host){const t=n(e.host.split(":"),2),i=t[0],o=t[1];r.config.host=i,o&&(r.config.port=Number(o))}},t&&r.set_config(t),r};e.exports={Client:function(e){return console.warn("The function `Client(token)` is deprecated. It is now called `init(token)`."),g(e)},init:g}}).call(this,r(10).Buffer)},function(e,t,r){const n=r(252).ProfileHelpers;class i extends(n()){constructor(e){super(),this.mixpanel=e,this.endpoint="/groups"}set_once(e,t,r,n,i,o){const a={$group_key:e,$group_id:t};this._set(r,n,i,o,{identifiers:a,set_once:!0})}set(e,t,r,n,i,o){const a={$group_key:e,$group_id:t};this._set(r,n,i,o,{identifiers:a})}delete_group(e,t,r,n){const i={$group_key:e,$group_id:t};this._delete_profile({identifiers:i,modifiers:r,callback:n})}remove(e,t,r,n,i){const o={$group_key:e,$group_id:t};this._remove({identifiers:o,data:r,modifiers:n,callback:i})}union(e,t,r,n,i){const o={$group_key:e,$group_id:t};this._union({identifiers:o,data:r,modifiers:n,callback:i})}unset(e,t,r,n,i){const o={$group_key:e,$group_id:t};this._unset({identifiers:o,prop:r,modifiers:n,callback:i})}}t.MixpanelGroups=i},function(e,t,r){function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,i,o=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==r.return||r.return()}finally{if(s)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}const o=r(252),a=o.merge_modifiers,s=o.ProfileHelpers;class u extends(s()){constructor(e){super(),this.mixpanel=e,this.endpoint="/engage"}set_once(e,t,r,n,i){const o={$distinct_id:e};this._set(t,r,n,i,{identifiers:o,set_once:!0})}set(e,t,r,n,i){const o={$distinct_id:e};this._set(t,r,n,i,{identifiers:o})}increment(e,t,r,i,o){var s={};if("object"==typeof t){"object"==typeof r?(o=i,i=r):o=r;for(const e of Object.entries(t)){var u=n(e,2);const t=u[0],r=u[1];isNaN(parseFloat(r))?this.mixpanel.config.debug&&(console.error("Invalid increment value passed to mixpanel.people.increment - must be a number"),console.error("Passed "+t+":"+r)):s[t]=r}}else"number"!=typeof r&&r?"function"==typeof r?(o=r,s[t]=1):(o=i,i="object"==typeof r?r:{},s[t]=1):(r=r||1,s[t]=r,"function"==typeof i&&(o=i));var c={$add:s,$token:this.mixpanel.token,$distinct_id:e};c=a(c,i),this.mixpanel.config.debug&&(console.log("Sending the following data to Mixpanel (Engage):"),console.log(c)),this.mixpanel.send_request({method:"GET",endpoint:"/engage",data:c},o)}append(e,t,r,n,i){var o={};"object"==typeof t?("object"==typeof r?(i=n,n=r):i=r,Object.keys(t).forEach((function(e){o[e]=t[e]}))):(o[t]=r,"function"==typeof n&&(i=n));var s={$append:o,$token:this.mixpanel.token,$distinct_id:e};s=a(s,n),this.mixpanel.config.debug&&(console.log("Sending the following data to Mixpanel (Engage):"),console.log(s)),this.mixpanel.send_request({method:"GET",endpoint:"/engage",data:s},i)}track_charge(e,t,r,n,i){if("function"!=typeof r&&r?"function"!=typeof n&&n||(i=n||function(){},(r.$ignore_time||r.hasOwnProperty("$ip"))&&(n={},Object.keys(r).forEach((function(e){n[e]=r[e],delete r[e]})))):(i=r||function(){},r={}),"number"!=typeof t&&(t=parseFloat(t),isNaN(t)))console.error("Invalid value passed to mixpanel.people.track_charge - must be a number");else{if(r.$amount=t,r.hasOwnProperty("$time")){var o=r.$time;"[object Date]"===Object.prototype.toString.call(o)&&(r.$time=o.toISOString())}var s={$append:{$transactions:r},$token:this.mixpanel.token,$distinct_id:e};s=a(s,n),this.mixpanel.config.debug&&(console.log("Sending the following data to Mixpanel (Engage):"),console.log(s)),this.mixpanel.send_request({method:"GET",endpoint:"/engage",data:s},i)}}clear_charges(e,t,r){var n={$set:{$transactions:[]},$token:this.mixpanel.token,$distinct_id:e};"function"==typeof t&&(r=t),n=a(n,t),this.mixpanel.config.debug&&console.log("Clearing this user's charges:",e),this.mixpanel.send_request({method:"GET",endpoint:"/engage",data:n},r)}delete_user(e,t,r){const n={$distinct_id:e};this._delete_profile({identifiers:n,modifiers:t,callback:r})}remove(e,t,r,n){const i={$distinct_id:e};this._remove({identifiers:i,data:t,modifiers:r,callback:n})}union(e,t,r,n){const i={$distinct_id:e};this._union({identifiers:i,data:t,modifiers:r,callback:n})}unset(e,t,r,n){const i={$distinct_id:e};this._unset({identifiers:i,prop:t,modifiers:r,callback:n})}}t.MixpanelPeople=u},function(e,t,r){"use strict";var n;if(!Object.keys){var i=Object.prototype.hasOwnProperty,o=Object.prototype.toString,a=r(253),s=Object.prototype.propertyIsEnumerable,u=!s.call({toString:null},"toString"),c=s.call((function(){}),"prototype"),l=["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},h=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!d["$"+e]&&i.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]"===o.call(e),n=a(e),s=t&&"[object String]"===o.call(e),d=[];if(!t&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var p=c&&r;if(s&&e.length>0&&!i.call(e,0))for(var g=0;g<e.length;++g)d.push(String(g));if(n&&e.length>0)for(var m=0;m<e.length;++m)d.push(String(m));else for(var y in e)p&&"prototype"===y||!i.call(e,y)||d.push(String(y));if(u)for(var b=function(e){if("undefined"==typeof window||!h)return f(e);try{return f(e)}catch(e){return!1}}(e),_=0;_<l.length;++_)b&&"constructor"===l[_]||!i.call(e,l[_])||d.push(l[_]);return d}}e.exports=n},function(e,t,r){"use strict";var n="Function.prototype.bind called on incompatible ",i=Array.prototype.slice,o=Object.prototype.toString;e.exports=function(e){var t=this;if("function"!=typeof t||"[object Function]"!==o.call(t))throw new TypeError(n+t);for(var r,a=i.call(arguments,1),s=function(){if(this instanceof r){var n=t.apply(this,a.concat(i.call(arguments)));return Object(n)===n?n:this}return t.apply(e,a.concat(i.call(arguments)))},u=Math.max(0,t.length-a.length),c=[],l=0;l<u;l++)c.push("$"+l);if(r=Function("binder","return function ("+c.join(",")+"){ return binder.apply(this,arguments); }")(s),t.prototype){var f=function(){};f.prototype=t.prototype,r.prototype=new f,f.prototype=null}return r}},function(e,t,r){"use strict";var n=r(167);e.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},function(e,t,r){"use strict";var n=r(81),i=r(123),o=r(255),a=r(256),s=r(445),u=i(a(),Object);n(u,{getPolyfill:a,implementation:o,shim:s}),e.exports=u},function(e,t,r){"use strict";var n=r(256),i=r(81);e.exports=function(){var e=n();return i(Object,{is:e},{is:function(){return Object.is!==e}}),e}},function(e,t,r){"use strict";var n,i,o,a,s=r(54),u=r(72)();if(u){n=s("Object.prototype.hasOwnProperty"),i=s("RegExp.prototype.exec"),o={};var c=function(){throw o};a={toString:c,valueOf:c},"symbol"==typeof Symbol.toPrimitive&&(a[Symbol.toPrimitive]=c)}var l=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{i(e,a)}catch(e){return e===o}}:function(e){return!(!e||"object"!=typeof e&&"function"!=typeof e)&&"[object RegExp]"===l(e)}},function(e,t,r){"use strict";var n=r(81),i=r(123),o=r(257),a=r(258),s=r(448),u=i(a());n(u,{getPolyfill:a,implementation:o,shim:s}),e.exports=u},function(e,t,r){"use strict";var n=r(81).supportsDescriptors,i=r(258),o=Object.getOwnPropertyDescriptor,a=Object.defineProperty,s=TypeError,u=Object.getPrototypeOf,c=/a/;e.exports=function(){if(!n||!u)throw new s("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var e=i(),t=u(c),r=o(t,"flags");return r&&r.get===e||a(t,"flags",{configurable:!0,enumerable:!1,get:e}),e}},function(e,t){var r={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},function(e,t,r){"use strict";var n=Date.prototype.getDay,i=Object.prototype.toString,o=r(72)();e.exports=function(e){return"object"==typeof e&&null!==e&&(o?function(e){try{return n.call(e),!0}catch(e){return!1}}(e):"[object Date]"===i.call(e))}},function(e,t,r){"use strict";var n=r(259),i=r(452),o=r(453),a=r(454),s=r(455);e.exports=function(e){return null==e||"object"!=typeof e&&"function"!=typeof e?null:n(e)?"String":i(e)?"Number":o(e)?"Boolean":a(e)?"Symbol":s(e)?"BigInt":void 0}},function(e,t,r){"use strict";var n=Number.prototype.toString,i=Object.prototype.toString,o=r(72)();e.exports=function(e){return"number"==typeof e||"object"==typeof e&&(o?function(e){try{return n.call(e),!0}catch(e){return!1}}(e):"[object Number]"===i.call(e))}},function(e,t,r){"use strict";var n=r(54),i=n("Boolean.prototype.toString"),o=n("Object.prototype.toString"),a=r(72)();e.exports=function(e){return"boolean"==typeof e||null!==e&&"object"==typeof e&&(a&&Symbol.toStringTag in e?function(e){try{return i(e),!0}catch(e){return!1}}(e):"[object Boolean]"===o(e))}},function(e,t,r){"use strict";var n=Object.prototype.toString;if(r(166)()){var i=Symbol.prototype.toString,o=/^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()&&o.test(i.call(e))}(e)}catch(e){return!1}}}else e.exports=function(e){return!1}},function(e,t,r){"use strict";if(r(456)()){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}},function(e,t,r){"use strict";(function(t){var r=t.BigInt;e.exports=function(){return"function"==typeof r&&"function"==typeof BigInt&&"bigint"==typeof r(42)&&"bigint"==typeof BigInt(42)}}).call(this,r(23))},function(e,t,r){"use strict";var n=r(260),i=r(261),o=r(458),a=r(459);e.exports=function(e){if(e&&"object"==typeof e){if(n(e))return"Map";if(i(e))return"Set";if(o(e))return"WeakMap";if(a(e))return"WeakSet"}return!1}},function(e,t,r){"use strict";var n,i="function"==typeof WeakMap&&WeakMap.prototype?WeakMap:null,o="function"==typeof WeakSet&&WeakSet.prototype?WeakSet:null;i||(n=function(e){return!1});var a=i?i.prototype.has:null,s=o?o.prototype.has:null;n||a||(n=function(e){return!1}),e.exports=n||function(e){if(!e||"object"!=typeof e)return!1;try{if(a.call(e,a),s)try{s.call(e,s)}catch(e){return!0}return e instanceof i}catch(e){}return!1}},function(e,t,r){"use strict";var n=r(80),i=r(54),o=n("%WeakSet%",!0),a=i("WeakSet.prototype.has",!0);if(a){var s=i("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 o}catch(e){}return!1}}else e.exports=function(e){return!1}},function(e,t,r){"use strict";(function(t){var n=r(254);if(r(166)()||r(122)()){var i=Symbol.iterator;e.exports=function(e){return null!=e&&void 0!==e[i]?e[i]():n(e)?Array.prototype[i].call(e):void 0}}else{var o=r(461),a=r(259),s=r(80),u=s("%Map%",!0),c=s("%Set%",!0),l=r(54),f=l("Array.prototype.push"),d=l("String.prototype.charCodeAt"),h=l("String.prototype.slice"),p=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}}}},g=function(e,t){if(o(e)||n(e))return p(e);if(a(e)){var r=0;return{next:function(){var t=function(e,t){if(t+1>=e.length)return t+1;var r=d(e,t);if(r<55296||r>56319)return t+1;var n=d(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(u||c){var m=r(260),y=r(261),b=l("Map.prototype.forEach",!0),_=l("Set.prototype.forEach",!0);if(void 0===t||!t.versions||!t.versions.node)var w=l("Map.prototype.iterator",!0),v=l("Set.prototype.iterator",!0),E=function(e){var t=!1;return{next:function(){try{return{done:t,value:t?void 0:e.next()}}catch(e){return t=!0,{done:!0,value:void 0}}}}};var S=l("Map.prototype.@@iterator",!0)||l("Map.prototype._es6-shim iterator_",!0),O=l("Set.prototype.@@iterator",!0)||l("Set.prototype._es6-shim iterator_",!0);e.exports=function(e){return function(e){if(m(e)){if(w)return E(w(e));if(S)return S(e);if(b){var t=[];return b(e,(function(e,r){f(t,[r,e])})),p(t)}}if(y(e)){if(v)return E(v(e));if(O)return O(e);if(_){var r=[];return _(e,(function(e){f(r,e)})),p(r)}}}(e)||g(e)}}else e.exports=function(e){if(null!=e)return g(e,!0)}}}).call(this,r(19))},function(e,t){var r={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},function(e,t,r){"use strict";var n=r(80),i=r(54),o=r(463),a=n("%TypeError%"),s=n("%WeakMap%",!0),u=n("%Map%",!0),c=i("WeakMap.prototype.get",!0),l=i("WeakMap.prototype.set",!0),f=i("WeakMap.prototype.has",!0),d=i("Map.prototype.get",!0),h=i("Map.prototype.set",!0),p=i("Map.prototype.has",!0),g=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 "+o(e))},get:function(n){if(s&&n&&("object"==typeof n||"function"==typeof n)){if(e)return c(e,n)}else if(u){if(t)return d(t,n)}else if(r)return function(e,t){var r=g(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!!g(e,t)}(r,n);return!1},set:function(n,i){s&&n&&("object"==typeof n||"function"==typeof n)?(e||(e=new s),l(e,n,i)):u?(t||(t=new u),h(t,n,i)):(r||(r={key:{},next:null}),function(e,t,r){var n=g(e,t);n?n.value=r:e.next={key:t,next:e.next,value:r}}(r,n,i))}};return n}},function(e,t,r){var n="function"==typeof Map&&Map.prototype,i=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,o=n&&i&&"function"==typeof i.get?i.get:null,a=n&&Map.prototype.forEach,s="function"==typeof Set&&Set.prototype,u=Object.getOwnPropertyDescriptor&&s?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,c=s&&u&&"function"==typeof u.get?u.get:null,l=s&&Set.prototype.forEach,f="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,d="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,h="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,p=Boolean.prototype.valueOf,g=Object.prototype.toString,m=Function.prototype.toString,y=String.prototype.match,b=String.prototype.slice,_=String.prototype.replace,w=String.prototype.toUpperCase,v=String.prototype.toLowerCase,E=RegExp.prototype.test,S=Array.prototype.concat,O=Array.prototype.join,T=Array.prototype.slice,A=Math.floor,M="function"==typeof BigInt?BigInt.prototype.valueOf:null,D=Object.getOwnPropertySymbols,I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,j="function"==typeof Symbol&&"object"==typeof Symbol.iterator,R="function"==typeof Symbol&&Symbol.toStringTag&&(typeof Symbol.toStringTag===j||"symbol")?Symbol.toStringTag:null,N=Object.prototype.propertyIsEnumerable,k=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function C(e,t){if(e===1/0||e===-1/0||e!=e||e&&e>-1e3&&e<1e3||E.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 i=String(n),o=b.call(t,i.length+1);return _.call(i,r,"$&_")+"."+_.call(_.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return _.call(t,r,"$&_")}var L=r(464).custom,x=L&&F(L)?L:null;function P(e,t,r){var n="double"===(r.quoteStyle||t)?'"':"'";return n+e+n}function B(e){return _.call(String(e),/"/g,"&quot;")}function U(e){return!("[object Array]"!==z(e)||R&&"object"==typeof e&&R in e)}function F(e){if(j)return e&&"object"==typeof e&&e instanceof Symbol;if("symbol"==typeof e)return!0;if(!e||"object"!=typeof e||!I)return!1;try{return I.call(e),!0}catch(e){}return!1}e.exports=function e(t,r,n,i){var s=r||{};if(H(s,"quoteStyle")&&"single"!==s.quoteStyle&&"double"!==s.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(H(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=!H(s,"customInspect")||s.customInspect;if("boolean"!=typeof u&&"symbol"!==u)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(H(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(H(s,"numericSeparator")&&"boolean"!=typeof s.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var g=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 function e(t,r){if(t.length>r.maxStringLength){var n=t.length-r.maxStringLength,i="... "+n+" more character"+(n>1?"s":"");return e(b.call(t,0,r.maxStringLength),r)+i}return P(_.call(_.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,V),"single",r)}(t,s);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var w=String(t);return g?C(t,w):w}if("bigint"==typeof t){var E=String(t)+"n";return g?C(t,E):E}var A=void 0===s.depth?5:s.depth;if(void 0===n&&(n=0),n>=A&&A>0&&"object"==typeof t)return U(t)?"[Array]":"[Object]";var D=function(e,t){var r;if("\t"===e.indent)r="\t";else{if(!("number"==typeof e.indent&&e.indent>0))return null;r=O.call(Array(e.indent+1)," ")}return{base:r,prev:O.call(Array(t+1),r)}}(s,n);if(void 0===i)i=[];else if(q(i,t)>=0)return"[Circular]";function L(t,r,o){if(r&&(i=T.call(i)).push(r),o){var a={depth:s.depth};return H(s,"quoteStyle")&&(a.quoteStyle=s.quoteStyle),e(t,a,n+1,i)}return e(t,s,n+1,i)}if("function"==typeof t){var W=function(e){if(e.name)return e.name;var t=y.call(m.call(e),/^function\s*([\w$]+)/);if(t)return t[1];return null}(t),X=Z(t,L);return"[Function"+(W?": "+W:" (anonymous)")+"]"+(X.length>0?" { "+O.call(X,", ")+" }":"")}if(F(t)){var J=j?_.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):I.call(t);return"object"!=typeof t||j?J:G(J)}if(function(e){if(!e||"object"!=typeof e)return!1;if("undefined"!=typeof HTMLElement&&e instanceof HTMLElement)return!0;return"string"==typeof e.nodeName&&"function"==typeof e.getAttribute}(t)){for(var Q="<"+v.call(String(t.nodeName)),ee=t.attributes||[],te=0;te<ee.length;te++)Q+=" "+ee[te].name+"="+P(B(ee[te].value),"double",s);return Q+=">",t.childNodes&&t.childNodes.length&&(Q+="..."),Q+="</"+v.call(String(t.nodeName))+">"}if(U(t)){if(0===t.length)return"[]";var re=Z(t,L);return D&&!function(e){for(var t=0;t<e.length;t++)if(q(e[t],"\n")>=0)return!1;return!0}(re)?"["+K(re,D)+"]":"[ "+O.call(re,", ")+" ]"}if(function(e){return!("[object Error]"!==z(e)||R&&"object"==typeof e&&R in e)}(t)){var ne=Z(t,L);return"cause"in t&&!N.call(t,"cause")?"{ ["+String(t)+"] "+O.call(S.call("[cause]: "+L(t.cause),ne),", ")+" }":0===ne.length?"["+String(t)+"]":"{ ["+String(t)+"] "+O.call(ne,", ")+" }"}if("object"==typeof t&&u){if(x&&"function"==typeof t[x])return t[x]();if("symbol"!==u&&"function"==typeof t.inspect)return t.inspect()}if(function(e){if(!o||!e||"object"!=typeof e)return!1;try{o.call(e);try{c.call(e)}catch(e){return!0}return e instanceof Map}catch(e){}return!1}(t)){var ie=[];return a.call(t,(function(e,r){ie.push(L(r,t,!0)+" => "+L(e,t))})),$("Map",o.call(t),ie,D)}if(function(e){if(!c||!e||"object"!=typeof e)return!1;try{c.call(e);try{o.call(e)}catch(e){return!0}return e instanceof Set}catch(e){}return!1}(t)){var oe=[];return l.call(t,(function(e){oe.push(L(e,t))})),$("Set",c.call(t),oe,D)}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 Y("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 Y("WeakSet");if(function(e){if(!h||!e||"object"!=typeof e)return!1;try{return h.call(e),!0}catch(e){}return!1}(t))return Y("WeakRef");if(function(e){return!("[object Number]"!==z(e)||R&&"object"==typeof e&&R in e)}(t))return G(L(Number(t)));if(function(e){if(!e||"object"!=typeof e||!M)return!1;try{return M.call(e),!0}catch(e){}return!1}(t))return G(L(M.call(t)));if(function(e){return!("[object Boolean]"!==z(e)||R&&"object"==typeof e&&R in e)}(t))return G(p.call(t));if(function(e){return!("[object String]"!==z(e)||R&&"object"==typeof e&&R in e)}(t))return G(L(String(t)));if(!function(e){return!("[object Date]"!==z(e)||R&&"object"==typeof e&&R in e)}(t)&&!function(e){return!("[object RegExp]"!==z(e)||R&&"object"==typeof e&&R in e)}(t)){var ae=Z(t,L),se=k?k(t)===Object.prototype:t instanceof Object||t.constructor===Object,ue=t instanceof Object?"":"null prototype",ce=!se&&R&&Object(t)===t&&R in t?b.call(z(t),8,-1):ue?"Object":"",le=(se||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(ce||ue?"["+O.call(S.call([],ce||[],ue||[]),": ")+"] ":"");return 0===ae.length?le+"{}":D?le+"{"+K(ae,D)+"}":le+"{ "+O.call(ae,", ")+" }"}return String(t)};var W=Object.prototype.hasOwnProperty||function(e){return e in this};function H(e,t){return W.call(e,t)}function z(e){return g.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 V(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 G(e){return"Object("+e+")"}function Y(e){return e+" { ? }"}function $(e,t,r,n){return e+" ("+t+") {"+(n?K(r,n):O.call(r,", "))+"}"}function K(e,t){if(0===e.length)return"";var r="\n"+t.prev+t.base;return r+O.call(e,","+r)+"\n"+t.prev}function Z(e,t){var r=U(e),n=[];if(r){n.length=e.length;for(var i=0;i<e.length;i++)n[i]=H(e,i)?t(e[i],e):""}var o,a="function"==typeof D?D(e):[];if(j){o={};for(var s=0;s<a.length;s++)o["$"+a[s]]=a[s]}for(var u in e)H(e,u)&&(r&&String(Number(u))===u&&u<e.length||j&&o["$"+u]instanceof Symbol||(E.call(/[^\w$]/,u)?n.push(t(u,e)+": "+t(e[u],e)):n.push(u+": "+t(e[u],e))));if("function"==typeof D)for(var c=0;c<a.length;c++)N.call(e,a[c])&&n.push("["+t(a[c])+"]: "+t(e[a[c]],e));return n}},function(e,t){},function(e,t,r){"use strict";(function(t){var n=r(262),i=r(263),o=r(54),a=o("Object.prototype.toString"),s=r(72)(),u="undefined"==typeof globalThis?t:globalThis,c=i(),l=o("String.prototype.slice"),f={},d=r(264),h=Object.getPrototypeOf;s&&d&&h&&n(c,(function(e){if("function"==typeof u[e]){var t=new u[e];if(Symbol.toStringTag in t){var r=h(t),n=d(r,Symbol.toStringTag);if(!n){var i=h(r);n=d(i,Symbol.toStringTag)}f[e]=n.get}}}));var p=r(466);e.exports=function(e){return!!p(e)&&(s&&Symbol.toStringTag in e?function(e){var t=!1;return n(f,(function(r,n){if(!t)try{var i=r.call(e);i===n&&(t=i)}catch(e){}})),t}(e):l(a(e),8,-1))}}).call(this,r(23))},function(e,t,r){"use strict";(function(t){var n=r(262),i=r(263),o=r(54),a=o("Object.prototype.toString"),s=r(72)(),u="undefined"==typeof globalThis?t:globalThis,c=i(),l=o("Array.prototype.indexOf",!0)||function(e,t){for(var r=0;r<e.length;r+=1)if(e[r]===t)return r;return-1},f=o("String.prototype.slice"),d={},h=r(264),p=Object.getPrototypeOf;s&&h&&p&&n(c,(function(e){var t=new u[e];if(Symbol.toStringTag in t){var r=p(t),n=h(r,Symbol.toStringTag);if(!n){var i=p(r);n=h(i,Symbol.toStringTag)}d[e]=n.get}}));e.exports=function(e){if(!e||"object"!=typeof e)return!1;if(!s||!(Symbol.toStringTag in e)){var t=f(a(e),8,-1);return l(c,t)>-1}return!!h&&function(e){var t=!1;return n(d,(function(r,n){if(!t)try{t=r.call(e)===n}catch(e){}})),t}(e)}}).call(this,r(23))},function(e,t,r){"use strict";var n=r(81),i=r(123),o=r(265),a=r(266),s=r(468),u=i.apply(a()),c=function(e,t){return u(Object,arguments)};n(c,{getPolyfill:a,implementation:o,shim:s}),e.exports=c},function(e,t,r){"use strict";var n=r(81),i=r(266);e.exports=function(){var e=i();return n(Object,{assign:e},{assign:function(){return Object.assign!==e}}),e}},function(e,t,r){function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,i,o=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==r.return||r.return()}finally{if(s)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}const o=r(64),a=r(470),s=r(119),u=r(471),c=r(271),l=r(483).amountToInteger;function f(e){switch(e){case"Cash":case"Checking":return"checking";case"CreditCard":return"credit";case"Savings":return"savings";case"InvestmentAccount":return"investment";case"Mortgage":return"mortgage";default:return"other"}}function d(e,t){return[...e].sort((e,r)=>e[t]<r[t]?-1:e[t]>r[t]?1:0)}function h(e){return o.format(function(e){if("string"==typeof e){let t=n(e.split("-"),3),r=t[0],i=t[1],o=t[2];return null!=o?new Date(parseInt(r),parseInt(i)-1,parseInt(o)):null!=i?new Date(parseInt(r),parseInt(i)-1,1):new Date(parseInt(r),0,1)}return e}(e),"yyyy-MM")}function p(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 g(e,t){let r=d(e.monthlyBudgets,"month");h(r[0].month),o.format(new Date,"yyyy-MM");await c.batchBudgetUpdates(async()=>{const n={};for(let i of r){let r=p(e,i.monthlySubCategoryBudgets.filter(e=>!e.isTombstone));await Promise.all(r.map(async e=>{let r=l(e.budgeted),o=t.get(e.categoryId),a=h(i.month);o&&(await c.setBudgetAmount(a,o,r),"AffectsBuffer"===e.overspendingHandling?n[o]=!1:("Confined"===e.overspendingHandling||n[o])&&(n[o]=!0,await c.setBudgetCarryover(a,o,!0)))}))}})}async function m(e){const t=new Map;console.log("Importing Accounts..."),await async function(e,t){return Promise.all(e.accounts.map(async e=>{if(!e.isTombstone){const r=await c.createAccount({type:f(e.accountType),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=d(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.createCategoryGroup({name:e.name,is_income:!1});if(t.set(e.entityId,r),e.subCategories){const r=d(e.subCategories,"sortableIndex");r.reverse();for(let e of r)if(!e.isTombstone){const r=await c.createCategory({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 c.createPayee({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 c.getCategories()).find(e=>"Income"===e.name).id,n=await c.getAccounts(),i=await c.getPayees();function o(e){return null==e||"Category/__Split__"===e?null:"Category/__ImmediateIncome__"===e||"Category/__DeferredIncome__"===e?r:t.get(e)}function a(e){let t=n.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)t.set(r.entityId,s.v4());let u=(f=e.transactions,d="accountId",f.reduce((function(e,t){var r=t[d];return e.hasOwnProperty(r)||(e[r]=[]),e[r].push(t),e}),{}));var f,d;await Promise.all(Object.keys(u).map(async e=>{let r=u[e].map(r=>{if(r.isTombstone)return;let n=t.get(r.entityId),s=t.get(r.transferTransactionId)||null,u=null;u=s?i.find(e=>e.transfer_acct===t.get(r.targetAccountId)).id:t.get(r.payeeId);let c={id:n,amount:l(r.amount),category:a(t.get(e))?null:o(r.categoryId),date:r.date,notes:r.memo||null,payee:u,transfer_id:s};return c.subtransactions=r.subTransactions&&r.subTransactions.map((e,t)=>({amount:l(e.amount),category:o(e.categoryId)})),c}).filter(e=>e);await c.addTransactions(t.get(e),r)}))}(e,t),console.log("Importing Budgets..."),await g(e,t),console.log("Setting up...")}function y(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 b(...e){return e.slice(1).reduce((e,t)=>e+"/"+t.replace(/^\//,""),e[0].replace(/\/$/,""))}e.exports={importBuffer:async function(e,t){let r=function(e){let t=a(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 i=new u(t),o=i.getEntries(),s="",l=o[0].entryName.match(/([^/]*\.ynab4)/);l&&(s=l[1]+"/");let f=i.readFile(y(o,s+"Budget.ymeta")),h=b(s,JSON.parse(f.toString("utf8")).relativeDataFolderName),p=function(e,t){let r=t.map(t=>{const r=e.readFile(t).toString("utf8");let i;try{i=JSON.parse(r)}catch(e){return null}return i.hasFullKnowledge?{deviceGUID:i.deviceGUID,shortName:i.shortDeviceId,recentness:(o=i.knowledge,o.split(",").reduce((e,t)=>{const r=n(t.split("-"),2),i=(r[0],r[1]);return e+parseInt(i)},0))}:null;var o}).filter(e=>e);return r=d(r,"recentness"),r[r.length-1].deviceGUID}(i,o.filter(e=>e.entryName.startsWith(b(h,"devices"))));const g=b(h,p,"Budget.yfull");let _,w;try{_=i.readFile(y(o,g)).toString("utf8")}catch(e){throw console.log(e),new Error("Error reading Budget.yfull file")}try{w=JSON.parse(_)}catch(e){throw new Error("Error parsing Budget.yull file")}return c.runImport(r,()=>m(w))}}},function(e,t,r){"use strict";e.exports=e=>{const t=/^\\\\\?\\/.test(e),r=/[^\u0000-\u0080]+/.test(e);return t||r?e:e.replace(/\\/g,"/")}},function(e,t,r){(function(t){const n=r(106),i=r(48),o=r(269),a=r(481),s=(e,t)=>"boolean"==typeof e?e:t,u=(e,t)=>"string"==typeof e?e:t,c={noSort:!1,readEntries:!1,method:n.Constants.NONE,fs:null};e.exports=function(e,r){let l=null;const f=Object.assign(Object.create(null),c);e&&"object"==typeof e&&(e instanceof Uint8Array||(Object.assign(f,e),e=f.input?f.input:void 0,f.input&&delete f.input),t.isBuffer(e)&&(l=e,f.method=n.Constants.BUFFER,e=void 0)),Object.assign(f,r);const d=new n(f);if(e&&"string"==typeof e){if(!d.fs.existsSync(e))throw new Error(n.Errors.INVALID_FILENAME);f.method=n.Constants.FILE,f.filename=e,l=d.fs.readFileSync(e)}const h=new a(l,f),p=n.canonical,g=n.sanitize;function m(e){var t;if(e&&h&&("string"==typeof e&&(t=h.getEntry(e)),"object"==typeof e&&void 0!==e.entryName&&void 0!==e.header&&(t=h.getEntry(e.entryName)),t))return t;return null}function y(e){const t=i.posix,r=t.join,n=t.normalize,o=t.sep;return r(".",n(o+e.split("\\").join(o)+o))}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&&h.deleteEntry(t.entryName)},addZipComment:function(e){h.comment=e},getZipComment:function(){return h.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,i){if(!d.fs.existsSync(e))throw new Error(n.Errors.FILE_NOT_FOUND.replace("%s",e));{t=t?y(t):"";var o=e.split("\\").join("/").split("/").pop();t+=r||o;const n=d.fs.statSync(e);this.addFile(t,d.fs.readFileSync(e),i,n)}},addLocalFolder:function(e,r,o){var a;if(o instanceof RegExp?(a=o,o=function(e){return a.test(e)}):"function"!=typeof o&&(o=function(){return!0}),r=r?y(r):"",e=i.normalize(e),!d.fs.existsSync(e))throw new Error(n.Errors.FILE_NOT_FOUND.replace("%s",e));{const n=d.findFiles(e),a=this;n.length&&n.forEach((function(n){var s=i.relative(e,n).split("\\").join("/");if(o(s)){var u=d.fs.statSync(n);u.isFile()?a.addFile(r+s,d.fs.readFileSync(n),"",u):a.addFile(r+s+"/",t.alloc(0),"",u)}}))}},addLocalFolderAsync:function(e,r,o,a){var s;a instanceof RegExp?(s=a,a=function(e){return s.test(e)}):"function"!=typeof a&&(a=function(){return!0}),o=o?y(o):"",e=i.normalize(e);var u=this;d.fs.open(e,"r",(function(s){if(s&&"ENOENT"===s.code)r(void 0,n.Errors.FILE_NOT_FOUND.replace("%s",e));else if(s)r(void 0,s);else{var c=d.findFiles(e),l=-1,f=function(){if((l+=1)<c.length){var n=c[l],s=i.relative(e,n).split("\\").join("/");s=s.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^\x20-\x7E]/g,""),a(s)?d.fs.stat(n,(function(e,i){e&&r(void 0,e),i.isFile()?d.fs.readFile(n,(function(e,t){e?r(void 0,e):(u.addFile(o+s,t,"",i),f())})):(u.addFile(o+s+"/",t.alloc(0),"",i),f())})):f()}else r(!0,void 0)};f()}}))},addLocalFolderPromise:function(e,t){return new Promise((r,n)=>{const i=Object.assign({},t),o=i.filter,a=i.zipPath;this.addLocalFolderAsync(e,(e,t)=>{t&&n(t),e&&r(this)},a,o)})},addFile:function(e,t,r,i){let a=m(e);const s=null!=a;s||(a=new o,a.entryName=e),a.comment=r||"";const u="object"==typeof i&&i instanceof d.fs.Stats;u&&(a.header.time=i.mtime);var c=a.isDirectory?16:0;if(!n.isWin){let e=a.isDirectory?16384:32768;e|=u?4095&i.mode:"number"==typeof i?4095&i:a.isDirectory?493:420,c=(c|e<<16)>>>0}a.attr=c,a.setData(t),s||h.setEntry(a)},getEntries:function(){return h?h.entries:[]},getEntry:function(e){return m(e)},getEntryCount:function(){return h.getEntryCount()},forEach:function(e){return h.forEach(e)},extractEntryTo:function(e,t,r,o,a,c){o=s(o,!1),a=s(a,!1),r=s(r,!0),c=u(c,u(a,void 0));var l=m(e);if(!l)throw new Error(n.Errors.NO_ENTRY);var f=p(l.entryName),y=g(t,c&&!l.isDirectory?c:r?f:i.basename(f));if(l.isDirectory)return h.getEntryChildren(l).forEach((function(e){if(e.isDirectory)return;var s=e.getData();if(!s)throw new Error(n.Errors.CANT_EXTRACT_FILE);var u=p(e.entryName),c=g(t,r?u:i.basename(u));const l=a?e.header.fileAttr:void 0;d.writeFileTo(c,s,o,l)})),!0;var b=l.getData();if(!b)throw new Error(n.Errors.CANT_EXTRACT_FILE);if(d.fs.existsSync(y)&&!o)throw new Error(n.Errors.CANT_OVERRIDE);const _=a?e.header.fileAttr:void 0;return d.writeFileTo(y,b,o,_),!0},test:function(e){if(!h)return!1;for(var t in h.entries)try{if(t.isDirectory)continue;if(!h.entries[t].getData(e))return!1}catch(e){return!1}return!0},extractAllTo:function(e,t,r,i){if(t=s(t,!1),i=u(r,i),r=s(r,!1),!h)throw new Error(n.Errors.NO_ZIP);h.entries.forEach((function(o){var a=g(e,p(o.entryName.toString()));if(o.isDirectory)return void d.makeDir(a);var s=o.getData(i);if(!s)throw new Error(n.Errors.CANT_EXTRACT_FILE);const u=r?o.header.fileAttr:void 0;d.writeFileTo(a,s,t,u);try{d.fs.utimesSync(a,o.header.time,o.header.time)}catch(e){throw new Error(n.Errors.CANT_EXTRACT_FILE)}}))},extractAllToAsync:function(e,t,r,o){if(o||(o=function(){}),t=s(t,!1),"function"!=typeof r||o||(o=r),r=s(r,!1),!h)return void o(new Error(n.Errors.NO_ZIP));e=i.resolve(e);const a=t=>g(e,i.normalize(p(t.entryName.toString()))),u=(e,t)=>new Error(e+': "'+t+'"'),c=[],l=new Set;h.entries.forEach(e=>{e.isDirectory?c.push(e):l.add(e)});for(const e of c){const t=a(e),n=r?e.header.fileAttr:void 0;try{d.makeDir(t),n&&d.fs.chmodSync(t,n),d.fs.utimesSync(t,e.header.time,e.header.time)}catch(e){o(u("Unable to create folder",t))}}const f=()=>{0===l.size&&o()};for(const a of l.values()){const s=i.normalize(p(a.entryName.toString())),c=g(e,s);a.getDataAsync((function(e,i){if(i)o(new Error(i));else if(e){const n=r?a.header.fileAttr:void 0;d.writeFileToAsync(c,e,t,n,(function(e){e?d.fs.utimes(c,a.header.time,a.header.time,(function(e){e?o(u("Unable to set times",c)):(l.delete(a),f())})):o(u("Unable to write file",c))}))}else o(new Error(n.Errors.CANT_EXTRACT_FILE))}))}f()},writeZip:function(e,t){if(1===arguments.length&&"function"==typeof e&&(t=e,e=""),!e&&f.filename&&(e=f.filename),e){var r=h.compressToBuffer();if(r){var n=d.writeFileTo(e,r,!0);"function"==typeof t&&t(n?null:new Error("failed"),"")}}},writeZipPromise:function(e,t){const r=Object.assign({overwrite:!0},t),n=r.overwrite,i=r.perm;return new Promise((t,r)=>{!e&&f.filename&&(e=f.filename),e||r("ADM-ZIP: ZIP File Name Missing"),this.toBufferPromise().then(o=>{d.writeFileToAsync(e,o,n,i,e=>e?t(e):r("ADM-ZIP: Wasn't able to write zip file"))},r)})},toBufferPromise:function(){return new Promise((e,t)=>{h.toAsyncBuffer(e,t)})},toBuffer:function(e,t,r,n){return this.valueOf=2,"function"==typeof e?(h.toAsyncBuffer(e,t,r,n),null):h.compressToBuffer()}}}}).call(this,r(10).Buffer)},function(e,t,r){(function(t,n){const i=r(267).require(),o=r(48),a=r(268),s="object"==typeof t&&"win32"===t.platform,u=e=>e&&"object"==typeof e,c=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 l(e){this.sep=o.sep,this.fs=i,u(e)&&u(e.fs)&&"function"==typeof e.fs.statSync&&(this.fs=e.fs)}e.exports=l,l.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 Errors.FILE_IN_THE_WAY.replace("%s",r)}}))}(e)},l.prototype.writeFileTo=function(e,t,r,n){const i=this;if(i.fs.existsSync(e)){if(!r)return!1;if(i.fs.statSync(e).isDirectory())return!1}var a,s=o.dirname(e);i.fs.existsSync(s)||i.makeDir(s);try{a=i.fs.openSync(e,"w",438)}catch(t){i.fs.chmodSync(e,438),a=i.fs.openSync(e,"w",438)}if(a)try{i.fs.writeSync(a,t,0,t.length,0)}finally{i.fs.closeSync(a)}return i.fs.chmodSync(e,n||438),!0},l.prototype.writeFileToAsync=function(e,t,r,n,i){"function"==typeof n&&(i=n,n=void 0);const a=this;a.fs.exists(e,(function(s){if(s&&!r)return i(!1);a.fs.stat(e,(function(r,u){if(s&&u.isDirectory())return i(!1);var c=o.dirname(e);a.fs.exists(c,(function(r){r||a.makeDir(c),a.fs.open(e,"w",438,(function(r,o){r?a.fs.chmod(e,438,(function(){a.fs.open(e,"w",438,(function(r,o){a.fs.write(o,t,0,t.length,0,(function(){a.fs.close(o,(function(){a.fs.chmod(e,n||438,(function(){i(!0)}))}))}))}))})):o?a.fs.write(o,t,0,t.length,0,(function(){a.fs.close(o,(function(){a.fs.chmod(e,n||438,(function(){i(!0)}))}))})):a.fs.chmod(e,n||438,(function(){i(!0)}))}))}))}))}))},l.prototype.findFiles=function(e){const t=this;return function e(r,n,i){"boolean"==typeof n&&(i=n,n=void 0);let a=[];return t.fs.readdirSync(r).forEach((function(s){var u=o.join(r,s);t.fs.statSync(u).isDirectory()&&i&&(a=a.concat(e(u,n,i))),n&&!n.test(u)||a.push(o.normalize(u)+(t.fs.statSync(u).isDirectory()?t.sep:""))})),a}(e,void 0,!0)},l.prototype.getAttributes=function(){},l.prototype.setAttributes=function(){},l.crc32update=function(e,t){return c[255&(e^t)]^e>>>8},l.crc32=function(e){"string"==typeof e&&(e=n.from(e,"utf8")),c.length||genCRCTable();let t=e.length,r=-1;for(let n=0;n<t;)r=l.crc32update(r,e[n++]);return~r>>>0},l.methodToString=function(e){switch(e){case a.STORED:return"STORED ("+e+")";case a.DEFLATED:return"DEFLATED ("+e+")";default:return"UNSUPPORTED ("+e+")"}},l.canonical=function(e){if(!e)return"";var t=o.posix.normalize("/"+e.split("\\").join("/"));return o.join(".",t)},l.sanitize=function(e,t){e=o.resolve(o.normalize(e));for(var r=t.split("/"),n=0,i=r.length;n<i;n++){var a=o.normalize(o.join(e,r.slice(n,i).join(o.sep)));if(0===a.indexOf(e))return a}return o.normalize(o.join(e,o.basename(t)))},l.toBuffer=function(e){return n.isBuffer(e)?e:e instanceof Uint8Array?n.from(e):"string"==typeof e?n.from(e,"utf8"):n.alloc(0)},l.readBigUInt64LE=function(e,t){var r=n.from(e.slice(t,t+8));return r.swap64(),parseInt("0x"+r.toString("hex"))},l.isWin=s,l.crcTable=c}).call(this,r(19),r(10).Buffer)},function(e,t){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"}},function(e,t,r){const n=r(267).require(),i=r(48);n.existsSync=n.existsSync||i.existsSync,e.exports=function(e){var t=e||"",r={directory:!1,readonly:!1,hidden:!1,executable:!1,mtime:0,atime:0},o=null;return t&&n.existsSync(t)?(o=n.statSync(t),r.directory=o.isDirectory(),r.mtime=o.mtime,r.atime=o.atime,r.executable=0!=(73&o.mode),r.readonly=0==(128&o.mode),r.hidden="."===i.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")}}}},function(e,t,r){(function(t){var n=r(106),i=n.Constants;e.exports=function(){var e=20,r=10,o=0,a=0,s=0,u=0,c=0,l=0,f=0,d=0,h=0,p=0,g=0,m=0,y=0;e|=n.isWin?2560:768,o|=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 r},set version(e){r=e},get flags(){return o},set flags(e){o=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 c},set compressedSize(e){c=Math.max(0,e)>>>0},get size(){return l},set size(e){l=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 h},set commentLength(e){h=e},get diskNumStart(){return p},set diskNumStart(e){p=Math.max(0,e)>>>0},get inAttr(){return g},set inAttr(e){g=Math.max(0,e)>>>0},get attr(){return m},set attr(e){m=Math.max(0,e)>>>0},get fileAttr(){return m?(m>>>0|0)>>16&4095:0},get offset(){return y},set offset(e){y=Math.max(0,e)>>>0},get encripted(){return 1==(1&o)},get entryHeaderSize(){return i.CENHDR+f+d+h},get realDataOffset(){return y+i.LOCHDR+b.fnameLen+b.extraLen},get dataHeader(){return b},loadDataHeaderFromBinary:function(e){var t=e.slice(y,y+i.LOCHDR);if(t.readUInt32LE(0)!==i.LOCSIG)throw new Error(n.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(t){if(t.length!==i.CENHDR||t.readUInt32LE(0)!==i.CENSIG)throw new Error(n.Errors.INVALID_CEN);e=t.readUInt16LE(i.CENVEM),r=t.readUInt16LE(i.CENVER),o=t.readUInt16LE(i.CENFLG),a=t.readUInt16LE(i.CENHOW),s=t.readUInt32LE(i.CENTIM),u=t.readUInt32LE(i.CENCRC),c=t.readUInt32LE(i.CENSIZ),l=t.readUInt32LE(i.CENLEN),f=t.readUInt16LE(i.CENNAM),d=t.readUInt16LE(i.CENEXT),h=t.readUInt16LE(i.CENCOM),p=t.readUInt16LE(i.CENDSK),g=t.readUInt16LE(i.CENATT),m=t.readUInt32LE(i.CENATX),y=t.readUInt32LE(i.CENOFF)},dataHeaderToBinary:function(){var e=t.alloc(i.LOCHDR);return e.writeUInt32LE(i.LOCSIG,0),e.writeUInt16LE(r,i.LOCVER),e.writeUInt16LE(o,i.LOCFLG),e.writeUInt16LE(a,i.LOCHOW),e.writeUInt32LE(s,i.LOCTIM),e.writeUInt32LE(u,i.LOCCRC),e.writeUInt32LE(c,i.LOCSIZ),e.writeUInt32LE(l,i.LOCLEN),e.writeUInt16LE(f,i.LOCNAM),e.writeUInt16LE(d,i.LOCEXT),e},entryHeaderToBinary:function(){var n=t.alloc(i.CENHDR+f+d+h);return n.writeUInt32LE(i.CENSIG,0),n.writeUInt16LE(e,i.CENVEM),n.writeUInt16LE(r,i.CENVER),n.writeUInt16LE(o,i.CENFLG),n.writeUInt16LE(a,i.CENHOW),n.writeUInt32LE(s,i.CENTIM),n.writeUInt32LE(u,i.CENCRC),n.writeUInt32LE(c,i.CENSIZ),n.writeUInt32LE(l,i.CENLEN),n.writeUInt16LE(f,i.CENNAM),n.writeUInt16LE(d,i.CENEXT),n.writeUInt16LE(h,i.CENCOM),n.writeUInt16LE(p,i.CENDSK),n.writeUInt16LE(g,i.CENATT),n.writeUInt32LE(m,i.CENATX),n.writeUInt32LE(y,i.CENOFF),n.fill(0,i.CENHDR),n},toJSON:function(){const t=function(e){return e+" bytes"};return{made:e,version:r,flags:o,method:n.methodToString(a),time:this.time,crc:"0x"+u.toString(16).toUpperCase(),compressedSize:t(c),size:t(l),fileNameLength:t(f),extraLength:t(d),commentLength:t(h),diskNumStart:p,inAttr:g,attr:m,offset:y,entryHeaderSize:t(i.CENHDR+f+d+h)}},toString:function(){return JSON.stringify(this.toJSON(),null,"\t")}}}}).call(this,r(10).Buffer)},function(e,t,r){(function(t){var n=r(106),i=n.Constants;e.exports=function(){var e=0,r=0,o=0,a=0,s=0;return{get diskEntries(){return e},set diskEntries(t){e=r=t},get totalEntries(){return r},set totalEntries(t){r=e=t},get size(){return o},set size(e){o=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(t){if((t.length!==i.ENDHDR||t.readUInt32LE(0)!==i.ENDSIG)&&(t.length<i.ZIP64HDR||t.readUInt32LE(0)!==i.ZIP64SIG))throw new Error(n.Errors.INVALID_END);t.readUInt32LE(0)===i.ENDSIG?(e=t.readUInt16LE(i.ENDSUB),r=t.readUInt16LE(i.ENDTOT),o=t.readUInt32LE(i.ENDSIZ),a=t.readUInt32LE(i.ENDOFF),s=t.readUInt16LE(i.ENDCOM)):(e=n.readBigUInt64LE(t,i.ZIP64SUB),r=n.readBigUInt64LE(t,i.ZIP64TOT),o=n.readBigUInt64LE(t,i.ZIP64SIZ),a=n.readBigUInt64LE(t,i.ZIP64OFF),s=0)},toBinary:function(){var n=t.alloc(i.ENDHDR+s);return n.writeUInt32LE(i.ENDSIG,0),n.writeUInt32LE(0,4),n.writeUInt16LE(e,i.ENDSUB),n.writeUInt16LE(r,i.ENDTOT),n.writeUInt32LE(o,i.ENDSIZ),n.writeUInt32LE(a,i.ENDOFF),n.writeUInt16LE(s,i.ENDCOM),n.fill(" ",i.ENDHDR),n},toJSON:function(){return{diskEntries:e,totalEntries:r,size:o+" bytes",offset:function(e,t){let r=e.toString(16).toUpperCase();for(;r.length<t;)r="0"+r;return"0x"+r}(a,4),commentLength:s}},toString:function(){return JSON.stringify(this.toJSON(),null,"\t")}}}}).call(this,r(10).Buffer)},function(e,t,r){t.Deflater=r(478),t.Inflater=r(479),t.ZipCrypto=r(480)},function(e,t,r){(function(t){e.exports=function(e){var n=r(120),i={chunkSize:1024*(parseInt(e.length/1024)+1)};return{deflate:function(){return n.deflateRawSync(e,i)},deflateAsync:function(r){var o=n.createDeflateRaw(i),a=[],s=0;o.on("data",(function(e){a.push(e),s+=e.length})),o.on("end",(function(){var e=t.alloc(s),n=0;e.fill(0);for(var i=0;i<a.length;i++){var o=a[i];o.copy(e,n),n+=o.length}r&&r(e)})),o.end(e)}}}}).call(this,r(10).Buffer)},function(e,t,r){(function(t){e.exports=function(e){var n=r(120);return{inflate:function(){return n.inflateRawSync(e)},inflateAsync:function(r){var i=n.createInflateRaw(),o=[],a=0;i.on("data",(function(e){o.push(e),a+=e.length})),i.on("end",(function(){var e=t.alloc(a),n=0;e.fill(0);for(var i=0;i<o.length;i++){var s=o[i];s.copy(e,n),n+=s.length}r&&r(e)})),i.end(e)}}}}).call(this,r(10).Buffer)},function(e,t,r){"use strict";(function(t){const n=r(190).randomFillSync,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}),o=(e,t)=>Math.imul(e,t)>>>0,a=(e,t)=>i[255&(e^t)]^e>>>8,s=()=>"function"==typeof n?n(t.alloc(12)):s.node();s.node=()=>{const e=t.alloc(12),r=e.length;for(let t=0;t<r;t++)e[t]=256*Math.random()&255;return e};const u={genSalt:s};function c(e){const r=t.isBuffer(e)?e:t.from(e);this.keys=new Uint32Array([305419896,591751049,878082192]);for(let e=0;e<r.length;e++)this.updateKeys(r[e])}c.prototype.updateKeys=function(e){const t=this.keys;return t[0]=a(t[0],e),t[1]+=255&t[0],t[1]=o(t[1],134775813)+1,t[2]=a(t[2],t[1]>>>24),e},c.prototype.next=function(){const e=(2|this.keys[2])>>>0;return o(e,1^e)>>8&255},e.exports={decrypt:function(e,r,n){if(!e||!t.isBuffer(e)||e.length<12)return t.alloc(0);const i=function(e){const r=new c(e);return function(e){const n=t.alloc(e.length);let i=0;for(let t of e)n[i++]=r.updateKeys(t^r.next());return n}}(n);if(i(e.slice(0,12))[11]!==r.crc>>>24)throw"ADM-ZIP: Wrong Password";return i(e.slice(12))},encrypt:function(e,r,n,i=!1){null==e&&(e=t.alloc(0)),t.isBuffer(e)||(e=t.from(e.toString()));const o=function(e){const r=new c(e);return function(e,n,i=0){n||(n=t.alloc(e.length));for(let t of e){const e=r.next();n[i++]=t^e,r.updateKeys(t)}return n}}(n),a=u.genSalt();a[11]=r.crc>>>24&255,i&&(a[10]=r.crc>>>16&255);const s=t.alloc(e.length+12);return o(a,s),o(e,s,12)},_salter:function(e){t.isBuffer(e)&&e.length>=12?u.genSalt=function(){return e.slice(0,12)}:u.genSalt="node"===e?s.node:s}}}).call(this,r(10).Buffer)},function(e,t,r){(function(t){const n=r(269),i=r(270),o=r(106);e.exports=function(e,r){var a=[],s={},u=t.alloc(0),c=new i.MainHeader,l=!1;const f=Object.assign(Object.create(null),r),d=f.noSort;function h(){l=!0,s={},a=new Array(c.diskEntries);for(var t=c.offset,r=0;r<a.length;r++){var i=t,u=new n(e);u.header=e.slice(i,i+=o.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,a[r]=u,s[u.entryName]=u}}function p(){a.length>1&&!d&&a.sort((e,t)=>e.entryName.toLowerCase().localeCompare(t.entryName.toLowerCase()))}return e?function(t){var r=e.length-o.Constants.ENDHDR,n=Math.max(0,r-65535),i=n,a=e.length,s=-1,l=0;for(;r>=i;r--)if(80===e[r])if(e.readUInt32LE(r)!==o.Constants.ENDSIG)if(e.readUInt32LE(r)!==o.Constants.END64SIG){if(e.readUInt32LE(r)===o.Constants.ZIP64SIG){s=r,a=r+o.readBigUInt64LE(e,r+o.Constants.ZIP64SIZE)+o.Constants.ZIP64LEAD;break}}else i=n;else s=r,l=r,a=r+o.Constants.ENDHDR,i=r-o.Constants.END64HDR;if(!~s)throw new Error(o.Errors.INVALID_FORMAT);c.loadFromBinary(e.slice(s,a)),c.commentLength&&(u=e.slice(l+o.Constants.ENDHDR));t&&h()}(f.readEntries):l=!0,{get entries(){return l||h(),a},get comment(){return u.toString()},set comment(e){u=o.toBuffer(e),c.commentLength=u.length},getEntryCount:function(){return l?a.length:c.diskEntries},forEach:function(t){l?a.forEach(t):function(t){const r=c.diskEntries;let i=c.offset;for(let a=0;a<r;a++){let r=i;const a=new n(e);a.header=e.slice(r,r+=o.Constants.CENHDR),a.entryName=e.slice(r,r+=a.header.fileNameLength),i+=a.header.entryHeaderSize,t(a)}}(t)},getEntry:function(e){return l||h(),s[e]||null},setEntry:function(e){l||h(),a.push(e),s[e.entryName]=e,c.totalEntries=a.length},deleteEntry:function(e){l||h();var t=s[e];if(t&&t.isDirectory){var r=this;this.getEntryChildren(t).forEach((function(t){t.entryName!==e&&r.deleteEntry(t.entryName)}))}a.splice(a.indexOf(t),1),delete s[e],c.totalEntries=a.length},getEntryChildren:function(e){if(l||h(),e&&e.isDirectory){const t=[],r=e.entryName,n=r.length;return a.forEach((function(e){e.entryName.substr(0,n)===r&&t.push(e)})),t}return[]},compressToBuffer:function(){l||h(),p();const e=[],r=[];let n=0,i=0;c.size=0,c.offset=0;for(const o of a){const a=o.getCompressedData();o.header.offset=i;const s=o.header.dataHeaderToBinary(),u=o.rawEntryName.length,l=t.alloc(u+o.extra.length);o.rawEntryName.copy(l,0),l.copy(o.extra,u);const f=s.length+l.length+a.length;i+=f,e.push(s),e.push(l),e.push(a);const d=o.packHeader();r.push(d),c.size+=d.length,n+=f+d.length}n+=c.mainHeaderSize,c.offset=i,i=0;const s=t.alloc(n);for(const t of e)t.copy(s,i),i+=t.length;for(const e of r)e.copy(s,i),i+=e.length;const f=c.toBinary();return u&&u.copy(f,o.Constants.ENDHDR),f.copy(s,i),s},toAsyncBuffer:function(e,r,n,i){try{l||h(),p();const r=[],s=[];let f=0,d=0;c.size=0,c.offset=0;const g=function(a){if(a.length){const e=a.pop(),o=e.entryName+e.extra.toString();n&&n(o),e.getCompressedDataAsync((function(n){i&&i(o),e.header.offset=d;const u=e.header.dataHeaderToBinary(),l=t.alloc(o.length,o),h=u.length+l.length+n.length;d+=h,r.push(u),r.push(l),r.push(n);const p=e.packHeader();s.push(p),c.size+=p.length,f+=h+p.length,g(a)}))}else{f+=c.mainHeaderSize,c.offset=d,d=0;const n=t.alloc(f);r.forEach((function(e){e.copy(n,d),d+=e.length})),s.forEach((function(e){e.copy(n,d),d+=e.length}));const i=c.toBinary();u&&u.copy(i,o.Constants.ENDHDR),i.copy(n,d),e(n)}};g(a)}catch(e){r(e)}}}}}).call(this,r(10).Buffer)},function(e,t){function r(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 n(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class o{constructor(e){this.state=n({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 o(n(n({},this.state),{},{filterExpressions:[...this.state.filterExpressions,e]}))}unfilter(e){let t=new Set(e);return new o(n(n({},this.state),{},{filterExpressions:this.state.filterExpressions.filter(e=>!t.has(Object.keys(e)[0]))}))}select(e=[]){Array.isArray(e)||(e=[e]);let t=new o(n(n({},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 o(n(n({},this.state),{},{groupExpressions:[...this.state.groupExpressions,...e]}))}orderBy(e){return Array.isArray(e)||(e=[e]),new o(n(n({},this.state),{},{orderExpressions:[...this.state.orderExpressions,...e]}))}limit(e){return new o(n(n({},this.state),{},{limit:e}))}offset(e){return new o(n(n({},this.state),{},{offset:e}))}raw(){return new o(n(n({},this.state),{},{rawMode:!0}))}withDead(){return new o(n(n({},this.state),{},{withDead:!0}))}withoutValidatedRefs(){return new o(n(n({},this.state),{},{validateRefs:!1}))}options(e){return new o(n(n({},this.state),{},{tableOptions:e}))}serialize(){return this.state}}e.exports=function(e){return new o({table:e})}},function(e,t){e.exports={amountToInteger:function(e){return 0|Math.round(100*e)},integerToAmount:function(e){return parseFloat((e/100).toFixed(2))}}},function(e,t,r){r(64);const n=r(119),i=r(271);r(485).amountToInteger;function o(e){return Math.round(e/10)}function a(e){let t=e.split("-");return t[0]+"-"+t[1]}function s(e){switch(e){case"cash":case"checking":return"checking";case"creditCard":case"lineOfCredit":return"credit";case"savings":return"savings";case"investmentAccount":return"investment";case"mortgage":return"mortgage";default:return"other"}}function u(e,t){return e.reduce((function(e,r){var n=r[t];return e.hasOwnProperty(n)||(e[n]=[]),e[n].push(r),e}),{})}async function c(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 i.createAccount({type:s(e.type),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 i.getCategories()).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 a=await i.createCategoryGroup({name:n.name,is_income:!1});t.set(n.id,a)}let s=e.categories.filter(e=>e.category_group_id===n.id);for(let e of s.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=a;let r=await i.createCategory(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 i.createPayee({name:e.name});t.set(e.id,r)}}))}(e,t),console.log("Importing Transactions..."),await async function(e,t){const r=await i.getPayees(),a=await i.getCategories(),s=a.find(e=>"Income"===e.name).id,c=a.find(e=>"Starting Balances"===e.name).id,l=e.payees.find(e=>"Starting Balance"===e.name).id;let f=u(e.transactions,"account_id"),d=u(e.subtransactions,"transaction_id");for(let r of e.transactions)t.set(r.id,n.v4());await Promise.all(Object.keys(f).map(async e=>{let n=f[e].map(e=>{if(e.deleted)return null;let n=d[e.id];n&&(n=n.map(e=>({amount:o(e.amount),category:t.get(e.category_id)||null,notes:e.memo})));let i={id:t.get(e.id),account:t.get(e.account_id),date:e.date,amount:o(e.amount),category:t.get(e.category_id)||null,cleared:["cleared","reconciled"].includes(e.cleared),notes:e.memo||null,imported_id:e.import_id||null,transfer_id:t.get(e.transfer_transaction_id)||null,subtransactions:n};return e.transfer_account_id?i.payee=r.find(r=>r.transfer_acct===t.get(e.transfer_account_id)).id:i.payee=t.get(e.payee_id),e.payee_id===l&&t.get(e.category_id)===s&&(i.category=c,i.payee=null),i}).filter(e=>e);await i.addTransactions(t.get(e),n)}))}(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.batchBudgetUpdates(async()=>{for(let e of r){let r=a(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 i.setBudgetAmount(r,n,o)}))}})}(e,t),console.log("Setting up...")}e.exports={importYNAB5:async function(e){return e.data&&(e=e.data),i.runImport(e.budget.name,()=>c(e.budget))}}},function(e,t){e.exports={amountToInteger:function(e){return 0|Math.round(100*e)},integerToAmount:function(e){return parseFloat((e/100).toFixed(2))}}}]);
//# sourceMappingURL=kcab.worker.b16816d5632f095a8a84.js.map