diff --git a/README.md b/README.md
index b38c157..de54423 100644
--- a/README.md
+++ b/README.md
@@ -28,11 +28,15 @@ https://forevermatt.github.io/svelte-budget/
a mouse
- [x] Autofocus the appropriate input (where applicable) on arrival at each
page
-- [ ] Allow adding a comment/note on each transaction
+- [x] Allow adding a comment/note on each transaction
- [ ] Handle page reloads in the middle of the add-expense process (which
loses the timestamp, for example)
- [ ] Add a data-breadcrumb trail as they enter data for a new transaction
- [x] Setup collaborator
+- [ ] Synchronize data between devices/browsers
+- [ ] Auto-refill categories each month
+- [ ] Enable adding category during new-transaction workflow
+- [ ] Enable adding account during new-transaction workflow
- [ ] ...
## Data Structure
diff --git a/assets/bundle.js b/assets/bundle.js
index 752b7cf..944cdb0 100644
--- a/assets/bundle.js
+++ b/assets/bundle.js
@@ -1 +1 @@
-var app=function(){"use strict";function t(){}function n(t,n){for(const e in n)t[e]=n[e];return t}function e(t){return t()}function r(){return Object.create(null)}function o(t){t.forEach(e)}function c(t){return"function"==typeof t}function s(t,n){return t!=t?n==n:t!==n||t&&"object"==typeof t||"function"==typeof t}function a(n,...e){if(null==n)return t;const r=n.subscribe(...e);return r.unsubscribe?()=>r.unsubscribe():r}function u(t){let n;return a(t,t=>n=t)(),n}function i(t,n,e){t.$$.on_destroy.push(a(n,e))}function l(t,n,e,r){if(t){const o=f(t,n,e,r);return t[0](o)}}function f(t,e,r,o){return t[1]&&o?n(r.ctx.slice(),t[1](o(e))):r.ctx}function $(t,n,e,r,o,c,s){const a=function(t,n,e,r){if(t[2]&&r){const o=t[2](r(e));if(void 0===n.dirty)return o;if("object"==typeof o){const t=[],e=Math.max(n.dirty.length,o.length);for(let r=0;rt.removeEventListener(n,e,r)}function A(t){return function(n){return n.preventDefault(),t.call(this,n)}}function L(t,n,e){null==e?t.removeAttribute(n):t.getAttribute(n)!==e&&t.setAttribute(n,e)}function C(t,n){n=""+n,t.wholeText!==n&&(t.data=n)}function N(t,n){t.value=null==n?"":n}function _(t,n,e,r){t.style.setProperty(n,e,r?"important":"")}function M(t,n,e){t.classList[e?"add":"remove"](n)}let j;function O(t){j=t}function S(){if(!j)throw new Error("Function called outside component initialization");return j}function D(t){S().$$.on_mount.push(t)}function z(){const t=S();return(n,e)=>{const r=t.$$.callbacks[n];if(r){const o=function(t,n){const e=document.createEvent("CustomEvent");return e.initCustomEvent(t,!1,!1,n),e}(n,e);r.slice().forEach(n=>{n.call(t,o)})}}}function H(t,n){const e=t.$$.callbacks[n.type];e&&e.slice().forEach(t=>t(n))}const T=[],V=[],P=[],R=[],I=Promise.resolve();let B=!1;function F(){B||(B=!0,I.then(G))}function q(){return F(),I}function U(t){P.push(t)}function Y(t){R.push(t)}let J=!1;const W=new Set;function G(){if(!J){J=!0;do{for(let t=0;t{Q.delete(t),r&&(e&&t.d(1),r())}),t.o(n)}}function rt(t,n){t.d(1),n.delete(t.key)}function ot(t,n,e,r,o,c,s,a,u,i,l,f){let $=t.length,p=c.length,m=$;const d={};for(;m--;)d[t[m].key]=m;const g=[],h=new Map,y=new Map;for(m=p;m--;){const t=f(o,c,m),a=e(t);let u=s.get(a);u?r&&u.p(t,n):(u=i(a,t),u.c()),h.set(a,g[m]=u),a in d&&y.set(a,Math.abs(m-d[a]))}const b=new Set,w=new Set;function x(t){nt(t,1),t.m(a,l),s.set(t.key,t),l=t.first,p--}for(;$&&p;){const n=g[p-1],e=t[$-1],r=n.key,o=e.key;n===e?(l=n.first,$--,p--):h.has(o)?!s.has(r)||b.has(r)?x(n):w.has(o)?$--:y.get(r)>y.get(o)?(w.add(r),x(n)):(b.add(o),$--):(u(e,s),$--)}for(;$--;){const n=t[$];h.has(n.key)||u(n,s)}for(;p;)x(g[p-1]);return g}function ct(t,n,e){const r=t.$$.props[n];void 0!==r&&(t.$$.bound[r]=e,e(t.$$.ctx[r]))}function st(t){t&&t.c()}function at(t,n,r){const{fragment:s,on_mount:a,on_destroy:u,after_update:i}=t.$$;s&&s.m(n,r),U(()=>{const n=a.map(e).filter(c);u?u.push(...n):o(n),t.$$.on_mount=[]}),i.forEach(U)}function ut(t,n){const e=t.$$;null!==e.fragment&&(o(e.on_destroy),e.fragment&&e.fragment.d(n),e.on_destroy=e.fragment=null,e.ctx=[])}function it(n,e,c,s,a,u,i=[-1]){const l=j;O(n);const f=e.props||{},$=n.$$={fragment:null,ctx:null,props:u,update:t,not_equal:a,bound:r(),on_mount:[],on_destroy:[],before_update:[],after_update:[],context:new Map(l?l.$$.context:[]),callbacks:r(),dirty:i,skip_bound:!1};let p=!1;if($.ctx=c?c(n,f,(t,e,...r)=>{const o=r.length?r[0]:e;return $.ctx&&a($.ctx[t],$.ctx[t]=o)&&(!$.skip_bound&&$.bound[t]&&$.bound[t](o),p&&function(t,n){-1===t.$$.dirty[0]&&(T.push(t),F(),t.$$.dirty.fill(0)),t.$$.dirty[n/31|0]|=1<{const t=e.indexOf(n);-1!==t&&e.splice(t,1)}}$set(t){var n;this.$$set&&(n=t,0!==Object.keys(n).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const ft=(t,n)=>{n.update(n=>[t,...n])},$t=(t,n,e,r)=>{r.update(r=>{const o=r.find(e=>e[t]===n),c=Object.assign({},o,e);let s=!1;for(let e=0;e{const n=dt(t);return pt(n)?n:[]},dt=t=>{const n=localStorage.getItem(t);return JSON.parse(n)},gt=(t,n)=>{localStorage.setItem(t,JSON.stringify(n))},ht=[];function yt(t,n){return{subscribe:bt(t,n).subscribe}}function bt(n,e=t){let r;const o=[];function c(t){if(s(n,t)&&(n=t,r)){const t=!ht.length;for(let t=0;t{const t=o.indexOf(u);-1!==t&&o.splice(t,1),0===o.length&&(r(),r=null)}}}}function wt(n,e,r){const s=!Array.isArray(n),u=s?[n]:n,i=e.length<2;return yt(r,n=>{let r=!1;const l=[];let f=0,$=t;const p=()=>{if(f)return;$();const r=e(s?l[0]:l,n);i?n(r):$=c(r)?r:t},m=u.map((t,n)=>a(t,t=>{l[n]=t,f&=~(1<{f|=1<Ct.set("");function _t(t){let n,e,r,o,c,s;return{c(){n=b("div"),e=b("button"),e.innerHTML='×',r=v(),o=x(t[0]),L(e,"type","button"),L(e,"class","close"),L(e,"aria-label","Close"),L(n,"class","alert alert-danger keep-line-breaks svelte-1anyckn"),L(n,"role","alert")},m(t,a){g(t,n,a),d(n,e),d(n,r),d(n,o),c||(s=E(e,"click",Nt),c=!0)},p(t,n){1&n&&C(o,t[0])},d(t){t&&h(n),c=!1,s()}}}function Mt(n){let e,r=n[0]&&_t(n);return{c(){r&&r.c(),e=k()},m(t,n){r&&r.m(t,n),g(t,e,n)},p(t,[n]){t[0]?r?r.p(t,n):(r=_t(t),r.c(),r.m(e.parentNode,e)):r&&(r.d(1),r=null)},i:t,o:t,d(t){r&&r.d(t),t&&h(e)}}}function jt(t,n,e){let r;return i(t,Ct,t=>e(0,r=t)),[r]}window.onunhandledrejection=t=>{let n=t.reason;Ct.set(n.message)};class Ot extends lt{constructor(t){super(),it(this,t,jt,Mt,s,{})}}const St=bt([]),Dt=()=>gt("accounts",u(St)),zt=bt([]),Ht=(t,n)=>n.find(n=>n.uuid===t)||{},Tt=()=>gt("categories",u(zt)),Vt=t=>new Date(t).toLocaleDateString(),Pt=t=>{if(t){let n=new Date(t);const e=n.getFullYear(),r=n.getMonth()+1,o=n.getDate();return`${e}-${String(r).padStart(2,"0")}-${String(o).padStart(2,"0")}`}return""},Rt=(t,n)=>{var e=n.getFullYear(),r=n.getMonth(),o=new Date(e,r-t),c=o.getFullYear(),s=o.getMonth()+1;return c+"-"+String("0"+s).slice(-2)},It=bt({}),Bt=t=>u(It)[t]||{},Ft=t=>Bt(t).budgeted||0,qt=()=>{It.set((t=>{const n=dt(t);return null!==n?n:{}})("budget"))},Ut=(t,n)=>{u(It);(t=>u(It).hasOwnProperty(t))(t)?Wt(t,n):((t,n)=>{Jt(t,{budgeted:n,remaining:n,refilled:Rt(0,new Date)})})(t,n)},Yt=(t,n)=>{const e=Bt(t).remaining||0;Jt(t,{remaining:e-n})},Jt=(t,n)=>{((t,n,e)=>{e.update(e=>(e.hasOwnProperty(t)?e[t]=Object.assign(e[t],n):e[t]=n,e))})(t,n,It),gt("budget",u(It))},Wt=(t,n)=>{let e=u(It)[t],r=e.budgeted,o=e.remaining;Jt(t,{budgeted:n,remaining:o+(n-r)})},Gt=bt([]),Kt=bt({}),Qt=t=>{const n=Object.assign({},t);Kt.set(n)},Xt=t=>u(Gt).filter(n=>n.accountUuid===t),Zt=t=>u(Gt).filter(n=>(n.categoryAmounts||{}).hasOwnProperty(t)),tn=()=>gt("transactions",u(Gt)),nn=t=>{const n=u(Kt),e=Object.assign({},n,t);Kt.set(e)};function en(t){let n,e,r;var o=t[0];return o&&(n=new o({}),n.$on("routeEvent",t[5])),{c(){n&&st(n.$$.fragment),e=k()},m(t,o){n&&at(n,t,o),g(t,e,o),r=!0},p(t,r){if(o!==(o=t[0])){if(n){Z();const t=n;et(t.$$.fragment,1,0,()=>{ut(t,1)}),tt()}o?(n=new o({}),n.$on("routeEvent",t[5]),st(n.$$.fragment),nt(n.$$.fragment,1),at(n,e.parentNode,e)):n=null}},i(t){r||(n&&nt(n.$$.fragment,t),r=!0)},o(t){n&&et(n.$$.fragment,t),r=!1},d(t){t&&h(e),n&&ut(n,t)}}}function rn(t){let n,e,r;var o=t[0];function c(t){return{props:{params:t[1]}}}return o&&(n=new o(c(t)),n.$on("routeEvent",t[4])),{c(){n&&st(n.$$.fragment),e=k()},m(t,o){n&&at(n,t,o),g(t,e,o),r=!0},p(t,r){const s={};if(2&r&&(s.params=t[1]),o!==(o=t[0])){if(n){Z();const t=n;et(t.$$.fragment,1,0,()=>{ut(t,1)}),tt()}o?(n=new o(c(t)),n.$on("routeEvent",t[4]),st(n.$$.fragment),nt(n.$$.fragment,1),at(n,e.parentNode,e)):n=null}else o&&n.$set(s)},i(t){r||(n&&nt(n.$$.fragment,t),r=!0)},o(t){n&&et(n.$$.fragment,t),r=!1},d(t){t&&h(e),n&&ut(n,t)}}}function on(t){let n,e,r,o;const c=[rn,en],s=[];function a(t,n){return t[1]?0:1}return n=a(t),e=s[n]=c[n](t),{c(){e.c(),r=k()},m(t,e){s[n].m(t,e),g(t,r,e),o=!0},p(t,[o]){let u=n;n=a(t),n===u?s[n].p(t,o):(Z(),et(s[u],1,1,()=>{s[u]=null}),tt(),e=s[n],e||(e=s[n]=c[n](t),e.c()),nt(e,1),e.m(r.parentNode,r))},i(t){o||(nt(e),o=!0)},o(t){et(e),o=!1},d(t){s[n].d(t),t&&h(r)}}}function cn(){const t=window.location.href.indexOf("#/");let n=t>-1?window.location.href.substr(t+1):"/";const e=n.indexOf("?");let r="";return e>-1&&(r=n.substr(e+1),n=n.substr(0,e)),{location:n,querystring:r}}const sn=yt(null,(function(t){t(cn());const n=()=>{t(cn())};return window.addEventListener("hashchange",n,!1),function(){window.removeEventListener("hashchange",n,!1)}}));wt(sn,t=>t.location),wt(sn,t=>t.querystring);function an(t){if(!t||t.length<1||"/"!=t.charAt(0)&&0!==t.indexOf("#/"))throw Error("Invalid parameter location");return q().then(()=>{window.location.hash=("#"==t.charAt(0)?"":"#")+t})}function un(n,e,r){let o,c=t;i(n,sn,t=>r(6,o=t)),n.$$.on_destroy.push(()=>c());let{routes:s={}}=e,{prefix:a=""}=e;class u{constructor(t,n){if(!n||"function"!=typeof n&&("object"!=typeof n||!0!==n._sveltesparouter))throw Error("Invalid component object");if(!t||"string"==typeof t&&(t.length<1||"/"!=t.charAt(0)&&"*"!=t.charAt(0))||"object"==typeof t&&!(t instanceof RegExp))throw Error('Invalid value for "path" argument');const{pattern:e,keys:r}=function(t,n){if(t instanceof RegExp)return{keys:!1,pattern:t};var e,r,o,c,s=[],a="",u=t.split("/");for(u[0]||u.shift();o=u.shift();)"*"===(e=o[0])?(s.push("wild"),a+="/(.*)"):":"===e?(r=o.indexOf("?",1),c=o.indexOf(".",1),s.push(o.substring(1,~r?r:~c?c:o.length)),a+=~r&&!~c?"(?:/([^/]+?))?":"/([^/]+?)",~c&&(a+=(~r?"?":"")+"\\"+o.substring(c))):a+="/"+o;return{keys:s,pattern:new RegExp("^"+a+(n?"(?=$|/)":"/?$"),"i")}}(t);this.path=t,"object"==typeof n&&!0===n._sveltesparouter?(this.component=n.route,this.conditions=n.conditions||[],this.userData=n.userData):(this.component=n,this.conditions=[],this.userData=void 0),this._pattern=e,this._keys=r}match(t){a&&t.startsWith(a)&&(t=t.substr(a.length)||"/");const n=this._pattern.exec(t);if(null===n)return null;if(!1===this._keys)return n;const e={};let r=0;for(;r{l.push(new u(n,t))}):Object.keys(s).forEach(t=>{l.push(new u(t,s[t]))});let f=null,$=null;const p=z(),m=(t,n)=>{q().then(()=>{p(t,n)})};return n.$$set=t=>{"routes"in t&&r(2,s=t.routes),"prefix"in t&&r(3,a=t.prefix)},n.$$.update=()=>{if(65&n.$$.dirty){r(0,f=null);let t=0;for(;!f&&t{"autofocusElement"in t&&e(0,c=t.autofocusElement),"$$scope"in t&&e(1,o=t.$$scope)},t.$$.update=()=>{1&t.$$.dirty&&c.focus&&c.focus()},[c,o,r,function(n){H(t,n)}]}class pn extends lt{constructor(t){super(),it(this,t,$n,fn,s,{autofocusElement:0})}}function mn(t){let n,e,r;return{c(){n=b("input"),L(n,"class","form-control"),L(n,"placeholder","New account name")},m(o,c){g(o,n,c),N(n,t[0]),t[4](n),e||(r=E(n,"input",t[3]),e=!0)},p(t,e){1&e&&n.value!==t[0]&&N(n,t[0])},d(o){o&&h(n),t[4](null),e=!1,r()}}}function dn(t){let n,e,r,o;return r=new pn({props:{autofocusElement:t[1],$$slots:{default:[mn]},$$scope:{ctx:t}}}),r.$on("submit",t[2]),{c(){n=b("h2"),n.textContent="New Account",e=v(),st(r.$$.fragment)},m(t,c){g(t,n,c),g(t,e,c),at(r,t,c),o=!0},p(t,[n]){const e={};2&n&&(e.autofocusElement=t[1]),35&n&&(e.$$scope={dirty:n,ctx:t}),r.$set(e)},i(t){o||(nt(r.$$.fragment,t),o=!0)},o(t){et(r.$$.fragment,t),o=!1},d(t){t&&h(n),t&&h(e),ut(r,t)}}}function gn(t,n,e){let r="",o={};return[r,o,function(){(t=>{const n={uuid:Lt(),name:t};ft(n,St),Dt()})(r),an("/accounts")},function(){r=this.value,e(0,r)},function(t){V[t?"unshift":"push"](()=>{o=t,e(1,o)})}]}function hn(n){let e,r,o;return{c(){e=w("svg"),r=w("path"),L(r,"fill","currentColor"),L(r,"d",n[0]),L(e,"aria-hidden","true"),L(e,"class",o=m(n[1])+" svelte-1d15yci"),L(e,"role","img"),L(e,"xmlns","http://www.w3.org/2000/svg"),L(e,"viewBox",n[2])},m(t,n){g(t,e,n),d(e,r)},p(t,[n]){1&n&&L(r,"d",t[0]),2&n&&o!==(o=m(t[1])+" svelte-1d15yci")&&L(e,"class",o),4&n&&L(e,"viewBox",t[2])},i:t,o:t,d(t){t&&h(e)}}}function yn(t,e,r){let{icon:o}=e,c=[],s="",a="";return t.$$set=t=>{r(4,e=n(n({},e),p(t))),"icon"in t&&r(3,o=t.icon)},t.$$.update=()=>{8&t.$$.dirty&&r(2,a="0 0 "+o.icon[0]+" "+o.icon[1]),r(1,s="fa-svelte "+(e.class?e.class:"")),8&t.$$.dirty&&r(0,c=o.icon[4])},e=p(e),[c,s,a,o]}class bn extends lt{constructor(t){super(),it(this,t,yn,hn,s,{icon:3})}}function wn(t){let n,e,r;return n=new bn({props:{icon:t[0]}}),{c(){st(n.$$.fragment),e=v()},m(t,o){at(n,t,o),g(t,e,o),r=!0},p(t,e){const r={};1&e&&(r.icon=t[0]),n.$set(r)},i(t){r||(nt(n.$$.fragment,t),r=!0)},o(t){et(n.$$.fragment,t),r=!1},d(t){ut(n,t),t&&h(e)}}}function xn(t){let n,e,r,o,c,s,a,u,i,l,f,$,p=t[0]&&wn(t);return{c(){n=b("a"),e=b("span"),p&&p.c(),r=b("br"),o=v(),c=b("br"),s=v(),a=x(t[1]),L(e,"class","button-circle svelte-2b5sup"),L(n,"id",u="button-"+t[1]),L(n,"class","btn svelte-2b5sup"),L(n,"href",i=t[3]||"javascript:void(0)"),L(n,"role","button"),M(n,"float-left",t[2])},m(u,i){g(u,n,i),d(n,e),p&&p.m(e,null),d(e,r),d(e,o),d(n,c),d(n,s),d(n,a),l=!0,f||($=E(n,"click",t[4]),f=!0)},p(t,[o]){t[0]?p?(p.p(t,o),1&o&&nt(p,1)):(p=wn(t),p.c(),nt(p,1),p.m(e,r)):p&&(Z(),et(p,1,1,()=>{p=null}),tt()),(!l||2&o)&&C(a,t[1]),(!l||2&o&&u!==(u="button-"+t[1]))&&L(n,"id",u),(!l||8&o&&i!==(i=t[3]||"javascript:void(0)"))&&L(n,"href",i),4&o&&M(n,"float-left",t[2])},i(t){l||(nt(p),l=!0)},o(t){et(p),l=!1},d(t){t&&h(n),p&&p.d(),f=!1,$()}}}function vn(t,n,e){let{icon:r}=n,{name:o}=n,{left:c=!1}=n,{url:s=""}=n;return t.$$set=t=>{"icon"in t&&e(0,r=t.icon),"name"in t&&e(1,o=t.name),"left"in t&&e(2,c=t.left),"url"in t&&e(3,s=t.url)},[r,o,c,s,function(n){H(t,n)}]}class kn extends lt{constructor(t){super(),it(this,t,vn,xn,s,{icon:0,name:1,left:2,url:3})}}function En(t){let n,e,r,o,c,s;const a=t[1].default,u=l(a,t,t[0],null);return{c(){n=b("div"),e=v(),r=b("div"),u&&u.c(),o=v(),c=b("div"),L(n,"id","button-row-spacer"),L(n,"class","svelte-17rvsyv"),L(c,"class","clearfix"),L(r,"id","button-row"),L(r,"class","svelte-17rvsyv")},m(t,a){g(t,n,a),g(t,e,a),g(t,r,a),u&&u.m(r,null),d(r,o),d(r,c),s=!0},p(t,[n]){u&&u.p&&1&n&&$(u,a,t,t[0],n,null,null)},i(t){s||(nt(u,t),s=!0)},o(t){et(u,t),s=!1},d(t){t&&h(n),t&&h(e),t&&h(r),u&&u.d(t)}}}function An(t,n,e){let{$$slots:r={},$$scope:o}=n;return t.$$set=t=>{"$$scope"in t&&e(0,o=t.$$scope)},[o,r]}class Ln extends lt{constructor(t){super(),it(this,t,An,En,s,{})}}var Cn={prefix:"fas",iconName:"arrow-right",icon:[448,512,[],"f061","M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z"]},Nn={prefix:"fas",iconName:"check",icon:[512,512,[],"f00c","M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"]},_n={prefix:"fas",iconName:"edit",icon:[576,512,[],"f044","M402.6 83.2l90.2 90.2c3.8 3.8 3.8 10 0 13.8L274.4 405.6l-92.8 10.3c-12.4 1.4-22.9-9.1-21.5-21.5l10.3-92.8L388.8 83.2c3.8-3.8 10-3.8 13.8 0zm162-22.9l-48.8-48.8c-15.2-15.2-39.9-15.2-55.2 0l-35.4 35.4c-3.8 3.8-3.8 10 0 13.8l90.2 90.2c3.8 3.8 10 3.8 13.8 0l35.4-35.4c15.2-15.3 15.2-40 0-55.2zM384 346.2V448H64V128h229.8c3.2 0 6.2-1.3 8.5-3.5l40-40c7.6-7.6 2.2-20.5-8.5-20.5H48C21.5 64 0 85.5 0 112v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V306.2c0-10.7-12.9-16-20.5-8.5l-40 40c-2.2 2.3-3.5 5.3-3.5 8.5z"]},Mn={prefix:"fas",iconName:"home",icon:[576,512,[],"f015","M280.37 148.26L96 300.11V464a16 16 0 0 0 16 16l112.06-.29a16 16 0 0 0 15.92-16V368a16 16 0 0 1 16-16h64a16 16 0 0 1 16 16v95.64a16 16 0 0 0 16 16.05L464 480a16 16 0 0 0 16-16V300L295.67 148.26a12.19 12.19 0 0 0-15.3 0zM571.6 251.47L488 182.56V44.05a12 12 0 0 0-12-12h-56a12 12 0 0 0-12 12v72.61L318.47 43a48 48 0 0 0-61 0L4.34 251.47a12 12 0 0 0-1.6 16.9l25.5 31A12 12 0 0 0 45.15 301l235.22-193.74a12.19 12.19 0 0 1 15.3 0L530.9 301a12 12 0 0 0 16.9-1.6l25.5-31a12 12 0 0 0-1.7-16.93z"]},jn={prefix:"fas",iconName:"list-ul",icon:[512,512,[],"f0ca","M48 48a48 48 0 1 0 48 48 48 48 0 0 0-48-48zm0 160a48 48 0 1 0 48 48 48 48 0 0 0-48-48zm0 160a48 48 0 1 0 48 48 48 48 0 0 0-48-48zm448 16H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm0-320H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16V80a16 16 0 0 0-16-16zm0 160H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16z"]},On={prefix:"fas",iconName:"minus",icon:[448,512,[],"f068","M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"]},Sn={prefix:"fas",iconName:"times",icon:[352,512,[],"f00d","M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"]};function Dn(t,n,e){const r=t.slice();return r[1]=n[e].name,r[2]=n[e].uuid,r}function zn(t){let n,e,r,o,c=t[1]+"";return{c(){n=b("p"),e=b("a"),r=x(c),L(e,"href",o="#/account/"+t[2]),L(e,"class","btn btn-outline-secondary")},m(t,o){g(t,n,o),d(n,e),d(e,r)},p(t,n){1&n&&c!==(c=t[1]+"")&&C(r,c),1&n&&o!==(o="#/account/"+t[2])&&L(e,"href",o)},d(t){t&&h(n)}}}function Hn(n){let e,r;return e=new kn({props:{icon:Mn,name:"budget",url:"#/budget",left:!0}}),{c(){st(e.$$.fragment)},m(t,n){at(e,t,n),r=!0},p:t,i(t){r||(nt(e.$$.fragment,t),r=!0)},o(t){et(e.$$.fragment,t),r=!1},d(t){ut(e,t)}}}function Tn(t){let n,e,r,o,c,s,a,u=t[0],i=[];for(let n=0;nAdd new account',c=v(),st(s.$$.fragment)},m(t,u){g(t,n,u),g(t,e,u);for(let n=0;ne(0,r=t)),[r]}const Pn=t=>Fn(t)?"danger":"",Rn=t=>Bn(t,2),In=t=>Bn(t,0),Bn=(t,n)=>(null==t&&(t=0),(Number(t)/100).toFixed(n)),Fn=t=>t&&t<0;function qn(t,n,e){const r=t.slice();return r[1]=n[e].amountTotal,r[2]=n[e].timestamp,r[3]=n[e].who,r}function Un(t){let n;return{c(){n=b("i"),n.textContent="No matching transactions found."},m(t,e){g(t,n,e)},d(t){t&&h(n)}}}function Yn(t){let n,e,r,o,c,s,a,u,i,l,f,$=Vt(t[2])+"",p=t[3]+"",m=Rn(t[1])+"";return{c(){n=b("div"),e=b("div"),r=x($),o=v(),c=b("div"),s=x(p),a=v(),u=b("div"),i=b("sup"),i.textContent="$",l=x(m),f=v(),L(e,"class","col-2 text-center"),L(c,"class","col-7"),L(u,"class","col-3 text-right"),L(n,"class","row")},m(t,$){g(t,n,$),d(n,e),d(e,r),d(n,o),d(n,c),d(c,s),d(n,a),d(n,u),d(u,i),d(u,l),d(n,f)},p(t,n){1&n&&$!==($=Vt(t[2])+"")&&C(r,$),1&n&&p!==(p=t[3]+"")&&C(s,p),1&n&&m!==(m=Rn(t[1])+"")&&C(l,m)},d(t){t&&h(n)}}}function Jn(n){let e,r=n[0],o=[];for(let t=0;t{"transactions"in t&&e(0,r=t.transactions)},[r]}class Gn extends lt{constructor(t){super(),it(this,t,Wn,Jn,s,{transactions:0})}}function Kn(n){let e,r;return e=new kn({props:{icon:jn,name:"accounts",url:"#/accounts",left:!0}}),{c(){st(e.$$.fragment)},m(t,n){at(e,t,n),r=!0},p:t,i(t){r||(nt(e.$$.fragment,t),r=!0)},o(t){et(e.$$.fragment,t),r=!1},d(t){ut(e,t)}}}function Qn(t){let n,e,r,o,c,s,a,u,i,l,f,$,p,m,y,w=t[0].name+"";return s=new bn({props:{icon:_n}}),l=new Gn({props:{transactions:t[1]}}),$=new Ln({props:{$$slots:{default:[Kn]},$$scope:{ctx:t}}}),{c(){n=b("h2"),e=b("span"),r=x(w),o=v(),c=b("a"),st(s.$$.fragment),a=v(),u=b("hr"),i=v(),st(l.$$.fragment),f=v(),st($.$$.fragment),L(c,"class","float-right svelte-12253py"),L(c,"tabindex","0"),L(c,"href","javascript:void(0)"),L(u,"class","small")},m(h,b){g(h,n,b),d(n,e),d(e,r),d(n,o),d(n,c),at(s,c,null),g(h,a,b),g(h,u,b),g(h,i,b),at(l,h,b),g(h,f,b),at($,h,b),p=!0,m||(y=E(c,"click",t[2]),m=!0)},p(t,[n]){(!p||1&n)&&w!==(w=t[0].name+"")&&C(r,w);const e={};2&n&&(e.transactions=t[1]),l.$set(e);const o={};64&n&&(o.$$scope={dirty:n,ctx:t}),$.$set(o)},i(t){p||(nt(s.$$.fragment,t),nt(l.$$.fragment,t),nt($.$$.fragment,t),p=!0)},o(t){et(s.$$.fragment,t),et(l.$$.fragment,t),et($.$$.fragment,t),p=!1},d(t){t&&h(n),ut(s),t&&h(a),t&&h(u),t&&h(i),ut(l,t),t&&h(f),ut($,t),m=!1,y()}}}function Xn(t,n,e){let r;i(t,St,t=>e(5,r=t));let{params:o={}}=n;let c,s,a;return t.$$set=t=>{"params"in t&&e(3,o=t.params)},t.$$.update=()=>{8&t.$$.dirty&&e(4,c=o.uuid||""),48&t.$$.dirty&&e(0,s=r.find(t=>t.uuid===c)||{}),16&t.$$.dirty&&e(1,a=Xt(c))},[s,a,()=>{let t=prompt("Edit account name:",s.name);null!=t&&((t,n)=>{$t("uuid",t,n,St),Dt()})(c,{name:t})},o]}function Zn(n){let e,r,o,c;return{c(){e=b("div"),r=b("div"),L(r,"class",o="category-graph-line "+n[2](n[1],n[0])+" svelte-6b2uyp"),_(r,"width",n[3](n[1],n[0])+"%"),L(e,"class",c="category-graph "+Pn(n[1])+" svelte-6b2uyp")},m(t,n){g(t,e,n),d(e,r)},p(t,[n]){3&n&&o!==(o="category-graph-line "+t[2](t[1],t[0])+" svelte-6b2uyp")&&L(r,"class",o),3&n&&_(r,"width",t[3](t[1],t[0])+"%"),2&n&&c!==(c="category-graph "+Pn(t[1])+" svelte-6b2uyp")&&L(e,"class",c)},i:t,o:t,d(t){t&&h(e)}}}function te(t,n,e){let{budgeted:r}=n,{remaining:o}=n;return t.$$set=t=>{"budgeted"in t&&e(0,r=t.budgeted),"remaining"in t&&e(1,o=t.remaining)},[r,o,(t,n)=>null==t?"":t<0?"danger":tt<0?0:0===n?t>0?100:0:t/n*100]}class ne extends lt{constructor(t){super(),it(this,t,te,Zn,s,{budgeted:0,remaining:1})}}function ee(t,n,e){const r=t.slice();return r[3]=n[e].budgeted,r[4]=n[e].remaining,r[5]=n[e].name,r[6]=n[e].uuid,r}function re(t){let n,e,r,o,c,s,a,u,i,l,f,$,p,m,y,w,k,E,A,N,_,M=t[5]+"",j=Rn(t[4])+"",O=In(t[3])+"";return u=new ne({props:{budgeted:t[3],remaining:t[4]}}),{c(){n=b("tr"),e=b("td"),r=b("a"),o=x(M),s=v(),a=b("td"),st(u.$$.fragment),i=v(),l=b("td"),f=b("div"),$=b("sup"),$.textContent="$",p=x(j),y=v(),w=b("div"),k=b("span"),E=x("/ "),A=x(O),N=v(),L(r,"href",c="#/category/"+t[6]),L(r,"class","btn btn-outline-secondary"),L(e,"class","category-name width-10 svelte-1g8xb6x"),L(a,"class","width-80 svelte-1g8xb6x"),L($,"class","svelte-1g8xb6x"),L(f,"class",m="category-available "+Pn(t[4])+" svelte-1g8xb6x"),L(w,"class","category-budgeted svelte-1g8xb6x"),L(l,"class","category-amount width-10 svelte-1g8xb6x")},m(t,c){g(t,n,c),d(n,e),d(e,r),d(r,o),d(n,s),d(n,a),at(u,a,null),d(n,i),d(n,l),d(l,f),d(f,$),d(f,p),d(l,y),d(l,w),d(w,k),d(k,E),d(k,A),d(n,N),_=!0},p(t,n){(!_||1&n)&&M!==(M=t[5]+"")&&C(o,M),(!_||1&n&&c!==(c="#/category/"+t[6]))&&L(r,"href",c);const e={};1&n&&(e.budgeted=t[3]),1&n&&(e.remaining=t[4]),u.$set(e),(!_||1&n)&&j!==(j=Rn(t[4])+"")&&C(p,j),(!_||1&n&&m!==(m="category-available "+Pn(t[4])+" svelte-1g8xb6x"))&&L(f,"class",m),(!_||1&n)&&O!==(O=In(t[3])+"")&&C(A,O)},i(t){_||(nt(u.$$.fragment,t),_=!0)},o(t){et(u.$$.fragment,t),_=!1},d(t){t&&h(n),ut(u)}}}function oe(t){let n,e,r,o=t[0],c=[];for(let n=0;net(c[t],1,1,()=>{c[t]=null});return{c(){n=b("table"),e=b("tbody");for(let t=0;te(1,r=t)),i(t,zt,t=>e(2,o=t)),t.$$.update=()=>{6&t.$$.dirty&&e(0,c=((t,n)=>{let e=[];for(var r in t)if(t.hasOwnProperty(r)){let o=Ht(r,n);e.push({budgeted:t[r].budgeted,remaining:t[r].remaining,name:o.name,uuid:o.uuid})}return e.sort((t,n)=>(t.name||"").localeCompare(n.name||""))})(r,o))},[c]}class se extends lt{constructor(t){super(),it(this,t,ce,oe,s,{})}}function ae(n){let e,r,o,c;return e=new kn({props:{icon:jn,name:"accounts",url:"#/accounts",left:!0}}),o=new kn({props:{icon:On,name:"expense",url:"#/expense/new"}}),{c(){st(e.$$.fragment),r=v(),st(o.$$.fragment)},m(t,n){at(e,t,n),g(t,r,n),at(o,t,n),c=!0},p:t,i(t){c||(nt(e.$$.fragment,t),nt(o.$$.fragment,t),c=!0)},o(t){et(e.$$.fragment,t),et(o.$$.fragment,t),c=!1},d(t){ut(e,t),t&&h(r),ut(o,t)}}}function ue(t){let n,e,r,o,c,s,a,u;return r=new se({}),a=new Ln({props:{$$slots:{default:[ae]},$$scope:{ctx:t}}}),{c(){n=b("h2"),n.textContent="Budget",e=v(),st(r.$$.fragment),o=v(),c=b("p"),c.innerHTML='Add new category',s=v(),st(a.$$.fragment)},m(t,i){g(t,n,i),g(t,e,i),at(r,t,i),g(t,o,i),g(t,c,i),g(t,s,i),at(a,t,i),u=!0},p(t,[n]){const e={};1&n&&(e.$$scope={dirty:n,ctx:t}),a.$set(e)},i(t){u||(nt(r.$$.fragment,t),nt(a.$$.fragment,t),u=!0)},o(t){et(r.$$.fragment,t),et(a.$$.fragment,t),u=!1},d(t){t&&h(n),t&&h(e),ut(r,t),t&&h(o),t&&h(c),t&&h(s),ut(a,t)}}}function ie(n){let e,r,c,s,a,u,i;return{c(){e=b("form"),r=b("div"),c=b("div"),c.innerHTML='$',s=v(),a=b("input"),L(c,"class","input-group-prepend"),L(a,"type","tel"),L(a,"aria-describedby","amount-input-currency-symbol"),L(a,"aria-label","Amount"),L(a,"class","text-right form-control"),L(r,"class","input-group input-group-lg"),e.noValidate=!0},m(t,o){g(t,e,o),d(e,r),d(r,c),d(r,s),d(r,a),n[5](a),u||(i=[E(a,"keydown",n[1]),E(e,"submit",A(n[2]))],u=!0)},p:t,i:t,o:t,d(t){t&&h(e),n[5](null),u=!1,o(i)}}}function le(t,n,e){let{amount:r=0}=n,{resultingAmount:o=0}=n;const c=z();let s,a=[];D(()=>{u(r),s.focus()});const u=t=>{var n;a=(n=t)?String(n).split("").filter((function(t){return"0123456789".indexOf(t)>=0})):[],i(a),l(Number(a.join("")))};function i(t){for(var n="",r=0;r{"amount"in t&&e(4,r=t.amount),"resultingAmount"in t&&e(3,o=t.resultingAmount)},t.$$.update=()=>{16&t.$$.dirty&&u(r)},[s,function(t){var n=t.which;(t=>t>=32&&t<112||t>=123&&t<127||t>=186)(n)&&t.preventDefault();var e=(t=>t>=48&&t<58?String(t-48):t>=96&&t<106?String(t-96):"")(n);e?a.push(e):(t=>8===t)(n)&&(t.preventDefault(),a.pop()),i(a),l(Number(a.join("")))},function(t){c("next",o)},o,r,function(t){V[t?"unshift":"push"](()=>{s=t,e(0,s)})}]}class fe extends lt{constructor(t){super(),it(this,t,le,ie,s,{amount:4,resultingAmount:3})}}function $e(n){let e,r,o,c;return e=new kn({props:{icon:Nn,name:"save"}}),e.$on("click",n[3]),o=new kn({props:{icon:Sn,name:"cancel",url:"#/budget",left:!0}}),{c(){st(e.$$.fragment),r=v(),st(o.$$.fragment)},m(t,n){at(e,t,n),g(t,r,n),at(o,t,n),c=!0},p:t,i(t){c||(nt(e.$$.fragment,t),nt(o.$$.fragment,t),c=!0)},o(t){et(e.$$.fragment,t),et(o.$$.fragment,t),c=!1},d(t){ut(e,t),t&&h(r),ut(o,t)}}}function pe(t){let n,e,r,o,c,s,a,u,i,l=t[1].name+"";function f(n){t[5].call(null,n)}let $={amount:t[2]};return void 0!==t[0]&&($.resultingAmount=t[0]),c=new fe({props:$}),V.push(()=>ct(c,"resultingAmount",f)),c.$on("next",t[3]),u=new Ln({props:{$$slots:{default:[$e]},$$scope:{ctx:t}}}),{c(){n=b("h2"),e=x("Monthly amount for "),r=x(l),o=v(),st(c.$$.fragment),a=v(),st(u.$$.fragment)},m(t,s){g(t,n,s),d(n,e),d(n,r),g(t,o,s),at(c,t,s),g(t,a,s),at(u,t,s),i=!0},p(t,[n]){(!i||2&n)&&l!==(l=t[1].name+"")&&C(r,l);const e={};4&n&&(e.amount=t[2]),!s&&1&n&&(s=!0,e.resultingAmount=t[0],Y(()=>s=!1)),c.$set(e);const o={};256&n&&(o.$$scope={dirty:n,ctx:t}),u.$set(o)},i(t){i||(nt(c.$$.fragment,t),nt(u.$$.fragment,t),i=!0)},o(t){et(c.$$.fragment,t),et(u.$$.fragment,t),i=!1},d(t){t&&h(n),t&&h(o),ut(c,t),t&&h(a),ut(u,t)}}}function me(t,n,e){let r;i(t,zt,t=>e(7,r=t));let{params:o}=n,c=0;let s,a,u;return t.$$set=t=>{"params"in t&&e(4,o=t.params)},t.$$.update=()=>{16&t.$$.dirty&&e(6,s=o.uuid),192&t.$$.dirty&&e(1,a=r.find(t=>t.uuid===s)||{}),66&t.$$.dirty&&e(2,u=a&&Ft(s)||0)},[c,a,u,()=>{Ut(s,c),an("/budget")},o,function(t){c=t,e(0,c)}]}function de(n){let e,r,c,s,a,u;return{c(){e=b("form"),r=b("h2"),r.innerHTML='',c=v(),s=b("input"),L(s,"class","form-control"),L(s,"placeholder","New category name"),L(s,"id","new-category-name")},m(t,o){g(t,e,o),d(e,r),d(e,c),d(e,s),N(s,n[0]),n[4](s),a||(u=[E(s,"input",n[3]),E(e,"submit",A(n[2]))],a=!0)},p(t,[n]){1&n&&s.value!==t[0]&&N(s,t[0])},i:t,o:t,d(t){t&&h(e),n[4](null),a=!1,o(u)}}}function ge(t,n,e){let r="",o={};return D(()=>{o.focus()}),[r,o,function(){an(`/category/${(t=>{const n=u(zt).find(n=>n.name===t);if(n)return n;{const n={uuid:Lt(),name:t};return ft(n,zt),Tt(),n}})(r).uuid}/amount`)},function(){r=this.value,e(0,r)},function(t){V[t?"unshift":"push"](()=>{o=t,e(1,o)})}]}function he(n){let e,r;return e=new kn({props:{icon:Mn,name:"budget",url:"#/budget",left:!0}}),{c(){st(e.$$.fragment)},m(t,n){at(e,t,n),r=!0},p:t,i(t){r||(nt(e.$$.fragment,t),r=!0)},o(t){et(e.$$.fragment,t),r=!1},d(t){ut(e,t)}}}function ye(t){let n,e,r,o,c,s,a,u,i,l,f,$,p,m,y,w,k,A,N,_=t[1].name+"",M=Rn(Ft(t[0]))+"";return m=new Gn({props:{transactions:t[2]}}),w=new Ln({props:{$$slots:{default:[he]},$$scope:{ctx:t}}}),{c(){n=b("h2"),e=b("b"),r=x(_),o=x(":"),c=v(),s=b("a"),a=b("sup"),a.textContent="$",u=v(),i=x(M),f=v(),$=b("hr"),p=v(),st(m.$$.fragment),y=v(),st(w.$$.fragment),L(e,"class","editable svelte-1uc4ts5"),L(e,"title","(Click to rename)"),L(s,"class","btn btn-default"),L(s,"href",l="#/category/"+t[0]+"/amount"),L($,"class","small")},m(l,h){g(l,n,h),d(n,e),d(e,r),d(e,o),d(n,c),d(n,s),d(s,a),d(s,u),d(s,i),g(l,f,h),g(l,$,h),g(l,p,h),at(m,l,h),g(l,y,h),at(w,l,h),k=!0,A||(N=E(e,"click",t[3]),A=!0)},p(t,[n]){(!k||2&n)&&_!==(_=t[1].name+"")&&C(r,_),(!k||1&n)&&M!==(M=Rn(Ft(t[0]))+"")&&C(i,M),(!k||1&n&&l!==(l="#/category/"+t[0]+"/amount"))&&L(s,"href",l);const e={};4&n&&(e.transactions=t[2]),m.$set(e);const o={};64&n&&(o.$$scope={dirty:n,ctx:t}),w.$set(o)},i(t){k||(nt(m.$$.fragment,t),nt(w.$$.fragment,t),k=!0)},o(t){et(m.$$.fragment,t),et(w.$$.fragment,t),k=!1},d(t){t&&h(n),t&&h(f),t&&h($),t&&h(p),ut(m,t),t&&h(y),ut(w,t),A=!1,N()}}}function be(t,n,e){let r;i(t,zt,t=>e(5,r=t));let{params:o={}}=n;let c,s,a;return t.$$set=t=>{"params"in t&&e(4,o=t.params)},t.$$.update=()=>{16&t.$$.dirty&&e(0,c=o.uuid||""),33&t.$$.dirty&&e(1,s=r.find(t=>t.uuid===c)||{}),1&t.$$.dirty&&e(2,a=Zt(c))},[c,s,a,()=>{let t=prompt("Edit category name:",s.name);null!=t&&((t,n)=>{$t("uuid",t,n,zt),Tt()})(c,{name:t})},o]}function we(t,n,e){const r=t.slice();return r[3]=n[e],r}function xe(t,n){let e,r,o,c,s,a,u=n[3].name+"";function i(...t){return n[2](n[3],...t)}return{key:t,first:null,c(){e=b("p"),r=b("button"),o=x(u),c=v(),L(r,"class","btn btn-outline-secondary"),this.first=e},m(t,n){g(t,e,n),d(e,r),d(r,o),d(e,c),s||(a=E(r,"click",i),s=!0)},p(t,e){n=t,1&e&&u!==(u=n[3].name+"")&&C(o,u)},d(t){t&&h(e),s=!1,a()}}}function ve(n){let e,r=[],o=new Map,c=n[0];const s=t=>t[3].uuid;for(let t=0;t{"accounts"in t&&e(0,r=t.accounts)},[r,o,t=>o("select",t.uuid)]}class Ee extends lt{constructor(t){super(),it(this,t,ke,ve,s,{accounts:0})}}function Ae(n){let e,r;return e=new kn({props:{icon:Mn,name:"budget",url:"#/budget",left:!0}}),{c(){st(e.$$.fragment)},m(t,n){at(e,t,n),r=!0},p:t,i(t){r||(nt(e.$$.fragment,t),r=!0)},o(t){et(e.$$.fragment,t),r=!1},d(t){ut(e,t)}}}function Le(t){let n,e,r,o,c,s;return r=new Ee({props:{accounts:t[0]}}),r.$on("select",t[1]),c=new Ln({props:{$$slots:{default:[Ae]},$$scope:{ctx:t}}}),{c(){n=b("h2"),n.textContent="Paid using",e=v(),st(r.$$.fragment),o=v(),st(c.$$.fragment)},m(t,a){g(t,n,a),g(t,e,a),at(r,t,a),g(t,o,a),at(c,t,a),s=!0},p(t,[n]){const e={};1&n&&(e.accounts=t[0]),r.$set(e);const o={};4&n&&(o.$$scope={dirty:n,ctx:t}),c.$set(o)},i(t){s||(nt(r.$$.fragment,t),nt(c.$$.fragment,t),s=!0)},o(t){et(r.$$.fragment,t),et(c.$$.fragment,t),s=!1},d(t){t&&h(n),t&&h(e),ut(r,t),t&&h(o),ut(c,t)}}}function Ce(t,n,e){let r;return i(t,St,t=>e(0,r=t)),[r,function(t){let n=t.detail;nn({accountUuid:n}),an("/expense/amount/")}]}function Ne(n){let e,r,o,c;return e=new kn({props:{icon:Cn,name:"next"}}),e.$on("click",n[2]),o=new kn({props:{icon:Mn,name:"budget",url:"#/budget",left:!0}}),{c(){st(e.$$.fragment),r=v(),st(o.$$.fragment)},m(t,n){at(e,t,n),g(t,r,n),at(o,t,n),c=!0},p:t,i(t){c||(nt(e.$$.fragment,t),nt(o.$$.fragment,t),c=!0)},o(t){et(e.$$.fragment,t),et(o.$$.fragment,t),c=!1},d(t){ut(e,t),t&&h(r),ut(o,t)}}}function _e(t){let n,e,r,o,c,s,a,u,i,l=t[1].who+"";function f(n){t[3].call(null,n)}let $={};return void 0!==t[0]&&($.resultingAmount=t[0]),c=new fe({props:$}),V.push(()=>ct(c,"resultingAmount",f)),c.$on("next",t[2]),u=new Ln({props:{$$slots:{default:[Ne]},$$scope:{ctx:t}}}),{c(){n=b("h2"),e=x("Amount paid to "),r=x(l),o=v(),st(c.$$.fragment),a=v(),st(u.$$.fragment)},m(t,s){g(t,n,s),d(n,e),d(n,r),g(t,o,s),at(c,t,s),g(t,a,s),at(u,t,s),i=!0},p(t,[n]){(!i||2&n)&&l!==(l=t[1].who+"")&&C(r,l);const e={};!s&&1&n&&(s=!0,e.resultingAmount=t[0],Y(()=>s=!1)),c.$set(e);const o={};32&n&&(o.$$scope={dirty:n,ctx:t}),u.$set(o)},i(t){i||(nt(c.$$.fragment,t),nt(u.$$.fragment,t),i=!0)},o(t){et(c.$$.fragment,t),et(u.$$.fragment,t),i=!1},d(t){t&&h(n),t&&h(o),ut(c,t),t&&h(a),ut(u,t)}}}function Me(t,n,e){let r;i(t,Kt,t=>e(4,r=t));let o=0;let c;return t.$$.update=()=>{16&t.$$.dirty&&e(1,c=r)},[o,c,()=>{nn({amountTotal:o}),an("/expense/category/")},function(t){o=t,e(0,o)}]}function je(t,n,e){const r=t.slice();return r[4]=n[e],r}function Oe(t,n){let e,r,o,c,s,a,u=n[4].name+"";function i(...t){return n[2](n[4],...t)}return{key:t,first:null,c(){e=b("p"),r=b("button"),o=x(u),c=v(),L(r,"class","btn btn-outline-secondary"),this.first=e},m(t,n){g(t,e,n),d(e,r),d(r,o),d(e,c),s||(a=E(r,"click",i),s=!0)},p(t,e){n=t,1&e&&u!==(u=n[4].name+"")&&C(o,u)},d(t){t&&h(e),s=!1,a()}}}function Se(n){let e,r=[],o=new Map,c=n[0];const s=t=>t[4].uuid;for(let t=0;t{"categories"in t&&e(0,r=t.categories)},[r,o,t=>o("select",t.uuid)]}class ze extends lt{constructor(t){super(),it(this,t,De,Se,s,{categories:0})}}function He(n){let e,r;return e=new kn({props:{icon:Mn,name:"budget",url:"#/budget",left:!0}}),{c(){st(e.$$.fragment)},m(t,n){at(e,t,n),r=!0},p:t,i(t){r||(nt(e.$$.fragment,t),r=!0)},o(t){et(e.$$.fragment,t),r=!1},d(t){ut(e,t)}}}function Te(t){let n,e,r,o,c,s;return r=new ze({props:{categories:t[0]}}),r.$on("select",t[1]),c=new Ln({props:{$$slots:{default:[He]},$$scope:{ctx:t}}}),{c(){n=b("h2"),n.textContent="Category",e=v(),st(r.$$.fragment),o=v(),st(c.$$.fragment)},m(t,a){g(t,n,a),g(t,e,a),at(r,t,a),g(t,o,a),at(c,t,a),s=!0},p(t,[n]){const e={};1&n&&(e.categories=t[0]),r.$set(e);const o={};8&n&&(o.$$scope={dirty:n,ctx:t}),c.$set(o)},i(t){s||(nt(r.$$.fragment,t),nt(c.$$.fragment,t),s=!0)},o(t){et(r.$$.fragment,t),et(c.$$.fragment,t),s=!1},d(t){t&&h(n),t&&h(e),ut(r,t),t&&h(o),ut(c,t)}}}function Ve(t,n,e){let r,o;return i(t,Kt,t=>e(2,r=t)),i(t,zt,t=>e(0,o=t)),[o,function(t){let n={};n[t.detail]=r.amountTotal,nn({categoryAmounts:n}),an("/expense/review/")}]}function Pe(t){const n=Date.now();return Qt({timestamp:n}),an("/expense/who/"),[]}function Re(n){let e,r,o,c,s=Rn(n[1])+"";return{c(){e=b("span"),r=x(n[0]),o=x(": $ "),c=x(s),L(e,"class","badge badge-info")},m(t,n){g(t,e,n),d(e,r),d(e,o),d(e,c)},p(t,[n]){1&n&&C(r,t[0]),2&n&&s!==(s=Rn(t[1])+"")&&C(c,s)},i:t,o:t,d(t){t&&h(e)}}}function Ie(t,n,e){let{name:r=""}=n,{amount:o=0}=n;return t.$$set=t=>{"name"in t&&e(0,r=t.name),"amount"in t&&e(1,o=t.amount)},[r,o]}class Be extends lt{constructor(t){super(),it(this,t,Ie,Re,s,{name:0,amount:1})}}function Fe(t,n,e){const r=t.slice();return r[4]=n[e],r}function qe(t){let n,e;return n=new Be({props:{name:Ht(t[4],t[2]).name,amount:t[0][t[4]]}}),{c(){st(n.$$.fragment)},m(t,r){at(n,t,r),e=!0},p(t,e){const r={};6&e&&(r.name=Ht(t[4],t[2]).name),3&e&&(r.amount=t[0][t[4]]),n.$set(r)},i(t){e||(nt(n.$$.fragment,t),e=!0)},o(t){et(n.$$.fragment,t),e=!1},d(t){ut(n,t)}}}function Ue(t){let n,e,r=t[1],o=[];for(let n=0;net(o[t],1,1,()=>{o[t]=null});return{c(){for(let t=0;te(2,r=t));let o,c,{transaction:s={}}=n;return t.$$set=t=>{"transaction"in t&&e(3,s=t.transaction)},t.$$.update=()=>{8&t.$$.dirty&&e(0,o=s.categoryAmounts||{}),1&t.$$.dirty&&e(1,c=Object.keys(o))},[o,c,r,s]}class Je extends lt{constructor(t){super(),it(this,t,Ye,Ue,s,{transaction:3})}}function We(n){let e,r;return e=new kn({props:{icon:Mn,name:"done"}}),e.$on("click",n[3]),{c(){st(e.$$.fragment)},m(t,n){at(e,t,n),r=!0},p:t,i(t){r||(nt(e.$$.fragment,t),r=!0)},o(t){et(e.$$.fragment,t),r=!1},d(t){ut(e,t)}}}function Ge(t){let n,e,r,o,c,s,a,u,i,l,f,$,p,m,y,w,k,A,N,_,M,j,O,S,D,z,H,T,V,P,R,I=t[0].who+"",B=Rn(t[2])+"";return m=new Je({props:{transaction:t[0]}}),T=new Ln({props:{$$slots:{default:[We]},$$scope:{ctx:t}}}),{c(){n=b("div"),e=b("div"),r=b("h2"),r.textContent="Review Expense",o=v(),c=b("p"),s=b("a"),a=x(I),u=v(),i=b("a"),l=x("$"),f=x(B),$=v(),p=b("p"),st(m.$$.fragment),y=v(),w=b("p"),k=b("b"),k.textContent="Account:",A=v(),N=b("a"),_=x(t[1]),M=v(),j=b("p"),O=b("b"),O.textContent="Date:",S=v(),D=b("input"),H=v(),st(T.$$.fragment),L(s,"class","btn btn-outline-secondary"),L(s,"href","#/expense/who/"),L(i,"class","btn btn-outline-secondary float-right"),L(i,"href","#/expense/amount/"),L(N,"class","btn btn-outline-secondary float-right"),L(N,"href","#/expense/account/"),L(D,"type","date"),L(D,"class","float-right"),D.value=z=Pt(t[0].timestamp),L(e,"class","col-12 col-sm-8 offset-sm-2 col-md-6 offset-md-3"),L(n,"class","row")},m(h,b){g(h,n,b),d(n,e),d(e,r),d(e,o),d(e,c),d(c,s),d(s,a),d(c,u),d(c,i),d(i,l),d(i,f),d(e,$),d(e,p),at(m,p,null),d(e,y),d(e,w),d(w,k),d(w,A),d(w,N),d(N,_),d(e,M),d(e,j),d(j,O),d(j,S),d(j,D),g(h,H,b),at(T,h,b),V=!0,P||(R=E(D,"change",t[4]),P=!0)},p(t,[n]){(!V||1&n)&&I!==(I=t[0].who+"")&&C(a,I),(!V||4&n)&&B!==(B=Rn(t[2])+"")&&C(f,B);const e={};1&n&&(e.transaction=t[0]),m.$set(e),(!V||2&n)&&C(_,t[1]),(!V||1&n&&z!==(z=Pt(t[0].timestamp)))&&(D.value=z);const r={};512&n&&(r.$$scope={dirty:n,ctx:t}),T.$set(r)},i(t){V||(nt(m.$$.fragment,t),nt(T.$$.fragment,t),V=!0)},o(t){et(m.$$.fragment,t),et(T.$$.fragment,t),V=!1},d(t){t&&h(n),ut(m),t&&h(H),ut(T,t),P=!1,R()}}}function Ke(t,n,e){let r,o;i(t,Kt,t=>e(5,r=t)),i(t,St,t=>e(7,o=t));let c,s,a,l;return t.$$.update=()=>{var n;32&t.$$.dirty&&e(0,c=r),129&t.$$.dirty&&e(6,(n=c.accountUuid,s=o.find(t=>t.uuid===n)||{})),64&t.$$.dirty&&e(1,a=s.name||""),1&t.$$.dirty&&e(2,l=c.amountTotal||0)},[c,a,l,function(){(()=>{const t=u(Kt);t.uuid=Lt(),ft(t,Gt),tn();const n=t.categoryAmounts||{};for(const t in n){const e=n[t]||0;Yt(t,e)}Qt({})})(),an("/budget")},t=>{let n=t.target.value,e=new Date(n+" 12:00:00");nn({timestamp:e.getTime()})}]}function Qe(t){let n,e,r,o,c,s,a;return{c(){n=b("h2"),e=b("label"),r=x(t[1]),o=v(),c=b("input"),L(e,"for","who"),L(c,"type","text"),L(c,"class","form-control"),L(c,"id","who")},m(u,i){g(u,n,i),d(n,e),d(e,r),g(u,o,i),g(u,c,i),N(c,t[0]),t[5](c),s||(a=E(c,"input",t[4]),s=!0)},p(t,n){2&n&&C(r,t[1]),1&n&&c.value!==t[0]&&N(c,t[0])},d(e){e&&h(n),e&&h(o),e&&h(c),t[5](null),s=!1,a()}}}function Xe(t){let n,e;return n=new pn({props:{autofocusElement:t[2],$$slots:{default:[Qe]},$$scope:{ctx:t}}}),n.$on("submit",t[3]),{c(){st(n.$$.fragment)},m(t,r){at(n,t,r),e=!0},p(t,[e]){const r={};4&e&&(r.autofocusElement=t[2]),135&e&&(r.$$scope={dirty:e,ctx:t}),n.$set(r)},i(t){e||(nt(n.$$.fragment,t),e=!0)},o(t){et(n.$$.fragment,t),e=!1},d(t){ut(n,t)}}}function Ze(t,n,e){let{title:r}=n,{who:o=""}=n;const c=z();let s={};return t.$$set=t=>{"title"in t&&e(1,r=t.title),"who"in t&&e(0,o=t.who)},[o,r,s,()=>{c("select",o)},function(){o=this.value,e(0,o)},function(t){V[t?"unshift":"push"](()=>{s=t,e(2,s)})}]}class tr extends lt{constructor(t){super(),it(this,t,Ze,Xe,s,{title:1,who:0})}}function nr(n){let e,r,o,c;return e=new kn({props:{icon:Cn,name:"next"}}),e.$on("click",n[1]),o=new kn({props:{icon:Mn,name:"budget",url:"#/budget",left:!0}}),{c(){st(e.$$.fragment),r=v(),st(o.$$.fragment)},m(t,n){at(e,t,n),g(t,r,n),at(o,t,n),c=!0},p:t,i(t){c||(nt(e.$$.fragment,t),nt(o.$$.fragment,t),c=!0)},o(t){et(e.$$.fragment,t),et(o.$$.fragment,t),c=!1},d(t){ut(e,t),t&&h(r),ut(o,t)}}}function er(t){let n,e,r,o,c;function s(n){t[2].call(null,n)}let a={title:"Paid to:"};return void 0!==t[0]&&(a.who=t[0]),n=new tr({props:a}),V.push(()=>ct(n,"who",s)),n.$on("select",t[1]),o=new Ln({props:{$$slots:{default:[nr]},$$scope:{ctx:t}}}),{c(){st(n.$$.fragment),r=v(),st(o.$$.fragment)},m(t,e){at(n,t,e),g(t,r,e),at(o,t,e),c=!0},p(t,[r]){const c={};!e&&1&r&&(e=!0,c.who=t[0],Y(()=>e=!1)),n.$set(c);const s={};8&r&&(s.$$scope={dirty:r,ctx:t}),o.$set(s)},i(t){c||(nt(n.$$.fragment,t),nt(o.$$.fragment,t),c=!0)},o(t){et(n.$$.fragment,t),et(o.$$.fragment,t),c=!1},d(t){ut(n,t),t&&h(r),ut(o,t)}}}function rr(t,n,e){let r="";return[r,()=>{nn({who:r}),an("/expense/account/")},function(t){r=t,e(0,r)}]}function or(t){return function(t){if(!t||t.length<1||"/"!=t.charAt(0)&&0!==t.indexOf("#/"))throw Error("Invalid parameter location");q().then(()=>{const n=("#"==t.charAt(0)?"":"#")+t;try{window.history.replaceState(void 0,void 0,n)}catch(t){console.warn("Caught exception while replacing the current page. If you're running this in the Svelte REPL, please note that the `replace` method might not work in this environment.")}window.dispatchEvent(new Event("hashchange"))})}("/budget"),[]}function cr(n){let e,r,o,c,s;return{c(){e=b("h2"),e.textContent="Hmm...",r=v(),o=b("p"),o.textContent="We can't seem to find that page.",c=v(),s=b("p"),s.innerHTML='Try going back to the Home screen. Perhaps there's a link\n from there to where you were trying to go.'},m(t,n){g(t,e,n),g(t,r,n),g(t,o,n),g(t,c,n),g(t,s,n)},p:t,i:t,o:t,d(t){t&&h(e),t&&h(r),t&&h(o),t&&h(c),t&&h(s)}}}const sr={"/":class extends lt{constructor(t){super(),it(this,t,or,null,s,{})}},"/account/new":class extends lt{constructor(t){super(),it(this,t,gn,dn,s,{})}},"/accounts":class extends lt{constructor(t){super(),it(this,t,Vn,Tn,s,{})}},"/account/:uuid":class extends lt{constructor(t){super(),it(this,t,Xn,Qn,s,{params:3})}},"/budget":class extends lt{constructor(t){super(),it(this,t,null,ue,s,{})}},"/category/new":class extends lt{constructor(t){super(),it(this,t,ge,de,s,{})}},"/category/:uuid":class extends lt{constructor(t){super(),it(this,t,be,ye,s,{params:4})}},"/category/:uuid/amount":class extends lt{constructor(t){super(),it(this,t,me,pe,s,{params:4})}},"/expense/account/":class extends lt{constructor(t){super(),it(this,t,Ce,Le,s,{})}},"/expense/amount/":class extends lt{constructor(t){super(),it(this,t,Me,_e,s,{})}},"/expense/category/":class extends lt{constructor(t){super(),it(this,t,Ve,Te,s,{})}},"/expense/new":class extends lt{constructor(t){super(),it(this,t,Pe,null,s,{})}},"/expense/review/":class extends lt{constructor(t){super(),it(this,t,Ke,Ge,s,{})}},"/expense/who/":class extends lt{constructor(t){super(),it(this,t,rr,er,s,{})}},"*":class extends lt{constructor(t){super(),it(this,t,null,cr,s,{})}}};function ar(n){let e,r,o,c,s;return r=new Ot({}),c=new ln({props:{routes:sr}}),{c(){e=b("div"),st(r.$$.fragment),o=v(),st(c.$$.fragment),L(e,"class","container-xl my-3")},m(t,n){g(t,e,n),at(r,e,null),d(e,o),at(c,e,null),s=!0},p:t,i(t){s||(nt(r.$$.fragment,t),nt(c.$$.fragment,t),s=!0)},o(t){et(r.$$.fragment,t),et(c.$$.fragment,t),s=!1},d(t){t&&h(e),ut(r),ut(c)}}}function ur(t){return D(async()=>{St.set(mt("accounts")),zt.set(mt("categories")),qt(),Gt.set(mt("transactions"))}),[]}return new class extends lt{constructor(t){super(),it(this,t,ur,ar,s,{})}}({target:document.body})}();
+var app=function(){"use strict";function t(){}function n(t,n){for(const e in n)t[e]=n[e];return t}function e(t){return t()}function r(){return Object.create(null)}function o(t){t.forEach(e)}function c(t){return"function"==typeof t}function s(t,n){return t!=t?n==n:t!==n||t&&"object"==typeof t||"function"==typeof t}function a(n,...e){if(null==n)return t;const r=n.subscribe(...e);return r.unsubscribe?()=>r.unsubscribe():r}function u(t){let n;return a(t,t=>n=t)(),n}function i(t,n,e){t.$$.on_destroy.push(a(n,e))}function l(t,n,e,r){if(t){const o=f(t,n,e,r);return t[0](o)}}function f(t,e,r,o){return t[1]&&o?n(r.ctx.slice(),t[1](o(e))):r.ctx}function $(t,n,e,r,o,c,s){const a=function(t,n,e,r){if(t[2]&&r){const o=t[2](r(e));if(void 0===n.dirty)return o;if("object"==typeof o){const t=[],e=Math.max(n.dirty.length,o.length);for(let r=0;rt.removeEventListener(n,e,r)}function A(t){return function(n){return n.preventDefault(),t.call(this,n)}}function C(t,n,e){null==e?t.removeAttribute(n):t.getAttribute(n)!==e&&t.setAttribute(n,e)}function L(t,n){n=""+n,t.wholeText!==n&&(t.data=n)}function N(t,n){t.value=null==n?"":n}function _(t,n,e,r){t.style.setProperty(n,e,r?"important":"")}function M(t,n,e){t.classList[e?"add":"remove"](n)}let j;function O(t){j=t}function S(){if(!j)throw new Error("Function called outside component initialization");return j}function D(t){S().$$.on_mount.push(t)}function z(){const t=S();return(n,e)=>{const r=t.$$.callbacks[n];if(r){const o=function(t,n){const e=document.createEvent("CustomEvent");return e.initCustomEvent(t,!1,!1,n),e}(n,e);r.slice().forEach(n=>{n.call(t,o)})}}}function H(t,n){const e=t.$$.callbacks[n.type];e&&e.slice().forEach(t=>t(n))}const T=[],V=[],P=[],R=[],I=Promise.resolve();let B=!1;function F(){B||(B=!0,I.then(G))}function q(){return F(),I}function U(t){P.push(t)}function Y(t){R.push(t)}let J=!1;const W=new Set;function G(){if(!J){J=!0;do{for(let t=0;t{Q.delete(t),r&&(e&&t.d(1),r())}),t.o(n)}}function rt(t,n){t.d(1),n.delete(t.key)}function ot(t,n,e,r,o,c,s,a,u,i,l,f){let $=t.length,p=c.length,m=$;const d={};for(;m--;)d[t[m].key]=m;const g=[],h=new Map,y=new Map;for(m=p;m--;){const t=f(o,c,m),a=e(t);let u=s.get(a);u?r&&u.p(t,n):(u=i(a,t),u.c()),h.set(a,g[m]=u),a in d&&y.set(a,Math.abs(m-d[a]))}const b=new Set,w=new Set;function x(t){nt(t,1),t.m(a,l),s.set(t.key,t),l=t.first,p--}for(;$&&p;){const n=g[p-1],e=t[$-1],r=n.key,o=e.key;n===e?(l=n.first,$--,p--):h.has(o)?!s.has(r)||b.has(r)?x(n):w.has(o)?$--:y.get(r)>y.get(o)?(w.add(r),x(n)):(b.add(o),$--):(u(e,s),$--)}for(;$--;){const n=t[$];h.has(n.key)||u(n,s)}for(;p;)x(g[p-1]);return g}function ct(t,n,e){const r=t.$$.props[n];void 0!==r&&(t.$$.bound[r]=e,e(t.$$.ctx[r]))}function st(t){t&&t.c()}function at(t,n,r){const{fragment:s,on_mount:a,on_destroy:u,after_update:i}=t.$$;s&&s.m(n,r),U(()=>{const n=a.map(e).filter(c);u?u.push(...n):o(n),t.$$.on_mount=[]}),i.forEach(U)}function ut(t,n){const e=t.$$;null!==e.fragment&&(o(e.on_destroy),e.fragment&&e.fragment.d(n),e.on_destroy=e.fragment=null,e.ctx=[])}function it(n,e,c,s,a,u,i=[-1]){const l=j;O(n);const f=e.props||{},$=n.$$={fragment:null,ctx:null,props:u,update:t,not_equal:a,bound:r(),on_mount:[],on_destroy:[],before_update:[],after_update:[],context:new Map(l?l.$$.context:[]),callbacks:r(),dirty:i,skip_bound:!1};let p=!1;if($.ctx=c?c(n,f,(t,e,...r)=>{const o=r.length?r[0]:e;return $.ctx&&a($.ctx[t],$.ctx[t]=o)&&(!$.skip_bound&&$.bound[t]&&$.bound[t](o),p&&function(t,n){-1===t.$$.dirty[0]&&(T.push(t),F(),t.$$.dirty.fill(0)),t.$$.dirty[n/31|0]|=1<{const t=e.indexOf(n);-1!==t&&e.splice(t,1)}}$set(t){var n;this.$$set&&(n=t,0!==Object.keys(n).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const ft=(t,n)=>{n.update(n=>[t,...n])},$t=(t,n,e,r)=>{r.update(r=>{const o=r.find(e=>e[t]===n),c=Object.assign({},o,e);let s=!1;for(let e=0;e{const n=dt(t);return pt(n)?n:[]},dt=t=>{const n=localStorage.getItem(t);return JSON.parse(n)},gt=(t,n)=>{localStorage.setItem(t,JSON.stringify(n))},ht=[];function yt(t,n){return{subscribe:bt(t,n).subscribe}}function bt(n,e=t){let r;const o=[];function c(t){if(s(n,t)&&(n=t,r)){const t=!ht.length;for(let t=0;t{const t=o.indexOf(u);-1!==t&&o.splice(t,1),0===o.length&&(r(),r=null)}}}}function wt(n,e,r){const s=!Array.isArray(n),u=s?[n]:n,i=e.length<2;return yt(r,n=>{let r=!1;const l=[];let f=0,$=t;const p=()=>{if(f)return;$();const r=e(s?l[0]:l,n);i?n(r):$=c(r)?r:t},m=u.map((t,n)=>a(t,t=>{l[n]=t,f&=~(1<{f|=1<Lt.set("");function _t(t){let n,e,r,o,c,s;return{c(){n=b("div"),e=b("button"),e.innerHTML='×',r=v(),o=x(t[0]),C(e,"type","button"),C(e,"class","close"),C(e,"aria-label","Close"),C(n,"class","alert alert-danger keep-line-breaks svelte-1anyckn"),C(n,"role","alert")},m(t,a){g(t,n,a),d(n,e),d(n,r),d(n,o),c||(s=E(e,"click",Nt),c=!0)},p(t,n){1&n&&L(o,t[0])},d(t){t&&h(n),c=!1,s()}}}function Mt(n){let e,r=n[0]&&_t(n);return{c(){r&&r.c(),e=k()},m(t,n){r&&r.m(t,n),g(t,e,n)},p(t,[n]){t[0]?r?r.p(t,n):(r=_t(t),r.c(),r.m(e.parentNode,e)):r&&(r.d(1),r=null)},i:t,o:t,d(t){r&&r.d(t),t&&h(e)}}}function jt(t,n,e){let r;return i(t,Lt,t=>e(0,r=t)),[r]}window.onunhandledrejection=t=>{let n=t.reason;Lt.set(n.message)};class Ot extends lt{constructor(t){super(),it(this,t,jt,Mt,s,{})}}const St=bt([]),Dt=()=>gt("accounts",u(St)),zt=bt([]),Ht=(t,n)=>n.find(n=>n.uuid===t)||{},Tt=()=>gt("categories",u(zt)),Vt=t=>new Date(t).toLocaleDateString(),Pt=t=>{if(t){let n=new Date(t);const e=n.getFullYear(),r=n.getMonth()+1,o=n.getDate();return`${e}-${String(r).padStart(2,"0")}-${String(o).padStart(2,"0")}`}return""},Rt=(t,n)=>{var e=n.getFullYear(),r=n.getMonth(),o=new Date(e,r-t),c=o.getFullYear(),s=o.getMonth()+1;return c+"-"+String("0"+s).slice(-2)},It=bt({}),Bt=t=>u(It)[t]||{},Ft=t=>Bt(t).budgeted||0,qt=()=>{It.set((t=>{const n=dt(t);return null!==n?n:{}})("budget"))},Ut=(t,n)=>{u(It);(t=>u(It).hasOwnProperty(t))(t)?Wt(t,n):((t,n)=>{Jt(t,{budgeted:n,remaining:n,refilled:Rt(0,new Date)})})(t,n)},Yt=(t,n)=>{const e=Bt(t).remaining||0;Jt(t,{remaining:e-n})},Jt=(t,n)=>{((t,n,e)=>{e.update(e=>(e.hasOwnProperty(t)?e[t]=Object.assign(e[t],n):e[t]=n,e))})(t,n,It),gt("budget",u(It))},Wt=(t,n)=>{let e=u(It)[t],r=e.budgeted,o=e.remaining;Jt(t,{budgeted:n,remaining:o+(n-r)})},Gt=bt([]),Kt=bt({}),Qt=t=>{const n=Object.assign({},t);Kt.set(n)},Xt=t=>u(Gt).filter(n=>n.accountUuid===t),Zt=t=>u(Gt).filter(n=>(n.categoryAmounts||{}).hasOwnProperty(t)),tn=()=>gt("transactions",u(Gt)),nn=t=>{const n=u(Kt),e=Object.assign({},n,t);Kt.set(e)};function en(t){let n,e,r;var o=t[0];return o&&(n=new o({}),n.$on("routeEvent",t[5])),{c(){n&&st(n.$$.fragment),e=k()},m(t,o){n&&at(n,t,o),g(t,e,o),r=!0},p(t,r){if(o!==(o=t[0])){if(n){Z();const t=n;et(t.$$.fragment,1,0,()=>{ut(t,1)}),tt()}o?(n=new o({}),n.$on("routeEvent",t[5]),st(n.$$.fragment),nt(n.$$.fragment,1),at(n,e.parentNode,e)):n=null}},i(t){r||(n&&nt(n.$$.fragment,t),r=!0)},o(t){n&&et(n.$$.fragment,t),r=!1},d(t){t&&h(e),n&&ut(n,t)}}}function rn(t){let n,e,r;var o=t[0];function c(t){return{props:{params:t[1]}}}return o&&(n=new o(c(t)),n.$on("routeEvent",t[4])),{c(){n&&st(n.$$.fragment),e=k()},m(t,o){n&&at(n,t,o),g(t,e,o),r=!0},p(t,r){const s={};if(2&r&&(s.params=t[1]),o!==(o=t[0])){if(n){Z();const t=n;et(t.$$.fragment,1,0,()=>{ut(t,1)}),tt()}o?(n=new o(c(t)),n.$on("routeEvent",t[4]),st(n.$$.fragment),nt(n.$$.fragment,1),at(n,e.parentNode,e)):n=null}else o&&n.$set(s)},i(t){r||(n&&nt(n.$$.fragment,t),r=!0)},o(t){n&&et(n.$$.fragment,t),r=!1},d(t){t&&h(e),n&&ut(n,t)}}}function on(t){let n,e,r,o;const c=[rn,en],s=[];function a(t,n){return t[1]?0:1}return n=a(t),e=s[n]=c[n](t),{c(){e.c(),r=k()},m(t,e){s[n].m(t,e),g(t,r,e),o=!0},p(t,[o]){let u=n;n=a(t),n===u?s[n].p(t,o):(Z(),et(s[u],1,1,()=>{s[u]=null}),tt(),e=s[n],e||(e=s[n]=c[n](t),e.c()),nt(e,1),e.m(r.parentNode,r))},i(t){o||(nt(e),o=!0)},o(t){et(e),o=!1},d(t){s[n].d(t),t&&h(r)}}}function cn(){const t=window.location.href.indexOf("#/");let n=t>-1?window.location.href.substr(t+1):"/";const e=n.indexOf("?");let r="";return e>-1&&(r=n.substr(e+1),n=n.substr(0,e)),{location:n,querystring:r}}const sn=yt(null,(function(t){t(cn());const n=()=>{t(cn())};return window.addEventListener("hashchange",n,!1),function(){window.removeEventListener("hashchange",n,!1)}}));wt(sn,t=>t.location),wt(sn,t=>t.querystring);function an(t){if(!t||t.length<1||"/"!=t.charAt(0)&&0!==t.indexOf("#/"))throw Error("Invalid parameter location");return q().then(()=>{window.location.hash=("#"==t.charAt(0)?"":"#")+t})}function un(n,e,r){let o,c=t;i(n,sn,t=>r(6,o=t)),n.$$.on_destroy.push(()=>c());let{routes:s={}}=e,{prefix:a=""}=e;class u{constructor(t,n){if(!n||"function"!=typeof n&&("object"!=typeof n||!0!==n._sveltesparouter))throw Error("Invalid component object");if(!t||"string"==typeof t&&(t.length<1||"/"!=t.charAt(0)&&"*"!=t.charAt(0))||"object"==typeof t&&!(t instanceof RegExp))throw Error('Invalid value for "path" argument');const{pattern:e,keys:r}=function(t,n){if(t instanceof RegExp)return{keys:!1,pattern:t};var e,r,o,c,s=[],a="",u=t.split("/");for(u[0]||u.shift();o=u.shift();)"*"===(e=o[0])?(s.push("wild"),a+="/(.*)"):":"===e?(r=o.indexOf("?",1),c=o.indexOf(".",1),s.push(o.substring(1,~r?r:~c?c:o.length)),a+=~r&&!~c?"(?:/([^/]+?))?":"/([^/]+?)",~c&&(a+=(~r?"?":"")+"\\"+o.substring(c))):a+="/"+o;return{keys:s,pattern:new RegExp("^"+a+(n?"(?=$|/)":"/?$"),"i")}}(t);this.path=t,"object"==typeof n&&!0===n._sveltesparouter?(this.component=n.route,this.conditions=n.conditions||[],this.userData=n.userData):(this.component=n,this.conditions=[],this.userData=void 0),this._pattern=e,this._keys=r}match(t){a&&t.startsWith(a)&&(t=t.substr(a.length)||"/");const n=this._pattern.exec(t);if(null===n)return null;if(!1===this._keys)return n;const e={};let r=0;for(;r{l.push(new u(n,t))}):Object.keys(s).forEach(t=>{l.push(new u(t,s[t]))});let f=null,$=null;const p=z(),m=(t,n)=>{q().then(()=>{p(t,n)})};return n.$$set=t=>{"routes"in t&&r(2,s=t.routes),"prefix"in t&&r(3,a=t.prefix)},n.$$.update=()=>{if(65&n.$$.dirty){r(0,f=null);let t=0;for(;!f&&t{"autofocusElement"in t&&e(0,c=t.autofocusElement),"$$scope"in t&&e(1,o=t.$$scope)},t.$$.update=()=>{1&t.$$.dirty&&c.focus&&c.focus()},[c,o,r,function(n){H(t,n)}]}class pn extends lt{constructor(t){super(),it(this,t,$n,fn,s,{autofocusElement:0})}}function mn(t){let n,e,r;return{c(){n=b("input"),C(n,"class","form-control"),C(n,"placeholder","New account name")},m(o,c){g(o,n,c),N(n,t[0]),t[4](n),e||(r=E(n,"input",t[3]),e=!0)},p(t,e){1&e&&n.value!==t[0]&&N(n,t[0])},d(o){o&&h(n),t[4](null),e=!1,r()}}}function dn(t){let n,e,r,o;return r=new pn({props:{autofocusElement:t[1],$$slots:{default:[mn]},$$scope:{ctx:t}}}),r.$on("submit",t[2]),{c(){n=b("h2"),n.textContent="New Account",e=v(),st(r.$$.fragment)},m(t,c){g(t,n,c),g(t,e,c),at(r,t,c),o=!0},p(t,[n]){const e={};2&n&&(e.autofocusElement=t[1]),35&n&&(e.$$scope={dirty:n,ctx:t}),r.$set(e)},i(t){o||(nt(r.$$.fragment,t),o=!0)},o(t){et(r.$$.fragment,t),o=!1},d(t){t&&h(n),t&&h(e),ut(r,t)}}}function gn(t,n,e){let r="",o={};return[r,o,function(){(t=>{const n={uuid:Ct(),name:t};ft(n,St),Dt()})(r),an("/accounts")},function(){r=this.value,e(0,r)},function(t){V[t?"unshift":"push"](()=>{o=t,e(1,o)})}]}function hn(n){let e,r,o;return{c(){e=w("svg"),r=w("path"),C(r,"fill","currentColor"),C(r,"d",n[0]),C(e,"aria-hidden","true"),C(e,"class",o=m(n[1])+" svelte-1d15yci"),C(e,"role","img"),C(e,"xmlns","http://www.w3.org/2000/svg"),C(e,"viewBox",n[2])},m(t,n){g(t,e,n),d(e,r)},p(t,[n]){1&n&&C(r,"d",t[0]),2&n&&o!==(o=m(t[1])+" svelte-1d15yci")&&C(e,"class",o),4&n&&C(e,"viewBox",t[2])},i:t,o:t,d(t){t&&h(e)}}}function yn(t,e,r){let{icon:o}=e,c=[],s="",a="";return t.$$set=t=>{r(4,e=n(n({},e),p(t))),"icon"in t&&r(3,o=t.icon)},t.$$.update=()=>{8&t.$$.dirty&&r(2,a="0 0 "+o.icon[0]+" "+o.icon[1]),r(1,s="fa-svelte "+(e.class?e.class:"")),8&t.$$.dirty&&r(0,c=o.icon[4])},e=p(e),[c,s,a,o]}class bn extends lt{constructor(t){super(),it(this,t,yn,hn,s,{icon:3})}}function wn(t){let n,e,r;return n=new bn({props:{icon:t[0]}}),{c(){st(n.$$.fragment),e=v()},m(t,o){at(n,t,o),g(t,e,o),r=!0},p(t,e){const r={};1&e&&(r.icon=t[0]),n.$set(r)},i(t){r||(nt(n.$$.fragment,t),r=!0)},o(t){et(n.$$.fragment,t),r=!1},d(t){ut(n,t),t&&h(e)}}}function xn(t){let n,e,r,o,c,s,a,u,i,l,f,$,p=t[0]&&wn(t);return{c(){n=b("a"),e=b("span"),p&&p.c(),r=b("br"),o=v(),c=b("br"),s=v(),a=x(t[1]),C(e,"class","button-circle svelte-2b5sup"),C(n,"id",u="button-"+t[1]),C(n,"class","btn svelte-2b5sup"),C(n,"href",i=t[3]||"javascript:void(0)"),C(n,"role","button"),M(n,"float-left",t[2])},m(u,i){g(u,n,i),d(n,e),p&&p.m(e,null),d(e,r),d(e,o),d(n,c),d(n,s),d(n,a),l=!0,f||($=E(n,"click",t[4]),f=!0)},p(t,[o]){t[0]?p?(p.p(t,o),1&o&&nt(p,1)):(p=wn(t),p.c(),nt(p,1),p.m(e,r)):p&&(Z(),et(p,1,1,()=>{p=null}),tt()),(!l||2&o)&&L(a,t[1]),(!l||2&o&&u!==(u="button-"+t[1]))&&C(n,"id",u),(!l||8&o&&i!==(i=t[3]||"javascript:void(0)"))&&C(n,"href",i),4&o&&M(n,"float-left",t[2])},i(t){l||(nt(p),l=!0)},o(t){et(p),l=!1},d(t){t&&h(n),p&&p.d(),f=!1,$()}}}function vn(t,n,e){let{icon:r}=n,{name:o}=n,{left:c=!1}=n,{url:s=""}=n;return t.$$set=t=>{"icon"in t&&e(0,r=t.icon),"name"in t&&e(1,o=t.name),"left"in t&&e(2,c=t.left),"url"in t&&e(3,s=t.url)},[r,o,c,s,function(n){H(t,n)}]}class kn extends lt{constructor(t){super(),it(this,t,vn,xn,s,{icon:0,name:1,left:2,url:3})}}function En(t){let n,e,r,o,c,s;const a=t[1].default,u=l(a,t,t[0],null);return{c(){n=b("div"),e=v(),r=b("div"),u&&u.c(),o=v(),c=b("div"),C(n,"id","button-row-spacer"),C(n,"class","svelte-17rvsyv"),C(c,"class","clearfix"),C(r,"id","button-row"),C(r,"class","svelte-17rvsyv")},m(t,a){g(t,n,a),g(t,e,a),g(t,r,a),u&&u.m(r,null),d(r,o),d(r,c),s=!0},p(t,[n]){u&&u.p&&1&n&&$(u,a,t,t[0],n,null,null)},i(t){s||(nt(u,t),s=!0)},o(t){et(u,t),s=!1},d(t){t&&h(n),t&&h(e),t&&h(r),u&&u.d(t)}}}function An(t,n,e){let{$$slots:r={},$$scope:o}=n;return t.$$set=t=>{"$$scope"in t&&e(0,o=t.$$scope)},[o,r]}class Cn extends lt{constructor(t){super(),it(this,t,An,En,s,{})}}var Ln={prefix:"fas",iconName:"arrow-right",icon:[448,512,[],"f061","M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z"]},Nn={prefix:"fas",iconName:"check",icon:[512,512,[],"f00c","M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"]},_n={prefix:"fas",iconName:"edit",icon:[576,512,[],"f044","M402.6 83.2l90.2 90.2c3.8 3.8 3.8 10 0 13.8L274.4 405.6l-92.8 10.3c-12.4 1.4-22.9-9.1-21.5-21.5l10.3-92.8L388.8 83.2c3.8-3.8 10-3.8 13.8 0zm162-22.9l-48.8-48.8c-15.2-15.2-39.9-15.2-55.2 0l-35.4 35.4c-3.8 3.8-3.8 10 0 13.8l90.2 90.2c3.8 3.8 10 3.8 13.8 0l35.4-35.4c15.2-15.3 15.2-40 0-55.2zM384 346.2V448H64V128h229.8c3.2 0 6.2-1.3 8.5-3.5l40-40c7.6-7.6 2.2-20.5-8.5-20.5H48C21.5 64 0 85.5 0 112v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V306.2c0-10.7-12.9-16-20.5-8.5l-40 40c-2.2 2.3-3.5 5.3-3.5 8.5z"]},Mn={prefix:"fas",iconName:"home",icon:[576,512,[],"f015","M280.37 148.26L96 300.11V464a16 16 0 0 0 16 16l112.06-.29a16 16 0 0 0 15.92-16V368a16 16 0 0 1 16-16h64a16 16 0 0 1 16 16v95.64a16 16 0 0 0 16 16.05L464 480a16 16 0 0 0 16-16V300L295.67 148.26a12.19 12.19 0 0 0-15.3 0zM571.6 251.47L488 182.56V44.05a12 12 0 0 0-12-12h-56a12 12 0 0 0-12 12v72.61L318.47 43a48 48 0 0 0-61 0L4.34 251.47a12 12 0 0 0-1.6 16.9l25.5 31A12 12 0 0 0 45.15 301l235.22-193.74a12.19 12.19 0 0 1 15.3 0L530.9 301a12 12 0 0 0 16.9-1.6l25.5-31a12 12 0 0 0-1.7-16.93z"]},jn={prefix:"fas",iconName:"list-ul",icon:[512,512,[],"f0ca","M48 48a48 48 0 1 0 48 48 48 48 0 0 0-48-48zm0 160a48 48 0 1 0 48 48 48 48 0 0 0-48-48zm0 160a48 48 0 1 0 48 48 48 48 0 0 0-48-48zm448 16H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm0-320H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16V80a16 16 0 0 0-16-16zm0 160H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16z"]},On={prefix:"fas",iconName:"minus",icon:[448,512,[],"f068","M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"]},Sn={prefix:"fas",iconName:"times",icon:[352,512,[],"f00d","M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"]};function Dn(t,n,e){const r=t.slice();return r[1]=n[e].name,r[2]=n[e].uuid,r}function zn(t){let n,e,r,o,c=t[1]+"";return{c(){n=b("p"),e=b("a"),r=x(c),C(e,"href",o="#/account/"+t[2]),C(e,"class","btn btn-outline-secondary")},m(t,o){g(t,n,o),d(n,e),d(e,r)},p(t,n){1&n&&c!==(c=t[1]+"")&&L(r,c),1&n&&o!==(o="#/account/"+t[2])&&C(e,"href",o)},d(t){t&&h(n)}}}function Hn(n){let e,r;return e=new kn({props:{icon:Mn,name:"budget",url:"#/budget",left:!0}}),{c(){st(e.$$.fragment)},m(t,n){at(e,t,n),r=!0},p:t,i(t){r||(nt(e.$$.fragment,t),r=!0)},o(t){et(e.$$.fragment,t),r=!1},d(t){ut(e,t)}}}function Tn(t){let n,e,r,o,c,s,a,u=t[0],i=[];for(let n=0;nAdd new account',c=v(),st(s.$$.fragment)},m(t,u){g(t,n,u),g(t,e,u);for(let n=0;ne(0,r=t)),[r]}const Pn=t=>Fn(t)?"danger":"",Rn=t=>Bn(t,2),In=t=>Bn(t,0),Bn=(t,n)=>(null==t&&(t=0),(Number(t)/100).toFixed(n)),Fn=t=>t&&t<0;function qn(t,n,e){const r=t.slice();return r[1]=n[e].amountTotal,r[2]=n[e].timestamp,r[3]=n[e].who,r}function Un(t){let n;return{c(){n=b("i"),n.textContent="No matching transactions found."},m(t,e){g(t,n,e)},d(t){t&&h(n)}}}function Yn(t){let n,e,r,o,c,s,a,u,i,l,f,$=Vt(t[2])+"",p=t[3]+"",m=Rn(t[1])+"";return{c(){n=b("div"),e=b("div"),r=x($),o=v(),c=b("div"),s=x(p),a=v(),u=b("div"),i=b("sup"),i.textContent="$",l=x(m),f=v(),C(e,"class","col-2 text-center"),C(c,"class","col-7"),C(u,"class","col-3 text-right"),C(n,"class","row")},m(t,$){g(t,n,$),d(n,e),d(e,r),d(n,o),d(n,c),d(c,s),d(n,a),d(n,u),d(u,i),d(u,l),d(n,f)},p(t,n){1&n&&$!==($=Vt(t[2])+"")&&L(r,$),1&n&&p!==(p=t[3]+"")&&L(s,p),1&n&&m!==(m=Rn(t[1])+"")&&L(l,m)},d(t){t&&h(n)}}}function Jn(n){let e,r=n[0],o=[];for(let t=0;t{"transactions"in t&&e(0,r=t.transactions)},[r]}class Gn extends lt{constructor(t){super(),it(this,t,Wn,Jn,s,{transactions:0})}}function Kn(n){let e,r;return e=new kn({props:{icon:jn,name:"accounts",url:"#/accounts",left:!0}}),{c(){st(e.$$.fragment)},m(t,n){at(e,t,n),r=!0},p:t,i(t){r||(nt(e.$$.fragment,t),r=!0)},o(t){et(e.$$.fragment,t),r=!1},d(t){ut(e,t)}}}function Qn(t){let n,e,r,o,c,s,a,u,i,l,f,$,p,m,y,w=t[0].name+"";return s=new bn({props:{icon:_n}}),l=new Gn({props:{transactions:t[1]}}),$=new Cn({props:{$$slots:{default:[Kn]},$$scope:{ctx:t}}}),{c(){n=b("h2"),e=b("span"),r=x(w),o=v(),c=b("a"),st(s.$$.fragment),a=v(),u=b("hr"),i=v(),st(l.$$.fragment),f=v(),st($.$$.fragment),C(c,"class","float-right svelte-12253py"),C(c,"tabindex","0"),C(c,"href","javascript:void(0)"),C(u,"class","small")},m(h,b){g(h,n,b),d(n,e),d(e,r),d(n,o),d(n,c),at(s,c,null),g(h,a,b),g(h,u,b),g(h,i,b),at(l,h,b),g(h,f,b),at($,h,b),p=!0,m||(y=E(c,"click",t[2]),m=!0)},p(t,[n]){(!p||1&n)&&w!==(w=t[0].name+"")&&L(r,w);const e={};2&n&&(e.transactions=t[1]),l.$set(e);const o={};64&n&&(o.$$scope={dirty:n,ctx:t}),$.$set(o)},i(t){p||(nt(s.$$.fragment,t),nt(l.$$.fragment,t),nt($.$$.fragment,t),p=!0)},o(t){et(s.$$.fragment,t),et(l.$$.fragment,t),et($.$$.fragment,t),p=!1},d(t){t&&h(n),ut(s),t&&h(a),t&&h(u),t&&h(i),ut(l,t),t&&h(f),ut($,t),m=!1,y()}}}function Xn(t,n,e){let r;i(t,St,t=>e(5,r=t));let{params:o={}}=n;let c,s,a;return t.$$set=t=>{"params"in t&&e(3,o=t.params)},t.$$.update=()=>{8&t.$$.dirty&&e(4,c=o.uuid||""),48&t.$$.dirty&&e(0,s=r.find(t=>t.uuid===c)||{}),16&t.$$.dirty&&e(1,a=Xt(c))},[s,a,()=>{let t=prompt("Edit account name:",s.name);null!=t&&((t,n)=>{$t("uuid",t,n,St),Dt()})(c,{name:t})},o]}function Zn(n){let e,r,o,c;return{c(){e=b("div"),r=b("div"),C(r,"class",o="category-graph-line "+n[2](n[1],n[0])+" svelte-6b2uyp"),_(r,"width",n[3](n[1],n[0])+"%"),C(e,"class",c="category-graph "+Pn(n[1])+" svelte-6b2uyp")},m(t,n){g(t,e,n),d(e,r)},p(t,[n]){3&n&&o!==(o="category-graph-line "+t[2](t[1],t[0])+" svelte-6b2uyp")&&C(r,"class",o),3&n&&_(r,"width",t[3](t[1],t[0])+"%"),2&n&&c!==(c="category-graph "+Pn(t[1])+" svelte-6b2uyp")&&C(e,"class",c)},i:t,o:t,d(t){t&&h(e)}}}function te(t,n,e){let{budgeted:r}=n,{remaining:o}=n;return t.$$set=t=>{"budgeted"in t&&e(0,r=t.budgeted),"remaining"in t&&e(1,o=t.remaining)},[r,o,(t,n)=>null==t?"":t<0?"danger":tt<0?0:0===n?t>0?100:0:t/n*100]}class ne extends lt{constructor(t){super(),it(this,t,te,Zn,s,{budgeted:0,remaining:1})}}function ee(t,n,e){const r=t.slice();return r[3]=n[e].budgeted,r[4]=n[e].remaining,r[5]=n[e].name,r[6]=n[e].uuid,r}function re(t){let n,e,r,o,c,s,a,u,i,l,f,$,p,m,y,w,k,E,A,N,_,M=t[5]+"",j=Rn(t[4])+"",O=In(t[3])+"";return u=new ne({props:{budgeted:t[3],remaining:t[4]}}),{c(){n=b("tr"),e=b("td"),r=b("a"),o=x(M),s=v(),a=b("td"),st(u.$$.fragment),i=v(),l=b("td"),f=b("div"),$=b("sup"),$.textContent="$",p=x(j),y=v(),w=b("div"),k=b("span"),E=x("/ "),A=x(O),N=v(),C(r,"href",c="#/category/"+t[6]),C(r,"class","btn btn-outline-secondary"),C(e,"class","category-name width-10 svelte-1g8xb6x"),C(a,"class","width-80 svelte-1g8xb6x"),C($,"class","svelte-1g8xb6x"),C(f,"class",m="category-available "+Pn(t[4])+" svelte-1g8xb6x"),C(w,"class","category-budgeted svelte-1g8xb6x"),C(l,"class","category-amount width-10 svelte-1g8xb6x")},m(t,c){g(t,n,c),d(n,e),d(e,r),d(r,o),d(n,s),d(n,a),at(u,a,null),d(n,i),d(n,l),d(l,f),d(f,$),d(f,p),d(l,y),d(l,w),d(w,k),d(k,E),d(k,A),d(n,N),_=!0},p(t,n){(!_||1&n)&&M!==(M=t[5]+"")&&L(o,M),(!_||1&n&&c!==(c="#/category/"+t[6]))&&C(r,"href",c);const e={};1&n&&(e.budgeted=t[3]),1&n&&(e.remaining=t[4]),u.$set(e),(!_||1&n)&&j!==(j=Rn(t[4])+"")&&L(p,j),(!_||1&n&&m!==(m="category-available "+Pn(t[4])+" svelte-1g8xb6x"))&&C(f,"class",m),(!_||1&n)&&O!==(O=In(t[3])+"")&&L(A,O)},i(t){_||(nt(u.$$.fragment,t),_=!0)},o(t){et(u.$$.fragment,t),_=!1},d(t){t&&h(n),ut(u)}}}function oe(t){let n,e,r,o=t[0],c=[];for(let n=0;net(c[t],1,1,()=>{c[t]=null});return{c(){n=b("table"),e=b("tbody");for(let t=0;te(1,r=t)),i(t,zt,t=>e(2,o=t)),t.$$.update=()=>{6&t.$$.dirty&&e(0,c=((t,n)=>{let e=[];for(var r in t)if(t.hasOwnProperty(r)){let o=Ht(r,n);e.push({budgeted:t[r].budgeted,remaining:t[r].remaining,name:o.name,uuid:o.uuid})}return e.sort((t,n)=>(t.name||"").localeCompare(n.name||""))})(r,o))},[c]}class se extends lt{constructor(t){super(),it(this,t,ce,oe,s,{})}}function ae(n){let e,r,o,c;return e=new kn({props:{icon:jn,name:"accounts",url:"#/accounts",left:!0}}),o=new kn({props:{icon:On,name:"expense",url:"#/expense/new"}}),{c(){st(e.$$.fragment),r=v(),st(o.$$.fragment)},m(t,n){at(e,t,n),g(t,r,n),at(o,t,n),c=!0},p:t,i(t){c||(nt(e.$$.fragment,t),nt(o.$$.fragment,t),c=!0)},o(t){et(e.$$.fragment,t),et(o.$$.fragment,t),c=!1},d(t){ut(e,t),t&&h(r),ut(o,t)}}}function ue(t){let n,e,r,o,c,s,a,u;return r=new se({}),a=new Cn({props:{$$slots:{default:[ae]},$$scope:{ctx:t}}}),{c(){n=b("h2"),n.textContent="Budget",e=v(),st(r.$$.fragment),o=v(),c=b("p"),c.innerHTML='Add new category',s=v(),st(a.$$.fragment)},m(t,i){g(t,n,i),g(t,e,i),at(r,t,i),g(t,o,i),g(t,c,i),g(t,s,i),at(a,t,i),u=!0},p(t,[n]){const e={};1&n&&(e.$$scope={dirty:n,ctx:t}),a.$set(e)},i(t){u||(nt(r.$$.fragment,t),nt(a.$$.fragment,t),u=!0)},o(t){et(r.$$.fragment,t),et(a.$$.fragment,t),u=!1},d(t){t&&h(n),t&&h(e),ut(r,t),t&&h(o),t&&h(c),t&&h(s),ut(a,t)}}}function ie(n){let e,r,c,s,a,u,i;return{c(){e=b("form"),r=b("div"),c=b("div"),c.innerHTML='$',s=v(),a=b("input"),C(c,"class","input-group-prepend"),C(a,"type","tel"),C(a,"aria-describedby","amount-input-currency-symbol"),C(a,"aria-label","Amount"),C(a,"class","text-right form-control"),C(r,"class","input-group input-group-lg"),e.noValidate=!0},m(t,o){g(t,e,o),d(e,r),d(r,c),d(r,s),d(r,a),n[5](a),u||(i=[E(a,"keydown",n[1]),E(e,"submit",A(n[2]))],u=!0)},p:t,i:t,o:t,d(t){t&&h(e),n[5](null),u=!1,o(i)}}}function le(t,n,e){let{amount:r=0}=n,{resultingAmount:o=0}=n;const c=z();let s,a=[];D(()=>{u(r),s.focus()});const u=t=>{var n;a=(n=t)?String(n).split("").filter((function(t){return"0123456789".indexOf(t)>=0})):[],i(a),l(Number(a.join("")))};function i(t){for(var n="",r=0;r{"amount"in t&&e(4,r=t.amount),"resultingAmount"in t&&e(3,o=t.resultingAmount)},t.$$.update=()=>{16&t.$$.dirty&&u(r)},[s,function(t){var n=t.which;(t=>t>=32&&t<112||t>=123&&t<127||t>=186)(n)&&t.preventDefault();var e=(t=>t>=48&&t<58?String(t-48):t>=96&&t<106?String(t-96):"")(n);e?a.push(e):(t=>8===t)(n)&&(t.preventDefault(),a.pop()),i(a),l(Number(a.join("")))},function(t){c("next",o)},o,r,function(t){V[t?"unshift":"push"](()=>{s=t,e(0,s)})}]}class fe extends lt{constructor(t){super(),it(this,t,le,ie,s,{amount:4,resultingAmount:3})}}function $e(n){let e,r,o,c;return e=new kn({props:{icon:Nn,name:"save"}}),e.$on("click",n[3]),o=new kn({props:{icon:Sn,name:"cancel",url:"#/budget",left:!0}}),{c(){st(e.$$.fragment),r=v(),st(o.$$.fragment)},m(t,n){at(e,t,n),g(t,r,n),at(o,t,n),c=!0},p:t,i(t){c||(nt(e.$$.fragment,t),nt(o.$$.fragment,t),c=!0)},o(t){et(e.$$.fragment,t),et(o.$$.fragment,t),c=!1},d(t){ut(e,t),t&&h(r),ut(o,t)}}}function pe(t){let n,e,r,o,c,s,a,u,i,l=t[1].name+"";function f(n){t[5].call(null,n)}let $={amount:t[2]};return void 0!==t[0]&&($.resultingAmount=t[0]),c=new fe({props:$}),V.push(()=>ct(c,"resultingAmount",f)),c.$on("next",t[3]),u=new Cn({props:{$$slots:{default:[$e]},$$scope:{ctx:t}}}),{c(){n=b("h2"),e=x("Monthly amount for "),r=x(l),o=v(),st(c.$$.fragment),a=v(),st(u.$$.fragment)},m(t,s){g(t,n,s),d(n,e),d(n,r),g(t,o,s),at(c,t,s),g(t,a,s),at(u,t,s),i=!0},p(t,[n]){(!i||2&n)&&l!==(l=t[1].name+"")&&L(r,l);const e={};4&n&&(e.amount=t[2]),!s&&1&n&&(s=!0,e.resultingAmount=t[0],Y(()=>s=!1)),c.$set(e);const o={};256&n&&(o.$$scope={dirty:n,ctx:t}),u.$set(o)},i(t){i||(nt(c.$$.fragment,t),nt(u.$$.fragment,t),i=!0)},o(t){et(c.$$.fragment,t),et(u.$$.fragment,t),i=!1},d(t){t&&h(n),t&&h(o),ut(c,t),t&&h(a),ut(u,t)}}}function me(t,n,e){let r;i(t,zt,t=>e(7,r=t));let{params:o}=n,c=0;let s,a,u;return t.$$set=t=>{"params"in t&&e(4,o=t.params)},t.$$.update=()=>{16&t.$$.dirty&&e(6,s=o.uuid),192&t.$$.dirty&&e(1,a=r.find(t=>t.uuid===s)||{}),66&t.$$.dirty&&e(2,u=a&&Ft(s)||0)},[c,a,u,()=>{Ut(s,c),an("/budget")},o,function(t){c=t,e(0,c)}]}function de(n){let e,r,c,s,a,u;return{c(){e=b("form"),r=b("h2"),r.innerHTML='',c=v(),s=b("input"),C(s,"class","form-control"),C(s,"placeholder","New category name"),C(s,"id","new-category-name")},m(t,o){g(t,e,o),d(e,r),d(e,c),d(e,s),N(s,n[0]),n[4](s),a||(u=[E(s,"input",n[3]),E(e,"submit",A(n[2]))],a=!0)},p(t,[n]){1&n&&s.value!==t[0]&&N(s,t[0])},i:t,o:t,d(t){t&&h(e),n[4](null),a=!1,o(u)}}}function ge(t,n,e){let r="",o={};return D(()=>{o.focus()}),[r,o,function(){an(`/category/${(t=>{const n=u(zt).find(n=>n.name===t);if(n)return n;{const n={uuid:Ct(),name:t};return ft(n,zt),Tt(),n}})(r).uuid}/amount`)},function(){r=this.value,e(0,r)},function(t){V[t?"unshift":"push"](()=>{o=t,e(1,o)})}]}function he(n){let e,r;return e=new kn({props:{icon:Mn,name:"budget",url:"#/budget",left:!0}}),{c(){st(e.$$.fragment)},m(t,n){at(e,t,n),r=!0},p:t,i(t){r||(nt(e.$$.fragment,t),r=!0)},o(t){et(e.$$.fragment,t),r=!1},d(t){ut(e,t)}}}function ye(t){let n,e,r,o,c,s,a,u,i,l,f,$,p,m,y,w,k,A,N,_=t[1].name+"",M=Rn(Ft(t[0]))+"";return m=new Gn({props:{transactions:t[2]}}),w=new Cn({props:{$$slots:{default:[he]},$$scope:{ctx:t}}}),{c(){n=b("h2"),e=b("b"),r=x(_),o=x(":"),c=v(),s=b("a"),a=b("sup"),a.textContent="$",u=v(),i=x(M),f=v(),$=b("hr"),p=v(),st(m.$$.fragment),y=v(),st(w.$$.fragment),C(e,"class","editable svelte-1uc4ts5"),C(e,"title","(Click to rename)"),C(s,"class","btn btn-default"),C(s,"href",l="#/category/"+t[0]+"/amount"),C($,"class","small")},m(l,h){g(l,n,h),d(n,e),d(e,r),d(e,o),d(n,c),d(n,s),d(s,a),d(s,u),d(s,i),g(l,f,h),g(l,$,h),g(l,p,h),at(m,l,h),g(l,y,h),at(w,l,h),k=!0,A||(N=E(e,"click",t[3]),A=!0)},p(t,[n]){(!k||2&n)&&_!==(_=t[1].name+"")&&L(r,_),(!k||1&n)&&M!==(M=Rn(Ft(t[0]))+"")&&L(i,M),(!k||1&n&&l!==(l="#/category/"+t[0]+"/amount"))&&C(s,"href",l);const e={};4&n&&(e.transactions=t[2]),m.$set(e);const o={};64&n&&(o.$$scope={dirty:n,ctx:t}),w.$set(o)},i(t){k||(nt(m.$$.fragment,t),nt(w.$$.fragment,t),k=!0)},o(t){et(m.$$.fragment,t),et(w.$$.fragment,t),k=!1},d(t){t&&h(n),t&&h(f),t&&h($),t&&h(p),ut(m,t),t&&h(y),ut(w,t),A=!1,N()}}}function be(t,n,e){let r;i(t,zt,t=>e(5,r=t));let{params:o={}}=n;let c,s,a;return t.$$set=t=>{"params"in t&&e(4,o=t.params)},t.$$.update=()=>{16&t.$$.dirty&&e(0,c=o.uuid||""),33&t.$$.dirty&&e(1,s=r.find(t=>t.uuid===c)||{}),1&t.$$.dirty&&e(2,a=Zt(c))},[c,s,a,()=>{let t=prompt("Edit category name:",s.name);null!=t&&((t,n)=>{$t("uuid",t,n,zt),Tt()})(c,{name:t})},o]}function we(t,n,e){const r=t.slice();return r[3]=n[e],r}function xe(t,n){let e,r,o,c,s,a,u=n[3].name+"";function i(...t){return n[2](n[3],...t)}return{key:t,first:null,c(){e=b("p"),r=b("button"),o=x(u),c=v(),C(r,"class","btn btn-outline-secondary"),this.first=e},m(t,n){g(t,e,n),d(e,r),d(r,o),d(e,c),s||(a=E(r,"click",i),s=!0)},p(t,e){n=t,1&e&&u!==(u=n[3].name+"")&&L(o,u)},d(t){t&&h(e),s=!1,a()}}}function ve(n){let e,r=[],o=new Map,c=n[0];const s=t=>t[3].uuid;for(let t=0;t{"accounts"in t&&e(0,r=t.accounts)},[r,o,t=>o("select",t.uuid)]}class Ee extends lt{constructor(t){super(),it(this,t,ke,ve,s,{accounts:0})}}function Ae(n){let e,r;return e=new kn({props:{icon:Mn,name:"budget",url:"#/budget",left:!0}}),{c(){st(e.$$.fragment)},m(t,n){at(e,t,n),r=!0},p:t,i(t){r||(nt(e.$$.fragment,t),r=!0)},o(t){et(e.$$.fragment,t),r=!1},d(t){ut(e,t)}}}function Ce(t){let n,e,r,o,c,s;return r=new Ee({props:{accounts:t[0]}}),r.$on("select",t[1]),c=new Cn({props:{$$slots:{default:[Ae]},$$scope:{ctx:t}}}),{c(){n=b("h2"),n.textContent="Paid using",e=v(),st(r.$$.fragment),o=v(),st(c.$$.fragment)},m(t,a){g(t,n,a),g(t,e,a),at(r,t,a),g(t,o,a),at(c,t,a),s=!0},p(t,[n]){const e={};1&n&&(e.accounts=t[0]),r.$set(e);const o={};4&n&&(o.$$scope={dirty:n,ctx:t}),c.$set(o)},i(t){s||(nt(r.$$.fragment,t),nt(c.$$.fragment,t),s=!0)},o(t){et(r.$$.fragment,t),et(c.$$.fragment,t),s=!1},d(t){t&&h(n),t&&h(e),ut(r,t),t&&h(o),ut(c,t)}}}function Le(t,n,e){let r;return i(t,St,t=>e(0,r=t)),[r,function(t){let n=t.detail;nn({accountUuid:n}),an("/expense/amount/")}]}function Ne(n){let e,r,o,c;return e=new kn({props:{icon:Ln,name:"next"}}),e.$on("click",n[2]),o=new kn({props:{icon:Mn,name:"budget",url:"#/budget",left:!0}}),{c(){st(e.$$.fragment),r=v(),st(o.$$.fragment)},m(t,n){at(e,t,n),g(t,r,n),at(o,t,n),c=!0},p:t,i(t){c||(nt(e.$$.fragment,t),nt(o.$$.fragment,t),c=!0)},o(t){et(e.$$.fragment,t),et(o.$$.fragment,t),c=!1},d(t){ut(e,t),t&&h(r),ut(o,t)}}}function _e(t){let n,e,r,o,c,s,a,u,i,l=t[1].who+"";function f(n){t[3].call(null,n)}let $={};return void 0!==t[0]&&($.resultingAmount=t[0]),c=new fe({props:$}),V.push(()=>ct(c,"resultingAmount",f)),c.$on("next",t[2]),u=new Cn({props:{$$slots:{default:[Ne]},$$scope:{ctx:t}}}),{c(){n=b("h2"),e=x("Amount paid to "),r=x(l),o=v(),st(c.$$.fragment),a=v(),st(u.$$.fragment)},m(t,s){g(t,n,s),d(n,e),d(n,r),g(t,o,s),at(c,t,s),g(t,a,s),at(u,t,s),i=!0},p(t,[n]){(!i||2&n)&&l!==(l=t[1].who+"")&&L(r,l);const e={};!s&&1&n&&(s=!0,e.resultingAmount=t[0],Y(()=>s=!1)),c.$set(e);const o={};32&n&&(o.$$scope={dirty:n,ctx:t}),u.$set(o)},i(t){i||(nt(c.$$.fragment,t),nt(u.$$.fragment,t),i=!0)},o(t){et(c.$$.fragment,t),et(u.$$.fragment,t),i=!1},d(t){t&&h(n),t&&h(o),ut(c,t),t&&h(a),ut(u,t)}}}function Me(t,n,e){let r;i(t,Kt,t=>e(4,r=t));let o=0;let c;return t.$$.update=()=>{16&t.$$.dirty&&e(1,c=r)},[o,c,()=>{nn({amountTotal:o}),an("/expense/category/")},function(t){o=t,e(0,o)}]}function je(t,n,e){const r=t.slice();return r[4]=n[e],r}function Oe(t,n){let e,r,o,c,s,a,u=n[4].name+"";function i(...t){return n[2](n[4],...t)}return{key:t,first:null,c(){e=b("p"),r=b("button"),o=x(u),c=v(),C(r,"class","btn btn-outline-secondary"),this.first=e},m(t,n){g(t,e,n),d(e,r),d(r,o),d(e,c),s||(a=E(r,"click",i),s=!0)},p(t,e){n=t,1&e&&u!==(u=n[4].name+"")&&L(o,u)},d(t){t&&h(e),s=!1,a()}}}function Se(n){let e,r=[],o=new Map,c=n[0];const s=t=>t[4].uuid;for(let t=0;t{"categories"in t&&e(0,r=t.categories)},[r,o,t=>o("select",t.uuid)]}class ze extends lt{constructor(t){super(),it(this,t,De,Se,s,{categories:0})}}function He(n){let e,r;return e=new kn({props:{icon:Mn,name:"budget",url:"#/budget",left:!0}}),{c(){st(e.$$.fragment)},m(t,n){at(e,t,n),r=!0},p:t,i(t){r||(nt(e.$$.fragment,t),r=!0)},o(t){et(e.$$.fragment,t),r=!1},d(t){ut(e,t)}}}function Te(t){let n,e,r,o,c,s;return r=new ze({props:{categories:t[0]}}),r.$on("select",t[1]),c=new Cn({props:{$$slots:{default:[He]},$$scope:{ctx:t}}}),{c(){n=b("h2"),n.textContent="Category",e=v(),st(r.$$.fragment),o=v(),st(c.$$.fragment)},m(t,a){g(t,n,a),g(t,e,a),at(r,t,a),g(t,o,a),at(c,t,a),s=!0},p(t,[n]){const e={};1&n&&(e.categories=t[0]),r.$set(e);const o={};8&n&&(o.$$scope={dirty:n,ctx:t}),c.$set(o)},i(t){s||(nt(r.$$.fragment,t),nt(c.$$.fragment,t),s=!0)},o(t){et(r.$$.fragment,t),et(c.$$.fragment,t),s=!1},d(t){t&&h(n),t&&h(e),ut(r,t),t&&h(o),ut(c,t)}}}function Ve(t,n,e){let r,o;return i(t,Kt,t=>e(2,r=t)),i(t,zt,t=>e(0,o=t)),[o,function(t){let n={};n[t.detail]=r.amountTotal,nn({categoryAmounts:n}),an("/expense/review/")}]}function Pe(t){const n=Date.now();return Qt({timestamp:n}),an("/expense/who/"),[]}function Re(n){let e,r,o,c,s=Rn(n[1])+"";return{c(){e=b("span"),r=x(n[0]),o=x(": $ "),c=x(s),C(e,"class","badge badge-info")},m(t,n){g(t,e,n),d(e,r),d(e,o),d(e,c)},p(t,[n]){1&n&&L(r,t[0]),2&n&&s!==(s=Rn(t[1])+"")&&L(c,s)},i:t,o:t,d(t){t&&h(e)}}}function Ie(t,n,e){let{name:r=""}=n,{amount:o=0}=n;return t.$$set=t=>{"name"in t&&e(0,r=t.name),"amount"in t&&e(1,o=t.amount)},[r,o]}class Be extends lt{constructor(t){super(),it(this,t,Ie,Re,s,{name:0,amount:1})}}function Fe(t,n,e){const r=t.slice();return r[4]=n[e],r}function qe(t){let n,e;return n=new Be({props:{name:Ht(t[4],t[2]).name,amount:t[0][t[4]]}}),{c(){st(n.$$.fragment)},m(t,r){at(n,t,r),e=!0},p(t,e){const r={};6&e&&(r.name=Ht(t[4],t[2]).name),3&e&&(r.amount=t[0][t[4]]),n.$set(r)},i(t){e||(nt(n.$$.fragment,t),e=!0)},o(t){et(n.$$.fragment,t),e=!1},d(t){ut(n,t)}}}function Ue(t){let n,e,r=t[1],o=[];for(let n=0;net(o[t],1,1,()=>{o[t]=null});return{c(){for(let t=0;te(2,r=t));let o,c,{transaction:s={}}=n;return t.$$set=t=>{"transaction"in t&&e(3,s=t.transaction)},t.$$.update=()=>{8&t.$$.dirty&&e(0,o=s.categoryAmounts||{}),1&t.$$.dirty&&e(1,c=Object.keys(o))},[o,c,r,s]}class Je extends lt{constructor(t){super(),it(this,t,Ye,Ue,s,{transaction:3})}}function We(n){let e,r;return e=new kn({props:{icon:Mn,name:"done"}}),e.$on("click",n[4]),{c(){st(e.$$.fragment)},m(t,n){at(e,t,n),r=!0},p:t,i(t){r||(nt(e.$$.fragment,t),r=!0)},o(t){et(e.$$.fragment,t),r=!1},d(t){ut(e,t)}}}function Ge(t){let n,e,r,c,s,a,u,i,l,f,$,p,m,y,w,k,A,N,_,M,j,O,S,D,z,H,T,V,P,R,I,B,F,q,U,Y,J=t[0].who+"",W=Rn(t[3])+"";return y=new Je({props:{transaction:t[0]}}),F=new Cn({props:{$$slots:{default:[We]},$$scope:{ctx:t}}}),{c(){n=b("div"),e=b("div"),r=b("h2"),r.textContent="Review Expense",c=v(),s=b("p"),a=b("a"),u=x(J),i=v(),l=b("a"),f=x("$"),$=x(W),p=v(),m=b("p"),st(y.$$.fragment),w=v(),k=b("p"),A=b("b"),A.textContent="Account:",N=v(),_=b("a"),M=x(t[2]),j=v(),O=b("p"),S=b("b"),S.textContent="Date:",D=v(),z=b("input"),T=v(),V=b("p"),P=b("b"),P.textContent="Note:",R=v(),I=b("input"),B=v(),st(F.$$.fragment),C(a,"class","btn btn-outline-secondary"),C(a,"href","#/expense/who/"),C(l,"class","btn btn-outline-secondary float-right"),C(l,"href","#/expense/amount/"),C(_,"class","btn btn-outline-secondary float-right"),C(_,"href","#/expense/account/"),C(z,"type","date"),C(z,"class","float-right"),z.value=H=Pt(t[0].timestamp),C(I,"class","float-right"),I.value=t[1],C(e,"class","col-12 col-sm-8 offset-sm-2 col-md-6 offset-md-3"),C(n,"class","row")},m(o,h){g(o,n,h),d(n,e),d(e,r),d(e,c),d(e,s),d(s,a),d(a,u),d(s,i),d(s,l),d(l,f),d(l,$),d(e,p),d(e,m),at(y,m,null),d(e,w),d(e,k),d(k,A),d(k,N),d(k,_),d(_,M),d(e,j),d(e,O),d(O,S),d(O,D),d(O,z),d(e,T),d(e,V),d(V,P),d(V,R),d(V,I),g(o,B,h),at(F,o,h),q=!0,U||(Y=[E(z,"change",t[6]),E(I,"change",t[5])],U=!0)},p(t,[n]){(!q||1&n)&&J!==(J=t[0].who+"")&&L(u,J),(!q||8&n)&&W!==(W=Rn(t[3])+"")&&L($,W);const e={};1&n&&(e.transaction=t[0]),y.$set(e),(!q||4&n)&&L(M,t[2]),(!q||1&n&&H!==(H=Pt(t[0].timestamp)))&&(z.value=H),(!q||2&n&&I.value!==t[1])&&(I.value=t[1]);const r={};2048&n&&(r.$$scope={dirty:n,ctx:t}),F.$set(r)},i(t){q||(nt(y.$$.fragment,t),nt(F.$$.fragment,t),q=!0)},o(t){et(y.$$.fragment,t),et(F.$$.fragment,t),q=!1},d(t){t&&h(n),ut(y),t&&h(B),ut(F,t),U=!1,o(Y)}}}function Ke(t,n,e){let r,o;i(t,Kt,t=>e(7,r=t)),i(t,St,t=>e(9,o=t));let c,s,a,l,f;return t.$$.update=()=>{var n;128&t.$$.dirty&&e(0,c=r),1&t.$$.dirty&&e(1,s=c.note||""),513&t.$$.dirty&&e(8,(n=c.accountUuid,a=o.find(t=>t.uuid===n)||{})),256&t.$$.dirty&&e(2,l=a.name||""),1&t.$$.dirty&&e(3,f=c.amountTotal||0)},[c,s,l,f,function(){(()=>{const t=u(Kt);t.uuid=Ct(),ft(t,Gt),tn();const n=t.categoryAmounts||{};for(const t in n){const e=n[t]||0;Yt(t,e)}Qt({})})(),an("/budget")},t=>{let n=t.target.value;nn({note:n})},t=>{let n=t.target.value,e=new Date(n+" 12:00:00");nn({timestamp:e.getTime()})}]}function Qe(t){let n,e,r,o,c,s,a;return{c(){n=b("h2"),e=b("label"),r=x(t[1]),o=v(),c=b("input"),C(e,"for","who"),C(c,"type","text"),C(c,"class","form-control"),C(c,"id","who")},m(u,i){g(u,n,i),d(n,e),d(e,r),g(u,o,i),g(u,c,i),N(c,t[0]),t[5](c),s||(a=E(c,"input",t[4]),s=!0)},p(t,n){2&n&&L(r,t[1]),1&n&&c.value!==t[0]&&N(c,t[0])},d(e){e&&h(n),e&&h(o),e&&h(c),t[5](null),s=!1,a()}}}function Xe(t){let n,e;return n=new pn({props:{autofocusElement:t[2],$$slots:{default:[Qe]},$$scope:{ctx:t}}}),n.$on("submit",t[3]),{c(){st(n.$$.fragment)},m(t,r){at(n,t,r),e=!0},p(t,[e]){const r={};4&e&&(r.autofocusElement=t[2]),135&e&&(r.$$scope={dirty:e,ctx:t}),n.$set(r)},i(t){e||(nt(n.$$.fragment,t),e=!0)},o(t){et(n.$$.fragment,t),e=!1},d(t){ut(n,t)}}}function Ze(t,n,e){let{title:r}=n,{who:o=""}=n;const c=z();let s={};return t.$$set=t=>{"title"in t&&e(1,r=t.title),"who"in t&&e(0,o=t.who)},[o,r,s,()=>{c("select",o)},function(){o=this.value,e(0,o)},function(t){V[t?"unshift":"push"](()=>{s=t,e(2,s)})}]}class tr extends lt{constructor(t){super(),it(this,t,Ze,Xe,s,{title:1,who:0})}}function nr(n){let e,r,o,c;return e=new kn({props:{icon:Ln,name:"next"}}),e.$on("click",n[1]),o=new kn({props:{icon:Mn,name:"budget",url:"#/budget",left:!0}}),{c(){st(e.$$.fragment),r=v(),st(o.$$.fragment)},m(t,n){at(e,t,n),g(t,r,n),at(o,t,n),c=!0},p:t,i(t){c||(nt(e.$$.fragment,t),nt(o.$$.fragment,t),c=!0)},o(t){et(e.$$.fragment,t),et(o.$$.fragment,t),c=!1},d(t){ut(e,t),t&&h(r),ut(o,t)}}}function er(t){let n,e,r,o,c;function s(n){t[2].call(null,n)}let a={title:"Paid to:"};return void 0!==t[0]&&(a.who=t[0]),n=new tr({props:a}),V.push(()=>ct(n,"who",s)),n.$on("select",t[1]),o=new Cn({props:{$$slots:{default:[nr]},$$scope:{ctx:t}}}),{c(){st(n.$$.fragment),r=v(),st(o.$$.fragment)},m(t,e){at(n,t,e),g(t,r,e),at(o,t,e),c=!0},p(t,[r]){const c={};!e&&1&r&&(e=!0,c.who=t[0],Y(()=>e=!1)),n.$set(c);const s={};8&r&&(s.$$scope={dirty:r,ctx:t}),o.$set(s)},i(t){c||(nt(n.$$.fragment,t),nt(o.$$.fragment,t),c=!0)},o(t){et(n.$$.fragment,t),et(o.$$.fragment,t),c=!1},d(t){ut(n,t),t&&h(r),ut(o,t)}}}function rr(t,n,e){let r="";return[r,()=>{nn({who:r}),an("/expense/account/")},function(t){r=t,e(0,r)}]}function or(t){return function(t){if(!t||t.length<1||"/"!=t.charAt(0)&&0!==t.indexOf("#/"))throw Error("Invalid parameter location");q().then(()=>{const n=("#"==t.charAt(0)?"":"#")+t;try{window.history.replaceState(void 0,void 0,n)}catch(t){console.warn("Caught exception while replacing the current page. If you're running this in the Svelte REPL, please note that the `replace` method might not work in this environment.")}window.dispatchEvent(new Event("hashchange"))})}("/budget"),[]}function cr(n){let e,r,o,c,s;return{c(){e=b("h2"),e.textContent="Hmm...",r=v(),o=b("p"),o.textContent="We can't seem to find that page.",c=v(),s=b("p"),s.innerHTML='Try going back to the Home screen. Perhaps there's a link\n from there to where you were trying to go.'},m(t,n){g(t,e,n),g(t,r,n),g(t,o,n),g(t,c,n),g(t,s,n)},p:t,i:t,o:t,d(t){t&&h(e),t&&h(r),t&&h(o),t&&h(c),t&&h(s)}}}const sr={"/":class extends lt{constructor(t){super(),it(this,t,or,null,s,{})}},"/account/new":class extends lt{constructor(t){super(),it(this,t,gn,dn,s,{})}},"/accounts":class extends lt{constructor(t){super(),it(this,t,Vn,Tn,s,{})}},"/account/:uuid":class extends lt{constructor(t){super(),it(this,t,Xn,Qn,s,{params:3})}},"/budget":class extends lt{constructor(t){super(),it(this,t,null,ue,s,{})}},"/category/new":class extends lt{constructor(t){super(),it(this,t,ge,de,s,{})}},"/category/:uuid":class extends lt{constructor(t){super(),it(this,t,be,ye,s,{params:4})}},"/category/:uuid/amount":class extends lt{constructor(t){super(),it(this,t,me,pe,s,{params:4})}},"/expense/account/":class extends lt{constructor(t){super(),it(this,t,Le,Ce,s,{})}},"/expense/amount/":class extends lt{constructor(t){super(),it(this,t,Me,_e,s,{})}},"/expense/category/":class extends lt{constructor(t){super(),it(this,t,Ve,Te,s,{})}},"/expense/new":class extends lt{constructor(t){super(),it(this,t,Pe,null,s,{})}},"/expense/review/":class extends lt{constructor(t){super(),it(this,t,Ke,Ge,s,{})}},"/expense/who/":class extends lt{constructor(t){super(),it(this,t,rr,er,s,{})}},"*":class extends lt{constructor(t){super(),it(this,t,null,cr,s,{})}}};function ar(n){let e,r,o,c,s;return r=new Ot({}),c=new ln({props:{routes:sr}}),{c(){e=b("div"),st(r.$$.fragment),o=v(),st(c.$$.fragment),C(e,"class","container-xl my-3")},m(t,n){g(t,e,n),at(r,e,null),d(e,o),at(c,e,null),s=!0},p:t,i(t){s||(nt(r.$$.fragment,t),nt(c.$$.fragment,t),s=!0)},o(t){et(r.$$.fragment,t),et(c.$$.fragment,t),s=!1},d(t){t&&h(e),ut(r),ut(c)}}}function ur(t){return D(async()=>{St.set(mt("accounts")),zt.set(mt("categories")),qt(),Gt.set(mt("transactions"))}),[]}return new class extends lt{constructor(t){super(),it(this,t,ur,ar,s,{})}}({target:document.body})}();
diff --git a/src/views/ExpenseReview.svelte b/src/views/ExpenseReview.svelte
index 7163a98..e0b331e 100644
--- a/src/views/ExpenseReview.svelte
+++ b/src/views/ExpenseReview.svelte
@@ -11,6 +11,7 @@ import { formatAmount } from "../helpers/numbers";
import { push } from 'svelte-spa-router'
$: transaction = $transactionInProgress
+$: transactionNote = transaction.note || ''
$: account = getAccountFrom(transaction.accountUuid, $accounts)
$: accountName = account.name || ''
$: amountTotal = transaction.amountTotal || 0
@@ -25,6 +26,11 @@ function setComment(event) {
updatePendingTransaction({ comment })
}
+const setNote = event => {
+ let note = event.target.value
+ updatePendingTransaction({ note })
+}
+
const setTimestamp = event => {
let dateString = event.target.value
let when = new Date(`${dateString} 12:00:00`)
@@ -54,7 +60,10 @@ const setTimestamp = event => {
Date:
-
+
+ Note:
+
+