@actual-app/web 23.7.0 → 23.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/asset-manifest.json +5 -5
- package/build/data/migrations/1688841238000_add_account_type.sql +5 -0
- package/build/data-file-index.txt +2 -1
- package/build/index.html +1 -1
- package/build/kcab/{kcab.worker.d3b18567995ce96e3239.js → kcab.worker.7aebb51bfd02e5b1a78f.js} +3 -3
- package/build/kcab/kcab.worker.7aebb51bfd02e5b1a78f.js.map +1 -0
- package/build/static/js/main.6ae08084.js +3 -0
- package/build/static/js/main.6ae08084.js.map +1 -0
- package/build/static/js/reports.c9bf4be9.chunk.js +2 -0
- package/build/static/js/reports.c9bf4be9.chunk.js.map +1 -0
- package/package.json +1 -3
- package/build/kcab/kcab.worker.d3b18567995ce96e3239.js.map +0 -1
- package/build/static/js/main.127f6bd4.js +0 -3
- package/build/static/js/main.127f6bd4.js.map +0 -1
- package/build/static/js/reports.51bcc145.chunk.js +0 -2
- package/build/static/js/reports.51bcc145.chunk.js.map +0 -1
- /package/build/data/migrations/{1685375406832_transaction_filters.sql → 1688749527273_transaction_filters.sql} +0 -0
- /package/build/kcab/{kcab.worker.d3b18567995ce96e3239.js.LICENSE.txt → kcab.worker.7aebb51bfd02e5b1a78f.js.LICENSE.txt} +0 -0
- /package/build/static/js/{main.127f6bd4.js.LICENSE.txt → main.6ae08084.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! For license information please see main.6ae08084.js.LICENSE.txt */
|
|
2
|
+
!function(){var e={2677:function(e,t,n){"use strict";n.d(t,{U:function(){return l}});var r=n(3017),o=n(702),i=n(8993);let a=(0,r.createContext)("app");function s(e){let{keyName:t,eventType:n="keydown",handler:i}=e,s=(0,r.useContext)(a);if("keyup"!==n&&"keydown"!==n)throw new Error("KeyHandler: unknown event type: "+n);return(0,r.useEffect)((()=>{function e(e,t){if(e.preventDefault(),e.type===n&&i)return i(e,t)}return(0,o.Z)(t,{scope:s,keyup:!0},e),()=>{o.Z.unbind({key:t,scope:s,method:e})}}),[t,i,s]),null}function l(e){let{eventType:t,keys:n={}}=e,r=Object.keys(n).map((e=>(0,i.jsx)(s,{keyName:e,eventType:t,handler:n[e]},e)));return(0,i.jsx)(i.Fragment,{children:r})}o.Z.filter=e=>{let t=e.target||e.srcElement,n=t.tagName;return!!(e.metaKey||!t.isContentEditable&&("INPUT"!==n&&"TEXTAREA"!==n&&"SELECT"!==n||t.readOnly))}},945:function(e,t,n){"use strict";n.d(t,{B:function(){return k},Z:function(){return N}});var r=n(3017),o=n(8989),i=n(5249),a=n(1785),s=n(1669),l=n(8297),u=n(9121),c=n(2328),d=n(5499),f=n(7156),h=n(1936),p=n(4917),g=n(837),m=n(8370),y=n(9585),v=n(5058),x=n(7888),b=n(2085),w=n(5371),S=n(9234),C=n(8993);let j=(0,c.n)((0,u.ZP)("schedules").select("*"));function k(e){let{value:t,field:n,valueIsRaw:s,inline:l=!1,data:u,describe:c=(e=>e.name)}=e,{data:d,dateFormat:f}=(0,o.v9)((e=>{let t;if(u)t=u;else switch(n){case"payee":t=e.queries.payees;break;case"category":t=e.queries.categories.list;break;case"account":t=e.queries.accounts;break;default:t=[]}return{data:t,dateFormat:e.prefs.local.dateFormat||"MM/dd/yyyy"}})),[h,g]=(0,r.useState)(!1);function v(e){if(null==e||""===e)return"(nothing)";if("boolean"===typeof e)return e?"true":"false";switch(n){case"amount":return(0,y.zA)(e);case"date":return e?e.frequency?(0,m.o7)(e):(0,i.Z)((0,a.Z)(e),f):null;case"month":return e?(0,i.Z)((0,a.Z)(e),(0,p.LT)(f)):null;case"year":return e?(0,i.Z)((0,a.Z)(e),"yyyy"):null;case"notes":case"imported_payee":return e;case"payee":case"category":case"account":case"rule":if(s)return e;if(d&&d.length){let t=d.find((t=>t.id===e));return t?c(t):"(deleted)"}return"\u2026";default:throw new Error(`Unknown field ${n}`)}}if(Array.isArray(t)){if(0===t.length)return(0,C.jsx)(w.xv,{style:{color:b.O9.p4},children:"(empty)"});if(1===t.length)return(0,C.jsxs)(w.xv,{children:["[",(0,C.jsx)(w.xv,{style:{color:b.O9.p4},children:v(t[0])}),"]"]});let e=t;!h&&t.length>4&&(e=t.slice(0,3));let n=t.length-e.length;return(0,C.jsxs)(w.xv,{style:{color:b.O9.n3},children:["[",e.map(((e,n)=>{let r,o=(0,C.jsx)(w.xv,{style:{color:b.O9.p4},children:v(e)});return r=l?0!==n?" ":"":(0,C.jsxs)(C.Fragment,{children:[0===n&&(0,C.jsx)("br",{}),"\xa0\xa0"]}),(0,C.jsxs)(w.xv,{children:[r,o,n===t.length-1?"":",",!l&&(0,C.jsx)("br",{})]},n)})),n>0&&(0,C.jsxs)(w.xv,{style:{color:b.O9.p4},children:["\xa0\xa0",(0,C.jsxs)(w.Qj,{onClick:function(e){e.preventDefault(),g(!0)},style:{color:b.O9.p4},children:[n," more items..."]}),!l&&(0,C.jsx)("br",{})]}),"]"]})}return t&&null!=t.num1&&null!=t.num2?(0,C.jsxs)(w.xv,{children:[(0,C.jsx)(w.xv,{style:{color:b.O9.p4},children:v(t.num1)})," and"," ",(0,C.jsx)(w.xv,{style:{color:b.O9.p4},children:v(t.num2)})]}):(0,C.jsx)(w.xv,{style:{color:b.O9.p4},children:v(t)})}function E(e){let{field:t,op:n,value:r,options:o,prefix:i,style:a,inline:s}=e;return(0,C.jsxs)(w.G7,{style:[{display:"block",maxWidth:"100%",backgroundColor:b.O9.n10,borderRadius:4,padding:"3px 5px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},a],children:[i&&(0,C.jsxs)(w.xv,{style:{color:b.O9.n3},children:[i," "]}),(0,C.jsx)(w.xv,{style:{color:b.O9.p4},children:(0,g.gL)(t,o)})," ",(0,C.jsx)(w.xv,{style:{color:b.O9.n3},children:(0,g.w8)(n)})," ",(0,C.jsx)(k,{value:r,field:t,inline:s})]})}function T(e,t){return t?`${t.name} (${e.next_date})`:`Next: ${e.next_date}`}function O(e){let{value:t}=e,n=(0,o.v9)((e=>e.queries.payees)),r=(0,d.yG)(n),{data:i}=j.useQuery();return(0,C.jsx)(k,{value:t,field:"rule",data:i,describe:e=>T(e,r[e._payee])})}function I(e){let{field:t,op:n,value:r,options:o,style:i}=e;return(0,C.jsx)(w.G7,{style:[{display:"block",maxWidth:"100%",backgroundColor:b.O9.n10,borderRadius:4,padding:"3px 5px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},i],children:"set"===n?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(w.xv,{style:{color:b.O9.n3},children:(0,g.w8)(n)})," ",(0,C.jsx)(w.xv,{style:{color:b.O9.p4},children:(0,g.gL)(t,o)})," ",(0,C.jsx)(w.xv,{style:{color:b.O9.n3},children:"to "}),(0,C.jsx)(k,{value:r,field:t})]}):"link-schedule"===n?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(w.xv,{style:{color:b.O9.n3},children:(0,g.w8)(n)})," ",(0,C.jsx)(O,{value:r})]}):null})}let D=(0,r.memo)((e=>{let{rule:t,hovered:n,selected:r,editing:o,focusedField:i,onHover:a,onEdit:s,onEditRule:l}=e,u=(0,v.YP)(),c=r?b.O9.b8:b.O9.border,d=n||"select"===i;return(0,C.jsxs)(S.X2,{height:"auto",borderColor:c,backgroundColor:r?b.O9.selected:d?b.O9.hover:"white",style:{fontSize:13,zIndex:o||r?101:"auto"},collapsed:"true",onMouseEnter:()=>a&&a(t.id),onMouseLeave:()=>a&&a(null),children:[(0,C.jsx)(S._7,{exposed:n||r||o,focused:"select"===i,onSelect:e=>{u({type:"select",id:t.id,event:e})},onEdit:()=>s(t.id,"select"),selected:r}),(0,C.jsx)(S.bL,{name:"stage",width:50,plain:!0,style:{color:b.O9.n5},children:t.stage&&(0,C.jsx)(w.G7,{style:{alignSelf:"flex-start",margin:5,backgroundColor:b.O9.b10,color:b.O9.b1,borderRadius:4,padding:"3px 5px"},children:t.stage})}),(0,C.jsx)(S.gN,{width:"flex",style:{padding:"15px 0"},truncate:!1,children:(0,C.jsxs)(w.Kq,{direction:"row",align:"center",children:[(0,C.jsx)(w.G7,{style:{flex:1,alignItems:"flex-start"},"data-testid":"conditions",children:t.conditions.map(((e,n)=>(0,C.jsx)(E,{field:e.field,op:e.op,inline:!0,value:e.value,options:e.options,prefix:n>0?(0,g.w8)(t.conditionsOp):null,style:0!==n&&{marginTop:3}},n)))}),(0,C.jsx)(w.xv,{children:(0,C.jsx)(x.Z,{color:b.O9.n4,style:{width:12,height:12}})}),(0,C.jsx)(w.G7,{style:{flex:1,alignItems:"flex-start"},"data-testid":"actions",children:t.actions.map(((e,t)=>(0,C.jsx)(I,{field:e.field,op:e.op,value:e.value,options:e.options,style:0!==t&&{marginTop:3}},t)))})]})}),(0,C.jsx)(S.bL,{name:"edit",focused:"edit"===i,plain:!0,style:{padding:"0 15px",paddingLeft:5},children:(0,C.jsx)(w.zx,{as:S.Sx,onSelect:()=>l(t),onEdit:()=>s(t.id,"edit"),children:"Edit"})})]})})),A=(0,r.forwardRef)(((e,t)=>{let{data:n,navigator:o,loadMore:i,style:a,onHoverLeave:s,children:l,...u}=e,c=(0,r.useRef)(),d=(0,r.useRef)(),f=(0,r.useRef)(),{getNavigatorProps:h}=o;return(0,r.useEffect)((()=>{c.current?d.current=c.current.getBoundingClientRect().height:d.current=null}),[c.current,n]),(0,C.jsx)(w.G7,{style:[{flex:1,outline:"none","& .animated .animated-row":{transition:".25s transform"}},a],tabIndex:"1","data-testid":"table",...h(u),children:(0,C.jsx)(w.G7,{innerRef:f,style:{maxWidth:"100%",overflow:"auto"},onScroll:function(e){null!=d.current&&i&&e.target.scrollTop>d.current-750&&i()},children:(0,C.jsx)("div",{ref:c,onMouseLeave:s,children:l})})})}));function _(){let e=(0,v.D9)(),t=(0,v.YP)();return(0,C.jsxs)(S.xD,{version:"v2",style:{},children:[(0,C.jsx)(S._7,{exposed:!0,focused:!1,selected:e.size>0,onSelect:e=>t({type:"select-all",event:e})}),(0,C.jsx)(S.bL,{value:"Stage",width:50}),(0,C.jsx)(S.bL,{value:"Rule",width:"flex"})]})}function P(e){let{rules:t,selectedItems:n,navigator:r,hoveredRule:o,collapsed:i,onHover:a,onCollapse:s,onEditRule:l}=e;return 0===t.length?null:(0,C.jsx)(w.G7,{children:t.map((e=>{let t=o===e.id,i=n.has(e.id),s=r.editingId===e.id;return(0,C.jsx)(D,{rule:e,hovered:t,selected:i,editing:s,focusedField:s&&r.focusedField,onHover:a,onEdit:r.onEdit,onEditRule:l},e.id)}))})}function M(e,t,n){let{payees:r,categories:o,accounts:i}=n;if(!t)return"";let a=null;if("payee"===e)a=r.find((e=>e.id===t));else if("category"===e)a=o.find((e=>e.id===t));else{if("account"!==e)return t;a=i.find((e=>e.id===t))}return a?a.name:"(deleted)"}function R(e){let{isModal:t,payeeId:n,setLoading:i}=e,[a,u]=(0,r.useState)(null),[c,d]=(0,r.useState)(null),[p,m]=(0,r.useState)(""),y=(0,o.I0)(),x=(0,S.wz)(c,["select","edit"]),{data:k}=j.useQuery(),E=(0,o.v9)((e=>({payees:e.queries.payees,categories:e.queries.categories.list,accounts:e.queries.accounts,schedules:k}))),O=(0,r.useMemo)((()=>""!==p&&c?c.filter((e=>function(e,t){let n=e.conditions.flatMap((e=>[(0,g.gL)(e.field),(0,g.w8)(e.op),"oneOf"===e.op?e.value.map((n=>M(e.field,n,t))).join(", "):M(e.field,e.value,t)])),r=e.actions.flatMap((e=>{if("set"===e.op)return[(0,g.w8)(e.op),(0,g.gL)(e.field),"to",M(e.field,e.value,t)];if("link-schedule"===e.op){let n=t.schedules.find((t=>t.id===e.value));return[(0,g.w8)(e.op),T(n,t.payees.find((e=>e.id===n._payee)))]}return[]}));return(e.stage||"")+" "+n.join(" ")+" "+r.join(" ")}(e,E).toLowerCase().includes(p.toLowerCase()))):c),[c,p,E]),I=(0,v.ZP)("manage-rules",a,[]),[D,R]=(0,r.useState)(null),N=(0,r.useRef)(null);async function L(){i(!0);let e=null;return e=n?await(0,f.lW)("payees-get-rules",{id:n}):await(0,f.lW)("rules-get"),u(e),e}(0,r.useEffect)((()=>(h.kp("openModal","manage-rules"),async function(){let e=await L();d(e.slice(0,100)),i(!1),await y((0,l.Rr)())}(),()=>{h.kp("openModal",null)})),[]);let F=(0,r.useCallback)((e=>{y((0,s.Ll)("edit-rule",{rule:e,onSave:async e=>{let t=await L();d((n=>{let r=t.findIndex((t=>t.id===e.id));return r>n.length?t.slice(0,r+75):t.slice(0,n.length)})),i(!1)}}))}),[]);let W=(0,r.useCallback)((e=>{R(e)}),[]);return null===c?null:(0,C.jsx)(v.i5,{instance:I,children:(0,C.jsxs)(w.G7,{style:{overflow:"hidden"},children:[(0,C.jsxs)(w.G7,{style:{flexDirection:"row",alignItems:"center",padding:t?"0 13px 15px":"0 0 15px",flexShrink:0},children:[(0,C.jsx)(w.G7,{style:{color:b.O9.n4,flexDirection:"row",alignItems:"center",width:"50%"},children:(0,C.jsxs)(w.xv,{children:["Rules are always run in the order that you see them."," ",(0,C.jsx)(w.dL,{to:"https://actualbudget.org/docs/budgeting/rules/",linkColor:"muted",children:"Learn more"})]})}),(0,C.jsx)(w.G7,{style:{flex:1}}),(0,C.jsx)(w.II,{placeholder:"Filter rules...",value:p,onChange:e=>{m(e.target.value),x.onEdit(null)},style:{width:350,borderColor:t?null:"transparent",backgroundColor:t?null:b.O9.n11,":focus":t?null:{backgroundColor:"white","::placeholder":{color:b.O9.n8}}}})]}),(0,C.jsxs)(w.G7,{style:{flex:1},children:[(0,C.jsx)(_,{}),(0,C.jsx)(A,{ref:N,data:O,navigator:x,loadMore:function(){d(c.concat(a.slice(c.length,c.length+50)))},style:{marginBottom:-1},children:(0,C.jsx)(P,{rules:O,selectedItems:I.items,navigator:x,hoveredRule:D,onHover:W,onEditRule:F})})]}),(0,C.jsx)(w.G7,{style:{paddingBlock:15,paddingInline:t?13:0,borderTop:t&&"1px solid "+b.O9.border,flexShrink:0},children:(0,C.jsxs)(w.Kq,{direction:"row",align:"center",justify:"flex-end",spacing:2,children:[I.items.size>0&&(0,C.jsxs)(w.zx,{onClick:async function(){i(!0);let{someDeletionsFailed:e}=await(0,f.lW)("rule-delete-all",[...I.items]);e&&alert("Some rules were not deleted because they are linked to schedules");let t=await L();d((e=>t.slice(0,e.length))),I.dispatch({type:"select-none"}),i(!1)},children:["Delete ",I.items.size," rules"]}),(0,C.jsx)(w.zx,{primary:!0,onClick:function(){let e={stage:null,conditionsOp:"and",conditions:[{field:"payee",op:"is",value:n||null,type:"id"}],actions:[{op:"set",field:"category",value:null,type:"id"}]};y((0,s.Ll)("edit-rule",{rule:e,onSave:async e=>{let t=await L();x.onEdit(e.id,"edit"),d((n=>{let r=t.findIndex((t=>t.id===e.id));return t.slice(0,r+75)})),i(!1)}}))},children:"Create new rule"})]})})]})})}function N(e){let{isModal:t,payeeId:n,setLoading:r=(()=>{})}=e;return(0,C.jsx)(j.Provider,{children:(0,C.jsx)(R,{isModal:t,payeeId:n,setLoading:r})})}},5432:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(3017),o=n(5068),i=n(2085),a=n(5371),s=n(7835),l=n(8993);function u(e){let{items:t,getItemProps:n,highlightedIndex:o,embedded:s}=e,u=null;return(0,l.jsx)(a.G7,{children:(0,l.jsx)(a.G7,{style:[{overflow:"auto",padding:"5px 0"},!s&&{maxHeight:175}],children:t.map(((e,t)=>{const a=!u||(e.offbudget!==u.offbudget&&!e.closed||e.closed!==u.closed&&!e.offbudget),c=""+(e.closed?"Closed Accounts":e.offbudget?"Off Budget":"For Budget");return u=e,[a?(0,l.jsx)("div",{style:{color:i.O9.y9,padding:"4px 9px"},"data-testid":"account-item-group",children:c},c):null,(0,r.createElement)("div",{...n?n({item:e}):null,key:e.id,style:{backgroundColor:o===t?i.O9.n4:"transparent",padding:4,paddingLeft:20,borderRadius:s?4:0},"data-testid":"account-item"+(o===t?"-highlighted":"")},e.name)]}))})})}function c(e){let{embedded:t,includeClosedAccounts:n=!0,...r}=e,i=(0,o.gM)()||[];return i=i.filter((e=>n?e:!e.closed)).sort(((e,t)=>e.closed===t.closed?e.offbudget===t.offbudget?0:e.offbudget?1:-1:e.closed?1:-1)),(0,l.jsx)(s.ZP,{strict:!0,highlightFirst:!0,embedded:t,suggestions:i,renderItems:(e,n,r)=>(0,l.jsx)(u,{items:e,getItemProps:n,highlightedIndex:r,embedded:t}),...r})}},7835:function(e,t,n){"use strict";n.d(t,{oo:function(){return ge},h5:function(){return pe},ZP:function(){return me},PW:function(){return oe}});var r=n(3017),o=n(1461),i=n(7896),a=n(753),s=n(8960);var l=n(7633),u=n.n(l);n(3612);let c=e=>"object"==typeof e&&null!=e&&1===e.nodeType,d=(e,t)=>(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e,f=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){let n=getComputedStyle(e,null);return d(n.overflowY,t)||d(n.overflowX,t)||(e=>{let t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}})(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)})(e)}return!1},h=(e,t,n,r,o,i,a,s)=>i<e&&a>t||i>e&&a<t?0:i<=e&&s<=n||a>=t&&s>=n?i-e-r:a>t&&s<n||i<e&&s>n?a-t+o:0,p=e=>{let t=e.parentElement;return null==t?e.getRootNode().host||null:t};var g=function(){return g=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},g.apply(this,arguments)};Object.create;Object.create;var m=0;function y(e){return"function"===typeof e?e:v}function v(){}function x(e,t){if(e){var n=((e,t)=>{var n,r,o,i,a,s;if("undefined"==typeof document)return[];let{scrollMode:l,block:u,inline:d,boundary:g,skipOverflowHiddenElements:m}=t,y="function"==typeof g?g:e=>e!==g;if(!c(e))throw new TypeError("Invalid target");let v=document.scrollingElement||document.documentElement,x=[],b=e;for(;c(b)&&y(b);){if(b=p(b),b===v){x.push(b);break}null!=b&&b===document.body&&f(b)&&!f(document.documentElement)||null!=b&&f(b,m)&&x.push(b)}let w=null!=(r=null==(n=window.visualViewport)?void 0:n.width)?r:innerWidth,S=null!=(i=null==(o=window.visualViewport)?void 0:o.height)?i:innerHeight,C=null!=(a=window.scrollX)?a:pageXOffset,j=null!=(s=window.scrollY)?s:pageYOffset,{height:k,width:E,top:T,right:O,bottom:I,left:D}=e.getBoundingClientRect(),A="start"===u||"nearest"===u?T:"end"===u?I:T+k/2,_="center"===d?D+E/2:"end"===d?O:D,P=[];for(let c=0;c<x.length;c++){let e=x[c],{height:t,width:n,top:r,right:o,bottom:i,left:a}=e.getBoundingClientRect();if("if-needed"===l&&T>=0&&D>=0&&I<=S&&O<=w&&T>=r&&I<=i&&D>=a&&O<=o)return P;let s=getComputedStyle(e),f=parseInt(s.borderLeftWidth,10),p=parseInt(s.borderTopWidth,10),g=parseInt(s.borderRightWidth,10),m=parseInt(s.borderBottomWidth,10),y=0,b=0,M="offsetWidth"in e?e.offsetWidth-e.clientWidth-f-g:0,R="offsetHeight"in e?e.offsetHeight-e.clientHeight-p-m:0,N="offsetWidth"in e?0===e.offsetWidth?0:n/e.offsetWidth:0,L="offsetHeight"in e?0===e.offsetHeight?0:t/e.offsetHeight:0;if(v===e)y="start"===u?A:"end"===u?A-S:"nearest"===u?h(j,j+S,S,p,m,j+A,j+A+k,k):A-S/2,b="start"===d?_:"center"===d?_-w/2:"end"===d?_-w:h(C,C+w,w,f,g,C+_,C+_+E,E),y=Math.max(0,y+j),b=Math.max(0,b+C);else{y="start"===u?A-r-p:"end"===u?A-i+m+R:"nearest"===u?h(r,i,t,p,m+R,A,A+k,k):A-(r+t/2)+R/2,b="start"===d?_-a-f:"center"===d?_-(a+n/2)+M/2:"end"===d?_-o+g+M:h(a,o,n,f,g+M,_,_+E,E);let{scrollLeft:s,scrollTop:l}=e;y=Math.max(0,Math.min(l+y/L,e.scrollHeight-t/L+R)),b=Math.max(0,Math.min(s+b/N,e.scrollWidth-n/N+M)),A+=l-y,_+=s-b}P.push({el:e,top:y,left:b})}return P})(e,{boundary:t,block:"nearest",scrollMode:"if-needed"});n.forEach((function(e){var t=e.el,n=e.top,r=e.left;t.scrollTop=n,t.scrollLeft=r}))}}function b(e,t,n){return e===t||t instanceof n.Node&&e.contains&&e.contains(t)}function w(e,t){var n;function r(){n&&clearTimeout(n)}function o(){for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];r(),n=setTimeout((function(){n=null,e.apply(void 0,i)}),t)}return o.cancel=r,o}function S(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return t.some((function(t){return t&&t.apply(void 0,[e].concat(r)),e.preventDownshiftDefault||e.hasOwnProperty("nativeEvent")&&e.nativeEvent.preventDownshiftDefault}))}}function C(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){t.forEach((function(t){"function"===typeof t?t(e):t&&(t.current=e)}))}}function j(){return String(m++)}function k(e){var t=e.isOpen,n=e.resultCount,r=e.previousResultCount;return t?n?n!==r?n+" result"+(1===n?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter key to select.":"":"No results are available.":""}function E(e,t){return!(e=Array.isArray(e)?e[0]:e)&&t?t:e}function T(e){return"string"===typeof e.type}function O(e){return e.props}var I=["highlightedIndex","inputValue","isOpen","selectedItem","type"];function D(e){void 0===e&&(e={});var t={};return I.forEach((function(n){e.hasOwnProperty(n)&&(t[n]=e[n])})),t}function A(e,t){return Object.keys(e).reduce((function(n,r){return n[r]=_(t,r)?t[r]:e[r],n}),{})}function _(e,t){return void 0!==e[t]}function P(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&0!==t.indexOf("Arrow")?"Arrow"+t:t}function M(e,t,n,r,o){if(void 0===o&&(o=!0),0===n)return-1;var i=n-1;("number"!==typeof t||t<0||t>=n)&&(t=e>0?-1:i+1);var a=t+e;a<0?a=o?i:0:a>i&&(a=o?0:i);var s=R(e,a,n,r,o);return-1===s?t>=n?-1:t:s}function R(e,t,n,r,o){var i=r(t);if(!i||!i.hasAttribute("disabled"))return t;if(e>0){for(var a=t+1;a<n;a++)if(!r(a).hasAttribute("disabled"))return a}else for(var s=t-1;s>=0;s--)if(!r(s).hasAttribute("disabled"))return s;return o?e>0?R(1,0,n,r,!1):R(-1,n-1,n,r,!1):-1}function N(e,t,n,r){return void 0===r&&(r=!0),t.some((function(t){return t&&(b(t,e,n)||r&&b(t,n.document.activeElement,n))}))}var L=w((function(e){W(e).textContent=""}),500);function F(e,t){var n=W(t);e&&(n.textContent=e,L(t))}function W(e){void 0===e&&(e=document);var t=e.getElementById("a11y-status-message");return t||((t=e.createElement("div")).setAttribute("id","a11y-status-message"),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-relevant","additions text"),Object.assign(t.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.appendChild(t),t)}var B=Object.freeze({__proto__:null,unknown:0,mouseUp:1,itemMouseEnter:2,keyDownArrowUp:3,keyDownArrowDown:4,keyDownEscape:5,keyDownEnter:6,keyDownHome:7,keyDownEnd:8,clickItem:9,blurInput:10,changeInput:11,keyDownSpaceButton:12,clickButton:13,blurButton:14,controlledPropUpdatedSelectedItem:15,touchEnd:16}),z=["refKey","ref"],G=["onClick","onPress","onKeyDown","onKeyUp","onBlur"],Z=["onKeyDown","onBlur","onChange","onInput","onChangeText"],U=["refKey","ref"],H=["onMouseMove","onMouseDown","onClick","onPress","index","item"],K=function(){var e=function(e){var t,n;function l(t){var n;(n=e.call(this,t)||this).id=n.props.id||"downshift-"+j(),n.menuId=n.props.menuId||n.id+"-menu",n.labelId=n.props.labelId||n.id+"-label",n.inputId=n.props.inputId||n.id+"-input",n.getItemId=n.props.getItemId||function(e){return n.id+"-item-"+e},n.input=null,n.items=[],n.itemCount=null,n.previousResultCount=0,n.timeoutIds=[],n.internalSetTimeout=function(e,t){var r=setTimeout((function(){n.timeoutIds=n.timeoutIds.filter((function(e){return e!==r})),e()}),t);n.timeoutIds.push(r)},n.setItemCount=function(e){n.itemCount=e},n.unsetItemCount=function(){n.itemCount=null},n.setHighlightedIndex=function(e,t){void 0===e&&(e=n.props.defaultHighlightedIndex),void 0===t&&(t={}),t=D(t),n.internalSetState((0,i.Z)({highlightedIndex:e},t))},n.clearSelection=function(e){n.internalSetState({selectedItem:null,inputValue:"",highlightedIndex:n.props.defaultHighlightedIndex,isOpen:n.props.defaultIsOpen},e)},n.selectItem=function(e,t,r){t=D(t),n.internalSetState((0,i.Z)({isOpen:n.props.defaultIsOpen,highlightedIndex:n.props.defaultHighlightedIndex,selectedItem:e,inputValue:n.props.itemToString(e)},t),r)},n.selectItemAtIndex=function(e,t,r){var o=n.items[e];null!=o&&n.selectItem(o,t,r)},n.selectHighlightedItem=function(e,t){return n.selectItemAtIndex(n.getState().highlightedIndex,e,t)},n.internalSetState=function(e,t){var r,o,a={},s="function"===typeof e;return!s&&e.hasOwnProperty("inputValue")&&n.props.onInputValueChange(e.inputValue,(0,i.Z)({},n.getStateAndHelpers(),e)),n.setState((function(t){t=n.getState(t);var l=s?e(t):e;l=n.props.stateReducer(t,l),r=l.hasOwnProperty("selectedItem");var u={};return r&&l.selectedItem!==t.selectedItem&&(o=l.selectedItem),l.type=l.type||0,Object.keys(l).forEach((function(e){t[e]!==l[e]&&(a[e]=l[e]),"type"!==e&&(l[e],_(n.props,e)||(u[e]=l[e]))})),s&&l.hasOwnProperty("inputValue")&&n.props.onInputValueChange(l.inputValue,(0,i.Z)({},n.getStateAndHelpers(),l)),u}),(function(){y(t)(),Object.keys(a).length>1&&n.props.onStateChange(a,n.getStateAndHelpers()),r&&n.props.onSelect(e.selectedItem,n.getStateAndHelpers()),void 0!==o&&n.props.onChange(o,n.getStateAndHelpers()),n.props.onUserAction(a,n.getStateAndHelpers())}))},n.rootRef=function(e){return n._rootNode=e},n.getRootProps=function(e,t){var r,a=void 0===e?{}:e,s=a.refKey,l=void 0===s?"ref":s,u=a.ref,c=(0,o.Z)(a,z),d=(void 0===t?{}:t).suppressRefError,f=void 0!==d&&d;n.getRootProps.called=!0,n.getRootProps.refKey=l,n.getRootProps.suppressRefError=f;var h=n.getState().isOpen;return(0,i.Z)(((r={})[l]=C(u,n.rootRef),r.role="combobox",r["aria-expanded"]=h,r["aria-haspopup"]="listbox",r["aria-owns"]=h?n.menuId:null,r["aria-labelledby"]=n.labelId,r),c)},n.keyDownHandlers={ArrowDown:function(e){var t=this;if(e.preventDefault(),this.getState().isOpen){var n=e.shiftKey?5:1;this.moveHighlightedIndex(n,{type:4})}else this.internalSetState({isOpen:!0,type:4},(function(){var e=t.getItemCount();if(e>0){var n=M(1,t.getState().highlightedIndex,e,(function(e){return t.getItemNodeFromIndex(e)}));t.setHighlightedIndex(n,{type:4})}}))},ArrowUp:function(e){var t=this;if(e.preventDefault(),this.getState().isOpen){var n=e.shiftKey?-5:-1;this.moveHighlightedIndex(n,{type:3})}else this.internalSetState({isOpen:!0,type:3},(function(){var e=t.getItemCount();if(e>0){var n=M(-1,t.getState().highlightedIndex,e,(function(e){return t.getItemNodeFromIndex(e)}));t.setHighlightedIndex(n,{type:3})}}))},Enter:function(e){if(229!==e.which){var t=this.getState(),n=t.isOpen,r=t.highlightedIndex;if(n&&null!=r){e.preventDefault();var o=this.items[r],i=this.getItemNodeFromIndex(r);if(null==o||i&&i.hasAttribute("disabled"))return;this.selectHighlightedItem({type:6})}}},Escape:function(e){e.preventDefault(),this.reset((0,i.Z)({type:5},!this.state.isOpen&&{selectedItem:null,inputValue:""}))}},n.buttonKeyDownHandlers=(0,i.Z)({},n.keyDownHandlers,{" ":function(e){e.preventDefault(),this.toggleMenu({type:12})}}),n.inputKeyDownHandlers=(0,i.Z)({},n.keyDownHandlers,{Home:function(e){var t=this,n=this.getState().isOpen;if(n){e.preventDefault();var r=this.getItemCount();if(!(r<=0)&&n){var o=R(1,0,r,(function(e){return t.getItemNodeFromIndex(e)}),!1);this.setHighlightedIndex(o,{type:7})}}},End:function(e){var t=this,n=this.getState().isOpen;if(n){e.preventDefault();var r=this.getItemCount();if(!(r<=0)&&n){var o=R(-1,r-1,r,(function(e){return t.getItemNodeFromIndex(e)}),!1);this.setHighlightedIndex(o,{type:8})}}}}),n.getToggleButtonProps=function(e){var t=void 0===e?{}:e,r=t.onClick;t.onPress;var a=t.onKeyDown,s=t.onKeyUp,l=t.onBlur,u=(0,o.Z)(t,G),c=n.getState().isOpen,d={onClick:S(r,n.buttonHandleClick),onKeyDown:S(a,n.buttonHandleKeyDown),onKeyUp:S(s,n.buttonHandleKeyUp),onBlur:S(l,n.buttonHandleBlur)},f=u.disabled?{}:d;return(0,i.Z)({type:"button",role:"button","aria-label":c?"close menu":"open menu","aria-haspopup":!0,"data-toggle":!0},f,u)},n.buttonHandleKeyUp=function(e){e.preventDefault()},n.buttonHandleKeyDown=function(e){var t=P(e);n.buttonKeyDownHandlers[t]&&n.buttonKeyDownHandlers[t].call((0,a.Z)(n),e)},n.buttonHandleClick=function(e){e.preventDefault(),n.props.environment.document.activeElement===n.props.environment.document.body&&e.target.focus(),n.internalSetTimeout((function(){return n.toggleMenu({type:13})}))},n.buttonHandleBlur=function(e){var t=e.target;n.internalSetTimeout((function(){n.isMouseDown||null!=n.props.environment.document.activeElement&&n.props.environment.document.activeElement.id===n.inputId||n.props.environment.document.activeElement===t||n.reset({type:14})}))},n.getLabelProps=function(e){return(0,i.Z)({htmlFor:n.inputId,id:n.labelId},e)},n.getInputProps=function(e){var t=void 0===e?{}:e,r=t.onKeyDown,a=t.onBlur,s=t.onChange,l=t.onInput;t.onChangeText;var u=(0,o.Z)(t,Z),c={};var d,f=n.getState(),h=f.inputValue,p=f.isOpen,g=f.highlightedIndex;u.disabled||((d={}).onChange=S(s,l,n.inputHandleChange),d.onKeyDown=S(r,n.inputHandleKeyDown),d.onBlur=S(a,n.inputHandleBlur),c=d);return(0,i.Z)({"aria-autocomplete":"list","aria-activedescendant":p&&"number"===typeof g&&g>=0?n.getItemId(g):null,"aria-controls":p?n.menuId:null,"aria-labelledby":u&&u["aria-label"]?void 0:n.labelId,autoComplete:"off",value:h,id:n.inputId},c,u)},n.inputHandleKeyDown=function(e){var t=P(e);t&&n.inputKeyDownHandlers[t]&&n.inputKeyDownHandlers[t].call((0,a.Z)(n),e)},n.inputHandleChange=function(e){n.internalSetState({type:11,isOpen:!0,inputValue:e.target.value,highlightedIndex:n.props.defaultHighlightedIndex})},n.inputHandleBlur=function(){n.internalSetTimeout((function(){var e=n.props.environment.document&&!!n.props.environment.document.activeElement&&!!n.props.environment.document.activeElement.dataset&&n.props.environment.document.activeElement.dataset.toggle&&n._rootNode&&n._rootNode.contains(n.props.environment.document.activeElement);n.isMouseDown||e||n.reset({type:10})}))},n.menuRef=function(e){n._menuNode=e},n.getMenuProps=function(e,t){var r,a=void 0===e?{}:e,s=a.refKey,l=void 0===s?"ref":s,u=a.ref,c=(0,o.Z)(a,U),d=(void 0===t?{}:t).suppressRefError,f=void 0!==d&&d;return n.getMenuProps.called=!0,n.getMenuProps.refKey=l,n.getMenuProps.suppressRefError=f,(0,i.Z)(((r={})[l]=C(u,n.menuRef),r.role="listbox",r["aria-labelledby"]=c&&c["aria-label"]?null:n.labelId,r.id=n.menuId,r),c)},n.getItemProps=function(e){var t,r=void 0===e?{}:e,a=r.onMouseMove,s=r.onMouseDown,l=r.onClick;r.onPress;var u=r.index,c=r.item,d=void 0===c?void 0:c,f=(0,o.Z)(r,H);void 0===u?(n.items.push(d),u=n.items.indexOf(d)):n.items[u]=d;var h=l,p=((t={onMouseMove:S(a,(function(){u!==n.getState().highlightedIndex&&(n.setHighlightedIndex(u,{type:2}),n.avoidScrolling=!0,n.internalSetTimeout((function(){return n.avoidScrolling=!1}),250))})),onMouseDown:S(s,(function(e){e.preventDefault()}))}).onClick=S(h,(function(){n.selectItemAtIndex(u,{type:9})})),t),g=f.disabled?{onMouseDown:p.onMouseDown}:p;return(0,i.Z)({id:n.getItemId(u),role:"option","aria-selected":n.getState().highlightedIndex===u},g,f)},n.clearItems=function(){n.items=[]},n.reset=function(e,t){void 0===e&&(e={}),e=D(e),n.internalSetState((function(t){var r=t.selectedItem;return(0,i.Z)({isOpen:n.props.defaultIsOpen,highlightedIndex:n.props.defaultHighlightedIndex,inputValue:n.props.itemToString(r)},e)}),t)},n.toggleMenu=function(e,t){void 0===e&&(e={}),e=D(e),n.internalSetState((function(t){var r=t.isOpen;return(0,i.Z)({isOpen:!r},r&&{highlightedIndex:n.props.defaultHighlightedIndex},e)}),(function(){var r=n.getState(),o=r.isOpen,i=r.highlightedIndex;o&&n.getItemCount()>0&&"number"===typeof i&&n.setHighlightedIndex(i,e),y(t)()}))},n.openMenu=function(e){n.internalSetState({isOpen:!0},e)},n.closeMenu=function(e){n.internalSetState({isOpen:!1},e)},n.updateStatus=w((function(){var e=n.getState(),t=n.items[e.highlightedIndex],r=n.getItemCount(),o=n.props.getA11yStatusMessage((0,i.Z)({itemToString:n.props.itemToString,previousResultCount:n.previousResultCount,resultCount:r,highlightedItem:t},e));n.previousResultCount=r,F(o,n.props.environment.document)}),200);var r=n.props,s=r.defaultHighlightedIndex,l=r.initialHighlightedIndex,u=void 0===l?s:l,c=r.defaultIsOpen,d=r.initialIsOpen,f=void 0===d?c:d,h=r.initialInputValue,p=void 0===h?"":h,g=r.initialSelectedItem,m=void 0===g?null:g,v=n.getState({highlightedIndex:u,isOpen:f,inputValue:p,selectedItem:m});return null!=v.selectedItem&&void 0===n.props.initialInputValue&&(v.inputValue=n.props.itemToString(v.selectedItem)),n.state=v,n}n=e,(t=l).prototype=Object.create(n.prototype),t.prototype.constructor=t,(0,s.Z)(t,n);var u=l.prototype;return u.internalClearTimeouts=function(){this.timeoutIds.forEach((function(e){clearTimeout(e)})),this.timeoutIds=[]},u.getState=function(e){return void 0===e&&(e=this.state),A(e,this.props)},u.getItemCount=function(){var e=this.items.length;return null!=this.itemCount?e=this.itemCount:void 0!==this.props.itemCount&&(e=this.props.itemCount),e},u.getItemNodeFromIndex=function(e){return this.props.environment.document.getElementById(this.getItemId(e))},u.scrollHighlightedItemIntoView=function(){var e=this.getItemNodeFromIndex(this.getState().highlightedIndex);this.props.scrollIntoView(e,this._menuNode)},u.moveHighlightedIndex=function(e,t){var n=this,r=this.getItemCount(),o=this.getState().highlightedIndex;if(r>0){var i=M(e,o,r,(function(e){return n.getItemNodeFromIndex(e)}));this.setHighlightedIndex(i,t)}},u.getStateAndHelpers=function(){var e=this.getState(),t=e.highlightedIndex,n=e.inputValue,r=e.selectedItem,o=e.isOpen,i=this.props.itemToString,a=this.id,s=this.getRootProps,l=this.getToggleButtonProps,u=this.getLabelProps,c=this.getMenuProps,d=this.getInputProps,f=this.getItemProps,h=this.openMenu,p=this.closeMenu,g=this.toggleMenu,m=this.selectItem,y=this.selectItemAtIndex,v=this.selectHighlightedItem,x=this.setHighlightedIndex,b=this.clearSelection,w=this.clearItems;return{getRootProps:s,getToggleButtonProps:l,getLabelProps:u,getMenuProps:c,getInputProps:d,getItemProps:f,reset:this.reset,openMenu:h,closeMenu:p,toggleMenu:g,selectItem:m,selectItemAtIndex:y,selectHighlightedItem:v,setHighlightedIndex:x,clearSelection:b,clearItems:w,setItemCount:this.setItemCount,unsetItemCount:this.unsetItemCount,setState:this.internalSetState,itemToString:i,id:a,highlightedIndex:t,inputValue:n,isOpen:o,selectedItem:r}},u.componentDidMount=function(){var e=this;var t=function(){e.isMouseDown=!0},n=function(t){e.isMouseDown=!1,!N(t.target,[e._rootNode,e._menuNode],e.props.environment)&&e.getState().isOpen&&e.reset({type:1},(function(){return e.props.onOuterClick(e.getStateAndHelpers())}))},r=function(){e.isTouchMove=!1},o=function(){e.isTouchMove=!0},i=function(t){var n=N(t.target,[e._rootNode,e._menuNode],e.props.environment,!1);e.isTouchMove||n||!e.getState().isOpen||e.reset({type:16},(function(){return e.props.onOuterClick(e.getStateAndHelpers())}))},a=this.props.environment;a.addEventListener("mousedown",t),a.addEventListener("mouseup",n),a.addEventListener("touchstart",r),a.addEventListener("touchmove",o),a.addEventListener("touchend",i),this.cleanup=function(){e.internalClearTimeouts(),e.updateStatus.cancel(),a.removeEventListener("mousedown",t),a.removeEventListener("mouseup",n),a.removeEventListener("touchstart",r),a.removeEventListener("touchmove",o),a.removeEventListener("touchend",i)}},u.shouldScroll=function(e,t){var n=(void 0===this.props.highlightedIndex?this.getState():this.props).highlightedIndex,r=(void 0===t.highlightedIndex?e:t).highlightedIndex;return n&&this.getState().isOpen&&!e.isOpen||n!==r},u.componentDidUpdate=function(e,t){_(this.props,"selectedItem")&&this.props.selectedItemChanged(e.selectedItem,this.props.selectedItem)&&this.internalSetState({type:15,inputValue:this.props.itemToString(this.props.selectedItem)}),!this.avoidScrolling&&this.shouldScroll(t,e)&&this.scrollHighlightedItemIntoView(),this.updateStatus()},u.componentWillUnmount=function(){this.cleanup()},u.render=function(){var e=E(this.props.children,v);this.clearItems(),this.getRootProps.called=!1,this.getRootProps.refKey=void 0,this.getRootProps.suppressRefError=void 0,this.getMenuProps.called=!1,this.getMenuProps.refKey=void 0,this.getMenuProps.suppressRefError=void 0,this.getLabelProps.called=!1,this.getInputProps.called=!1;var t=E(e(this.getStateAndHelpers()));return t?this.getRootProps.called||this.props.suppressRefError?t:T(t)?(0,r.cloneElement)(t,this.getRootProps(O(t))):void 0:null},l}(r.Component);return e.defaultProps={defaultHighlightedIndex:null,defaultIsOpen:!1,getA11yStatusMessage:k,itemToString:function(e){return null==e?"":String(e)},onStateChange:v,onInputValueChange:v,onUserAction:v,onChange:v,onSelect:v,onOuterClick:v,selectedItemChanged:function(e,t){return e!==t},environment:"undefined"===typeof window?{}:window,stateReducer:function(e,t){return t},suppressRefError:!1,scrollIntoView:x},e.stateChangeTypes=B,e}(),V=K;w((function(e,t){F(e(),t)}),200),"undefined"!==typeof window&&"undefined"!==typeof window.document&&"undefined"!==typeof window.document.createElement?r.useLayoutEffect:r.useEffect;var q={itemToString:function(e){return e?String(e):""},stateReducer:function(e,t){return t.changes},getA11ySelectionMessage:function(e){var t=e.selectedItem,n=e.itemToString;return t?n(t)+" has been selected.":""},scrollIntoView:x,environment:"undefined"===typeof window?{}:window};u().array.isRequired,u().func,u().func,u().func,u().number,u().number,u().number,u().bool,u().bool,u().bool,u().any,u().any,u().any,u().string,u().string,u().string,u().func,u().string,u().func,u().func,u().func,u().func,u().func,u().shape({addEventListener:u().func,removeEventListener:u().func,document:u().shape({getElementById:u().func,activeElement:u().any,body:u().any})});g(g({},q),{getA11yStatusMessage:function(e){var t=e.isOpen,n=e.resultCount,r=e.previousResultCount;return t?n?n!==r?"".concat(n," result").concat(1===n?" is":"s are"," available, use up and down arrow keys to navigate. Press Enter or Space Bar keys to select."):"":"No results are available.":""}});u().array.isRequired,u().func,u().func,u().func,u().func,u().number,u().number,u().number,u().bool,u().bool,u().bool,u().any,u().any,u().any,u().string,u().string,u().string,u().string,u().string,u().string,u().func,u().string,u().string,u().func,u().func,u().func,u().func,u().func,u().func,u().shape({addEventListener:u().func,removeEventListener:u().func,document:u().shape({getElementById:u().func,activeElement:u().any,body:u().any})});(0,i.Z)({},q,{selectedItemChanged:function(e,t){return e!==t},getA11yStatusMessage:k});u().array,u().array,u().array,u().func,u().func,u().func,u().number,u().number,u().number,u().func,u().func,u().string,u().string,u().shape({addEventListener:u().func,removeEventListener:u().func,document:u().shape({getElementById:u().func,activeElement:u().any,body:u().any})});var $=n(6634),Y=n(2141),Q=n(2085),X=n(5371),J=n(8993);const ee={};function te(e,t,n){if(e){let e=t.findIndex((e=>e.id===n));return-1===e?null:t[e]}return n}function ne(e){return null==e?"":"string"===typeof e?e:e.name||""}function re(e){return"string"===typeof e?e:e?e.id:null}function oe(e,t){return ne(e).toLowerCase().includes(t.toLowerCase())}function ie(e,t){return e.filter((e=>oe(e,t)))}function ae(e,t,n,r,o){let i=null;if(t)if(null==r){let e=n.find((e=>e.id===o));e&&(i=e.id)}else r<n.length&&(i=n[r].id);else i=o;e&&e(i,o)}function se(e){return(0,J.jsx)(X.II,{...e})}function le(e,t,n){return(0,J.jsx)("div",{children:e.map(((e,o)=>{let i=ne(e);return(0,r.createElement)("div",{...t({item:e}),key:i,...(0,$.iv)({padding:5,cursor:"default",backgroundColor:n===o?Q.O9.n4:null})},i)}))})}function ue(e){return"Enter"===e.code}function ce(e){return e?ne(e):""}function de(e){let{focused:t,embedded:n=!1,containerProps:o,labelProps:i={},inputProps:a={},suggestions:s,tooltipStyle:l,tooltipProps:u,renderInput:c=se,renderItems:d=le,itemToString:f=ce,shouldSaveFromKey:h=ue,filterSuggestions:p=ie,openOnFocus:g=!0,getHighlightedIndex:m,highlightFirst:y,onUpdate:v,strict:x,onSelect:b,tableBehavior:w,value:S,isMulti:C=!1}=e;const[j,k]=(0,r.useState)((()=>te(x,s,S))),[E,T]=(0,r.useState)(j?ne(j):""),[O,I]=(0,r.useState)(!1),[D,A]=(0,r.useState)(j),_=(0,r.useMemo)((()=>p(s,E)),[p,s,E]),[P,M]=(0,r.useState)(null),[R,N]=(0,r.useState)(n);(0,r.useEffect)((()=>{k(te(x,s,S))}),[S,s,x]);const L=O&&_||s;return(0,J.jsx)(V,{onSelect:(e,t)=>{let{inputValue:n}=t;k(e),M(null),C?T(""):N(!1),b&&setTimeout((()=>{b(re(e),n)}),0)},highlightedIndex:P,selectedItem:j||null,itemToString:f,inputValue:E,isOpen:R,onInputValueChange:(e,t)=>{if(!document.hasFocus())return;if([V.stateChangeTypes.controlledPropUpdatedSelectedItem,V.stateChangeTypes.touchEnd].includes(t.type))return;const n=p(s,e);if(""===e)t.type!==V.stateChangeTypes.clickItem&&ae(v,x,n,null,null),M(null);else{let r=e=>y&&e.length?0:null,o=(m||r)(n);t.type!==V.stateChangeTypes.clickItem&&ae(v,x,n,o,e),M(o)}T(e),I(!0)},onStateChange:e=>{w&&e.type===V.stateChangeTypes.mouseUp||("highlightedIndex"in e&&e.type!==V.stateChangeTypes.changeInput&&M(e.highlightedIndex),"selectedItem"in e&&k(e.selectedItem),!R||e.type!==V.stateChangeTypes.keyDownArrowUp&&e.type!==V.stateChangeTypes.keyDownArrowDown||ae(v,x,_||s,null!=e.highlightedIndex?e.highlightedIndex:P,E),ee.lastChangeType=e.type)},labelId:null===i||void 0===i?void 0:i.id,children:e=>{let{getInputProps:r,getItemProps:i,isOpen:f,inputValue:p,highlightedIndex:m}=e;return(0,J.jsxs)("div",{className:"view "+(0,$.iv)({display:"flex"}).toString(),...o,children:[c(r({focused:t,...a,onFocus:e=>{a.onFocus&&a.onFocus(e),g&&N(!0)},onBlur:e=>{if(e.preventDownshiftDefault=!0,a.onBlur&&a.onBlur(e),w)N(!1);else{if(""===e.target.value)return b&&b(null,e.target.value),k(null),void N(!1);!function(e){let t=te(x,s,void 0===e?S:e);k(t),T(t?ne(t):""),A(t),M(null),N(n),I(!1)}(j?re(j):null)}},onKeyDown:e=>{let{onKeyDown:t}=a||{};if(f)if("Enter"===e.key)if(null!=m)ee.lastChangeType===V.stateChangeTypes.itemMouseEnter?e.preventDefault():e.stopPropagation();else{if(!x)return e.stopPropagation(),b(E,e.target.value),T(""),k(null),M(null),void I(!1);e.preventDefault(),t&&t(e)}else h(e)&&(e.preventDefault(),t&&t(e));"Escape"===e.key&&(e.nativeEvent.preventDownshiftDefault=!0,n||e.stopPropagation(),ae(v,x,s,null,re(D)),T(ne(D)),k(te(x,s,D)),M(null),N(!!n))},onChange:e=>{const{onChange:t}=a||{};t&&t(e.target.value)}})),f&&L.length>0&&(n?(0,J.jsx)(X.G7,{style:{marginTop:5},"data-testid":"autocomplete",children:d(L,i,m,p)}):(0,J.jsx)(X.u,{position:"bottom-stretch",offset:2,style:{padding:0,backgroundColor:Q.O9.n1,color:"white",minWidth:200,...l},...u,"data-testid":"autocomplete",children:d(L,i,m,p)}))]})}})}function fe(e){let{name:t,onRemove:n}=e;return(0,J.jsxs)(X.G7,{style:{alignItems:"center",flexDirection:"row",backgroundColor:Q.O9.b9,padding:"2px 4px",margin:"2px",borderRadius:4},children:[t,(0,J.jsx)(X.zx,{type:"button",bare:!0,style:{marginLeft:1},onClick:n,children:(0,J.jsx)(Y.Z,{style:{width:8,height:8}})})]})}function he(e){let{value:t,onSelect:n,suggestions:o,strict:i,...a}=e,[s,l]=(0,r.useState)(!1),u=(0,r.useRef)();function c(e){let r=t.filter((t=>t!==e));n(r)}return(0,r.useEffect)((()=>{u.current=t})),(0,J.jsx)(me,{...a,isMulti:!0,value:null,suggestions:o.filter((e=>!t.includes(re(e)))),onSelect:function(e){e&&(e=e.trim(),n([...t,e],e))},highlightFirst:!0,strict:i,tooltipProps:{forceLayout:u.current!==t},renderInput:e=>(0,J.jsxs)(X.G7,{style:[{display:"flex",flexWrap:"wrap",flexDirection:"row",alignItems:"center",backgroundColor:"white",borderRadius:4,border:"1px solid #d0d0d0"},s&&{border:"1px solid "+Q.O9.b5,boxShadow:"0 1px 1px "+Q.O9.b7}],children:[t.map(((e,t)=>(e=te(i,o,e))&&(0,J.jsx)(fe,{name:ne(e),onRemove:()=>c(re(e))},re(e)||t))),(0,J.jsx)(X.II,{...e,onKeyDown:n=>function(e,n){"Backspace"===e.key&&""===e.target.value&&c(t[t.length-1]),n&&n(e)}(n,e.onKeyDown),onFocus:t=>{l(!0),e.onFocus(t)},onBlur:t=>{l(!1),e.onBlur(t)},style:[{flex:1,minWidth:30,border:0,":focus":{border:0,boxShadow:"none"}},e.style]})]})})}function pe(e){let{title:t,style:n,hoveredStyle:r,onClick:o}=e;return(0,J.jsx)(X.zx,{style:[{fontSize:12,color:Q.O9.n10,backgroundColor:"transparent",borderColor:Q.O9.n5},n],hoveredStyle:[{backgroundColor:"rgba(200, 200, 200, .25)"},r],onClick:o,children:t})}function ge(e){let{show:t=!0,embedded:n,children:r}=e;return t&&(0,J.jsx)(X.G7,{style:[{flexShrink:0},n?{paddingTop:5}:{padding:5}],onMouseDown:e=>e.preventDefault(),children:r})}function me(e){let{multi:t,...n}=e;return t?(0,J.jsx)(he,{...n}):(0,J.jsx)(de,{...n})}},7740:function(e,t,n){"use strict";n.d(t,{e:function(){return u},Z:function(){return d}});var r=n(3017),o=n(8993);var i=e=>(0,o.jsx)("svg",{...e,fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",style:{color:"#242134",...e.style},children:(0,o.jsx)("path",{d:"m30 9-4-4M30 9l-4 4M6 5 2 9M2 9l4 4M10 9H3M22 9h7M16 15l6-6M16 15l-6-6M16 28V15",fill:"none",stroke:"currentColor",strokeWidth:3.5,strokeMiterlimit:10,strokeLinecap:"round"})}),a=n(2085),s=n(5371),l=n(7835);const u=(0,r.forwardRef)(((e,t)=>{let{categoryGroups:n,emptyLabel:r,...i}=e;return(0,o.jsxs)(s.Ph,{...i,ref:t,children:[(0,o.jsx)("option",{value:"",children:r||"Select category..."}),n.map((e=>(0,o.jsx)("optgroup",{label:e.name,children:e.categories.map((e=>(0,o.jsx)("option",{value:e.id,children:e.name},e.id)))},e.id)))]})}));function c(e){let{items:t,getItemProps:n,highlightedIndex:l,embedded:u,footer:c}=e,d=null;return(0,o.jsxs)(s.G7,{children:[(0,o.jsx)(s.G7,{style:[{overflow:"auto",padding:"5px 0"},!u&&{maxHeight:175}],children:t.map(((e,t)=>{if("split"===e.id)return(0,o.jsxs)(s.G7,{...n?n({item:e}):null,style:{backgroundColor:l===t?a.O9.n4:"transparent",borderRadius:u?4:0,flexShrink:0,flexDirection:"row",alignItems:"center",fontSize:11,fontWeight:500,color:a.O9.g8,padding:"6px 8px"},"data-testid":"split-transaction-button",children:[(0,o.jsx)(s.xv,{style:{lineHeight:0},children:(0,o.jsx)(i,{width:10,height:10,style:{marginRight:5,color:"inherit"}})}),"Split Transaction"]},"split");const c=e.cat_group!==d;return d=e.cat_group,(0,o.jsxs)(r.Fragment,{children:[c&&(0,o.jsx)("div",{style:{color:a.O9.y9,padding:"4px 9px"},"data-testid":"category-item-group",children:e.groupName}),(0,o.jsx)("div",{...n?n({item:e}):null,style:{backgroundColor:l===t?a.O9.n4:"transparent",padding:4,paddingLeft:20,borderRadius:u?4:0},"data-testid":"category-item"+(l===t?"-highlighted":""),children:e.name})]},e.id)}))}),c]})}function d(e){let{categoryGroups:t,showSplitOption:n,embedded:i,...a}=e,s=(0,r.useMemo)((()=>t.reduce(((e,t)=>e.concat(t.categories.map((e=>({...e,groupName:t.name}))))),n?[{id:"split",name:""}]:[])),[t]);return(0,o.jsx)(l.ZP,{strict:!0,highlightFirst:!0,embedded:i,getHighlightedIndex:e=>0===e.length?null:"split"===e[0].id?e.length>1?1:null:0,filterSuggestions:(e,t)=>e.filter((e=>"split"===e.id||(0,l.PW)(e,t)||e.groupName.toLowerCase().includes(t.toLowerCase()))),suggestions:s,renderItems:(e,t,n)=>(0,o.jsx)(c,{items:e,embedded:i,getItemProps:t,highlightedIndex:n}),...a})}},5946:function(e,t,n){"use strict";n.d(t,{Z:function(){return y}});var r=n(3017),o=n(8989),i=n(8297),a=n(5068),s=n(9476),l=n(5499),u=n(1576),c=n(2085),d=n(5371),f=n(7835),h=n(8993);function p(e,t){return"new"!==e||t.startsWith("new:")?e:"new:"+t}function g(e){return"string"===typeof e&&e.startsWith("new:")?"new":e}function m(e){let{items:t,getItemProps:n,highlightedIndex:o,embedded:i,inputValue:a,footer:s}=e,l=t.filtered,f=null;if(t=[...t],"new"===t[0].id){let[e,...n]=t;f=e,t=n}let p=f?1:0,g=null;return(0,h.jsxs)(d.G7,{children:[(0,h.jsxs)(d.G7,{style:[{overflow:"auto",padding:"5px 0"},!i&&{maxHeight:175}],children:[f&&(0,h.jsx)(d.G7,{...n?n({item:f}):null,style:{flexShrink:0,padding:"6px 9px",backgroundColor:0===o?c.O9.n4:"transparent",borderRadius:i?4:0},children:(0,h.jsxs)(d.G7,{style:{display:"block",color:c.O9.g8,borderRadius:4,fontSize:11,fontWeight:500},children:[(0,h.jsx)(u.Z,{width:8,height:8,style:{color:c.O9.g8,marginRight:5,display:"inline-block"}}),"Create Payee \u201c",a,"\u201d"]})}),t.map(((e,a)=>{let s,u=e.transfer_acct?"account":"payee";"payee"===u&&g!==u?s="Payees":"account"===u&&g!==u&&(s="Transfer To/From");let d=a===t.length-1&&l;return g=u,(0,h.jsxs)(r.Fragment,{children:[s&&(0,h.jsx)("div",{style:{color:c.O9.y9,padding:"4px 9px"},children:s},"title-"+a),(0,r.createElement)("div",{...n?n({item:e}):null,key:e.id,style:{backgroundColor:o===a+p?c.O9.n4:"transparent",borderRadius:i?4:0,padding:4,paddingLeft:20}},e.name),d&&(0,h.jsx)("div",{style:{fontSize:11,padding:5,color:c.O9.n5,textAlign:"center"},children:"More payees are available, search to find them"})]},e.id)}))]}),s]})}function y(e){let{value:t,inputProps:n,showMakeTransfer:u=!0,showManagePayees:d=!1,defaultFocusTransferPayees:y=!1,tableBehavior:v,embedded:x,onUpdate:b,onSelect:w,onManagePayees:S,accounts:C,payees:j,...k}=e,E=(0,s.n4)();j||(j=E);let T=(0,a.gM)();C||(C=T);let[O,I]=(0,r.useState)(y),[D,A]=(0,r.useState)(""),_=!!D,P=(0,r.useMemo)((()=>{const e=function(e,t,n){let r=n?(0,l.nc)(e,n):e;return t&&r&&(r=r.filter((e=>!!e.transfer_acct))),r||[]}(j,O,C);return _?[{id:"new",name:""},...e]:e}),[j,O,C,_]),M=(0,o.I0)();const[R,N]=(0,r.useState)(!1);return(0,h.jsx)(f.ZP,{strict:!0,embedded:x,value:g(t),suggestions:P,tableBehavior:v,itemToString:e=>e?"new"===e.id?D:e.name:"",focused:R,inputProps:{...n,onBlur:()=>{A(""),N(!1)},onFocus:()=>N(!0),onChange:A},onUpdate:(e,t)=>b&&b(p(e,t)),onSelect:async function(e,t){if(v)w&&w(p(e,t));else{let n=()=>M((0,i.fz)(t));Array.isArray(e)?e=await Promise.all(e.map((e=>"new"===e?n():e))):"new"===e&&(e=await n()),w&&w(e)}},getHighlightedIndex:e=>e.length>1&&"new"===e[0].id?1:0,filterSuggestions:(e,t)=>{let n=e.filter((e=>"new"===e.id?!(!t||""===t||O):(0,f.PW)(e,t)));n.sort(((e,n)=>{let r=e.name.toLowerCase().startsWith(t.toLowerCase()),o=n.name.toLowerCase().startsWith(t.toLowerCase()),i=e.name.toLowerCase()===t.toLowerCase(),a=n.name.toLowerCase()===t.toLowerCase();return"new"===e.id?-1:"new"===n.id?1:i&&!a?-1:!i&&a?1:r===o?0:r&&!o?-1:1}));let r=n.length>100;return n=n.slice(0,100),n.filtered=r,n.length>=2&&"new"===n[0].id&&n[1].name.toLowerCase()===t.toLowerCase()&&!n[1].transfer_acct?n.slice(1):n},renderItems:(e,t,n,r)=>(0,h.jsx)(m,{items:e,getItemProps:t,highlightedIndex:n,inputValue:r,embedded:x,footer:(0,h.jsxs)(f.oo,{embedded:x,children:[u&&(0,h.jsx)(f.h5,{title:"Make Transfer",style:[d&&{marginBottom:5},O&&{backgroundColor:c.O9.y8,color:c.O9.g2,borderColor:c.O9.y8}],hoveredStyle:O&&{backgroundColor:c.O9.y8,colors:c.O9.y2},onClick:()=>{b&&b(null),I(!O)}}),d&&(0,h.jsx)(f.h5,{title:"Manage Payees",onClick:()=>S()})]})}),...k},O?"transfers":"all")}},5371:function(e,t,n){"use strict";n.d(t,{OI:function(){return h},PN:function(){return Zt},gO:function(){return d},zx:function(){return u.Z},ZP:function(){return Kt},yp:function(){return u.y},Zb:function(){return g},AP:function(){return vt},dL:function(){return Ht},Xq:function(){return xt.Z},yL:function(){return bt},$Y:function(){return wt},_9:function(){return St},II:function(){return Ct.C},F5:function(){return jt},Hp:function(){return Bt.Hp},__:function(){return Et},Qj:function(){return Gt},v2:function(){return Ot},j2:function(){return At},zR:function(){return _t},u_:function(){return Pt.C},Zf:function(){return Pt.Z},P:function(){return Vt},ol:function(){return Mt},Ph:function(){return Rt},Kq:function(){return Ft},xv:function(){return kt.Z},oR:function(){return Wt},u:function(){return Bt.u},G7:function(){return f.Z},R9:function(){return zt},lL:function(){return Bt.lL}});var r=n(3017),o=n.t(r,2),i=n(9274),a=n(7745),s=n(6634),l=n(2085),u=n(3743),c=n(8993);function d(e){const{style:t,innerRef:n,...r}=e;return(0,c.jsx)("div",{...r,ref:n,className:`${e.className||""} ${(0,s.iv)(e.style)}`})}var f=n(1743);function h(e){let{left:t,right:n,style:r,leftStyle:o,rightStyle:i,truncate:a="left",...s}=e;const l={textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"};return(0,c.jsxs)(f.Z,{style:[{flexDirection:"row",alignItems:"center"},r],...s,children:[(0,c.jsx)(d,{style:[{marginRight:10},"left"===a&&l,o],children:t}),(0,c.jsx)(d,{style:[{flex:1,textAlign:"right"},"right"===a&&l,i],children:n})]})}const p=(0,r.forwardRef)(((e,t)=>{let{children:n,...r}=e;return(0,c.jsx)(f.Z,{...r,ref:t,style:[{marginTop:15,marginLeft:5,marginRight:5,borderRadius:6,backgroundColor:"white",borderColor:l.O9.p3,boxShadow:"0 1px 2px #9594A8"},r.style],children:(0,c.jsx)(f.Z,{style:{borderRadius:6,overflow:"hidden"},children:n})})}));var g=p;function m(){return!("undefined"===typeof window||!window.document||!window.document.createElement)}function y(e,t){return n=>{if(e&&e(n),!n.defaultPrevented)return t(n)}}function v(e){return"boolean"===typeof e}function x(e){return!(!e||"[object Function]"!={}.toString.call(e))}function b(e){return"string"===typeof e}function w(e,t){if(null!=e)if(x(e))e(t);else try{e.current=t}catch(n){throw new Error(`Cannot assign value "${t}" to ref "${e}"`)}}function S(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,r.useCallback)((e=>{for(let n of t)w(n,e)}),t)}function C(e){return m()?e?e.ownerDocument:document:null}function j(e,t){let n=r.createContext(t);return n.displayName=e,n}function k(e){return"which"in e?3===e.which:"button"in e&&2===e.button}function E(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter((e=>null!=e)).join("--")}function T(){}function O(e){const t=(0,r.useRef)();return t.current||(t.current={v:e()}),t.current.v}function I(){let[,e]=(0,r.useState)(Object.create(null));return(0,r.useCallback)((()=>{e(Object.create(null))}),[])}var D=m()?r.useLayoutEffect:r.useEffect;function A(e,t){let n=(0,r.useRef)(t);return e((()=>{n.current=t})),(0,r.useCallback)((function(){n.current&&n.current(...arguments)}),[])}var _=!1,P=0;function M(){return++P}var R=o["useId".toString()];function N(e){if(void 0!==R){let t=R();return e??t}let t=e??(_?M():null),[n,o]=r.useState(t);return D((()=>{null===n&&o(M())}),[]),r.useEffect((()=>{!1===_&&(_=!0)}),[]),e??n??void 0}var L=n(6214),F=e=>{let{children:t,type:n="reach-portal",containerRef:o}=e,i=r.useRef(null),a=r.useRef(null),s=I();return r.useEffect((()=>{null!=o&&("object"===typeof o&&"current"in o?null==o.current&&console.warn("@reach/portal: A ref was passed to the `containerRef` prop of a `Portal`, but no DOM node was attached to it. Be sure to pass the ref to a DOM component.\n\nIf you are forwarding the ref from another component, be sure to use the React.forwardRef API. See https://reactjs.org/docs/forwarding-refs.html."):console.warn("@reach/portal: Invalid value passed to the `containerRef` of a `Portal`. The portal will be appended to the document body, but if you want to attach it to another DOM node you must pass a valid React ref object to `containerRef`."))}),[o]),D((()=>{if(!i.current)return;let e=i.current.ownerDocument,t=o?.current||e.body;return a.current=e?.createElement(n),t.appendChild(a.current),s(),()=>{a.current&&t&&t.removeChild(a.current)}}),[n,s,o]),a.current?(0,L.createPortal)(t,a.current):r.createElement("span",{ref:i})},W=e=>{let{unstable_skipInitialRender:t,...n}=e,[o,i]=r.useState(!1);return r.useEffect((()=>{t&&i(!0)}),[t]),t&&!o?null:r.createElement(F,{...n})};W.displayName="Portal";var B,z=["bottom","height","left","right","top","width"],G=new Map,Z=function e(){var t=[];G.forEach((function(e,n){var r=n.getBoundingClientRect();(function(e,t){return void 0===e&&(e={}),void 0===t&&(t={}),z.some((function(n){return e[n]!==t[n]}))})(r,e.rect)&&(e.rect=r,t.push(e))})),t.forEach((function(e){e.callbacks.forEach((function(t){return t(e.rect)}))})),B=window.requestAnimationFrame(e)};var U=function(e,t){return{observe:function(){var n=0===G.size;G.has(e)?G.get(e).callbacks.push(t):G.set(e,{rect:void 0,hasRectChanged:!1,callbacks:[t]}),n&&Z()},unobserve:function(){var n=G.get(e);if(n){var r=n.callbacks.indexOf(t);r>=0&&n.callbacks.splice(r,1),n.callbacks.length||G.delete(e),G.size||cancelAnimationFrame(B)}}}};function H(e,t,n){let o,i;v(t)?o=t:(o=t?.observe??!0,i=t?.onChange),x(n)&&(i=n),r.useEffect((()=>{v(t)&&console.warn("Passing `observe` as the second argument to `useRect` is deprecated and will be removed in a future version of Reach UI. Instead, you can pass an object of options with an `observe` property as the second argument (`useRect(ref, { observe })`).\nSee https://reach.tech/rect#userect-observe")}),[t]),r.useEffect((()=>{x(n)&&console.warn("Passing `onChange` as the third argument to `useRect` is deprecated and will be removed in a future version of Reach UI. Instead, you can pass an object of options with an `onChange` property as the second argument (`useRect(ref, { onChange })`).\nSee https://reach.tech/rect#userect-onchange")}),[n]);let[a,s]=r.useState(e.current),l=r.useRef(!1),u=r.useRef(!1),[c,d]=r.useState(null),f=r.useRef(i);return D((()=>{f.current=i,e.current!==a&&s(e.current)})),D((()=>{a&&!l.current&&(l.current=!0,d(a.getBoundingClientRect()))}),[a]),D((()=>{if(!o)return;let t=a;if(u.current||(u.current=!0,t=e.current),!t)return void console.warn("You need to place the ref");let n=U(t,(e=>{f.current?.(e),d(e)}));return n.observe(),()=>{n.unobserve()}}),[o,a,e]),c}var K=["input","select","textarea","a[href]","button","[tabindex]:not(slot)","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"details>summary:first-of-type","details"],V=K.join(","),q="undefined"===typeof Element,$=q?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Y=!q&&Element.prototype.getRootNode?function(e){return e.getRootNode()}:function(e){return e.ownerDocument},Q=function(e,t,n){var r=Array.prototype.slice.apply(e.querySelectorAll(V));return t&&$.call(e,V)&&r.unshift(e),r=r.filter(n)},X=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var a=i.shift();if("SLOT"===a.tagName){var s=a.assignedElements(),l=e(s.length?s:a.children,!0,r);r.flatten?o.push.apply(o,l):o.push({scope:a,candidates:l})}else{$.call(a,V)&&r.filter(a)&&(n||!t.includes(a))&&o.push(a);var u=a.shadowRoot||"function"===typeof r.getShadowRoot&&r.getShadowRoot(a),c=!r.shadowRootFilter||r.shadowRootFilter(a);if(u&&c){var d=e(!0===u?a.children:u.children,!0,r);r.flatten?o.push.apply(o,d):o.push({scope:a,candidates:d})}else i.unshift.apply(i,a.children)}}return o},J=function(e,t){return e.tabIndex<0&&(t||/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||e.isContentEditable)&&isNaN(parseInt(e.getAttribute("tabindex"),10))?0:e.tabIndex},ee=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},te=function(e){return"INPUT"===e.tagName},ne=function(e){return function(e){return te(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||Y(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!==typeof window&&"undefined"!==typeof window.CSS&&"function"===typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var o=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!o||o===e}(e)},re=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},oe=function(e,t){return!(t.disabled||function(e){return te(e)&&"hidden"===e.type}(t)||function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=$.call(e,"details>summary:first-of-type")?e.parentElement:e;if($.call(o,"details:not([open]) *"))return!0;var i=Y(e).host,a=(null===i||void 0===i?void 0:i.ownerDocument.contains(i))||e.ownerDocument.contains(e);if(n&&"full"!==n){if("non-zero-area"===n)return re(e)}else{if("function"===typeof r){for(var s=e;e;){var l=e.parentElement,u=Y(e);if(l&&!l.shadowRoot&&!0===r(l))return re(e);e=e.assignedSlot?e.assignedSlot:l||u===e.ownerDocument?l:u.host}e=s}if(a)return!e.getClientRects().length}return!1}(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!$.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},ie=function(e,t){return!(ne(t)||J(t)<0||!oe(e,t))},ae=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},se=function e(t){var n=[],r=[];return t.forEach((function(t,o){var i=!!t.scope,a=i?t.scope:t,s=J(a,i),l=i?e(t.candidates):a;0===s?i?n.push.apply(n,l):n.push(a):r.push({documentOrder:o,tabIndex:s,item:t,isScope:i,content:l})})),r.sort(ee).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},le=function(e,t){var n;return n=(t=t||{}).getShadowRoot?X([e],t.includeContainer,{filter:ie.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:ae}):Q(e,t.includeContainer,ie.bind(null,t)),se(n)},ue=r.forwardRef((function(e,t){let{unstable_skipInitialPortalRender:n,...o}=e;return r.createElement(W,{unstable_skipInitialRender:n},r.createElement(ce,{ref:t,...o}))}));ue.displayName="Popover";var ce=r.forwardRef((function(e,t){let{as:n="div",targetRef:o,position:i=pe,unstable_observableRefs:a=[],...s}=e;const l=r.useRef(null),u=H(l,{observe:!s.hidden}),c=H(o,{observe:!0}),d=S(l,t);return function(e,t){const n=C(e.current);function o(e){"Tab"===e.key&&t.current&&0===le(t.current).length||("Tab"===e.key&&e.shiftKey?c(e)?d(e):f(e)?h(e):g(e)&&y():"Tab"===e.key&&(a()?s(e):l()?u(e):p(e)&&y()))}function i(){const r=le(n),o=r&&e.current?r.indexOf(e.current):-1,i=r&&r[o+1];return(!t.current||!t.current.contains(i||null))&&i}function a(){return!!e.current&&e.current===n.activeElement}function s(e){const n=t.current&&le(t.current);n&&n[0]&&(e.preventDefault(),n[0].focus())}function l(){if(!!t.current&&t.current.contains(n.activeElement||null)){const e=t.current&&le(t.current);return Boolean(e&&e[e.length-1]===n.activeElement)}return!1}function u(e){const t=i();t&&(e.preventDefault(),t.focus())}function c(e){if(!e.shiftKey)return;const t=i();return e.target===t}function d(e){const n=t.current&&le(t.current),r=n&&n[n.length-1];r&&(e.preventDefault(),r.focus())}function f(e){const n=t.current&&le(t.current);return!!n&&(0!==n.length&&e.target===n[0])}function h(t){t.preventDefault(),e.current?.focus()}function p(e){const r=t.current?le(n).filter((e=>!t.current.contains(e))):null;return!!r&&e.target===r[r.length-1]}function g(e){return e.target===le(n)[0]}r.useEffect((()=>(n.addEventListener("keydown",o),()=>{n.removeEventListener("keydown",o)})),[]);let m=[];function y(){const e=t.current&&le(t.current);e&&(e.forEach((e=>{m.push([e,e.tabIndex]),e.tabIndex=-1})),n.addEventListener("focusin",v))}function v(){n.removeEventListener("focusin",v),m.forEach((e=>{let[t,n]=e;t.tabIndex=n}))}}(o,l),r.createElement(n,{"data-reach-popover":"",ref:d,...s,style:{position:"absolute",...de(i,c,u,...a),...s.style}})}));function de(e,t,n){for(var r=arguments.length,o=new Array(r>3?r-3:0),i=3;i<r;i++)o[i-3]=arguments[i];return n?e(t,n,...o.map((e=>e.current))):{visibility:"hidden"}}function fe(e,t,n){return{top:n?`${e.top-t.height+window.pageYOffset}px`:`${e.top+e.height+window.pageYOffset}px`}}ce.displayName="PopoverImpl";var he,pe=(e,t)=>{if(!e||!t)return{};const{directionRight:n,directionUp:r}=me(e,t);return{left:n?`${e.right-t.width+window.pageXOffset}px`:`${e.left+window.pageXOffset}px`,...fe(e,t,r)}},ge=(e,t)=>{if(!e||!t)return{};const{directionUp:n}=me(e,t);return{width:e.width,left:e.left,...fe(e,t,n)}};function me(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const o={top:e.top-t.height<0,right:window.innerWidth<e.left+t.width-n,bottom:window.innerHeight<e.bottom+t.height-r,left:e.left+e.width-t.width<0};return{directionRight:o.right&&!o.left,directionLeft:o.left&&!o.right,directionUp:o.bottom&&!o.top,directionDown:o.top&&!o.bottom}}function ye(e){let{context:t,children:n,items:o,set:i}=e,a=r.useCallback((e=>{let{element:t,index:n,...r}=e;return t?(i((e=>{if(null!=n&&-1!==n)return xe(e,{element:t,index:n,...r},n);if(0===e.length)return[{...r,element:t,index:0}];if(e.find((e=>e.element===t)))return console.warn("[reach-ui]: `useDescendant` was called with an element that was already registered.\n\nIf you are using the `@reach/descendants` package directly, make sure to only register descendants once. Registering a descendant more than once will lead to bugs in your app.\n\nIf you are using another `reach-ui` package, this is probably our bug!\n\nTo report a bug, open a new issue:\n\n https://github.com/reach/reach-ui/issues/new?assignees=&labels=&template=Bug_report.md\n\nIMPORTANT: this check will only run in the development build, so if you see this warning please be aware that your app may crash when deployed."),function(e){return e.sort(((e,t)=>e.element&&t.element?ve(e.element,t.element)?-1:1:0)).map(((e,t)=>({...e,index:t})))}(e);let o,i=function(e,t){if(!t)return-1;if(!e.length)return-1;let n=e.length;for(;n--;){let r=e[n].element;if(r&&ve(r,t))return n+1}return-1}(e,t);return o=-1===i?[...e,{...r,element:t,index:e.length}]:xe(e,{...r,element:t,index:i},i),o})),()=>{t&&i((e=>e.filter((e=>t!==e.element))))}):T}),[]);return r.createElement(t.Provider,{value:r.useMemo((()=>({descendants:o,registerDescendant:a})),[o,a])},n)}function ve(e,t){return Boolean(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function xe(e,t,n){return null!=n&&n in e?[...e.slice(0,n),t,...e.slice(n)]:[...e,t]}!function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(he||(he={}));var be={type:"xstate.init"};function we(e){return void 0===e?[]:[].concat(e)}function Se(e){return{type:"xstate.assign",assignment:e}}function Ce(e,t){return"string"==typeof(e="string"==typeof e&&t&&t[e]?t[e]:e)?{type:e}:"function"==typeof e?{type:e.name,exec:e}:e}function je(e){return function(t){return e===t}}function ke(e){return"string"==typeof e?{type:e}:e}function Ee(e,t){return{value:e,context:t,actions:[],changed:!1,matches:je(e)}}var Te=function(e,t){return e.actions.forEach((function(n){var r=n.exec;return r&&r(e.context,t)}))};function Oe(e,t,n){let o=r.useRef(e),i=O((()=>function(e){var t=e.initialState,n=he.NotStarted,r=new Set,o={_machine:e,send:function(o){n===he.Running&&(t=e.transition(t,o),Te(t,ke(o)),r.forEach((function(e){return e(t)})))},subscribe:function(e){return r.add(e),e(t),{unsubscribe:function(){return r.delete(e)}}},start:function(){return n=he.Running,Te(t,be),o},stop:function(){return n=he.Stopped,r.clear(),o},get state(){return t},get status(){return n}};return o}(o.current).start())),a=r.useRef(null),[s,l]=r.useState((()=>(e=>{let t;return e.subscribe((e=>{t=e})).unsubscribe(),t})(i))),u=r.useCallback((e=>{let r=b(e)?{type:e}:e,o=function(e){return Object.entries(e).reduce(((e,t)=>{let[n,r]=t;return e[n]=r.current,e}),{})}(t);i.send({...r,lastEventType:a.current,refs:o}),a.current=r.type,n&&(console.group("Event Sent"),console.log("Event:",r),console.groupEnd())}),[n]);r.useEffect((()=>(i.subscribe((function(e){e.changed&&l(e)})),()=>{i.stop()})),[i]),r.useEffect((()=>{n&&s.changed&&(console.group("State Updated"),console.log("State:",s),console.groupEnd())}),[n,s]);return[r.useMemo((()=>({...s,matches:e=>e===s.value})),[s.changed,s.context,s.value]),u,i]}function Ie(e,t){return O((()=>function(e,t){void 0===t&&(t={});var n={config:e,_options:t,initialState:{value:e.initial,actions:we(e.states[e.initial].entry).map((function(e){return Ce(e,t.actions)})),context:e.context,matches:je(e.initial)},transition:function(t,r){var o,i,a="string"==typeof t?{value:t,context:e.context}:t,s=a.value,l=a.context,u=ke(r),c=e.states[s];if(c.on){var d=we(c.on[u.type]),f=function(t){if(void 0===t)return{value:Ee(s,l)};var r="string"==typeof t?{target:t}:t,o=r.target,i=void 0===o?s:o,a=r.actions,d=void 0===a?[]:a,f=r.cond,h=l;if((void 0===f?function(){return!0}:f)(l,u)){var p=e.states[i],g=!1,m=[].concat(c.exit,d,p.entry).filter((function(e){return e})).map((function(e){return Ce(e,n._options.actions)})).filter((function(e){if("xstate.assign"===e.type){g=!0;var t=Object.assign({},h);return"function"==typeof e.assignment?t=e.assignment(h,u):Object.keys(e.assignment).forEach((function(n){t[n]="function"==typeof e.assignment[n]?e.assignment[n](h,u):e.assignment[n]})),h=t,!1}return!0}));return{value:{value:i,context:h,actions:m,changed:i!==s||m.length>0||g,matches:je(i)}}}};try{for(var h=function(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}(d),p=h.next();!p.done;p=h.next()){var g=f(p.value);if("object"==typeof g)return g.value}}catch(e){o={error:e}}finally{try{p&&!p.done&&(i=h.return)&&i.call(h)}finally{if(o)throw o.error}}}return Ee(s,l)}};return n}(e,t)))}var De=Se({navigationValue:null}),Ae=Se({typeaheadQuery:null}),_e=Se({value:(e,t)=>t.value}),Pe=Se({value:(e,t)=>e.initialValue}),Me=Se({navigationValue:(e,t)=>t.value}),Re=Se({navigationValue:e=>{let t=(n=e.value,r=e.options,n?r.find((e=>e.value===n)):void 0);var n,r;return t&&!t.disabled?e.value:e.options.find((e=>!e.disabled))?.value||null}});function Ne(e,t){if("BLUR"===t.type){let{list:e,popover:n}=t.refs,{relatedTarget:r}=t,o=C(n);return!(o?.activeElement===e||!n||n.contains(r||o?.activeElement))}return!1}function Le(e,t){if("OUTSIDE_MOUSE_DOWN"===t.type||"OUTSIDE_MOUSE_UP"===t.type){let{button:e,popover:n}=t.refs,{relatedTarget:r}=t;return!(r===e||!e||e.contains(r)||!n||n.contains(r))}return!1}function Fe(e,t){return!!e.options.find((t=>t.value===e.navigationValue))}function We(e,t){let{popover:n,list:r}=t.refs,{relatedTarget:o}=t;return!(n&&o&&n.contains(o)&&o!==r)&&Fe(e)}function Be(e,t){requestAnimationFrame((()=>{t.refs.list&&t.refs.list.focus()}))}function ze(e,t){t.refs.button&&t.refs.button.focus()}function Ge(e,t){return!t.disabled}function Ze(e,t){return"isControlled"in t&&!t.isControlled}function Ue(e,t){return"OPTION_TOUCH_START"!==t.type||!t||!t.disabled}function He(e,t){return(!("disabled"in t)||!t.disabled)&&("value"in t?null!=t.value:null!=e.navigationValue)}function Ke(e,t){t.callback&&t.callback(t.value)}function Ve(e,t){if("KEY_DOWN_ENTER"!==t.type)return;let{hiddenInput:n}=t.refs;if(n&&n.form){let e=n.form.querySelector("button:not([type]),[type='submit']");e&&e.click()}}var qe=Se({typeaheadQuery:(e,t)=>(e.typeaheadQuery||"")+t.query}),$e=Se({value:(e,t)=>{if("UPDATE_AFTER_TYPEAHEAD"===t.type&&t.query){let n=Xe(e.options,t.query);if(n&&!n.disabled)return t.callback&&t.callback(n.value),n.value}return e.value}}),Ye=Se({navigationValue:(e,t)=>{if("UPDATE_AFTER_TYPEAHEAD"===t.type&&t.query){let n=Xe(e.options,t.query);if(n&&!n.disabled)return n.value}return e.navigationValue}}),Qe={GET_DERIVED_DATA:{actions:Se(((e,t)=>({...e,...t.data})))},VALUE_CHANGE:{actions:[_e,Ke]}};function Xe(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(!t)return null;return e.find((e=>!e.disabled&&e.label&&e.label.toLowerCase().startsWith(t.toLowerCase())))||null}var Je=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.createContext({descendants:[],registerDescendant:()=>T,...t});return n.displayName=e,n}("ListboxDescendantContext"),et=j("ListboxContext",{}),tt=j("ListboxGroupContext",{}),nt=r.forwardRef((function(e,t){let{as:n="div","aria-labelledby":o,"aria-label":i,children:a,defaultValue:s,disabled:l=!1,form:u,name:c,onChange:d,required:f,value:h,__componentName:p="ListboxInput",...g}=e,m=r.useRef(null!=h),[y,v]=r.useState([]),b=r.useRef(null),w=r.useRef(null),C=r.useRef(null),j=r.useRef(null),k=r.useRef(null),T=r.useRef(null),O=r.useRef(null),I=Ie((e=>{let{value:t}=e;return{id:"listbox",initial:"IDLE",context:{initialValue:t,value:t,options:[],navigationValue:null,typeaheadQuery:null},states:{IDLE:{on:{...Qe,BUTTON_MOUSE_DOWN:{target:"OPEN",actions:[Re],cond:Ge},KEY_DOWN_SPACE:{target:"NAVIGATING",actions:[Re,Be],cond:Ge},KEY_DOWN_SEARCH:{target:"IDLE",actions:qe,cond:Ge},UPDATE_AFTER_TYPEAHEAD:{target:"IDLE",actions:[$e],cond:Ge},CLEAR_TYPEAHEAD:{target:"IDLE",actions:Ae},KEY_DOWN_NAVIGATE:{target:"NAVIGATING",actions:[Re,Ae,Be],cond:Ge},KEY_DOWN_ENTER:{actions:[Ve],cond:Ge},RESET_VALUE:{actions:[Pe,Ke],cond:Ze}}},INTERACTING:{entry:[De],on:{...Qe,CLEAR_NAV_SELECTION:{actions:[De,Be]},KEY_DOWN_ENTER:{target:"IDLE",actions:[_e,Ae,ze,Ke],cond:He},KEY_DOWN_SPACE:{target:"IDLE",actions:[_e,Ae,ze,Ke],cond:He},BUTTON_MOUSE_DOWN:{target:"IDLE",actions:[ze]},KEY_DOWN_ESCAPE:{target:"IDLE",actions:[ze]},OPTION_MOUSE_DOWN:{target:"DRAGGING"},OUTSIDE_MOUSE_DOWN:[{target:"IDLE",cond:Le,actions:Ae},{target:"DRAGGING",actions:Ae,cond:Fe}],OUTSIDE_MOUSE_UP:[{target:"IDLE",cond:Le,actions:Ae},{target:"NAVIGATING",cond:Fe},{target:"INTERACTING",actions:Ae}],KEY_DOWN_ENTER:"INTERACTING",BLUR:[{target:"IDLE",cond:Ne,actions:Ae},{target:"NAVIGATING",cond:We},{target:"INTERACTING",actions:Ae}],OPTION_TOUCH_START:{target:"NAVIGATING",actions:[Me,Ae],cond:Ue},OPTION_CLICK:{target:"IDLE",actions:[_e,Ae,ze,Ke],cond:He},OPTION_PRESS:{target:"IDLE",actions:[_e,Ae,ze,Ke],cond:He},OPTION_MOUSE_ENTER:{target:"NAVIGATING",actions:[Me,Ae],cond:Ue},KEY_DOWN_NAVIGATE:{target:"NAVIGATING",actions:[Me,Ae,Be]}}},OPEN:{on:{...Qe,CLEAR_NAV_SELECTION:{actions:[De]},KEY_DOWN_ENTER:{target:"IDLE",actions:[_e,Ae,ze,Ke],cond:He},KEY_DOWN_SPACE:{target:"IDLE",actions:[_e,Ae,ze,Ke],cond:He},BUTTON_MOUSE_DOWN:{target:"IDLE",actions:[ze]},KEY_DOWN_ESCAPE:{target:"IDLE",actions:[ze]},OPTION_MOUSE_DOWN:{target:"DRAGGING"},OUTSIDE_MOUSE_DOWN:[{target:"IDLE",cond:Le,actions:Ae},{target:"DRAGGING",cond:Fe},{target:"INTERACTING",actions:Ae}],OUTSIDE_MOUSE_UP:[{target:"IDLE",cond:Le,actions:Ae},{target:"NAVIGATING",cond:Fe},{target:"INTERACTING",actions:Ae}],BLUR:[{target:"IDLE",cond:Ne,actions:Ae},{target:"NAVIGATING",cond:We},{target:"INTERACTING",actions:Ae}],BUTTON_MOUSE_UP:{target:"NAVIGATING",actions:[Re,Be]},LIST_MOUSE_UP:{target:"NAVIGATING",actions:[Re,Be]},OPTION_TOUCH_START:{target:"NAVIGATING",actions:[Me,Ae],cond:Ue},OPTION_CLICK:{target:"IDLE",actions:[_e,Ae,ze,Ke],cond:He},OPTION_PRESS:{target:"IDLE",actions:[_e,Ae,ze,Ke],cond:He},KEY_DOWN_NAVIGATE:{target:"NAVIGATING",actions:[Me,Ae,Be]},KEY_DOWN_SEARCH:{target:"NAVIGATING",actions:qe},UPDATE_AFTER_TYPEAHEAD:{actions:[Ye]},CLEAR_TYPEAHEAD:{actions:Ae},OPTION_MOUSE_MOVE:[{target:"DRAGGING",actions:[Me],cond:Ue},{target:"DRAGGING"}]}},DRAGGING:{on:{...Qe,CLEAR_NAV_SELECTION:{actions:[De]},KEY_DOWN_ENTER:{target:"IDLE",actions:[_e,Ae,ze,Ke],cond:He},KEY_DOWN_SPACE:{target:"IDLE",actions:[_e,Ae,ze,Ke],cond:He},BUTTON_MOUSE_DOWN:{target:"IDLE",actions:[ze]},KEY_DOWN_ESCAPE:{target:"IDLE",actions:[ze]},OPTION_MOUSE_DOWN:{target:"DRAGGING"},OUTSIDE_MOUSE_DOWN:[{target:"IDLE",cond:Le,actions:Ae},{target:"NAVIGATING",cond:Fe},{target:"INTERACTING",actions:Ae}],OUTSIDE_MOUSE_UP:[{target:"IDLE",cond:Le,actions:Ae},{target:"NAVIGATING",cond:Fe,actions:Be},{target:"INTERACTING",actions:[Ae,Be]}],BLUR:[{target:"IDLE",cond:Ne,actions:Ae},{target:"NAVIGATING",cond:We},{target:"INTERACTING",actions:Ae}],BUTTON_MOUSE_UP:{target:"NAVIGATING",actions:[Re,Be]},OPTION_TOUCH_START:{target:"NAVIGATING",actions:[Me,Ae],cond:Ue},OPTION_CLICK:{target:"IDLE",actions:[_e,Ae,ze,Ke],cond:He},OPTION_PRESS:{target:"IDLE",actions:[_e,Ae,ze,Ke],cond:He},OPTION_MOUSE_ENTER:{target:"DRAGGING",actions:[Me,Ae],cond:Ue},KEY_DOWN_NAVIGATE:{target:"NAVIGATING",actions:[Me,Ae,Be]},KEY_DOWN_SEARCH:{target:"NAVIGATING",actions:qe},UPDATE_AFTER_TYPEAHEAD:{actions:[Ye]},CLEAR_TYPEAHEAD:{actions:Ae},OPTION_MOUSE_MOVE:[{target:"NAVIGATING",actions:[Me],cond:Ue},{target:"NAVIGATING"}],OPTION_MOUSE_UP:{target:"IDLE",actions:[_e,Ae,ze,Ke],cond:He}}},NAVIGATING:{on:{...Qe,CLEAR_NAV_SELECTION:{actions:[De,Be]},KEY_DOWN_ENTER:{target:"IDLE",actions:[_e,Ae,ze,Ke],cond:He},KEY_DOWN_SPACE:{target:"IDLE",actions:[_e,Ae,ze,Ke],cond:He},BUTTON_MOUSE_DOWN:{target:"IDLE",actions:[ze]},KEY_DOWN_ESCAPE:{target:"IDLE",actions:[ze]},OPTION_MOUSE_DOWN:{target:"DRAGGING"},OUTSIDE_MOUSE_DOWN:[{target:"IDLE",cond:Le,actions:Ae},{target:"NAVIGATING",cond:Fe},{target:"INTERACTING",actions:Ae}],OUTSIDE_MOUSE_UP:[{target:"IDLE",cond:Le,actions:Ae},{target:"NAVIGATING",cond:Fe},{target:"INTERACTING",actions:Ae}],BLUR:[{target:"IDLE",cond:Ne,actions:Ae},{target:"NAVIGATING",cond:We},{target:"INTERACTING",actions:Ae}],BUTTON_MOUSE_UP:{target:"NAVIGATING",actions:[Re,Be]},OPTION_TOUCH_START:{target:"NAVIGATING",actions:[Me,Ae],cond:Ue},OPTION_CLICK:{target:"IDLE",actions:[_e,Ae,ze,Ke],cond:He},OPTION_PRESS:{target:"IDLE",actions:[_e,Ae,ze,Ke],cond:He},OPTION_MOUSE_ENTER:{target:"NAVIGATING",actions:[Me,Ae],cond:Ue},KEY_DOWN_NAVIGATE:{target:"NAVIGATING",actions:[Me,Ae,Be]},KEY_DOWN_SEARCH:{target:"NAVIGATING",actions:qe},UPDATE_AFTER_TYPEAHEAD:{actions:[Ye]},CLEAR_TYPEAHEAD:{actions:Ae},OPTION_MOUSE_MOVE:[{target:"NAVIGATING",actions:[Me],cond:Ue},{target:"NAVIGATING"}]}}}}})({value:(m.current?h:s)||null})),[A,_]=Oe(I,{button:b,hiddenInput:w,highlightedOption:C,input:j,list:k,popover:T,selectedOption:O},false);let P=N(g.id),M=g.id||E("listbox-input",P),R=S(j,t),L=r.useMemo((()=>{let e=y.find((e=>e.value===A.context.value));return e?e.label:null}),[y,A.context.value]),F=function(e){return["NAVIGATING","OPEN","DRAGGING","INTERACTING"].includes(e)}(A.value),W={ariaLabel:i,ariaLabelledBy:o,buttonRef:b,disabled:l,highlightedOptionRef:C,isExpanded:F,listboxId:M,listboxValueLabel:L,listRef:k,onValueChange:function(e){e!==A.context.value&&d?.(e)},popoverRef:T,selectedOptionRef:O,send:_,state:A.value,stateData:A.context},B=r.useRef(!1);if(!m.current&&null==s&&!B.current&&y.length){B.current=!0;let e=y.find((e=>!e.disabled));e&&e.value&&_({type:"VALUE_CHANGE",value:e.value})}return function(e,t,n){{let o=(0,r.useRef)(null!=e),i=(0,r.useRef)({componentName:n,controlledPropName:t});(0,r.useEffect)((()=>{i.current={componentName:n,controlledPropName:t}}),[n,t]),(0,r.useEffect)((()=>{let{current:t}=o,{componentName:n,controlledPropName:r}=i.current;t!==(null!=e)&&console.error(`A component is changing an ${t?"":"un"}controlled \`${r}\` state of ${n} to be ${t?"un":""}controlled. This is likely caused by the value changing from undefined to a defined value, which should not happen. Decide between using a controlled or uncontrolled ${n} element for the lifetime of the component.\n More info: https://fb.me/react-controlled-components`)}),[e])}}(h,"value",p),function(e,t,n){let{current:o}=r.useRef(null!=e);o&&e!==t&&n()}(h,A.context.value,(()=>{_({type:"VALUE_CHANGE",value:h})})),D((()=>{_({type:"GET_DERIVED_DATA",data:{options:y}})}),[y,_]),r.useEffect((()=>{function e(e){let{target:t,relatedTarget:n}=e;mt(T.current,t)||_({type:"OUTSIDE_MOUSE_DOWN",relatedTarget:n||t})}return F&&window.addEventListener("mousedown",e),()=>{window.removeEventListener("mousedown",e)}}),[_,F]),r.useEffect((()=>{function e(e){let{target:t,relatedTarget:n}=e;mt(T.current,t)||_({type:"OUTSIDE_MOUSE_UP",relatedTarget:n||t})}return F&&window.addEventListener("mouseup",e),()=>{window.removeEventListener("mouseup",e)}}),[_,F]),r.useEffect((()=>{let e=w.current?.form;if(e)return e.addEventListener("reset",t),()=>{e?.removeEventListener("reset",t)};function t(e){_({type:"RESET_VALUE",isControlled:m.current})}}),[j,m,_]),r.createElement(n,{...g,ref:R,"data-reach-listbox-input":"","data-state":F?"expanded":"closed","data-value":A.context.value,id:M},r.createElement(et.Provider,{value:W},r.createElement(ye,{context:Je,items:y,set:v},x(a)?a({id:M,isExpanded:F,value:A.context.value,selectedOptionRef:O,highlightedOptionRef:C,valueLabel:L,expanded:F}):a,(u||c||f)&&r.createElement("input",{ref:w,"data-reach-listbox-hidden-input":"",disabled:l,form:u,name:c,readOnly:!0,required:f,tabIndex:-1,type:"hidden",value:A.context.value||""}))))}));nt.displayName="ListboxInput";var rt=r.forwardRef((function(e,t){let{arrow:n="\u25bc",button:o,children:i,portal:a=!0,...s}=e;return r.createElement(nt,{...s,__componentName:"Listbox",ref:t},(e=>{let{value:t,valueLabel:s}=e;return r.createElement(r.Fragment,null,r.createElement(it,{arrow:n,children:o?x(o)?o({value:t,label:s}):o:void 0}),r.createElement(ut,{portal:a},r.createElement(ct,null,i)))}))}));rt.displayName="Listbox";var ot=r.forwardRef((function(e,t){let{"aria-label":n,arrow:o=!1,as:i="span",children:a,onKeyDown:s,onMouseDown:l,onMouseUp:u,...c}=e,{buttonRef:d,send:f,ariaLabelledBy:h,disabled:p,isExpanded:g,listboxId:m,stateData:b,listboxValueLabel:w}=r.useContext(et),C=b.value,j=S(d,t),T=pt();let O=E("button",m),I=r.useMemo((()=>a?x(a)?a({isExpanded:g,label:w,value:C,expanded:g}):a:w),[a,w,g,C]);return r.createElement(i,{"aria-disabled":p||void 0,"aria-expanded":g||void 0,"aria-haspopup":"listbox","aria-labelledby":n?void 0:[h,O].filter(Boolean).join(" "),"aria-label":n,role:"button",tabIndex:p?-1:0,...c,ref:j,"data-reach-listbox-button":"",id:O,onKeyDown:y(s,T),onMouseDown:y(l,(function(e){k(e.nativeEvent)||(e.preventDefault(),e.stopPropagation(),f({type:"BUTTON_MOUSE_DOWN",disabled:p}))})),onMouseUp:y(u,(function(e){k(e.nativeEvent)||(e.preventDefault(),e.stopPropagation(),f({type:"BUTTON_MOUSE_UP"}))}))},I,o&&r.createElement(st,null,v(o)?null:o))}));ot.displayName="ListboxButton";var it=r.memo(ot),at=r.forwardRef((function(e,t){let{as:n="span",children:o,...i}=e,{isExpanded:a}=r.useContext(et);return r.createElement(n,{"aria-hidden":!0,...i,ref:t,"data-reach-listbox-arrow":"","data-expanded":a?"":void 0},x(o)?o({isExpanded:a,expanded:a}):o||"\u25bc")}));at.displayName="ListboxArrow";var st=r.memo(at),lt=r.forwardRef((function(e,t){let{as:n="div",position:o=ge,onBlur:i,onKeyDown:a,onMouseUp:s,portal:l=!0,unstable_observableRefs:u,...c}=e,{isExpanded:d,buttonRef:f,popoverRef:h,send:p}=r.useContext(et),g=S(h,t),m=pt();let v={hidden:!d,tabIndex:-1,...c,ref:g,"data-reach-listbox-popover":"",onMouseUp:y(s,(function(){p({type:"LIST_MOUSE_UP"})})),onBlur:y(i,(function(e){let{nativeEvent:t}=e;requestAnimationFrame((()=>{p({type:"BLUR",relatedTarget:t.relatedTarget||t.target})}))})),onKeyDown:y(a,m)};return l?r.createElement(ue,{...v,as:n,targetRef:f,position:o,unstable_observableRefs:u,unstable_skipInitialPortalRender:!0}):r.createElement(n,{...v})}));lt.displayName="ListboxPopover";var ut=r.memo(lt),ct=r.forwardRef((function(e,t){let{as:n="ul",...o}=e,{listRef:i,ariaLabel:a,ariaLabelledBy:s,isExpanded:l,listboxId:u,stateData:{value:c,navigationValue:d}}=r.useContext(et),f=S(t,i);return r.createElement(n,{"aria-activedescendant":gt(l?d:c),"aria-labelledby":a?void 0:s,"aria-label":a,role:"listbox",tabIndex:-1,...o,ref:f,"data-reach-listbox-list":"",id:E("listbox",u)})}));ct.displayName="ListboxList";var dt=r.forwardRef((function(e,t){let{as:n="li",children:o,disabled:i,index:a,label:s,onClick:l,onMouseDown:u,onMouseEnter:c,onMouseLeave:d,onMouseMove:f,onMouseUp:h,onTouchStart:p,value:g,...m}=e,{highlightedOptionRef:v,selectedOptionRef:x,send:b,isExpanded:w,onValueChange:C,state:j,stateData:{value:E,navigationValue:T}}=r.useContext(et),[O,A]=r.useState(s),_=s||O||"",P=r.useRef(null),[M,R]=function(e,t){let[n,o]=(0,r.useState)(t);return[n,(0,r.useCallback)((t=>{e.current=t,o(t)}),[])]}(P,null);!function(e,t,n){let o=I(),{registerDescendant:i,descendants:a}=r.useContext(t),s=n??a.findIndex((t=>t.element===e.element));D((()=>(e.element||o(),i({...e,index:s}))),[e,o,s,i,...Object.values(e)])}(r.useMemo((()=>({element:M,value:g,label:_,disabled:!!i})),[i,M,_,g]),Je,a);let N=r.useCallback((e=>{!s&&e&&A((t=>e.textContent&&t!==e.textContent?e.textContent:t||""))}),[s]),L=!!T&&T===g,F=E===g,W=S(N,t,R,F?x:null,L?v:null);return r.createElement(n,{"aria-selected":(w?L:F)||void 0,"aria-disabled":i||void 0,role:"option",...m,ref:W,id:gt(g),"data-reach-listbox-option":"","data-current-nav":L?"":void 0,"data-current-selected":F?"":void 0,"data-label":_,"data-value":g,onClick:y(l,(function(e){k(e.nativeEvent)||b({type:"OPTION_CLICK",value:g,callback:C,disabled:!!i})})),onMouseDown:y(u,(function(e){k(e.nativeEvent)||(e.preventDefault(),b({type:"OPTION_MOUSE_DOWN"}))})),onMouseEnter:y(c,(function(){b({type:"OPTION_MOUSE_ENTER",value:g,disabled:!!i})})),onMouseLeave:y(d,(function(){b({type:"CLEAR_NAV_SELECTION"})})),onMouseMove:y(f,(function(){"OPEN"!==j&&T===g||b({type:"OPTION_MOUSE_MOVE",value:g,disabled:!!i})})),onMouseUp:y(h,(function(e){k(e.nativeEvent)||b({type:"OPTION_MOUSE_UP",value:g,callback:C,disabled:!!i})})),onTouchStart:y(p,(function(){b({type:"OPTION_TOUCH_START",value:g,disabled:!!i})}))},o)}));dt.displayName="ListboxOption";var ft=r.forwardRef((function(e,t){let{as:n="div",label:o,children:i,...a}=e,{listboxId:s}=r.useContext(et),l=E("label",N(a.id),s);return r.createElement(tt.Provider,{value:{labelId:l}},r.createElement(n,{"aria-labelledby":l,role:"group",...a,"data-reach-listbox-group":"",ref:t},o&&r.createElement(ht,null,o),i))}));ft.displayName="ListboxGroup";var ht=r.forwardRef((function(e,t){let{as:n="span",...o}=e,{labelId:i}=r.useContext(tt);return r.createElement(n,{role:"presentation",...o,ref:t,"data-reach-listbox-group-label":"",id:i})}));function pt(){let{send:e,disabled:t,onValueChange:n,stateData:{navigationValue:o,typeaheadQuery:i}}=r.useContext(et),a=(s=Je,r.useContext(s).descendants);var s;let l=(u=n,A(r.useEffect,u));var u;r.useEffect((()=>{i&&e({type:"UPDATE_AFTER_TYPEAHEAD",query:i,callback:l});let t=window.setTimeout((()=>{null!=i&&e({type:"CLEAR_TYPEAHEAD"})}),1e3);return()=>{window.clearTimeout(t)}}),[l,e,i]);let c=a.findIndex((e=>{let{value:t}=e;return t===o})),d=y((function(r){let{key:i}=r,s=b(i)&&1===i.length,l=a.find((e=>e.value===o));switch(i){case"Enter":return void e({type:"KEY_DOWN_ENTER",value:o,callback:n,disabled:!(!l?.disabled&&!t)});case" ":return r.preventDefault(),void e({type:"KEY_DOWN_SPACE",value:o,callback:n,disabled:!(!l?.disabled&&!t)});case"Escape":return void e({type:"KEY_DOWN_ESCAPE"});case"Tab":let a=r.shiftKey?"KEY_DOWN_SHIFT_TAB":"KEY_DOWN_TAB";return void e({type:a});default:return void(s&&e({type:"KEY_DOWN_SEARCH",query:i,disabled:t}))}}),function(e,t){let{descendants:n}=r.useContext(e),{callback:o,currentIndex:i,filter:a,key:s="index",orientation:l="vertical",rotate:u=!0,rtl:c=!1}=t;return function(e){if(!["ArrowDown","ArrowUp","ArrowLeft","ArrowRight","PageUp","PageDown","Home","End"].includes(e.key))return;let t=i??-1,r=a?n.filter(a):n;if(!r.length)return;let d=r.findIndex((e=>e.index===i));function f(){return t===g().index?u?p():r[d]:r[(d+1)%r.length]}function h(){return t===p().index?u?g():r[d]:r[(d-1+r.length)%r.length]}function p(){return r[0]}function g(){return r[r.length-1]}switch(e.key){case"ArrowDown":if("vertical"===l||"both"===l){e.preventDefault();let t=f();o("option"===s?t:t[s])}break;case"ArrowUp":if("vertical"===l||"both"===l){e.preventDefault();let t=h();o("option"===s?t:t[s])}break;case"ArrowLeft":if("horizontal"===l||"both"===l){e.preventDefault();let t=(c?f:h)();o("option"===s?t:t[s])}break;case"ArrowRight":if("horizontal"===l||"both"===l){e.preventDefault();let t=(c?h:f)();o("option"===s?t:t[s])}break;case"PageUp":e.preventDefault();let t=(e.ctrlKey?h:p)();o("option"===s?t:t[s]);break;case"Home":e.preventDefault();let n=p();o("option"===s?n:n[s]);break;case"PageDown":e.preventDefault();let r=(e.ctrlKey?f:g)();o("option"===s?r:r[s]);break;case"End":e.preventDefault();let i=g();o("option"===s?i:i[s])}}}(Je,{currentIndex:c,orientation:"vertical",key:"index",rotate:!0,filter:e=>!e.disabled,callback(n){e({type:"KEY_DOWN_NAVIGATE",value:a[n].value,disabled:t})}}));return d}function gt(e){let{listboxId:t}=r.useContext(et);return e?E(`option-${e}`,t):void 0}function mt(e,t){return!(!e||!e.contains(t))}ht.displayName="ListboxGroupLabel";var yt=n(9220);function vt(e){let{options:t,value:n,onChange:r,style:o,disabledKeys:i=[]}=e;return(0,c.jsxs)(nt,{value:n,onChange:r,style:{lineHeight:"1em"},children:[(0,c.jsx)(it,{...(0,s.iv)([{borderWidth:0,padding:5,borderRadius:4},o]),arrow:(0,c.jsx)(yt.Z,{style:{width:7,height:7,paddingTop:3}})}),(0,c.jsx)(ut,{style:{zIndex:1e4,outline:0,borderRadius:4},children:(0,c.jsx)(ct,{style:{maxHeight:250,overflowY:"auto"},children:t.map((e=>{let[t,n]=e;return(0,c.jsx)(dt,{value:t,disabled:i.includes(t),children:n},t)}))})})]})}var xt=n(134);function bt(e){let{style:t,contentStyle:n,children:o,renderContent:i,disabled:a}=e,[s,l]=(0,r.useState)(!1);const u=(0,r.useCallback)((()=>{a||l(!0)}),[a]),d=(0,r.useCallback)((()=>{a||l(!1)}),[a]);return(0,r.useEffect)((()=>{a&&s&&l(!1)}),[a,s]),(0,c.jsxs)(f.Z,{style:t,children:[(0,c.jsx)(f.Z,{onMouseEnter:u,onMouseLeave:d,style:n,children:o}),s&&i()]})}function wt(e){let{children:t}=e,o=(0,r.useRef)(null);return(0,r.useEffect)((()=>{o.current&&!n.g.IS_DESIGN_MODE&&setTimeout((()=>{o.current&&(o.current.focus(),o.current.setSelectionRange(0,1e4))}),0)}),[]),"function"===typeof t?t(o):(0,r.cloneElement)(t,{inputRef:o})}function St(e){let{label:t,labelWidth:n,children:r,width:o,style:i}=e;return(0,c.jsxs)("label",{...(0,s.iv)({display:"flex",flexDirection:"row",alignItems:"center",margin:"7px 0",width:o},i),children:[(0,c.jsxs)("div",{style:{width:n||75,textAlign:"right",paddingRight:10},children:[t,":"]}),r]})}var Ct=n(7904);function jt(e){let{leftContent:t,rightContent:n,inputStyle:o,style:i,getStyle:a,...s}=e,[u,d]=(0,r.useState)(!1);return(0,c.jsxs)(f.Z,{style:[Ct.Z,{padding:0,flex:1,flexDirection:"row",alignItems:"center"},u&&{border:"1px solid "+l.O9.b5,boxShadow:"0 1px 1px "+l.O9.b7},i,a&&a(u)],children:[t,(0,c.jsx)(Ct.C,{...s,style:[o,{flex:1,"&, &:focus, &:hover":{border:0,backgroundColor:"transparent",boxShadow:"none",color:"inherit"}}],onFocus:e=>{d(!0),s.onFocus&&s.onFocus(e)},onBlur:e=>{d(!1),s.onBlur&&s.onBlur(e)}}),n]})}var kt=n(666);function Et(e){let{title:t,style:n}=e;return(0,c.jsx)(kt.Z,{style:[l.W2.text,{color:l.O9.n2,textAlign:"right",fontSize:12,marginBottom:2},n],children:t})}function Tt(e){let{keyName:t}=e;return(0,c.jsx)(kt.Z,{style:{fontSize:10,color:l.O9.n6},children:t})}function Ot(e){let{header:t,footer:n,items:o,onMenuSelect:i}=e,a=(0,r.useRef)(null),s=o.filter((e=>e)),[u,d]=(0,r.useState)(null);return(0,r.useEffect)((()=>{const e=a.current;e.focus();let t=e=>{let t=s.filter((e=>e&&e!==Ot.line&&e.type!==Ot.label)),n=t.indexOf(s[u]),r=e=>s.indexOf(t[e]);switch(e.key){case"ArrowUp":e.preventDefault(),d(null===u?0:r(Math.max(n-1,0)));break;case"ArrowDown":e.preventDefault(),d(null===u?0:r(Math.min(n+1,t.length-1)));break;case"Enter":e.preventDefault();const o=s[u];null!==u&&o!==Ot.line&&i&&i(o.name)}};return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}}),[u]),(0,c.jsxs)(f.Z,{style:{outline:"none",borderRadius:4,overflow:"hidden"},tabIndex:1,innerRef:a,children:[t,s.map(((e,t)=>{if(e===Ot.line)return(0,c.jsx)(f.Z,{style:{margin:"3px 0px"},children:(0,c.jsx)(f.Z,{style:{borderTop:"1px solid "+l.O9.n10}})},t);if(e.type===Ot.label)return(0,c.jsx)(kt.Z,{style:{color:l.O9.n6,fontSize:11,lineHeight:"1em",textTransform:"uppercase",margin:"3px 9px",marginTop:5},children:e.name},e.name);let n=s[t-1];return(0,c.jsxs)(f.Z,{role:"button",style:[{cursor:"default",padding:"9px 10px",marginTop:0===t||n===Ot.line||n.type===Ot.label?0:-3,flexDirection:"row",alignItems:"center"},e.disabled&&{color:l.O9.n7},!e.disabled&&u===t&&{backgroundColor:l.O9.n10}],onMouseEnter:()=>d(t),onMouseLeave:()=>d(null),onClick:t=>!e.disabled&&i&&i(e.name),children:[(0,c.jsx)(kt.Z,{style:{lineHeight:0},children:e.icon&&(0,r.createElement)(e.icon,{width:e.iconSize||10,height:e.iconSize||10,style:{marginRight:7,width:10}})}),(0,c.jsx)(kt.Z,{children:e.text}),(0,c.jsx)(f.Z,{style:{flex:1}}),e.key&&(0,c.jsx)(Tt,{keyName:e.key})]},e.name)})),n]})}const It=Symbol("menu-line");Ot.line=It,Ot.label=Symbol("menu-label");var Dt=n(7800);function At(e){let{onClick:t}=e;return(0,c.jsx)(u.Z,{bare:!0,onClick:t,"aria-label":"Menu",children:(0,c.jsx)(Dt.Z,{width:15,height:15,style:{color:"inherit",transform:"rotateZ(90deg)"}})})}function _t(e){let{width:t,onClose:n,children:r}=e;return(0,c.jsx)(Bt.u,{position:"bottom-right",width:t,style:{padding:0},onClose:n,children:r})}var Pt=n(2131);function Mt(e){let{inputRef:t,value:n,onChange:r,placeholder:o,isInModal:i,width:a=350}=e;return(0,c.jsx)(Ct.C,{inputRef:t,placeholder:o,value:n,onChange:e=>r(e.target.value),style:{width:a,borderColor:i?null:"transparent",backgroundColor:i?null:l.O9.n11,":focus":i?null:{backgroundColor:"white","::placeholder":{color:l.O9.n8}}}})}var Rt=(0,r.forwardRef)(((e,t)=>{let{style:n,children:r,...o}=e;return(0,c.jsx)("select",{ref:t,...(0,s.iv)({backgroundColor:"transparent",height:28,fontSize:14,flex:1,border:"1px solid #d0d0d0",borderRadius:4,color:l.O9.n1,":focus":{border:"1px solid "+l.O9.b5,boxShadow:"0 1px 1px "+l.O9.b7,outline:"none"}},n),...o,children:r})}));function Nt(e,t){return r.Children.toArray(t).reduce(((t,n)=>n?"object"===typeof n&&"type"in n&&n.type===r.Fragment?t.concat(Nt(n.key,n.props.children)):(t.push({key:e+n.key,child:n}),t):t),[])}const Lt=(0,r.forwardRef)(((e,t)=>{let{direction:n="column",align:o,justify:i,spacing:a=3,children:s,debug:l,style:u,...d}=e;const h=n.endsWith("reverse"),p=n.startsWith("row"),g=Nt("",s);return(0,c.jsx)(f.Z,{style:[{flexDirection:n,alignItems:o,justifyContent:i},u],innerRef:t,...d,children:g.map(((e,t)=>{let n,{key:o,child:i}=e,s=g.length===t+1;return n=p?h?"marginLeft":"marginRight":h?"marginTop":"marginBottom",(0,r.cloneElement)("string"===typeof i?(0,c.jsx)(kt.Z,{children:i}):i,{key:o,style:[l&&{borderWidth:1,borderColor:"red"},s?null:{[n]:5*a},i.props?i.props.style:null]})}))})}));var Ft=Lt;function Wt(e){let{children:t,...n}=e;return(0,c.jsx)(kt.Z,{...n,style:[n.style,{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block"}],children:t})}var Bt=n(3679);const zt=e=>{const t=(0,r.useRef)(),n=(0,r.useCallback)((function(){return t.current&&t.current(...arguments)}),[]);return(0,r.useLayoutEffect)((()=>{t.current=e})),n};function Gt(e){let{style:t,children:n,...r}=e;return(0,c.jsx)(u.Z,{style:[{textDecoration:"none",color:l.W2.textColor,backgroundColor:"transparent",display:"inline",border:0,cursor:"pointer",padding:0,font:"inherit",":hover":{textDecoration:"underline",boxShadow:"none"},":focus":{boxShadow:"none"}},l.W2.smallText,t],...r,children:n})}function Zt(e){let{to:t,style:n,activeStyle:r,children:o}=e,u=(0,i.bS)({path:t});return(0,c.jsx)(a.OL,{to:t,...(0,s.iv)([l.W2.smallText,n,u?r:null]),children:o})}let Ut={purple:l.O9.p4,blue:l.O9.b4,muted:"inherit"};const Ht=(0,r.forwardRef)(((e,t)=>{let{children:n,to:r,linkColor:o="blue"}=e;return(0,c.jsx)("a",{ref:t,href:r,target:"_blank",rel:"noopener noreferrer",style:{color:Ut[o]},children:n})}));function Kt(e){let{to:t,style:n,activeStyle:r,...o}=e;const a=(0,i.s0)(),s=(0,i.bS)({path:t});return(0,c.jsx)(u.Z,{style:{...n,...s?r:{}},...o,onClick:e=>{o.onClick&&o.onClick(e),a(t)}})}function Vt(e){let{style:t,isLast:n,children:r,...o}=e;return(0,c.jsx)("div",{...o,...(0,s.iv)(!n&&{marginBottom:15},t,{lineHeight:"1.5em"}),children:r})}},3743:function(e,t,n){"use strict";n.d(t,{y:function(){return c}});var r=n(3017),o=n(6634),i=n(9314),a=n(2085),s=n(1743),l=n(8993);const u=(0,r.forwardRef)(((e,t)=>{let{children:n,pressed:r,primary:i,hover:s,bare:u,style:c,disabled:d,hoveredStyle:f,activeStyle:h,bounce:p=!0,as:g="button",...m}=e;f=[u?{backgroundColor:"rgba(100, 100, 100, .15)"}:{...a.W2.shadow},f],h=[u?{backgroundColor:"rgba(100, 100, 100, .25)"}:{transform:p&&"translateY(1px)",boxShadow:!u&&(i?"0 1px 4px 0 rgba(0,0,0,0.3)":"0 1px 4px 0 rgba(0,0,0,0.2)"),transition:"none"},h];let y=g,v=[{alignItems:"center",justifyContent:"center",flexShrink:0,padding:u?"5px":"5px 10px",margin:0,overflow:"hidden",display:"flex",borderRadius:4,backgroundColor:u?"transparent":i?d?a.O9.n7:a.O9.p5:"white",border:u?"none":"1px solid "+(i?d?a.O9.n7:a.O9.p5:a.O9.n9),color:i?"white":d?a.O9.n6:a.O9.n1,transition:"box-shadow .25s",WebkitAppRegion:"no-drag",...a.W2.smallText},{":hover":!d&&f},{":active":!d&&h},s&&f,r&&h,c];return(0,l.jsx)(y,{ref:t,..."string"===typeof g?(0,o.iv)(v):{style:v},disabled:d,...m,children:n})})),c=(0,r.forwardRef)(((e,t)=>{let{loading:n,children:r,...o}=e;return(0,l.jsxs)(u,{...o,ref:t,style:[{position:"relative"},o.style],children:[n&&(0,l.jsx)(s.Z,{style:{position:"absolute",top:0,left:0,right:0,bottom:0,alignItems:"center",justifyContent:"center"},children:(0,l.jsx)(i.Z,{color:"currentColor",style:{width:20,height:20,color:"currentColor"}})}),(0,l.jsx)(s.Z,{style:{opacity:n?0:1,flexDirection:"row",alignItems:"center"},children:r})]})}));t.Z=u},134:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(1743),o=n(8993);function i(e){let{style:t,children:n}=e;return(0,o.jsx)(r.Z,{style:[{color:"red",fontSize:13},t],children:n})}},7904:function(e,t,n){"use strict";n.d(t,{C:function(){return c},Z:function(){return u}});var r=n(3017);var o=function(e){return function(t){e.forEach((function(e){"function"===typeof e?e(t):null!=e&&(e.current=t)}))}},i=n(6634),a=n(5197),s=n(2085),l=n(8993);const u={outline:0,backgroundColor:"white",margin:0,padding:5,borderRadius:4,border:"1px solid #d0d0d0"};var c=e=>{let{style:t,inputRef:n,onEnter:c,onUpdate:d,focused:f,...h}=e,p=(0,r.useRef)();return(0,a.X)(p,f),(0,l.jsx)("input",{ref:n?o([n,p]):p,...(0,i.iv)(u,{":focus":{border:"1px solid "+s.O9.b5,boxShadow:"0 1px 1px "+s.O9.b7},"::placeholder":{color:s.O9.n7}},s.W2.smallText,t),...h,onKeyDown:e=>{"Enter"===e.key&&c&&c(e),h.onKeyDown&&h.onKeyDown(e)},onChange:e=>{d&&d(e.target.value),h.onChange&&h.onChange(e)}})}},2131:function(e,t,n){"use strict";n.d(t,{Z:function(){return m}});var r=n(3017),o=n(2942),i=n.n(o),a=n(702),s=n(9314),l=n(8091),u=n(2085),c=n(5761),d=n(3743),f=n(666),h=n(1743),p=n(8993);const g=e=>{let{style:t,size:n,noAnimation:o,isCurrent:i,stackIndex:a,children:s}=e,l=(0,r.useRef)(null),u=(0,r.useRef)(!1),c=(0,r.useRef)(10*Math.random()-5);return(0,r.useLayoutEffect)((()=>{function e(){i?(l.current.style.transform="translateY(0px) scale(1)",l.current.style.pointerEvents="auto"):(l.current.style.transform=`translateY(-40px) scale(.95) rotate(${c.current}deg)`,l.current.style.pointerEvents="none")}null!=l.current&&(u.current?e():o?(l.current.style.opacity=1,l.current.style.transform="translateY(0px) scale(1)",setTimeout((()=>{l.current&&(l.current.style.transition="opacity .1s, transform .1s cubic-bezier(.42, 0, .58, 1)")}),0)):(l.current.style.opacity=0,l.current.style.transform="translateY(10px) scale(1)",setTimeout((()=>{l.current&&(u.current=!0,l.current.style.transition="opacity .1s, transform .1s cubic-bezier(.42, 0, .58, 1)",l.current.style.opacity=1,e())}),0)))}),[o,i,a]),(0,p.jsx)(h.Z,{innerRef:l,style:[t,n&&{width:n.width,height:n.height},o&&!i&&{display:"none"}],children:s})},m=e=>{let{style:t,leftContent:n,focusButton:o=!1,children:i}=e,a=(0,r.useRef)(null);return(0,r.useEffect)((()=>{if(o&&a.current){let e=a.current.querySelector("button:not([data-hidden])");e&&e.focus()}}),[o]),(0,p.jsxs)(h.Z,{innerRef:a,style:[{flexDirection:"row",marginTop:30},t],children:[n,(0,p.jsx)(h.Z,{style:{flex:1}}),i]})};t.C=e=>{let{title:t,isCurrent:o,isHidden:m,size:y,padding:v=20,showHeader:x=!0,showTitle:b=!0,showClose:w=!0,showOverlay:S=!0,loading:C=!1,noAnimation:j=!1,focusAfterClose:k=!0,stackIndex:E,parent:T,style:O,contentStyle:I,overlayStyle:D,children:A,onClose:_}=e;return(0,r.useEffect)((()=>{let e=a.Z.getScope();return a.Z.setScope("modal"),()=>a.Z.setScope(e)}),[]),(0,p.jsx)(i(),{isOpen:!0,onRequestClose:_,shouldCloseOnOverlayClick:!1,shouldFocusAfterRender:!n.g.IS_DESIGN_MODE,shouldReturnFocusAfterClose:k,appElement:document.querySelector("#root"),parentSelector:T&&(()=>T),style:{content:{top:0,left:0,right:0,bottom:0,display:"flex",justifyContent:"center",alignItems:"center",overflow:"visible",border:0,fontSize:14,backgroundColor:"transparent",padding:0,pointerEvents:"auto",...I},overlay:{zIndex:3e3,backgroundColor:S&&0===E?"rgba(0, 0, 0, .1)":"none",pointerEvents:S?"auto":"none",...D,...T?{position:"absolute",top:0,left:0,right:0,bottom:0}:{}}},children:(0,p.jsxs)(g,{noAnimation:j,isCurrent:o,size:y,style:[{willChange:"opacity, transform",minWidth:"100%",minHeight:0,borderRadius:4,backgroundColor:"white",opacity:m?0:1,[`@media (min-width: ${c.Z.breakpoint_small})`]:{minWidth:c.Z.breakpoint_small}},u.W2.shadowLarge,O,u.W2.lightScrollbar],children:[x&&(0,p.jsxs)(h.Z,{style:{padding:20,position:"relative",flexShrink:0},children:[b&&(0,p.jsx)(h.Z,{style:{color:u.O9.n2,flex:1,alignSelf:"center",textAlign:"center",width:"calc(100% - 40px)"},children:(0,p.jsx)(f.Z,{style:{fontSize:25,fontWeight:700,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t})}),(0,p.jsx)(h.Z,{style:{position:"absolute",right:0,top:0,bottom:0,justifyContent:"center",alignItems:"center"},children:(0,p.jsx)(h.Z,{style:{flexDirection:"row",marginRight:15},children:w&&(0,p.jsx)(d.Z,{bare:!0,onClick:_,style:{padding:"10px 10px"},"aria-label":"Close",children:(0,p.jsx)(l.Z,{width:10})})})})]}),(0,p.jsx)(h.Z,{style:{padding:v,paddingTop:0,flex:1},children:"function"===typeof A?A():A}),C&&(0,p.jsx)(h.Z,{style:{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(255, 255, 255, .6)",alignItems:"center",justifyContent:"center",zIndex:1e3},children:(0,p.jsx)(s.Z,{style:{width:20,height:20},color:u.O9.n1})})]})})}},666:function(e,t,n){"use strict";n(3017);var r=n(6634),o=n(8993);t.Z=e=>{const{style:t,innerRef:n,...i}=e;return(0,o.jsx)("span",{...i,ref:n,className:String((0,r.iv)([e.className,e.style]))})}},1743:function(e,t,n){"use strict";n(3017);var r=n(6634),o=n(8993);t.Z=e=>{const{style:t,nativeStyle:n,innerRef:i,...a}=e;return(0,o.jsx)("div",{...a,ref:i,style:n,className:`view ${(0,r.iv)([e.className,e.style])}`})}},8030:function(e,t,n){"use strict";n.d(t,{M:function(){return A},L:function(){return O}});var r=n(3017),o=n(8989),i=n(7876),a=n(3189),s=n(8664),l=n(5249),u=n(6018),c=n(7156),d=n(4917),f=n(837),h=n(9585),p=n(8091),g=n(8993);var m=e=>(0,g.jsx)("svg",{...e,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",style:{color:"#242134",...e.style},children:(0,g.jsx)("path",{d:"M4.5 17.5h6.646a3.5 3.5 0 0 0 6.708 0H19.5a1 1 0 0 0 0-2h-1.646a3.5 3.5 0 0 0-6.708 0H4.5a1 1 0 0 0 0 2Zm10-2.5a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM19.5 6.5h-6.646a3.5 3.5 0 0 0-6.708 0H4.5a1 1 0 0 0 0 2h1.646a3.5 3.5 0 0 0 6.708 0H19.5a1 1 0 1 0 0-2ZM9.5 9a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3Z",fill:"currentColor"})}),y=n(2085),v=n(5371),x=n(945),b=n(9446),w=n(8130);let S=["date","account","payee","notes","category","amount","cleared","saved"].map((e=>[e,(0,f.gL)(e)]));function C(e){let{field:t,options:n,value:r}=e;if("date"===t){if(7===r.length)return"month";if(4===r.length)return"year"}else if("amount"===t){if(n&&n.inflow)return"amount-inflow";if(n&&n.outflow)return"amount-outflow"}return t}function j(e,t){switch(e){case"amount":switch(t){case"amount-inflow":return{inflow:!0};case"amount-outflow":return{outflow:!0};default:return null}case"date":switch(t){case"month":return{month:!0};case"year":return{year:!0};default:return null}default:return null}}function k(e){let{op:t,selected:n,style:r,onClick:o}=e;return(0,g.jsx)(v.zx,{bare:!0,style:[{backgroundColor:y.O9.n10,marginBottom:5},r,n&&{color:"white","&,:hover,:active":{backgroundColor:y.O9.b4}}],onClick:o,children:(0,f.w8)(t)})}function E(e,t){switch(t.type){case"set-op":{let n=f.Z9.get(e.field),r=e.value;return"id"===n&&"contains"===t.op&&(r=null),{...e,op:t.op,value:r}}case"set-value":{let{value:n}=(0,f.l1)(t.value,{type:f.Z9.get(e.field)});return{...e,value:n}}default:throw new Error(`Unhandled action type: ${t.type}`)}}function T(e){let{field:t,initialSubfield:n=t,op:o,value:a,dispatch:s,onApply:l}=e,[u,c]=(0,r.useState)(n),d=(0,r.useRef)(),p=(0,r.useRef)(null);(0,r.useEffect)((()=>{p.current!==o&&d.current&&d.current.focus(),p.current=o}),[o]);let m=f.Z9.get(t),x=f.wZ[m].ops;return"month"!==u&&"year"!==u||(x=["is"]),(0,g.jsx)(v.u,{position:"bottom-left",style:{padding:15},width:250,onClose:()=>s({type:"close"}),children:(0,g.jsxs)(i.MT,{children:[(0,g.jsx)(v.G7,{style:{marginBottom:10},children:"amount"===t||"date"===t?(0,g.jsx)(v.AP,{options:"amount"===t?[["amount","Amount"],["amount-inflow","Amount (inflow)"],["amount-outflow","Amount (outflow)"]]:"date"===t?[["date","Date"],["month","Month"],["year","Year"]]:null,value:u,onChange:e=>{c(e),"month"!==e&&"year"!==e||s({type:"set-op",op:"is"})},style:{borderWidth:1}}):(0,h.VL)((0,f.gL)(t))}),(0,g.jsx)(v.G7,{style:{color:y.O9.n4,marginBottom:10},children:"saved"===t&&"Existing filters will be cleared"}),(0,g.jsx)(v.Kq,{direction:"row",align:"flex-start",spacing:1,style:{flexWrap:"wrap"},children:"boolean"===m?[(0,g.jsx)(k,{op:"true",selected:!0===a,onClick:()=>{s({type:"set-op",op:"is"}),s({type:"set-value",value:!0})}},"true"),(0,g.jsx)(k,{op:"false",selected:!1===a,onClick:()=>{s({type:"set-op",op:"is"}),s({type:"set-value",value:!1})}},"false")]:x.map((e=>(0,g.jsx)(k,{op:e,selected:e===o,onClick:()=>s({type:"set-op",op:e})},e)))}),(0,g.jsxs)("form",{action:"#",children:["boolean"!==m&&(0,g.jsx)(b.Z,{inputRef:d,field:t,subfield:u,type:"id"===m&&"contains"===o?"string":m,value:a,multi:"oneOf"===o,style:{marginTop:10},onChange:e=>s({type:"set-value",value:e})}),(0,g.jsxs)(v.Kq,{direction:"row",justify:"flex-end",align:"center",children:[(0,g.jsx)(v.G7,{style:{flex:1}}),(0,g.jsx)(v.zx,{primary:!0,style:{marginTop:15},onClick:e=>{e.preventDefault(),l({field:t,op:o,value:a,options:j(t,u)})},children:"Apply"})]})]})]})})}function O(e){let{onApply:t}=e,n=(0,u.m)(),{dateFormat:i}=(0,o.v9)((e=>({dateFormat:e.prefs.local.dateFormat||"MM/dd/yyyy"}))),[p,y]=(0,r.useReducer)(((e,t)=>{switch(t.type){case"select-field":return{...e,fieldsOpen:!0,condOpen:!1};case"configure":{let{field:n}=(0,f.Z)(t.field),r=f.Z9.get(n),o=f.wZ[r].ops;return{...e,fieldsOpen:!1,condOpen:!0,field:t.field,op:o[0],value:"boolean"===r||null}}case"close":return{fieldsOpen:!1,condOpen:!1,value:null};default:return E(e,t)}}),{fieldsOpen:!1,condOpen:!1,field:null,value:null});return(0,g.jsxs)(v.G7,{children:[(0,g.jsxs)(v.zx,{bare:!0,onClick:()=>y({type:"select-field"}),children:[(0,g.jsx)(m,{style:{width:16,height:16,color:"inherit",marginRight:5}})," ","Filter"]}),p.fieldsOpen&&(0,g.jsx)(v.u,{position:"bottom-left",style:{padding:0},onClose:()=>y({type:"close"}),children:(0,g.jsx)(v.v2,{onMenuSelect:e=>{y({type:"configure",field:e})},items:S.map((e=>{let[t,n]=e;return{name:t,text:(0,h.VL)(n)}}))})}),p.condOpen&&(0,g.jsx)(T,{field:p.field,op:p.op,value:p.value,dispatch:y,onApply:async function(e){if("date"===(e=(0,f.Z2)({...e,type:f.Z9.get(e.field)})).type&&e.options)if(e.options.month){let t=(0,a.Z)(e.value,(0,d.LT)(i),new Date);if(!(0,s.Z)(t))return void alert("Invalid date format");e.value=(0,l.Z)(t,"yyyy-MM")}else if(e.options.year){let t=(0,a.Z)(e.value,"yyyy",new Date);if(!(0,s.Z)(t))return void alert("Invalid date format");e.value=(0,l.Z)(t,"yyyy")}let{error:r}="saved"!==e.field&&await(0,c.lW)("rule-validate",{conditions:[e],actions:[]}),o=n.find((t=>e.value===t.id));if(r&&r.conditionErrors.length>0){let t=(0,h.VL)((0,f.gL)(e.field));alert(t+": "+(0,f.zQ)(r.conditionErrors[0]))}else t(o||e),y({type:"close"})}})]})}function I(e){let{field:t,op:n,value:o,options:i,onSave:a,onClose:s}=e,[l,u]=(0,r.useReducer)(((e,t)=>"close"===t.type?(s(),e):E(e,t)),{field:t,op:n,value:o,options:i});return(0,g.jsx)(T,{field:l.field,initialSubfield:C({field:t,options:i,value:o}),op:l.op,value:l.value,options:l.options,dispatch:u,onApply:e=>{a(e),s()}})}function D(e){let{field:t,customName:n,op:o,value:i,options:a,stage:s,style:l,onChange:u,onDelete:c}=e,[d,h]=(0,r.useState)(!1),m=C({field:t,value:i});return(0,g.jsxs)(v.G7,{style:[{backgroundColor:y.O9.n9,borderRadius:4,flexDirection:"row",alignItems:"center",marginRight:10,marginTop:10},l],children:[(0,g.jsx)(v.zx,{bare:!0,disabled:null!=n,onClick:()=>h(!0),style:{marginRight:-7},children:(0,g.jsx)("div",{style:{paddingBlock:1,paddingLeft:5,paddingRight:2},children:n?(0,g.jsx)(v.xv,{style:{color:y.O9.p4},children:n}):(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(v.xv,{style:{color:y.O9.p4},children:(0,f.gL)(m,a)})," ",(0,g.jsx)(v.xv,{style:{color:y.O9.n3},children:(0,f.w8)(o)})," ",(0,g.jsx)(x.B,{value:i,field:m,inline:!0,valueIsRaw:"contains"===o})]})})}),(0,g.jsx)(v.zx,{bare:!0,onClick:c,children:(0,g.jsx)(p.Z,{style:{width:8,height:8,color:y.O9.n4,margin:5,marginLeft:3}})}),d&&(0,g.jsx)(I,{field:t,customName:n,op:o,value:i,options:a,stage:s,onSave:u,onClose:()=>h(!1)})]})}function A(e){let{filters:t,editingFilter:n,onUpdate:r,onDelete:o,conditionsOp:i,onCondOpChange:a}=e;return(0,g.jsxs)(v.G7,{style:{flexDirection:"row",alignItems:"flex-start",flexWrap:"wrap"},children:[(0,g.jsx)(w.a,{conditionsOp:i,onCondOpChange:a,filters:t}),t.map(((e,t)=>(0,g.jsx)(D,{customName:e.customName,field:e.field,op:e.op,value:e.value,options:e.options,editing:n===e,onChange:t=>r(e,t),onDelete:()=>o(e)},t)))]})}},8130:function(e,t,n){"use strict";n.d(t,{O:function(){return g},a:function(){return p}});var r=n(3017),o=n(7156),i=n(9220),a=n(2085),s=n(5371),l=n(6717),u=n(7117),c=n(9446),d=n(8030),f=n(8993);function h(e){let t,n,{filters:u,conditionsOp:d,filterId:h,onClearFilters:p,onReloadSavedFilter:g,filtersList:m}=e,[y,v]=(0,r.useState)(!1),[x,b]=(0,r.useState)(!1),[w,S]=(0,r.useState)(!1),[C,j]=(0,r.useState)(null),[k,E]=(0,r.useState)(null),T=(0,r.useRef)(),O=h.name,I=h.id;(0,r.useEffect)((()=>{T.current&&T.current.focus()}),[_]);const D=async e=>{switch(E(e),e){case"rename-filter":j(null),b(!1),S(!1),v(!0);break;case"delete-filter":S(!1),await(0,o.lW)("filter-delete",I),p();break;case"update-filter":j(null),b(!1),S(!1),n={conditions:u,conditionsOp:d,id:h.id,name:h.name,status:"saved"},t=await(0,o.OK)("filter-update",{state:n,filters:[...m]}),t.error?(j(t.error.message),v(!0)):g(n,"update");break;case"save-filter":j(null),b(!0),S(!1),v(!0);break;case"reload-filter":S(!1),n={status:"saved"},g(n,"reload");break;case"clear-filter":S(!1),p()}};function A(e){let{onClose:t,filterId:n}=e;return(0,f.jsx)(s.zR,{width:200,onClose:t,children:(0,f.jsx)(s.v2,{onMenuSelect:e=>{D(e)},items:[...n.id?[...null!==n.id&&"saved"===n.status?[{name:"rename-filter",text:"Rename"},{name:"delete-filter",text:"Delete"},s.v2.line,{name:"save-filter",text:"Save new filter",disabled:!0},{name:"clear-filter",text:"Clear all conditions"}]:[{name:"rename-filter",text:"Rename"},{name:"update-filter",text:"Update condtions"},{name:"reload-filter",text:"Revert changes"},{name:"delete-filter",text:"Delete"},s.v2.line,{name:"save-filter",text:"Save new filter"},{name:"clear-filter",text:"Clear all conditions"}]]:[{name:"save-filter",text:"Save new filter"},{name:"clear-filter",text:"Clear all conditions"}]]})})}function _(e){let{onClose:r}=e;return(0,f.jsxs)(s.zR,{width:325,onClose:r,children:["update-filter"!==k&&(0,f.jsx)("form",{children:(0,f.jsxs)(s.Kq,{direction:"row",justify:"flex-end",align:"center",style:{padding:10},children:[(0,f.jsxs)(l.Wi,{style:{flex:1},children:[(0,f.jsx)(l.lX,{title:"Filter Name",htmlFor:"name-field",style:{userSelect:"none"}}),(0,f.jsx)(c.Z,{inputRef:T,id:"name-field",field:"string",type:"string",value:O,onChange:e=>O=e})]}),(0,f.jsx)(s.zx,{primary:!0,type:"submit",style:{marginTop:18},onClick:e=>{e.preventDefault(),async function(){x?(n={conditions:u,conditionsOp:d,name:O,status:"saved"},t=await(0,o.OK)("filter-create",{state:n,filters:[...m]}),n={...n,id:t.data}):(n={conditions:h.conditions,conditionsOp:h.conditionsOp,id:h.id,name:O},t=await(0,o.OK)("filter-update",{state:n,filters:[...m]})),t.error?j(t.error.message):(v(!1),g(n))}()},children:x?"Add":"Update"})]})}),C&&(0,f.jsx)(s.Kq,{direction:"row",align:"center",style:{padding:10},children:(0,f.jsx)(s.xv,{style:{color:a.O9.r4},children:C})})]})}return(0,f.jsxs)(s.G7,{children:[u.length>0&&(0,f.jsxs)(s.zx,{bare:!0,style:{marginTop:10},onClick:()=>{S(!0)},children:[(0,f.jsxs)(s.xv,{style:{maxWidth:150,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flexShrink:0},children:[h.id?h.name:"Unsaved filter","\xa0"]}),h.id&&"saved"!==h.status&&(0,f.jsx)(s.xv,{children:"(modified)\xa0"}),(0,f.jsx)(i.Z,{width:8,height:8,style:{marginRight:5}})]}),w&&(0,f.jsx)(A,{onClose:()=>S(!1),filterId:h}),y&&(0,f.jsx)(_,{onClose:()=>v(!1)})]})}function p(e){let{conditionsOp:t,onCondOpChange:n,filters:r}=e;return r.length>1&&(0,f.jsxs)(s.xv,{style:{color:a.O9.n4,marginTop:11,marginRight:5},children:[(0,f.jsx)(u.Wy,{style:{display:"inline-flex"},fields:[["and","all"],["or","any"]],value:t,onChange:(e,t)=>n(t,r)}),"of:"]})}function g(e){let{filters:t,conditionsOp:n,onUpdateFilter:r,onDeleteFilter:o,onClearFilters:i,onReloadSavedFilter:a,filterId:l,filtersList:u,onCondOpChange:c}=e;return(0,f.jsx)(s.G7,{children:(0,f.jsxs)(s.Kq,{spacing:2,direction:"row",justify:"flex-start",align:"flex-start",children:[(0,f.jsx)(d.M,{filters:t,conditionsOp:n,onCondOpChange:c,onUpdate:r,onDelete:o}),(0,f.jsx)(s.G7,{style:{flex:1}}),(0,f.jsx)(h,{filters:t,conditionsOp:n,filterId:l,onClearFilters:i,onReloadSavedFilter:a,filtersList:u})]})})}},6717:function(e,t,n){"use strict";n.d(t,{Wi:function(){return u},XZ:function(){return c},eX:function(){return s},lX:function(){return l}});n(3017);var r=n(6634),o=n(2085),i=n(5371),a=n(8993);const s=e=>{let{title:t,style:n}=e;return(0,a.jsx)(i.G7,{style:[{fontWeight:500,textTransform:"uppercase",color:o.O9.b3,marginBottom:5,lineHeight:"1em"},n],children:t})},l=e=>{let{style:t,title:n,id:r,htmlFor:s}=e;return(0,a.jsx)(i.xv,{style:[{fontSize:13,marginBottom:3,color:o.O9.n3},t],children:(0,a.jsx)("label",{htmlFor:s,id:r,children:n})})},u=e=>{let{style:t,children:n}=e;return(0,a.jsx)(i.G7,{style:t,children:n})},c=e=>(0,a.jsx)("input",{type:"checkbox",...e,...(0,r.iv)([{position:"relative",margin:0,marginRight:6,width:15,height:15,appearance:"none",outline:0,border:"1px solid #d0d0d0",borderRadius:4,display:"flex",alignItems:"center",justifyContent:"center",color:"white",backgroundColor:"white",":checked":{border:"1px solid "+o.O9.b6,backgroundColor:o.O9.b6,"::after":{display:"block",background:o.O9.b6+' url(\'data:image/svg+xml; utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path fill="white" d="M0 11l2-2 5 5L18 3l2 2L7 18z"/></svg>\') 9px 9px',width:9,height:9,content:" "}},"&.focus-visible:focus":{"::before":{position:"absolute",top:-5,bottom:-5,left:-5,right:-5,border:"2px solid "+o.O9.b5,borderRadius:6,content:" "}}}],e.style)})},7117:function(e,t,n){"use strict";n.d(t,{Jz:function(){return O},Wy:function(){return T},ZP:function(){return z}});var r=n(3017),o=n(8989),i=n(8297),a=n(3865),s=n(9121),l=n(7156),u=n(4917),c=n(837),d=n(9585),f=n(5058),h=n(7292),p=n(9716),g=n(2101),m=n(2085),y=n(5371),v=n(1912),x=n(9432),b=n(1218),w=n(4652),S=n(9446),C=n(8993);function j(e,t,n){return e.map((e=>e===t?n():e))}function k(e,t){return e.map(((e,n)=>({...e,error:t[n]})))}function E(e,t){let n=["date"];return e.find((e=>"imported_payee"===e.field))&&n.push("imported_payee"),n.push("payee"),t.find((e=>"category"===e.field))?n.push("category"):t.length>0&&!["payee","date","amount"].includes(t[0].field)&&n.push(t[0].field),n.push("amount"),n}function T(e){let{fields:t,style:n,value:r,onChange:o}=e;return(0,C.jsx)(y.G7,{style:n,children:(0,C.jsx)(y.AP,{options:t,value:r,onChange:e=>o("field",e),style:{color:m.O9.p4}})})}function O(e){let{ops:t,type:n,style:r,value:o,formatOp:i=c.w8,onChange:a}=e;return"id"===n&&(t=t.filter((e=>"contains"!==e))),(0,C.jsx)(y.AP,{options:t.map((e=>[e,i(e,n)])),value:o,onChange:e=>a("op",e),style:r})}function I(e){let{onAdd:t,onDelete:n,style:r}=e;return(0,C.jsxs)(C.Fragment,{children:[n&&(0,C.jsx)(y.zx,{bare:!0,onClick:n,style:{padding:7},"aria-label":"Delete entry",children:(0,C.jsx)(p.Z,{style:{width:8,height:8}})}),t&&(0,C.jsx)(y.zx,{bare:!0,onClick:t,style:{padding:7},"aria-label":"Add entry",children:(0,C.jsx)(h.Z,{style:{width:10,height:10}})})]})}function D(e){let{type:t}=e;return(0,C.jsx)(y.xv,{style:{fontSize:12,textAlign:"center",color:m.O9.r5,marginBottom:5},children:(0,c.zQ)(t)})}function A(e){let{error:t,style:n,children:r}=e;return(0,C.jsxs)(y.G7,{style:n,"data-testid":"editor-row",children:[(0,C.jsx)(y.Kq,{direction:"row",align:"center",spacing:1,style:{padding:"3px 5px"},children:r}),t&&(0,C.jsx)(D,{type:t})]})}function _(e){let t,{ops:n,condition:r,editorStyle:o,isSchedule:i,onChange:a,onDelete:s,onAdd:l}=e,{field:u,op:c,value:d,type:f,options:h,error:p}=r;return"amount"===u&&h&&(h.inflow?u="amount-inflow":h.outflow&&(u="amount-outflow")),t="number"===f&&"isbetween"===c?(0,C.jsx)(b.I,{defaultValue:d,onChange:e=>a("value",e)}):(0,C.jsx)(S.Z,{field:u,type:f,value:d,multi:"oneOf"===c,onChange:e=>a("value",e)}),(0,C.jsxs)(A,{style:o,error:p,children:[(0,C.jsx)(T,{fields:B,value:u,onChange:a}),(0,C.jsx)(O,{ops:n,value:c,type:f,onChange:a}),(0,C.jsx)(y.G7,{style:{flex:1},children:t}),(0,C.jsx)(y.Kq,{direction:"row",children:(0,C.jsx)(I,{onAdd:l,onDelete:i&&"date"===u?null:s})})]})}function P(e){let{id:t}=e,n=(0,o.v9)((e=>e.prefs.local.dateFormat||"MM/dd/yyyy")),i=(0,a.gZ)({transform:(0,r.useCallback)((e=>e.filter({id:t})),[])});if(null==i)return null;if(0===i.schedules.length)return(0,C.jsx)(y.G7,{style:{flex:1},children:t});let[s]=i.schedules,l=s&&i.statuses.get(s.id);return(0,C.jsxs)(y.G7,{style:{flex:1,flexDirection:"row",alignItems:"center"},children:[(0,C.jsxs)(y.G7,{style:{marginRight:15,flexDirection:"row"},children:[(0,C.jsxs)(y.xv,{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:["Payee:"," ",(0,C.jsx)(w.Z,{type:"payees",id:s._payee,noneColor:m.O9.n5})]}),(0,C.jsx)(y.xv,{style:{margin:"0 5px"},children:" \u2014 "}),(0,C.jsxs)(y.xv,{style:{flexShrink:0},children:["Amount: ",(c=s._amount,c?"number"===typeof c?(0,d.zA)(c):`${(0,d.zA)(c.num1)} to ${(0,d.zA)(c.num2)}`:(0,d.zA)(0))]}),(0,C.jsx)(y.xv,{style:{margin:"0 5px"},children:" \u2014 "}),(0,C.jsxs)(y.xv,{style:{flexShrink:0},children:["Next: ",u.WU(s.next_date,n)]})]}),(0,C.jsx)(v.O,{status:l})]});var c}let M=["category","payee","notes","cleared","account","date","amount"].map((e=>[e,(0,c.gL)(e)]));function R(e){let{ops:t,action:n,editorStyle:r,onChange:o,onDelete:i,onAdd:a}=e,{field:s,op:l,value:u,type:d,error:f,inputKey:h="initial"}=n;return(0,C.jsxs)(A,{style:r,error:f,children:["set"===l?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(y.G7,{style:{padding:"5px 10px",lineHeight:"1em"},children:(0,c.w8)(l)}),(0,C.jsx)(T,{fields:M,value:s,onChange:o}),(0,C.jsx)(y.G7,{style:{flex:1},children:(0,C.jsx)(S.Z,{field:s,type:d,op:l,value:u,onChange:e=>o("value",e)},h)})]}):"link-schedule"===l?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(y.G7,{style:{padding:"5px 10px",color:m.O9.p4},children:(0,c.w8)(l)}),(0,C.jsx)(P,{id:u||null})]}):null,(0,C.jsx)(y.Kq,{direction:"row",children:(0,C.jsx)(I,{onAdd:a,onDelete:"link-schedule"!==l&&i})})]})}function N(){let[e,t]=(0,r.useState)();return(0,C.jsxs)(y.G7,{style:{position:"relative",marginLeft:5},children:[(0,C.jsx)(y.G7,{onMouseEnter:()=>t(!0),onMouseLeave:()=>t(!1),children:(0,C.jsx)(g.Z,{style:{width:11,height:11,color:m.O9.n4}})}),e&&(0,C.jsx)(y.u,{position:"bottom-left",style:{padding:10,color:m.O9.n4,maxWidth:450,lineHeight:1.5},children:"The stage of a rule allows you to force a specific order. Pre rules always run first, and post rules always run last. Within each stage rules are automatically ordered from least to most specific."})]})}function L(e){let{selected:t,children:n,style:r,onSelect:o}=e;return(0,C.jsx)(y.zx,{bare:!0,style:[{fontSize:"inherit"},t&&{backgroundColor:m.O9.b9,":hover":{backgroundColor:m.O9.b9}},r],onClick:o,children:n})}function F(e){return{...e,inputKey:""+Math.random()}}function W(e){let{conditionsOp:t,conditions:n,editorStyle:r,isSchedule:o,onChangeConditions:i}=e;function a(e){let r=B.map((e=>e[0])).filter((e=>"amount-inflow"!==e&&"amount-outflow"!==e));r=n.length&&"or"===t?[n[0].field]:r.filter((e=>!n.some((t=>t.field.includes(e)||e.includes(t.field)))));let o=r[0]||"payee",a=[...n];a.splice(e+1,0,{type:c.Z9.get(o),field:o,op:"is",value:null}),i(a)}return 0===n.length?(0,C.jsx)(y.zx,{style:{alignSelf:"flex-start"},onClick:function(){a(-1)},children:"Add condition"}):(0,C.jsx)(y.Kq,{spacing:2,"data-testid":"condition-list",children:n.map(((e,t)=>{let s=c.wZ[e.type].ops;return"date"===e.type&&e.value&&e.value.frequency?s=["is","isapprox"]:e.options&&(e.options.inflow||e.options.outflow)&&(s=s.filter((e=>"isbetween"!==e))),(0,C.jsx)(y.G7,{children:(0,C.jsx)(_,{editorStyle:r,ops:s,condition:e,isSchedule:o,onChange:(t,r)=>{!function(e,t,r){i(j(n,e,(()=>{if("field"===t){let t={field:r};"amount-inflow"===r?(t.field="amount",t.options={inflow:!0}):"amount-outflow"===r&&(t.field="amount",t.options={outflow:!0}),t.type=c.Z9.get(t.field);let n=c.Z9.get(e.field);return"string"!==n&&"number"!==n||n!==t.type||"isbetween"===e.op?(t.op=c.wZ[t.type].ops[0],F((0,c.l1)(null,t))):(t.op=e.op,F((0,c.l1)(e.value,t)))}if("op"===t){let t=r;return"oneOf"!==e.op&&"oneOf"===t?F((0,c.l1)(null!=e.value?[e.value]:[],{...e,op:r})):"oneOf"===e.op&&"oneOf"!==t?F((0,c.l1)(e.value.length>0?e.value[0]:null,{...e,op:r})):"isbetween"!==e.op&&"isbetween"===t?(0,c.l1)({num1:(0,d.l9)(e.value),num2:(0,d.l9)(e.value)},{...e,op:r}):"isbetween"===e.op&&"isbetween"!==t?(0,c.l1)((0,d.Bf)(e.value.num1||0),{...e,op:r}):{...e,op:r}}return"value"===t?(0,c.l1)(r,e):e})))}(e,t,r)},onDelete:()=>function(e){i(n.filter((t=>t!==e)))}(e),onAdd:()=>a(t)})},t)}))})}let B=["imported_payee","account","category","date","payee","notes","amount"].map((e=>[e,(0,c.gL)(e)])).concat([["amount-inflow",(0,c.gL)("amount",{inflow:!0})],["amount-outflow",(0,c.gL)("amount",{outflow:!0})]]);function z(e){let{modalProps:t,defaultRule:n,onSave:a}=e,[u,d]=(0,r.useState)(n.conditions.map(c.Qc)),[h,p]=(0,r.useState)(n.actions.map(c.Qc)),[g,v]=(0,r.useState)(n.stage),[b,w]=(0,r.useState)(n.conditionsOp),[S,O]=(0,r.useState)([]),I=(0,o.I0)(),D=(0,r.useRef)(),A=h.some((e=>"link-schedule"===e.op));(0,r.useEffect)((()=>(I((0,i.Rr)()),(0,i.Ew)(!1),()=>(0,i.Ew)(!0))),[]),(0,r.useEffect)((()=>{if(D.current){let e=D.current,t=e.scrollTop;e.scrollTop=t+1,e.scrollTop=t}!async function(){let{filters:e}=await(0,l.lW)("make-filters-from-conditions",{conditions:u.map(c.Z2)});if(e.length>0){const t="or"===b?"$or":"$and";let{data:n}=await(0,s.Vn)((0,s.ZP)("transactions").filter({[t]:e}).select("*"));O(n)}else O([])}()}),[h,u,b]);let _=(0,f.ZP)("transactions",S,[]);function P(){B(-1)}function B(e){let t=M.map((e=>e[0]));for(let o of h)t=t.filter((e=>e!==o.field));let n=t[0]||"category",r=[...h];r.splice(e+1,0,{type:c.Z9.get(n),field:n,op:"set",value:null}),p(r)}function z(e){v(e)}function G(e,t){w(t)}function Z(){(0,l.lW)("rule-apply-actions",{transactionIds:[..._.items],actions:h}).then((()=>{p([...h])}))}let U={backgroundColor:m.O9.n10,borderRadius:4};return(0,C.jsx)(y.u_,{title:"Rule",padding:0,...t,style:[t.style,{flex:"inherit",maxWidth:"90%"}],children:()=>(0,C.jsxs)(y.G7,{style:{maxWidth:"100%",width:900,height:"80vh",flexGrow:0,flexShrink:0,flexBasis:"auto",overflow:"hidden"},children:[(0,C.jsxs)(y.G7,{style:{flexDirection:"row",alignItems:"center",marginBottom:15,padding:"0 20px"},children:[(0,C.jsx)(y.xv,{style:{color:m.O9.n4,marginRight:15},children:"Stage of rule:"}),(0,C.jsxs)(y.Kq,{direction:"row",align:"center",spacing:1,children:[(0,C.jsx)(L,{selected:"pre"===g,onSelect:()=>z("pre"),children:"Pre"}),(0,C.jsx)(L,{selected:null===g,onSelect:()=>z(null),children:"Default"}),(0,C.jsx)(L,{selected:"post"===g,onSelect:()=>z("post"),children:"Post"}),(0,C.jsx)(N,{})]})]}),(0,C.jsx)(y.G7,{innerRef:D,style:{borderBottom:"1px solid "+m.O9.border,padding:20,overflow:"auto",maxHeight:"calc(100% - 300px)"},children:(0,C.jsxs)(y.G7,{style:{flexShrink:0},children:[(0,C.jsxs)(y.G7,{style:{marginBottom:30},children:[(0,C.jsxs)(y.xv,{style:{color:m.O9.n4,marginBottom:15},children:["If",(0,C.jsx)(T,{"data-testid":"conditions-op",style:{display:"inline-flex"},fields:[["and","all"],["or","any"]],value:b,onChange:G}),"of these conditions match:"]}),(0,C.jsx)(W,{conditionsOp:b,conditions:u,editorStyle:U,isSchedule:A,onChangeConditions:e=>d(e)})]}),(0,C.jsx)(y.xv,{style:{color:m.O9.n4,marginBottom:15},children:"Then apply these actions:"}),(0,C.jsx)(y.G7,{style:{flex:1},children:0===h.length?(0,C.jsx)(y.zx,{style:{alignSelf:"flex-start"},onClick:P,children:"Add action"}):(0,C.jsx)(y.Kq,{spacing:2,"data-testid":"action-list",children:h.map(((e,t)=>(0,C.jsx)(y.G7,{children:(0,C.jsx)(R,{ops:["set","link-schedule"],action:e,editorStyle:U,onChange:(t,n)=>{!function(e,t,n){p(j(h,e,(()=>{let r={...e};return r[t]=n,"field"===t?(r.type=c.Z9.get(r.field),r.value=null,F(r)):"op"===t?(r.value=null,r.inputKey=""+Math.random(),F(r)):r})))}(e,t,n)},onDelete:()=>function(e){p(h.filter((t=>t!==e)))}(e),onAdd:()=>B(t)})},t)))})})]})}),(0,C.jsx)(f.i5,{instance:_,children:(0,C.jsxs)(y.G7,{style:{padding:"20px",flex:1},children:[(0,C.jsxs)(y.G7,{style:{flexDirection:"row",alignItems:"center",marginBottom:12},children:[(0,C.jsx)(y.xv,{style:{color:m.O9.n4,marginBottom:0},children:"This rule applies to these transactions:"}),(0,C.jsx)(y.G7,{style:{flex:1}}),(0,C.jsxs)(y.zx,{disabled:0===_.items.size,onClick:Z,children:["Apply actions (",_.items.size,")"]})]}),(0,C.jsx)(x.Z,{transactions:S,fields:E(u,h),style:{border:"1px solid "+m.O9.border}}),(0,C.jsxs)(y.Kq,{direction:"row",justify:"flex-end",style:{marginTop:20},children:[(0,C.jsx)(y.zx,{onClick:()=>t.onClose(),children:"Cancel"}),(0,C.jsx)(y.zx,{primary:!0,onClick:()=>async function(){let e={...n,stage:g,conditionsOp:b,conditions:u.map(c.Z2),actions:h.map(c.Z2)},r=e.id?"rule-update":"rule-add",{error:o,id:i}=await(0,l.lW)(r,e);o?(o.conditionErrors&&d(k(u,o.conditionErrors)),o.actionErrors&&p(k(h,o.actionErrors))):(i&&(e.id=i),a&&a(e),t.onClose())}(),children:"Save"})]})]})})]})})}},1912:function(e,t,n){"use strict";n.d(t,{O:function(){return g},V:function(){return p}});n(3017);var r=n(9585),o=n(2756),i=n(2873),a=n(6854),s=n(8993);var l=e=>(0,s.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:(0,s.jsx)("path",{d:"M12 0C1.308 0-4.044 12.925 3.516 20.484 11.075 28.044 24 22.692 24 12 23.992 5.376 18.624.008 12 0zm.01 1.988c5.521.007 9.995 4.48 10.002 10.002 0 8.912-10.774 13.373-17.075 7.072-6.3-6.3-1.839-17.074 7.073-17.074zm6.234 4.588a1 1 0 0 0-.928.442l-6.226 8.45-4.076-3.261a1 1 0 1 0-1.25 1.563l4.888 3.908a1.011 1.011 0 0 0 1.43-.19L18.928 8.2a1 1 0 0 0-.684-1.623z",fill:"currentColor"})});var u=e=>(0,s.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:(0,s.jsx)("path",{d:"M12 0a10.286 10.286 0 0 0-6.243 18.45 1.714 1.714 0 0 1 .672 1.36v1.619A2.571 2.571 0 0 0 9 24a1.714 1.714 0 0 0 1.714-1.714V21a1.286 1.286 0 0 1 2.572 0v1.286A1.714 1.714 0 0 0 15 24a2.571 2.571 0 0 0 2.571-2.571V19.81a1.714 1.714 0 0 1 .672-1.36A10.286 10.286 0 0 0 12 0ZM7.714 12.429a2.143 2.143 0 1 1 2.143-2.143 2.143 2.143 0 0 1-2.143 2.143Zm8.572 0a2.143 2.143 0 1 1 2.143-2.143 2.143 2.143 0 0 1-2.143 2.143Z",fill:"currentColor"})});var c=e=>(0,s.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:(0,s.jsx)("path",{d:"M23.91 9.113a1.785 1.785 0 0 0-1.453-1.227l-6.132-.926-2.714-5.506a1.863 1.863 0 0 0-3.222 0l-2.78 5.552-6.066.88a1.798 1.798 0 0 0-1 3.068l4.428 4.361-1.028 6.055a1.797 1.797 0 0 0 2.607 1.895l5.488-2.865 5.429 2.858a1.797 1.797 0 0 0 2.607-1.895l-1.011-6.128 4.394-4.286a1.786 1.786 0 0 0 .454-1.836Z",fill:"currentColor"})});var d=e=>(0,s.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:(0,s.jsx)("path",{d:"M7.176 22.5a4.111 4.111 0 0 1-3.17-1.486l-3.62-4.6a1.8 1.8 0 1 1 2.828-2.228l3.6 4.56a.384.384 0 0 0 .379.152.52.52 0 0 0 .408-.197L20.794 2.177a1.8 1.8 0 1 1 2.812 2.246L10.39 20.964A4.12 4.12 0 0 1 7.2 22.5Z",fill:"currentColor"})}),f=n(2085),h=n(5371);function p(e){let t,n,r;switch(e){case"missed":t=f.O9.r1,n=f.O9.r10,r=u;break;case"due":t=f.O9.y1,n=f.O9.y9,r=o.Z;break;case"upcoming":t=f.O9.p1,n=f.O9.p10,r=i.Z;break;case"paid":t=f.O9.g2,n=f.O9.g10,r=d;break;case"completed":t=f.O9.n4,n=f.O9.n11,r=c;break;case"pending":t=f.O9.g4,n=f.O9.g11,r=i.Z;break;case"scheduled":t=f.O9.n1,n=f.O9.n11,r=i.Z;break;case"cleared":t=f.O9.g5,n=f.O9.n11,r=a.Z;break;default:t=f.O9.n1,n=f.O9.n11,r=l}return{color:t,backgroundColor:n,Icon:r}}function g(e){let{status:t,style:n}=e,{color:o,backgroundColor:i,Icon:a}=p(t);return(0,s.jsxs)(h.G7,{style:[{color:o,backgroundColor:i,padding:"6px 8px",borderRadius:4,flexDirection:"row",alignItems:"center",flexShrink:0},n],children:[(0,s.jsx)(a,{style:{width:13,height:13,color:"inherit",marginRight:7}}),(0,s.jsx)(h.xv,{style:{lineHeight:"1em"},children:(0,r.VL)(t)})]})}},5547:function(e,t,n){"use strict";n.d(t,{Z:function(){return w}});var r=n(3017),o=n(8989),i=n(9474),a=n(8756),s=n(3189),l=n(5249),u=n(1785),c=n(8664),d=n(8582),f=n.n(d),h=n(4917),p=n(9585),g=n(2085),m=n(5371),y=n(8993);let v={"& .pika-single.actual-date-picker":{color:g.O9.n11,background:g.O9.n1,border:"none",boxShadow:"0 0px 4px rgba(0, 0, 0, .25)",borderRadius:4},"& .actual-date-picker":{"& .pika-lendar":{float:"none",width:"auto"},"& .pika-label":{backgroundColor:g.O9.n1},"& .pika-prev":{backgroundImage:"url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAeCAQAAACGG/bgAAAAQ0lEQVR4Ae3KIQ4AIBTD0N0/IeHGI3UIRA3ut/Zl+ltXc5++htVAmIAwAWECwgSEKbgthEoIlRAqIVRCqINQB9nDgQd7ktwFo6UpWQAAAABJRU5ErkJggg==)"},"& .pika-next":{backgroundImage:"url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAeCAQAAACGG/bgAAAAP0lEQVQ4y+3TMQoAMAgEwfwfAvvjTZ1uGzuvHhBPPGczEG+FRqqRaqQaqUaqkX6QBmmjacvQ6qEVTjsh+xizebvlaWptGXZAAAAAAElFTkSuQmCC)"},"& .pika-table th":{color:g.O9.n11,"& abbr":{textDecoration:"none"}},"& .pika-button":{backgroundColor:g.O9.n2,color:g.O9.n11},"& .is-today .pika-button":{textDecoration:"underline"},"& .is-selected .pika-button":{backgroundColor:g.O9.n5,boxShadow:"none"}}},x=(0,r.forwardRef)(((e,t)=>{let{value:n,firstDayOfWeekIdx:o,dateFormat:u,onUpdate:c,onSelect:d}=e,h=(0,r.useRef)(null),g=(0,r.useRef)(null);return(0,r.useImperativeHandle)(t,(()=>({handleInputKeyDown(e){let t=null;switch(e.key){case"ArrowLeft":e.preventDefault(),t=i.Z(h.current.getDate(),1);break;case"ArrowUp":e.preventDefault(),t=i.Z(h.current.getDate(),7);break;case"ArrowRight":e.preventDefault(),t=a.Z(h.current.getDate(),1);break;case"ArrowDown":e.preventDefault(),t=a.Z(h.current.getDate(),7)}t&&(h.current.setDate(t,!0),c&&c(t))}})),[]),(0,r.useLayoutEffect)((()=>(h.current=new(f())({theme:"actual-date-picker",keyboardInput:!1,firstDay:(0,p.CD)(o),defaultDate:n?s.Z(n,u,new Date):new Date,setDefaultDate:!0,toString(e){return l.Z(e,u)},parse(e){return s.Z(e,u,new Date)},onSelect:d}),g.current.appendChild(h.current.el),()=>{h.current.destroy()})),[]),(0,r.useEffect)((()=>{h.current.getDate()!==n&&h.current.setDate(s.Z(n,u,new Date),!0)}),[n,u]),(0,y.jsx)(m.G7,{style:[v,{flex:1}],innerRef:g})}));function b(e){return"Enter"===e.key}function w(e){let{containerProps:t,inputProps:n,tooltipStyle:i,value:a,isOpen:d,embedded:f,dateFormat:p="yyyy-MM-dd",focused:g,openOnFocus:v=!0,inputRef:w,shouldSaveFromKey:S=b,tableBehavior:C,onUpdate:j,onSelect:k}=e,E=(0,r.useMemo)((()=>{if(a){let e=u.Z(a);if(c.Z(e))return l.Z(e,p)}return""}),[a,p]),T=(0,r.useRef)(null),[O,I]=(0,r.useState)(E),[D,A]=(0,r.useState)(f||d||!1),_=(0,r.useRef)(null);(0,r.useLayoutEffect)((()=>{w&&(w.current=_.current)}),[]);let[P,M]=(0,r.useState)(O),R=(0,r.useRef)(P);const N=(0,o.v9)((e=>{var t;return null!==(t=e.prefs.local)&&void 0!==t&&t.firstDayOfWeekIdx?e.prefs.local.firstDayOfWeekIdx:"0"}));(0,r.useEffect)((()=>{R.current=O}),[O]),(0,r.useEffect)((()=>I(E)),[E]),(0,r.useEffect)((()=>{if((0,h.Ze)(p).test(O)){let e=s.Z(O,(0,h.D1)(p),new Date);c.Z(e)&&(j&&j(l.Z(e,"yyyy-MM-dd")),M(l.Z(e,p)))}else if((0,h._y)(p).test(O)){let e=s.Z(O,(0,h.JC)(p),new Date);c.Z(e)&&(j&&j(l.Z(e,"yyyy-MM-dd")),M(l.Z(e,p)))}else{let e=s.Z(O,p,new Date);if(c.Z(e)){let t=l.Z(e,"yyyy-MM-dd");j&&j(t),M(O)}}}),[O]);return(0,y.jsxs)(m.G7,{...t,children:[(0,y.jsx)(m.II,{focused:g,...n,inputRef:_,value:O,onKeyDown:function(e){if(!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(e.key)||e.shiftKey||e.metaKey||e.altKey||!D)if("Escape"===e.key)I(E),M(E),E===O?D&&(f||e.stopPropagation(),A(!1)):(A(!0),j&&j(a));else if(S(e)){I(P),A(!1);let t=s.Z(P,p,new Date);k(l.Z(t,"yyyy-MM-dd")),D&&R.current!==P&&(e.stopPropagation(),e.preventDefault());let{onKeyDown:r}=n||{};r&&r(e)}else D||(A(!0),_.current&&_.current.setSelectionRange(0,1e4));else T.current.handleInputKeyDown(e)},onChange:function(e){I(e.target.value)},onFocus:e=>{!f&&v&&A(!0),n&&n.onFocus&&n.onFocus(e)},onBlur:e=>{if(f||A(!1),n&&n.onBlur&&n.onBlur(e),!C)if(""===O)M(null),k(null);else{I(P||"");let e=s.Z(P,p,new Date);e instanceof Date&&!isNaN(e)&&k(l.Z(e,"yyyy-MM-dd"))}}}),D&&(L=(0,y.jsx)(x,{ref:T,value:P,firstDayOfWeekIdx:N,dateFormat:p,onUpdate:e=>{M(l.Z(e,p)),j&&j(l.Z(e,"yyyy-MM-dd"))},onSelect:e=>{I(l.Z(e,p)),k(l.Z(e,"yyyy-MM-dd")),A(!1)}}),f?L:(0,y.jsx)(m.u,{position:"bottom-left",offset:2,style:[{padding:0,minWidth:225},i],children:L}))]});var L}},3964:function(e,t,n){"use strict";n.d(t,{Z:function(){return O}});var r=n(3017),o=n(8989),i=n(7156),a=n(4917),s=n(8370),l=n(7292),u=n(9716),c=n(2085),d=n(5371),f=n(3679),h=n(5547),p=n(8993);const g=5,m=[{id:"daily",name:"Days"},{id:"weekly",name:"Weeks"},{id:"monthly",name:"Months"},{id:"yearly",name:"Years"}],y=[...Array(31).keys()].map((e=>e+1)),v=[{id:"SU",name:"Sunday"},{id:"MO",name:"Monday"},{id:"TU",name:"Tuesday"},{id:"WE",name:"Wednesday"},{id:"TH",name:"Thursday"},{id:"FR",name:"Friday"},{id:"SA",name:"Saturday"}];function x(e){return e||{start:a.PR(),interval:1,frequency:"monthly",patterns:[w(a.PR())]}}function b(e){return{...e,interval:k(e.interval)}}function w(e){return{value:parseInt(a.WU(e,"d")),type:"day"}}function S(e){let{field:t,value:n,recurrence:r}=e;return"value"===t&&"day"!==r.type&&n>g||"type"===t&&"day"!==n&&r.value>g?{[t]:n,value:g}:{[t]:n}}function C(e,t){switch(t.type){case"replace-config":return{...e,config:t.config};case"change-field":return{...e,config:{...e.config,[t.field]:t.value,patterns:"monthly"!==e.config.frequency?[]:e.config.patterns}};case"update-recurrence":return{...e,config:{...e.config,patterns:e.config.patterns.map((e=>e===t.recurrence?{...t.recurrence,...S(t)}:e))}};case"add-recurrence":return{...e,config:{...e.config,patterns:[...e.config.patterns||[],w(e.config.start)]}};case"remove-recurrence":return{...e,config:{...e.config,patterns:e.config.patterns.filter((e=>e!==t.recurrence))}};default:return e}}function j(e){let{previewDates:t}=e;const n=(0,o.v9)((e=>(e.prefs.local.dateFormat||"MM/dd/yyyy").replace("MM","M").replace("dd","d")));if(!t)return null;let r=null;return r="string"===typeof t?(0,p.jsx)(d.xv,{children:t}):(0,p.jsxs)(d.G7,{children:[(0,p.jsx)(d.xv,{style:{fontWeight:600},children:"Upcoming dates"}),(0,p.jsx)(d.Kq,{direction:"row",spacing:4,style:{marginTop:10},children:t.map((e=>(0,p.jsxs)(d.G7,{children:[(0,p.jsx)(d.xv,{children:a.WU(e,n)}),(0,p.jsx)(d.xv,{children:a.WU(e,"EEEE")})]})))})]}),(0,p.jsx)(d.Kq,{direction:"column",spacing:1,style:{marginTop:15,color:c.O9.n4},children:r})}function k(e){const t=parseInt(e);return Number.isInteger(t)&&t>0?t:1}function E(e){let{config:t,dispatch:n}=e,r=(e,t,r)=>n({type:"update-recurrence",recurrence:e,field:t,value:r});return(0,p.jsx)(d.Kq,{spacing:2,style:{marginTop:10},children:t.patterns.map(((e,t)=>(0,p.jsxs)(d.G7,{style:{display:"flex",flexDirection:"row"},children:[(0,p.jsxs)(d.Ph,{style:{marginRight:10},value:e.value,onChange:t=>{return r(e,"value","last"===(n=t.target.value)?-1:Number(n));var n},children:[(0,p.jsx)("option",{value:-1,children:"Last"}),(0,p.jsx)("option",{disabled:!0,children:"---"}),y.map((e=>(0,p.jsx)("option",{value:e,children:e},e)))]}),(0,p.jsxs)(d.Ph,{style:{marginRight:10},value:e.type,onChange:t=>r(e,"type",t.target.value),children:[(0,p.jsx)("option",{value:"day",children:"Day"}),(0,p.jsx)("option",{disabled:!0,children:"---"}),v.map((e=>(0,p.jsx)("option",{value:e.id,children:e.name},e.id)))]}),(0,p.jsx)(d.zx,{bare:!0,style:{padding:7},onClick:()=>n({type:"remove-recurrence",recurrence:e}),children:(0,p.jsx)(u.Z,{style:{width:8,height:8}})}),(0,p.jsx)(d.zx,{bare:!0,style:{padding:7,marginLeft:5},onClick:()=>n({type:"add-recurrence"}),children:(0,p.jsx)(l.Z,{style:{width:10,height:10}})})]},t)))})}function T(e){let{config:t,onClose:n,onSave:a}=e,[s,l]=(0,r.useState)(null),[u,c]=(0,r.useReducer)(C,{config:x(t)}),f=(0,o.v9)((e=>e.prefs.local.dateFormat||"MM/dd/yyyy"));(0,r.useEffect)((()=>{c({type:"replace-config",config:x(t)})}),[t]);let{config:g}=u,y=(e,t)=>c({type:"change-field",field:e,value:t});return(0,r.useEffect)((()=>{!async function(){let{data:e,error:t}=await(0,i.OK)("schedule/get-upcoming-dates",{config:b(g),count:4});l(t?"Invalid rule":e)}()}),[g]),null==s?null:(0,p.jsxs)(d.u,{style:{padding:10,width:380},offset:1,position:"bottom-left",onClose:n,children:[(0,p.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,p.jsx)("label",{htmlFor:"start",style:{marginRight:5},children:"Starts:"}),(0,p.jsx)(h.Z,{id:"start",inputProps:{placeholder:"Start Date"},value:g.start,onSelect:e=>y("start",e),containerProps:{style:{width:100}},dateFormat:f})]}),(0,p.jsxs)(d.Kq,{direction:"row",align:"center",justify:"flex-start",style:{marginTop:10},spacing:2,children:[(0,p.jsx)(d.xv,{style:{whiteSpace:"nowrap"},children:"Repeat every"}),(0,p.jsx)(d.II,{id:"interval",style:{width:40},type:"text",onBlur:e=>y("interval",e.target.value),onEnter:e=>y("interval",e.target.value),defaultValue:g.interval||1}),(0,p.jsx)(d.Ph,{onChange:e=>y("frequency",e.target.value),value:g.frequency,style:{flex:0},children:m.map((e=>(0,p.jsx)("option",{value:e.id,children:e.name},e.id)))}),"monthly"!==g.frequency||null!=g.patterns&&0!==g.patterns.length?null:(0,p.jsx)(d.zx,{onClick:()=>c({type:"add-recurrence"}),children:"Add specific days"})]}),"monthly"===g.frequency&&g.patterns&&g.patterns.length>0&&(0,p.jsx)(E,{config:g,dispatch:c}),(0,p.jsx)(j,{previewDates:s}),(0,p.jsxs)("div",{style:{display:"flex",marginTop:15,justifyContent:"flex-end"},children:[(0,p.jsx)(d.zx,{onClick:n,children:"Cancel"}),(0,p.jsx)(d.zx,{onClick:()=>a(b(g)),primary:!0,style:{marginLeft:10},children:"Apply"})]})]})}function O(e){let{value:t,buttonStyle:n,onChange:r}=e,{isOpen:o,close:i,getOpenEvents:a}=(0,f.lL)();return(0,p.jsxs)(d.G7,{children:[(0,p.jsx)(d.zx,{...a(),style:[{textAlign:"left"},n],children:t?(0,s.o7)(t):"No recurring date"}),o&&(0,p.jsx)(T,{config:t,onClose:i,onSave:function(e){r(e),i()}})]})}},1388:function(e,t,n){"use strict";var r=n(3017);t.Z=(0,r.createContext)(void 0)},5901:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(3017),o=n(2914),i=n(1388),a=n(8993);function s(e){let{binding:t,initialValue:s,children:l,onChange:u}=e;if(!t)throw new Error("SheetValue binding is required");n.g.IS_TESTING&&"string"!==typeof t&&!t.name&&(t={...t,name:t.value.toString()});const c="string"===typeof t?{name:t,value:null}:t;if(null==c.name)throw new Error("Binding name is now required");let d=(0,o.M)(),f=(0,r.useContext)(i.Z)||"__global",[h,p]=(0,r.useState)({name:f+"!"+c.name,value:null!=s?s:c.value,query:c.query}),g=(0,r.useRef)(u),m=(0,r.useRef)(h.value);return(0,r.useLayoutEffect)((()=>{g.current=u,m.current=h.value})),(0,r.useLayoutEffect)((()=>(c.query&&d.createQuery(f,c.name,c.query),d.bind(f,c,null,(e=>{g.current&&g.current(e),e.value!==m.current&&p(e)})))),[f,c.name]),null!=h.value?(0,a.jsx)(a.Fragment,{children:l(h,(function(){throw new Error("setCell is not implemented anymore")}))}):null}},1685:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(9585);function o(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"string";switch(t){case"string":const n=JSON.stringify(e);return'"'===n.charAt(0)&&'"'===n.charAt(n.length-1)?n.slice(1,-1):n;case"number":return""+e;case"financial-with-sign":let i=o(e,"financial");return e>=0?"+"+i:i;case"financial":if(null==e||""===e||0===e)return(0,r.zA)(0);if("string"===typeof e){const t=parseFloat(e);e=isNaN(t)?0:t}if("number"!==typeof e)throw new Error("Value is not a number ("+typeof e+"): "+e);return(0,r.zA)(e);default:throw new Error("Unknown format type: "+t)}}},9234:function(e,t,n){"use strict";n.d(t,{bL:function(){return D},Sx:function(){return W},wh:function(){return L},nu:function(){return F},gN:function(){return O},F3:function(){return R},dN:function(){return C},X2:function(){return A},_7:function(){return B},Vg:function(){return Z},OX:function(){return z},iA:function(){return K},xD:function(){return G},pX:function(){return H},rt:function(){return I},wz:function(){return V}});var r=n(3017),o=n(8989),i=n(2644),a=n(5197),s=n(5058),l=n(9314),u=n(8091),c=n(9220),d=n(7871),f=n(2085),h=n(5371),p=n(1678),g=n(9227),m=n(8993);const y=(e,t)=>e;function v(e){let{onResize:t,children:n}=e;return n((0,g.Z)(t))}class x extends r.PureComponent{constructor(e){super(e),this._resetIsScrollingTimeoutId=null,this.setRowAnimation=e=>{this.animationEnabled=e;let t=this._outerRef;t&&(this.animationEnabled?t.classList.add("animated"):t.classList.remove("animated"))},this.onHeaderResize=e=>{},this.getItemOffset=e=>e*this.props.itemSize,this.getItemSize=e=>this.props.itemSize,this.getEstimatedTotalSize=()=>this.props.itemSize*this.props.itemCount,this.getOffsetForIndexAndAlignment=(e,t,n)=>{const r=this.props.height,o=Math.max(0,this.props.itemCount*this.props.itemSize-r),i=Math.min(o,e*this.props.itemSize),a=Math.max(0,e*this.props.itemSize-r+this.props.itemSize);switch("smart"===t&&(t=n>=a-r&&n<=i+r?"auto":"center"),t){case"start":return i;case"end":return a;case"center":{const e=Math.round(a+(i-a)/2);return e<Math.ceil(r/2)?0:e>o+Math.floor(r/2)?o:e}default:return n>=a&&n<=i?n:n<a?a:i}},this.getStartIndexForOffset=e=>Math.max(0,Math.min(this.props.itemCount-1,Math.floor(e/this.props.itemSize))),this.getStopIndexForStartIndex=(e,t)=>{const n=e*this.props.itemSize,r=this.props.height,o=Math.ceil((r+t-n)/this.props.itemSize);return Math.max(0,Math.min(this.props.itemCount-1,e+o-1))},this._callOnItemsRendered=(0,p.Z)(((e,t,n,r)=>this.props.onItemsRendered({overscanStartIndex:e,overscanStopIndex:t,visibleStartIndex:n,visibleStopIndex:r}))),this._callOnScroll=(0,p.Z)(((e,t,n)=>this.props.onScroll({scrollDirection:e,scrollOffset:t,scrollUpdateWasRequested:n}))),this._getItemStyle=e=>{const{direction:t,itemSize:n,layout:r}=this.props,o=this._getItemStyleCache(n,r,t);let i;if(o.hasOwnProperty(e))i=o[e];else{const t=this.getItemOffset(e),n=this.getItemSize(e);o[e]=i={position:"absolute",left:0,top:t,height:n,width:"100%"}}return i},this._getItemStyleCache=(0,p.Z)(((e,t,n)=>({}))),this._onScrollVertical=e=>{let{scrollTop:t}=e.currentTarget;this.setState((e=>{if(e.scrollOffset===t)return null;let n=t;return{isScrolling:!0,scrollDirection:e.scrollOffset<n?"forward":"backward",scrollOffset:n,scrollUpdateWasRequested:!1}}),this._resetIsScrollingDebounced)},this._outerRefSetter=e=>{const{outerRef:t}=this.props;this._outerRef=e,"function"===typeof t?t(e):null!=t&&"object"===typeof t&&t.hasOwnProperty("current")&&(t.current=e)},this._resetIsScrollingDebounced=()=>{null!==this._resetIsScrollingTimeoutId&&clearTimeout(this._resetIsScrollingTimeoutId),this._resetIsScrollingTimeoutId=setTimeout(this._resetIsScrolling,150)},this._resetIsScrolling=()=>{this._resetIsScrollingTimeoutId=null,this.setState({isScrolling:!1},(()=>{this._getItemStyleCache(-1,null)}))},this.lastPositions=(0,r.createRef)(),this.lastPositions.current=new Map,this.needsAnimationRerender=(0,r.createRef)(),this.needsAnimationRerender.current=!1,this.animationEnabled=!1,this.state={instance:this,isScrolling:!1,scrollDirection:"forward",scrollOffset:"number"===typeof this.props.initialScrollOffset?this.props.initialScrollOffset:0,scrollUpdateWasRequested:!1}}scrollTo(e){e=Math.max(0,e),this.setState((t=>t.scrollOffset===e?null:(this.requestScrollUpdateHandled=!1,{scrollDirection:t.scrollOffset<e?"forward":"backward",scrollOffset:e,scrollUpdateWasRequested:!0})),this._resetIsScrollingDebounced)}scrollToItem(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"auto";const{itemCount:n}=this.props,{scrollOffset:r}=this.state;e=Math.max(0,Math.min(e,n-1)),this.scrollTo(this.getOffsetForIndexAndAlignment(e,t,r))}componentDidMount(){const{initialScrollOffset:e}=this.props;if("number"===typeof e&&null!=this._outerRef){let t=this._outerRef;t=this._outerRef,t.scrollTop=e}this._callPropsCallbacks()}getAnchoredScrollPos(){if(this.anchored&&this.props.indexForKey&&null!=this._outerRef){let e=this.props.indexForKey(this.anchored.key);return this.getOffsetForIndexAndAlignment(e,"start")+this.anchored.offset}return null}componentDidUpdate(){const{scrollOffset:e,scrollUpdateWasRequested:t}=this.state;let n=this.getAnchoredScrollPos();if(null!=n){this._outerRef.scrollTop=n}else if(t&&!this.requestScrollUpdateHandled&&null!=this._outerRef){this.requestScrollUpdateHandled=!0;this._outerRef.scrollTop=e}this.needsAnimationRerender.current&&(this.needsAnimationRerender.current=!1,this.rerenderTimeout=setTimeout((()=>{this.forceUpdate()}),10)),this._callPropsCallbacks()}componentWillUnmount(){null!==this._resetIsScrollingTimeoutId&&clearTimeout(this._resetIsScrollingTimeoutId)}render(){const{className:e,height:t,header:n,innerRef:r,innerElementType:o,innerTagName:i,itemCount:a,renderRow:s,itemKey:l=y,outerElementType:u,outerTagName:c,style:d,useIsScrolling:f,width:p}=this.props,{isScrolling:g}=this.state,[x,b]=this._getRangeToRender(),w=new Map,S=[];if(a>0)for(let h=x;h<=b;h++){let e=l(h),t=this._getItemStyle(h),n=this.lastPositions.current.get(e),r=!1;w.set(e,t.top),this.animationEnabled&&null!=n&&n!==t.top&&(t={...t,top:n},this.needsAnimationRerender.current=!0,r=!0),S.push(s({index:h,key:e,style:t,isScrolling:f?g:void 0,isAnimating:r}))}this.lastPositions.current=w;let C=this.getEstimatedTotalSize(),j=u||c||"div",k=o||i||"div";return(0,m.jsx)(v,{onResize:this.onHeaderResize,children:o=>(0,m.jsxs)(j,{className:e,onScroll:this._onScrollVertical,ref:this._outerRefSetter,style:{height:t,width:p,overflow:"auto",...d},children:[(0,m.jsx)(h.G7,{innerRef:o,children:n}),(0,m.jsx)(k,{ref:r,style:{position:"relative",height:C,width:"100%",pointerEvents:g?"none":void 0},children:S})]})})}anchor(){let e=this.props.itemKey||y,t=this._outerRef,n=t?t.scrollTop:0,r=this.getStartIndexForOffset(n),o=e(r);this.anchored={key:o,offset:n-this.getItemOffset(r)}}unanchor(){this.anchored=null}isAnchored(){return null!=this.anchored}_callPropsCallbacks(){if("function"===typeof this.props.onItemsRendered){const{itemCount:e}=this.props;if(e>0){const[e,t,n,r]=this._getRangeToRender();this._callOnItemsRendered(e,t,n,r)}}if("function"===typeof this.props.onScroll){const{scrollDirection:e,scrollOffset:t,scrollUpdateWasRequested:n}=this.state;this._callOnScroll(e,t,n)}}_getRangeToRender(){let{itemCount:e,overscanCount:t}=this.props,{isScrolling:n,scrollDirection:r,scrollOffset:o}=this.state,i=this.getAnchoredScrollPos();if(null!=i&&(o=i),0===e)return[0,0,0,0];const a=this.getStartIndexForOffset(o),s=this.getStopIndexForStartIndex(a,o),l=n&&"backward"!==r?1:Math.max(1,t),u=n&&"forward"!==r?1:Math.max(1,t);return[Math.max(0,a-l),Math.max(0,Math.min(e-1,s+u)),a,s]}}x.defaultProps={direction:"ltr",renderRow:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1,headerHeight:0};var b=n(2677),w=n(1685),S=n(5901);const C=32,j=f.O9.n11;function k(e,t){document.hasFocus()?e&&e(t):t.stopPropagation()}const E=(0,r.createContext)({backgroundColor:"white",borderColor:f.O9.n9});function T(e){let{backgroundColor:t,borderColor:n,children:o}=e,i=(0,r.useMemo)((()=>({backgroundColor:t,borderColor:n})),[t,n]);return(0,m.jsx)(E.Provider,{value:i,children:o})}const O=(0,r.forwardRef)((function(e,t){let{width:n,name:o,borderColor:i,truncate:a=!0,children:s,style:l,contentStyle:u,...c}=e,{backgroundColor:d,borderColor:p}=(0,r.useContext)(E);return i&&(p=i),(0,m.jsx)(h.G7,{innerRef:t,...c,style:["flex"===n?{flex:1,flexBasis:0}:{width:n},{position:"relative",borderTopWidth:p?1:0,borderBottomWidth:p?1:0,borderColor:p,backgroundColor:d},f.W2.smallText,l],"data-testid":o,children:(0,m.jsx)(h.G7,{style:[{flex:1,padding:"0 5px",justifyContent:"center"},u],children:a?(0,m.jsx)(h.xv,{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:s}):s})})}));function I(e){let{value:t,formatter:n}=e;return(0,m.jsx)(h.xv,{style:{flexGrow:1,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n?n(t):t})}function D(e){let{width:t,name:o,exposed:i,focused:s,value:l,formatter:u,textAlign:c,onExpose:d,borderColor:p,children:g,plain:y,style:v,valueStyle:x,unexposedContent:b,...w}=e,S=(0,r.useRef)(null),C=(0,r.useRef)(null),{backgroundColor:j,borderColor:k}=(0,r.useContext)(E);(0,a.X)(C,void 0!==s?s:i),p&&(k=p);const T="flex"===t?{flex:1,flexBasis:0}:{width:t},O={position:"relative",textAlign:c||"left",justifyContent:"center",borderTopWidth:k?1:0,borderBottomWidth:k?1:0,borderColor:k,backgroundColor:j};return(0,m.jsx)(h.G7,{innerRef:C,style:[T,O,v],className:"animated-cell",...w,"data-testid":o,children:y?g:i?g():(0,m.jsx)(h.G7,{style:[{flexDirection:"row",flex:1,padding:"0 5px",alignItems:"center"},f.W2.smallText,x],onMouseDown:e=>S.current=[e.clientX,e.clientY],onClick:n.g.IS_TESTING?()=>d&&d(o):e=>{S.current&&Math.abs(e.clientX-S.current[0])<5&&Math.abs(e.clientY-S.current[1])<5&&d&&d(o)},children:b||(0,m.jsx)(I,{value:l,formatter:u})})})}function A(e){let{backgroundColor:t="white",borderColor:n=f.O9.border,inset:o=0,collapsed:i,focused:a,highlighted:s,children:l,height:u,style:c,...d}=e,[p,g]=(0,r.useState)(!1),y=(0,r.useRef)(!1),v=(0,r.useRef)(null),x=(0,r.useRef)(null);return(0,r.useEffect)((()=>{s&&!y.current&&v.current&&(v.current.classList.add("animated"),g(!0),clearTimeout(x.current),x.current=setTimeout((()=>{g(!1),x.current=setTimeout((()=>{v.current&&v.current.classList.remove("animated")}),500)}),500))}),[s]),(0,r.useEffect)((()=>{y.current=s})),(0,m.jsx)(T,{backgroundColor:p?f.O9.y9:t,borderColor:p?f.O9.y8:n,children:(0,m.jsxs)(h.G7,{innerRef:v,style:[{flexDirection:"row",height:u||C,flex:"0 0 "+(u||C)+"px",userSelect:"text","&.animated .animated-cell":{transition:".7s background-color"}},i&&{marginTop:-1},c],"data-testid":"row",...d,children:[0!==o&&(0,m.jsx)(O,{width:o}),l,0!==o&&(0,m.jsx)(O,{width:o})]})})}const _={backgroundColor:"white",padding:"5px 3px",margin:"0 1px"},P={backgroundColor:"transparent","::selection":{backgroundColor:"#d9d9d9"}};function M(e){let{value:t,onUpdate:n,onBlur:o,...i}=e,[a,s]=(0,r.useState)(t);return(0,m.jsx)(h.II,{...i,value:a,onUpdate:e=>s(e),onBlur:function(e){n&&n(a),o&&k(o,e)},onKeyDown:function(e){"Enter"!==e.key&&"Tab"!==e.key&&e.stopPropagation(),"Escape"===e.key?a!==t&&s(t):N(e)&&n&&n(a)},style:[_,i.readOnly?P:null,i.style]})}function R(e){let{inputProps:t,onUpdate:n,onBlur:r,textAlign:o,error:i,...a}=e;return(0,m.jsx)(D,{textAlign:o,...a,children:()=>(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(M,{value:a.value,onUpdate:n,onBlur:r,style:[{textAlign:o},t&&t.style],...t}),i&&(0,m.jsx)(h.u,{targetHeight:C,width:180,position:"bottom-left",children:i},"error")]})})}function N(e){switch(e.key){case"Tab":case"Enter":return e.preventDefault(),!0}}function L(e){let{value:t,children:n,onUpdate:o,onBlur:i,...a}=e,[s,l]=(0,r.useState)(t),[u,c]=(0,r.useState)(t);function d(e){document.hasFocus()&&(o&&o(s),k(i,e))}function f(e){N(e)&&o&&o(s)}return u!==t&&(l(t),c(t)),(0,m.jsx)(D,{...a,value:t,children:()=>n({onBlur:d,onKeyDown:f,onUpdate:e=>l(e),onSave:e=>{l(e),o&&o(e)},shouldSaveFromKey:N,inputStyle:_})})}function F(e){let{onDelete:t,style:n,...r}=e;return(0,m.jsx)(D,{...r,name:"delete",width:20,style:[{alignItems:"center",userSelect:"none"},n],onClick:e=>{e.stopPropagation(),t&&t()},children:()=>(0,m.jsx)(u.Z,{width:7,height:7})})}const W=(0,r.forwardRef)(((e,t)=>{let{style:n,disabled:r,clickBehavior:o,onSelect:i,onEdit:a,children:s}=e;return(0,m.jsx)(h.G7,{innerRef:t,className:"cell-button",tabIndex:0,onKeyDown:e=>{"x"!==e.key&&" "!==e.key||(e.preventDefault(),r||i&&i(e))},style:[{flexDirection:"row",alignItems:"center",cursor:"default",transition:"box-shadow .15s",":focus":{outline:0,boxShadow:`0 0 0 3px white, 0 0 0 5px ${f.O9.b5}`}},n],onFocus:()=>a&&a(),"data-testid":"cell-button",onClick:"none"===o?null:e=>{r||(i&&i(e),a&&a())},children:s})}));function B(e){let{focused:t,selected:n,partial:r,style:o,onSelect:i,onEdit:a,...s}=e;return(0,m.jsx)(D,{...s,focused:t,name:"select",width:20,style:[{alignItems:"center",userSelect:"none"},o],onClick:e=>{e.stopPropagation(),i&&i(e),a&&a()},children:()=>(0,m.jsx)(W,{style:[{width:12,height:12,border:"1px solid "+f.O9.n8,borderRadius:3,justifyContent:"center",alignItems:"center",":focus":{border:"1px solid "+f.O9.b5,boxShadow:"0 1px 2px "+f.O9.b5}},n&&{backgroundColor:r?f.O9.b9:f.O9.b5,borderColor:r?f.O9.b9:f.O9.b5}],onEdit:a,onSelect:i,clickBehavior:"none",children:n&&(0,m.jsx)(d.Z,{width:6,height:6,style:{color:"white"}})})})}function z(e){let{valueProps:t,valueStyle:n,inputProps:r,textAlign:o,onSave:i,...a}=e;const{binding:s,type:l,getValueStyle:u,formatExpr:c,unformatExpr:d}=t;return(0,m.jsx)(S.Z,{binding:s,onChange:e=>{a.exposed&&r&&r.onBlur&&r.onBlur(e)},children:e=>(0,m.jsx)(D,{valueStyle:u?[n,u(e.value)]:n,textAlign:o,...a,value:e.value,formatter:e=>a.formatter?a.formatter(e,l):(0,w.Z)(e,l),"data-cellname":e.name,children:()=>(0,m.jsx)(M,{value:c?c(e.value):e.value,onUpdate:e=>{i(d?d(e):e)},style:{textAlign:o},...r})})})}function G(e){let{headers:t,children:n,version:r,...o}=e;return(0,m.jsx)(h.G7,{style:"v2"===r&&{borderRadius:"6px 6px 0 0",overflow:"hidden",flexShrink:0},children:(0,m.jsx)(A,{backgroundColor:"white",borderColor:f.O9.border,collapsed:!0,...o,style:[{zIndex:200},"v2"===r?{color:f.O9.n4,fontWeight:500}:{color:f.O9.n4},o.style],children:t?t.map((e=>(0,m.jsx)(D,{value:e.name,width:e.width,style:e.style,valueStyle:e.valueStyle},e.name))):n})})}function Z(e){let{name:t,keyHandlers:n,items:o,onSelect:i}=e,a=(0,s.D9)(),[l,u]=(0,r.useState)(null);return 0===a.size?null:(0,m.jsxs)(h.G7,{children:[(0,m.jsx)(b.U,{keys:n||{}}),(0,m.jsxs)(h.zx,{bare:!0,style:{color:f.O9.b3},onClick:()=>u(!0),children:[(0,m.jsx)(c.Z,{width:8,height:8,style:{marginRight:5}}),a.size," ",t]}),l&&(0,m.jsx)(h.u,{position:"bottom-right",width:200,style:{padding:0},onClose:()=>u(!1),children:(0,m.jsx)(h.v2,{onMenuSelect:e=>{i(e,[...a]),u(!1)},items:o})})]})}let U={position:"absolute",willChange:"transform",width:"100%"};const H=(0,r.forwardRef)(((e,t)=>{let{fields:n,...r}=e,o=V(r.items,n);return(0,m.jsx)(K,{...r,navigator:o})})),K=(0,r.forwardRef)(((e,t)=>{let{items:n,count:o,headers:s,contentHeader:u,loading:c,rowHeight:d=C,backgroundColor:p=j,renderItem:g,renderEmpty:y,getItemKey:v,loadMore:b,style:w,navigator:S,listRef:k,onScroll:E,version:T="v1",animated:O,allowPopupsEscape:I,isSelected:D,...A}=e;S||(S={onEdit:()=>{},editingId:null,focusedField:null,getNavigatorProps:e=>e});let{onEdit:_,editingId:P,focusedField:M,getNavigatorProps:R}=S,N=(0,r.useRef)(null),L=(0,r.useRef)(null),F=(0,r.useRef)(null),W=(0,r.useRef)(null),B=(0,r.useRef)(!1);function z(e){let{index:t,style:r,key:o}=e,i=n[t],a=P===i.id,s=D&&D(i.id),l=g({item:i,editing:a,focusedField:a&&M,onEdit:_,index:t,position:r.top});return(0,m.jsx)(h.G7,{className:"animated-row",style:[U,{zIndex:a||s?101:"auto",transform:"translateY(var(--pos))"}],nativeStyle:{"--pos":r.top-1+"px"},"data-focus-key":i.id,children:l},o)}function Z(e,t){return t*(d-1)+(d-1)/2-e/2+2*(d-1)}function H(e){let{overscanStartIndex:t,overscanStopIndex:r}=e;b&&r>n.length-100&&b()}if((0,r.useImperativeHandle)(t,(()=>({scrollTo:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"smart",r=n.findIndex((t=>t.id===e));-1!==r&&(N.current?N.current.scrollToItem(r,t):W.current=r)},scrollToTop:()=>{N.current&&N.current.scrollTo(0)},getScrolledItem:()=>{if(F.current){let e=F.current.scrollTop,t=N.current.getStartIndexForOffset(e);return n[t].id}return 0},setRowAnimation:e=>{N.current&&N.current.setRowAnimation(e)},edit(e,n,r){_(e,n),e&&r&&t.scrollTo(e)},anchor(){N.current&&N.current.anchor()},unanchor(){N.current&&N.current.unanchor()},isAnchored(){return N.current&&N.current.isAnchored()}}))),(0,r.useLayoutEffect)((()=>{!B.current&&L.current&&(N.current&&N.current.setRowAnimation(!0),B.current=!0)})),c)return(0,m.jsx)(h.G7,{style:[{flex:1,justifyContent:"center",alignItems:"center",backgroundColor:p}],children:(0,m.jsx)(l.Z,{width:25,color:f.O9.n1})});let K=0===(o||n.length);return(0,m.jsxs)(h.G7,{style:[{flex:1,outline:"none","& .animated .animated-row":{transition:".25s transform"}},w],tabIndex:"1",...R(A),"data-testid":"table",children:[s&&(0,m.jsx)(G,{version:T,height:d,...Array.isArray(s)?{headers:s}:{children:s}}),(0,m.jsx)(h.G7,{style:{flex:1,backgroundColor:p},children:K?(V=y,null==V?null:"function"===typeof V?V():(0,m.jsx)(h.G7,{style:{justifyContent:"center",alignItems:"center",fontStyle:"italic",color:f.O9.n6,flex:1},children:V})):(0,m.jsx)(i.Z,{children:e=>{let{width:t,height:r}=e;return 0===t||0===r?null:(0,m.jsx)(h.Hp.Provider,{value:!I&&L,children:(0,m.jsx)(a.M,{children:(0,m.jsx)(x,{ref:N,header:u,innerRef:L,outerRef:F,width:t,height:r,renderRow:z,itemCount:o||n.length,itemSize:d-1,itemKey:v||((e,t)=>n[e].id),indexForKey:e=>n.findIndex((t=>t.id===e)),initialScrollOffset:W.current?Z(r,W.current):0,version:T,animated:O,overscanCount:5,onItemsRendered:H,onScroll:E})})})}})})]});var V}));function V(e,t){let n="function"!==typeof t?()=>t:t,[i,a]=(0,r.useState)(null),[s,l]=(0,r.useState)(null),u=(0,r.useRef)(),c=(0,o.oR)(),d=(0,r.useRef)(0),f=(0,r.useCallback)(((e,t)=>{a(e),l(e?t:null)}),[]);function h(){u.current.focus(),f(null),setTimeout((()=>{f(i,s)}),100)}function p(t){if(i){let r=n(e.find((e=>e.id===i))),o=r.indexOf(s)+t;o<0?function(){let t=e.findIndex((e=>e.id===i));if(t>0){let r=e[t-1],o=n(r);f(r.id,o[o.length-1])}else h()}():o>=r.length?function(){let t=e.findIndex((e=>e.id===i));if(t<e.length-1){let r=e[t+1],o=n(r);f(r.id,o[0])}else h()}():l(r[o])}}function g(t){if(i){let r=e.findIndex((e=>e.id===i));for(;;){if(r+=t,!(r>=0&&r<e.length)){h();break}{const t=e[r];if(n(t).includes(s)){f(t.id,s);break}}}}}function m(e){switch(e){case"left":p(-1);break;case"right":p(1);break;case"up":g(-1);break;case"down":g(1);break;default:throw new Error("Unknown direction: "+e)}}return(0,r.useEffect)((()=>{d.current=c.getState().modals.modalStack.length}),[]),{onEdit:f,editingId:i,focusedField:s,getNavigatorProps:function(e){return{...e,innerRef:u,onKeyDown:t=>{if(e&&e.onKeyDown&&e.onKeyDown(t),!t.isPropagationStopped())switch(t.key){case"ArrowUp":case"k":"INPUT"!==t.target.tagName&&m("up");break;case"ArrowDown":case"j":"INPUT"!==t.target.tagName&&m("down");break;case"Enter":case"Tab":t.preventDefault(),t.stopPropagation(),m("Enter"===t.key?t.shiftKey?"up":"down":t.shiftKey?"left":"right")}},onBlur:e=>{let t=d.current,n=c.getState().modals.modalStack.length;!document.hasFocus()||null!=e.relatedTarget&&u.current.contains(e.relatedTarget)&&u.current!==e.relatedTarget||t!==n||f(null)}}}}}},3679:function(e,t,n){"use strict";n.d(t,{Hp:function(){return l},lL:function(){return u},u:function(){return c}});var r=n(3017),o=n(6214),i=n(6634),a=n(2085),s=n(8993);const l=(0,r.createContext)();function u(){let[e,t]=(0,r.useState)(!1);return{getOpenEvents:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{onClick:n=>{n.stopPropagation(),e.onClick&&e.onClick(n),t(!0)}}},isOpen:e,close:()=>t(!1)}}class c extends r.Component{constructor(e){super(e),this.state={position:null},this.position=e.position||"bottom-right",this.contentRef=(0,r.createRef)()}setup(){this.layout();let e=e=>{let t=e.target;for(;t&&t!==document.documentElement&&"tooltip"!==t.dataset.testid&&null==t.dataset.reachPopover;)t=t.parentNode;t===document.documentElement&&this.props.onClose&&this.props.onClose()};window.document.addEventListener("mousedown",e,!1),this.contentRef.current.addEventListener("keydown",(e=>{"Escape"===e.key&&this.props.onClose&&this.props.onClose()}),!1),this.cleanup=()=>{window.document.removeEventListener("mousedown",e)}}componentDidMount(){this.getContainer()?this.setup():this.forceUpdate((()=>{this.getContainer()?this.setup():console.log("Warning: could not mount tooltip, container missing")}))}componentDidUpdate(e){(e.targetRect!==this.props.targetRect||e.forceTop!==this.props.forceTop||this.props.forceLayout)&&this.layout()}getContainer(){let{ignoreBoundary:e=!1}=this.props;return!e&&this.context?this.context.current:document.body}getBoundsContainer(){let e=this.getContainer();return e.parentNode&&"auto"===e.parentNode.style.overflow?e.parentNode:e}layout(){let{targetRect:e,offset:t=0}=this.props,n=this.contentRef.current;if(!n)return;let r=n.getBoundingClientRect(),o=this.target.parentNode,i=e||o.getBoundingClientRect();i={top:i.top,left:i.left,width:i.width,height:i.height};let a=this.getBoundsContainer();if(!a)return;let s=a.getBoundingClientRect();if(i.left-=s.left,i.top-=s.top,this.props.forceTop)i.top=this.props.forceTop;else{let e=r.height+t,n=i.top-e,o=i.top+i.height+e;(-1!==this.position.indexOf("top")&&n<s.top||-1!==this.position.indexOf("bottom")&&o>s.height&&n>0)&&(this.position=this.getOppositePosition(this.position)),i.top+=a.scrollTop}const l=this.getStyleForPosition(this.position,r,i,this.getContainer().getBoundingClientRect(),t);n.style.top=l.top,n.style.bottom=l.bottom,n.style.left=l.left,n.style.right=l.right,n.style.width=l.width}componentWillUnmount(){this.cleanup&&this.cleanup()}getOppositePosition(e){switch(e){case"top":case"top-left":return"bottom";case"top-right":return"bottom-right";case"bottom":case"bottom-left":return"top";case"bottom-right":return"top-right";case"bottom-stretch":return"top-stretch";case"top-stretch":return"bottom-stretch";case"bottom-center":return"top-center";case"top-center":return"bottom-center";case"right":return"right"}}getStyleForPosition(e,t,n,r,o){const i={top:"inherit",bottom:"inherit",left:"inherit",right:"inherit"};if("top"===e||"top-right"===e||"top-left"===e)i.top=n.top-t.height-o+"px",i.left="top-right"===e?n.left+(n.width-t.width)+"px":n.left+"px";else if("bottom"===e||"bottom-right"===e||"bottom-left"===e)i.top=n.top+n.height+o+"px",i.left="bottom-right"===e?n.left+(n.width-t.width)+"px":n.left+"px";else if("bottom-center"===e)i.top=n.top+n.height+o+"px",i.left=n.left-(t.width-n.width)/2+"px";else if("top-center"===e)i.top=n.top-t.height-o+"px",i.left=n.left-(t.width-n.width)/2+"px";else if("left-center"===e)i.top=n.top-(t.height-n.height)/2+"px",i.left=n.left-t.width+"px";else if("top-stretch"===e)i.bottom=r.height-n.top+o+"px",i.left=n.left+"px",i.width=n.width+"px";else if("bottom-stretch"===e)i.top=n.top+n.height+o+"px",i.left=n.left+"px",i.width=n.width+"px";else{if("right"!==e)throw new Error("Invalid position for Tooltip: "+e);i.top=n.top+"px",i.left=n.left+n.width+o+"px"}return i}render(){const{children:e,width:t,style:n}=this.props,r={position:"absolute",zIndex:3e3,padding:5,width:t,...a.W2.shadowLarge,borderRadius:4,backgroundColor:"white"};return this.getContainer()?(0,s.jsx)("div",{ref:e=>this.target=e,children:o.createPortal((0,s.jsx)("div",{...(0,i.iv)(r,n,a.W2.darkScrollbar),ref:this.contentRef,"data-testid":"tooltip",onClick:e=>{e.stopPropagation()},children:e}),this.getContainer())}):null}}c.contextType=l},9432:function(e,t,n){"use strict";n.d(t,{Z:function(){return y}});var r=n(3017),o=n(8989),i=n(8664),a=n(1785),s=n(5249),l=n(5499),u=n(9585),c=n(5058),d=n(6288),f=n(2085),h=n(9234),p=n(4652),g=n(8993);const m=(0,r.memo)((function(e){let{transaction:t,fields:n,payees:r,categories:o,accounts:i,selected:a}=e,s=(0,l.ch)(o)[t.category],m=(0,l.gI)(i)[t.account],y=(0,c.YP)();return(0,g.jsxs)(h.X2,{children:[(0,g.jsx)(h._7,{exposed:!0,focused:!1,onSelect:e=>{y({type:"select",id:t.id,event:e})},selected:a}),n.map(((e,n)=>{switch(e){case"date":return(0,g.jsx)(h.gN,{width:100,children:t.date},n);case"imported_payee":return(0,g.jsx)(h.gN,{width:"flex",children:t.imported_payee},n);case"payee":return(0,g.jsx)(h.bL,{width:"flex",exposed:!0,style:{flexDirection:"row",alignItems:"center",justifyContent:"flex-start"},children:()=>(0,g.jsxs)(g.Fragment,{children:[t.schedule&&(0,g.jsx)(d.Z,{style:{width:13,height:13,margin:"0 5px"}}),(0,g.jsx)(p.Z,{type:"payees",id:t.payee})]})},n);case"category":return(0,g.jsx)(h.gN,{width:"flex",title:s&&s.name,children:s?s.name:""},n);case"account":return(0,g.jsx)(h.gN,{width:"flex",title:m.name,children:m.name},n);case"notes":return(0,g.jsx)(h.gN,{width:"flex",title:t.notes,children:t.notes},n);case"amount":return(0,g.jsx)(h.gN,{width:75,style:[{textAlign:"right"},f.W2.tnum],children:(0,u.zA)(t.amount)},n);default:return null}}))]})}));function y(e){let{transactions:t,schedules:n,renderEmpty:l,fields:u=["date","payee","amount"],style:d}=e,{payees:f,categories:p,accounts:y,dateFormat:v}=(0,o.v9)((e=>({payees:e.queries.payees,accounts:e.queries.accounts,categories:e.queries.categories.grouped,dateFormat:e.prefs.local.dateFormat||"MM/dd/yyyy"}))),x=(0,c.D9)(),b=(0,c.YP)(),w=(0,r.useMemo)((()=>u),[JSON.stringify(u)]),S=(0,r.useMemo)((()=>t.map((e=>function(e,t){let{date:n}=e;return(0,i.Z)((0,a.Z)(n))||(n=null),{...e,date:n?(0,s.Z)((0,a.Z)(n),t):null}}(e,v)))),[t]),C=(0,r.useCallback)((e=>{let{item:t}=e;return(0,g.jsx)(m,{transaction:t,payees:f,categories:p,accounts:y,fields:w,selected:x&&x.has(t.id)})}),[f,p,w,x]);return(0,g.jsx)(h.iA,{style:d,items:S,renderEmpty:l,headers:(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(h._7,{exposed:!0,focused:!1,selected:x.size>0,width:20,onSelect:e=>b({type:"select-all",event:e})}),u.map(((e,t)=>{switch(e){case"date":return(0,g.jsx)(h.gN,{width:100,children:"Date"},t);case"imported_payee":return(0,g.jsx)(h.gN,{width:"flex",children:"Imported payee"},t);case"payee":return(0,g.jsx)(h.gN,{width:"flex",children:"Payee"},t);case"category":return(0,g.jsx)(h.gN,{width:"flex",children:"Category"},t);case"account":return(0,g.jsx)(h.gN,{width:"flex",children:"Account"},t);case"notes":return(0,g.jsx)(h.gN,{width:"flex",children:"Notes"},t);case"amount":return(0,g.jsx)(h.gN,{width:75,style:{textAlign:"right"},children:"Amount"},t);default:return null}}))]}),renderItem:C})}},1218:function(e,t,n){"use strict";n.d(t,{_:function(){return u},I:function(){return c}});var r=n(3017),o=n(9585),i=n(1576),a=n(8993);var s=e=>(0,a.jsx)("svg",{...e,viewBox:"0 0 23 3",xmlns:"http://www.w3.org/2000/svg",style:{color:"#242134",...e.style},children:(0,a.jsx)("path",{d:"M23 1.5A1.5 1.5 0 0 1 21.5 3h-20a1.5 1.5 0 0 1 0-3h20A1.5 1.5 0 0 1 23 1.5z",fillRule:"nonzero",fill:"currentColor"})}),l=n(5371);function u(e){let{id:t,defaultValue:n=0,onChange:u,style:c}=e,[d,f]=(0,r.useState)(n<=0),[h,p]=(0,r.useState)((0,o.zA)(Math.abs(n)));function g(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:d,t=(0,o.qT)(h);u(e?t<0?t:-t:t>0?t:-t)}return(0,a.jsx)(l.F5,{id:t,leftContent:(0,a.jsx)(l.zx,{bare:!0,style:{padding:"0 7px"},onClick:function(){f(!d),g(!d)},children:d?(0,a.jsx)(s,{style:{width:8,height:8}}):(0,a.jsx)(i.Z,{style:{width:8,height:8}})}),value:h,style:{flex:1,alignItems:"stretch",...c},inputStyle:{paddingLeft:0},onChange:e=>p(e.target.value),onBlur:e=>g()})}function c(e){let{defaultValue:t,onChange:n}=e,[o,i]=(0,r.useState)(t.num1),[s,c]=(0,r.useState)(t.num2);return(0,a.jsxs)(l.G7,{style:{flexDirection:"row",alignItems:"center"},children:[(0,a.jsx)(u,{defaultValue:o,onChange:e=>{i(e),n({num1:e,num2:s})}}),(0,a.jsx)(l.G7,{style:{margin:"0 5px"},children:"and"}),(0,a.jsx)(u,{defaultValue:s,onChange:e=>{c(e),n({num1:o,num2:e})}})]})}},4652:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});n(3017);var r=n(5068),o=n(9476),i=n(2085),a=n(5371),s=n(8993);function l(e){let t,{type:n,id:l,noneColor:u=i.O9.n8}=e;switch(n){case"payees":t=o.mp;break;case"accounts":t=r.Re;break;default:throw new Error("DisplayId: unknown object type: "+n)}return(0,s.jsx)(t,{idKey:!0,children:e=>{let t=e[l];return(0,s.jsx)(a.xv,{style:null==t?{color:u}:null,title:t?t.name:"None",children:t?t.name:"None"})}})}},9446:function(e,t,n){"use strict";n.d(t,{Z:function(){return x}});var r=n(3017),o=n(8989),i=n(4917),a=n(5432),s=n(7835),l=n(7740),u=n(5946),c=n(6018),d=n(2085),f=n(5371),h=n(8993);function p(e){let{items:t,getItemProps:n,highlightedIndex:o,embedded:i}=e;return(0,h.jsx)(f.G7,{children:(0,h.jsx)(f.G7,{style:[{overflow:"auto",padding:"5px 0"},!i&&{maxHeight:175}],children:t.map(((e,t)=>[(0,r.createElement)("div",{...n?n({item:e}):null,key:e.id,style:{backgroundColor:o===t?d.O9.n4:"transparent",padding:4,paddingLeft:20,borderRadius:i?4:0},"data-testid":"filter-item"+(o===t?"-highlighted":"")},e.name)]))})})}function g(e){let{embedded:t,...n}=e,r=(0,c.m)()||[];return(0,h.jsx)(s.ZP,{strict:!0,highlightFirst:!0,embedded:t,suggestions:r,renderItems:(e,n,r)=>(0,h.jsx)(p,{items:e,getItemProps:n,highlightedIndex:r,embedded:t}),...n})}var m=n(6717),y=n(5547),v=n(3964);function x(e){let{field:t,subfield:n,type:r,multi:c,value:d,inputRef:p,style:x,onChange:b}=e,{saved:w,categoryGroups:S,dateFormat:C}=(0,o.v9)((e=>({saved:e.queries.saved,categoryGroups:e.queries.categories.grouped,dateFormat:e.prefs.local.dateFormat||"MM/dd/yyyy"})));if(c&&!Array.isArray(d))d=[];else if(!c&&Array.isArray(d))return null;let j,k=!c||0===d.length;switch(r){case"id":switch(t){case"payee":j=(0,h.jsx)(u.Z,{multi:c,showMakeTransfer:!1,openOnFocus:!0,value:d,onSelect:b,inputProps:{inputRef:p,...k?{placeholder:"nothing"}:null}});break;case"account":j=(0,h.jsx)(a.Z,{value:d,multi:c,openOnFocus:!0,onSelect:b,inputProps:{inputRef:p,...k?{placeholder:"nothing"}:null}});break;case"category":j=(0,h.jsx)(l.Z,{categoryGroups:S,value:d,multi:c,openOnFocus:!0,onSelect:b,inputProps:{inputRef:p,...k?{placeholder:"nothing"}:null}})}break;case"saved":if("saved"===t)j=(0,h.jsx)(g,{saved:w,value:d,multi:c,openOnFocus:!0,onSelect:b,inputProps:{inputRef:p,...k?{placeholder:"nothing"}:null}});break;case"date":switch(n){case"month":j=(0,h.jsx)(f.II,{inputRef:p,defaultValue:d||"",placeholder:(0,i.LT)(C).toLowerCase(),onEnter:e=>b(e.target.value),onBlur:e=>b(e.target.value)});break;case"year":j=(0,h.jsx)(f.II,{inputRef:p,defaultValue:d||"",placeholder:"yyyy",onEnter:e=>b(e.target.value),onBlur:e=>b(e.target.value)});break;default:j=d&&d.frequency?(0,h.jsx)(v.Z,{value:d,buttonStyle:{justifyContent:"flex-start"},onChange:b}):(0,h.jsx)(y.Z,{value:d,dateFormat:C,openOnFocus:!1,inputRef:p,inputProps:{placeholder:C.toLowerCase()},onSelect:b})}break;case"boolean":j=(0,h.jsx)(m.XZ,{checked:d,value:d,onChange:()=>b(!d)});break;default:j=c?(0,h.jsx)(s.ZP,{multi:!0,suggestions:[],value:d,inputProps:{inputRef:p},onSelect:b}):(0,h.jsx)(f.II,{inputRef:p,defaultValue:d||"",placeholder:"nothing",onEnter:e=>b(e.target.value),onBlur:e=>b(e.target.value)})}return(0,h.jsx)(f.G7,{style:[{flex:1},x],children:j})}},5197:function(e,t,n){"use strict";n.d(t,{M:function(){return a},X:function(){return s}});var r=n(3017),o=n(8993);let i=(0,r.createContext)(null);function a(e){let{children:t}=e,n=(0,r.useRef)(null),a=(0,r.useMemo)((()=>({keyRef:n,onKeyChange:e=>{n.current=e}})),[n]);return(0,o.jsx)(i.Provider,{value:a,children:t})}function s(e,t){let n=(0,r.useContext)(i),o=(0,r.useRef)(null);(0,r.useLayoutEffect)((()=>{let r=o.current,i=e.current;if(i&&t&&(null===r||!1===r)){let e="input,button,div[tabindex]",r=i.matches(e)?i:i.querySelector(e);t&&r&&function(e,t){if(t){let n=function(e){let t=e;for(let n=0;n<10&&t;n++){let e=t.dataset&&t.dataset.focusKey;if(e)return e;t=t.parentNode}return null}(e);e.focus({preventScroll:n&&n===t.keyRef.current}),t.onKeyChange(n)}else e.focus();"INPUT"===e.tagName&&e.setSelectionRange(0,1e4)}(r,n)}o.current=t}),[t])}},9227:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(3017);function o(e){let t=(0,r.useRef)(null);return t.current||(t.current=new ResizeObserver((t=>{e(t[0].contentRect)}))),(0,r.useCallback)((e=>{t.current.disconnect(),e&&t.current.observe(e,{box:"border-box"})}),[])}},5058:function(e,t,n){"use strict";n.d(t,{D9:function(){return p},YP:function(){return h},ZP:function(){return c},i5:function(){return g},mL:function(){return m}});var r=n(3017),o=n(8989),i=n(7156),a=n(1936),s=n(4812),l=n(8993);function u(e,t){let n=Math.min(e.start,e.end),r=Math.max(e.start,e.end);for(let o=n;o<=r;o++)t(o)}function c(e,t,n){let[s,l]=(0,r.useReducer)(((e,n)=>{switch(n.type){case"select":{let{selectedRange:r}=e,o=new Set(e.selectedItems),{id:i,event:a}=n;if(a.shiftKey&&r){let n,a,s=t.findIndex((e=>e.id===i)),l=t.findIndex((e=>e.id===r.start)),c=t.findIndex((e=>e.id===r.end));return-1===c?n={start:l,end:s}:c<l?s<=l?(n={start:l,end:s},s>c&&(a={start:s-1,end:c})):n={start:c,end:s}:s>=l?(n={start:l,end:s},s<c&&(a={start:s+1,end:c})):n={start:c,end:s},u(n,(e=>o.add(t[e].id))),a&&u(a,(e=>o.delete(t[e].id))),{...e,selectedItems:o,selectedRange:{start:t[n.start].id,end:t[n.end].id}}}{let t=null;return o.delete(i)||(o.add(i),t={start:i,end:null}),{...e,selectedItems:o,selectedRange:t}}}case"select-none":return{...e,selectedItems:new Set};case"select-all":return{...e,selectedItems:new Set(n.ids||t.map((e=>e.id))),selectedRange:n.ids&&1===n.ids.length?{start:n.ids[0],end:null}:null};default:throw new Error("Unexpected action: "+n.type)}}),null,(()=>({selectedItems:new Set(n||[]),selectedRange:n&&1===n.length?{start:n[0],end:null}:null}))),c=(0,r.useRef)(t);(0,r.useEffect)((()=>{if(s.selectedItems.size>0){let e=new Set(t.map((e=>e.id)));if(!(c.current.length===t.length&&c.current.every((t=>e.has(t.id))))){let t=[...s.selectedItems],n=t.filter((t=>e.has(t)));t.length!==n.length&&l({type:"select-all",ids:n})}}c.current=t}),[t,s.selectedItems]),(0,r.useEffect)((()=>{let t=a.a2("selectedItems");return a.kp("selectedItems",{name:e,items:s.selectedItems}),()=>a.kp("selectedItems",t)}),[s.selectedItems]);let d=(0,o.v9)((e=>e.app.lastUndoState));return(0,r.useEffect)((()=>{function t(t){let{messages:n,undoTag:r}=t,o=a.r8(r),i=new Set(n.filter((e=>"tombstone"===e.column&&1===e.value)).map((e=>e.row)));o&&o.selectedItems&&o.selectedItems.name===e&&l({type:"select-all",ids:[...o.selectedItems.items].filter((e=>!i.has(e)))})}return d&&d.current&&t(d.current),(0,i.oL)("undo-event",t)}),[]),{items:s.selectedItems,setItems:s.setSelectedItems,dispatch:l}}let d=(0,r.createContext)(null),f=(0,r.createContext)(null);function h(){return(0,r.useContext)(d)}function p(){return(0,r.useContext)(f)}function g(e){let{instance:t,fetchAllIds:n,children:o}=e,i=(0,r.useRef)(null);(0,r.useEffect)((()=>{i.current=t.items}),[t.items]);let a=(0,r.useCallback)((async e=>{if(!e.event&&(0,s.Ry)())throw new Error("SelectedDispatch actions must have an event");return"select-all"===e.type?i.current&&i.current.size>0?t.dispatch({type:"select-none",event:e.event}):n?t.dispatch({type:"select-all",ids:await n(),event:e.event}):t.dispatch({type:"select-all",event:e.event}):t.dispatch(e)}),[t.dispatch,n]);return(0,l.jsx)(f.Provider,{value:t.items,children:(0,l.jsx)(d.Provider,{value:a,children:o})})}function m(e){let{name:t,items:n,initialSelectedIds:o,fetchAllIds:i,registerDispatch:a,children:s}=e,u=c(t,n,o);return(0,r.useEffect)((()=>{a&&a(u.dispatch)}),[a]),(0,l.jsx)(g,{instance:u,fetchAllIds:i,children:s})}},9314:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(3017),o=n(6634),i=n(8993);var a=e=>{let{color:t="#fff"}=e,[n]=(0,r.useState)("gradient-"+Math.random());return(0,i.jsxs)("svg",{...e,viewBox:"0 0 38 38",style:{...e.style},children:[(0,i.jsx)("defs",{children:(0,i.jsxs)("linearGradient",{x1:"8.042%",y1:"0%",x2:"65.682%",y2:"23.865%",id:n,children:[(0,i.jsx)("stop",{stopColor:t,stopOpacity:0,offset:"0%"}),(0,i.jsx)("stop",{stopColor:t,stopOpacity:.631,offset:"63.146%"}),(0,i.jsx)("stop",{stopColor:t,offset:"100%"})]})}),(0,i.jsxs)("g",{transform:"translate(1 2)",fill:"none",fillRule:"evenodd",children:[(0,i.jsx)("path",{d:"M36 18c0-9.94-8.06-18-18-18",stroke:"url(#"+n+")",strokeWidth:2,fill:"none"}),(0,i.jsx)("circle",{fill:t,cx:36,cy:18,r:1})]})]})};const s=o.iv.keyframes({"0%":{transform:"rotate(-90deg)"},"100%":{transform:"rotate(666deg)"}});var l=function(e){return(0,i.jsx)("span",{...(0,o.iv)({animationName:s,animationDuration:"1.6s",animationTimingFunction:"cubic-bezier(0.17, 0.67, 0.83, 0.67)",animationIterationCount:"infinite",lineHeight:0}),children:(0,i.jsx)(a,{...e})})}},7292:function(e,t,n){"use strict";n(3017);var r=n(8993);t.Z=e=>(0,r.jsxs)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:[(0,r.jsx)("path",{d:"M23 11.5a1.5 1.5 0 0 1-1.5 1.5h-20a1.5 1.5 0 0 1 0-3h20a1.5 1.5 0 0 1 1.5 1.5Z",fill:"currentColor"}),(0,r.jsx)("path",{d:"M11.5 23a1.5 1.5 0 0 1-1.5-1.5v-20a1.5 1.5 0 0 1 3 0v20a1.5 1.5 0 0 1-1.5 1.5Z",fill:"currentColor"})]})},8091:function(e,t,n){"use strict";n(3017);var r=n(8993);t.Z=e=>(0,r.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:(0,r.jsx)("path",{fill:"none",stroke:"currentColor",strokeWidth:4,strokeLinecap:"round",strokeMiterlimit:10,d:"m2 2 20 20M22 2 2 22"})})},9220:function(e,t,n){"use strict";n(3017);var r=n(8993);t.Z=e=>(0,r.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 15",style:{color:"#242134",...e.style},children:(0,r.jsx)("path",{fill:"currentColor",d:"M24.483.576c-.309-.327-.674-.49-1.097-.49H1.56C1.137.086.771.25.463.576A1.635 1.635 0 0 0 0 1.737c0 .448.154.834.463 1.161l10.913 11.558c.31.327.675.49 1.097.49.422 0 .788-.163 1.096-.49L24.483 2.898c.308-.327.463-.713.463-1.16 0-.448-.155-.835-.463-1.162Z"})})},7888:function(e,t,n){"use strict";n(3017);var r=n(8993);t.Z=e=>(0,r.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 91 51",style:{color:"#242134",...e.style},children:(0,r.jsx)("path",{fill:"currentColor",d:"M63.004.003a3 3 0 0 0-1.875 5.219L79.44 22.034H3.16a3.257 3.257 0 0 0-.313 0c-1.57.082-2.925 1.585-2.843 3.156.081 1.571 1.585 2.926 3.156 2.844H79.44L61.129 44.815a3 3 0 1 0 4.062 4.407l24-22a3 3 0 0 0 0-4.407l-24-22a3 3 0 0 0-2.187-.812Z"})})},9716:function(e,t,n){"use strict";n(3017);var r=n(8993);t.Z=e=>(0,r.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:(0,r.jsx)("path",{d:"M23 11.5a1.5 1.5 0 0 1-1.5 1.5h-20a1.5 1.5 0 0 1 0-3h20a1.5 1.5 0 0 1 1.5 1.5Z",fill:"currentColor"})})},1576:function(e,t,n){"use strict";n(3017);var r=n(8993);t.Z=e=>(0,r.jsxs)("svg",{...e,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",style:{color:"#242134",...e.style},children:[(0,r.jsx)("path",{fill:"currentColor",className:"path",d:"M23 11.5a1.5 1.5 0 0 1-1.5 1.5h-20a1.5 1.5 0 0 1 0-3h20a1.5 1.5 0 0 1 1.5 1.5Z"}),(0,r.jsx)("path",{fill:"currentColor",className:"path",d:"M11.5 23a1.5 1.5 0 0 1-1.5-1.5v-20a1.5 1.5 0 0 1 3 0v20a1.5 1.5 0 0 1-1.5 1.5Z"})]})},2177:function(e,t,n){"use strict";n(3017);var r=n(8993);t.Z=e=>(0,r.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"#242134",...e.style},children:(0,r.jsx)("path",{d:"m3.828 9 6.071-6.071-1.414-1.414L0 10l.707.707 7.778 7.778 1.414-1.414L3.828 11H20V9H3.828z",fill:"currentColor"})})},7871:function(e,t,n){"use strict";n(3017);var r=n(8993);t.Z=e=>(0,r.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"#242134",...e.style},children:(0,r.jsx)("path",{d:"m0 11 2-2 5 5L18 3l2 2L7 18z",fill:"currentColor"})})},7800:function(e,t,n){"use strict";n(3017);var r=n(8993);t.Z=e=>(0,r.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"#242134",...e.style},children:(0,r.jsx)("path",{d:"M10 12a2 2 0 1 1 0-4 2 2 0 0 1 0 4zm0-6a2 2 0 1 1 0-4 2 2 0 0 1 0 4zm0 12a2 2 0 1 1 0-4 2 2 0 0 1 0 4z",fill:"currentColor"})})},2101:function(e,t,n){"use strict";n(3017);var r=n(8993);t.Z=e=>(0,r.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"#242134",...e.style},children:(0,r.jsx)("path",{d:"M2.93 17.07A10 10 0 1 1 17.07 2.93 10 10 0 0 1 2.93 17.07zm12.73-1.41A8 8 0 1 0 4.34 4.34a8 8 0 0 0 11.32 11.32zM9 11V9h2v6H9v-4zm0-6h2v2H9V5z",fill:"currentColor"})})},2756:function(e,t,n){"use strict";n(3017);var r=n(8993);t.Z=e=>(0,r.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:(0,r.jsx)("path",{d:"M23.119 20 13.772 2.15a2 2 0 0 0-3.543 0L.881 20a2 2 0 0 0 1.772 2.928h18.694A2 2 0 0 0 23.119 20ZM11 8.423a1 1 0 0 1 2 0v6a1 1 0 1 1-2 0Zm1.05 11.51h-.028a1.528 1.528 0 0 1-1.522-1.47 1.476 1.476 0 0 1 1.448-1.53h.028A1.527 1.527 0 0 1 13.5 18.4a1.475 1.475 0 0 1-1.45 1.533Z",fill:"currentColor"})})},6288:function(e,t,n){"use strict";n(3017);var r=n(8993);t.Z=e=>(0,r.jsx)("svg",{...e,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",style:{color:"#242134",...e.style},children:(0,r.jsx)("g",{fill:"#000",children:(0,r.jsx)("path",{d:"m23.962 17.457-.82-3.297a1.287 1.287 0 0 0-1.56-.934l-3.294.823a1.286 1.286 0 0 0-.343 2.35L19 17.03A9.538 9.538 0 0 1 12 20.604a8.652 8.652 0 0 1-8.085-5.667 1.286 1.286 0 0 0-2.415.884A11.232 11.232 0 0 0 12 23.175a12.108 12.108 0 0 0 9.214-4.8l.839.503a1.286 1.286 0 0 0 1.91-1.415ZM2.422 10.774l3.295-.823a1.286 1.286 0 0 0 .352-2.35l-.972-.583A9.588 9.588 0 0 1 12 3.396a8.652 8.652 0 0 1 8.085 5.667A1.286 1.286 0 0 0 22.5 8.18 11.232 11.232 0 0 0 12 .825 12.242 12.242 0 0 0 2.866 5.68l-.919-.552a1.286 1.286 0 0 0-1.91 1.414l.82 3.297a1.287 1.287 0 0 0 1.246.974 1.311 1.311 0 0 0 .32-.04Z",fill:"currentColor"})})})},2873:function(e,t,n){"use strict";n(3017);var r=n(8993);t.Z=e=>(0,r.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:(0,r.jsx)("path",{d:"M21.5 3h-2.75a.25.25 0 0 1-.25-.25V1a1 1 0 0 0-2 0v4.75a.75.75 0 0 1-.75.75.75.75 0 0 1-.75-.75V3.5a.5.5 0 0 0-.5-.5H8.25A.25.25 0 0 1 8 2.751V1a1 1 0 1 0-2 0v4.75a.75.75 0 0 1-.75.75.75.75 0 0 1-.75-.75V3.5A.5.5 0 0 0 4 3H2.5a2 2 0 0 0-2 2v17a2 2 0 0 0 2 2h19a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2ZM21 22H3a.5.5 0 0 1-.5-.5v-12A.5.5 0 0 1 3 9h18a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5Z",fill:"currentColor"})})},6854:function(e,t,n){"use strict";n(3017);var r=n(8993);t.Z=e=>(0,r.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:(0,r.jsx)("path",{d:"M12 0a12 12 0 1 0 12 12A12.014 12.014 0 0 0 12 0Zm6.927 8.2-6.845 9.289a1.011 1.011 0 0 1-1.43.188l-4.888-3.908a1 1 0 1 1 1.25-1.562l4.076 3.261 6.227-8.451a1 1 0 1 1 1.61 1.183Z",fill:"currentColor"})})},2141:function(e,t,n){"use strict";n(3017);var r=n(8993);t.Z=e=>(0,r.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:(0,r.jsx)("path",{d:"M.439 21.44a1.5 1.5 0 0 0 2.122 2.121l9.262-9.261a.25.25 0 0 1 .354 0l9.262 9.263a1.5 1.5 0 1 0 2.122-2.121L14.3 12.177a.25.25 0 0 1 0-.354l9.263-9.262A1.5 1.5 0 0 0 21.439.44L12.177 9.7a.25.25 0 0 1-.354 0L2.561.44A1.5 1.5 0 0 0 .439 2.561L9.7 11.823a.25.25 0 0 1 0 .354Z",fill:"currentColor"})})},2085:function(e,t,n){"use strict";n.d(t,{O9:function(){return a},W2:function(){return s},bA:function(){return c}});var r=n(6634),o=n(9515),i=n(5761);const a={y1:"#733309",y2:"#87540d",y3:"#B88115",y4:"#D4A31C",y5:"#E6BB20",y6:"#F2D047",y7:"#F5E35D",y8:"#FCF088",y9:"#FFF7C4",y10:"#FFFBEA",y11:"#FFFEFA",r1:"#610316",r2:"#8A041A",r3:"#AB091E",r4:"#CF1124",r5:"#E12D39",r6:"#EF4E4E",r7:"#F86A6A",r8:"#FF9B9B",r9:"#FFBDBD",r10:"#FFE3E3",r11:"#FFF1F1",b1:"#034388",b2:"#0B5FA3",b3:"#1271BF",b4:"#1980D4",b5:"#2B8FED",b6:"#40A5F7",b7:"#66B5FA",b8:"#8BCAFD",b9:"#B3D9FF",b10:"#E3F0FF",b11:"#F5FCFF",n1:"#102A43",n2:"#243B53",n3:"#334E68",n4:"#486581",n5:"#627D98",n6:"#829AB1",n7:"#9FB3C8",n8:"#BCCCDC",n9:"#D9E2EC",n10:"#E8ECF0",n11:"#F7FAFC",g1:"#014D40",g2:"#0C6B58",g3:"#147D64",g4:"#199473",g5:"#27AB83",g6:"#3EBD93",g7:"#65D6AD",g8:"#8EEDC7",g9:"#C6F7E2",g10:"#EFFCF6",g11:"#FAFFFD",p1:"#44056E",p2:"#580A94",p3:"#690CB0",p4:"#7A0ECC",p5:"#8719E0",p6:"#9446ED",p7:"#A368FC",p8:"#B990FF",p9:"#DAC4FF",p10:"#F2EBFE",p11:"#F9F6FE",get border(){return this.n10},hover:"#fafafa",get selected(){return this.b9}},s={veryLargeText:{fontSize:30,fontWeight:600},largeText:{fontSize:20,fontWeight:700,letterSpacing:.5},mediumText:{fontSize:15,fontWeight:500},smallText:{fontSize:13,[`@media (min-width: ${i.Z.breakpoint_small})`]:{}},verySmallText:{fontSize:13},page:{flex:1,minHeight:700,paddingTop:8,[`@media (min-width: ${i.Z.breakpoint_small})`]:{paddingTop:36}},pageHeader:{fontSize:25,borderBottomWidth:5,borderStyle:"solid",display:"inline",flex:0,marginTop:40,marginBottom:20,paddingBottom:5},pageContent:{paddingLeft:2,paddingRight:2,[`@media (min-width: ${i.Z.breakpoint_small})`]:{paddingLeft:20,paddingRight:20}},settingsPageContent:{padding:20,[`@media (min-width: ${i.Z.breakpoint_small})`]:{padding:"inherit"}},staticText:{cursor:"default",userSelect:"none"},shadow:{boxShadow:"0 2px 4px 0 rgba(0,0,0,0.1)"},shadowLarge:{boxShadow:"0 15px 30px 0 rgba(0,0,0,0.11), 0 5px 15px 0 rgba(0,0,0,0.08)"},tnum:{fontFeatureSettings:'"tnum"'},notFixed:{fontFeatureSettings:""},header:{headerStyle:{backgroundColor:"white",borderBottomWidth:1,borderBottomColor:a.n9,elevation:0},headerTintColor:a.n1,headerTitleStyle:{color:a.n1,fontSize:15,fontWeight:600},headerBackTitle:null},text:{fontSize:16},textColor:a.n1,delayedFadeIn:{animationName:(0,r.F4)({"0%":{opacity:0},"100%":{opacity:1}}),animationDuration:"0.2s",animationFillMode:"both",animationDelay:"0.5s"},lightScrollbar:void 0,darkScrollbar:void 0,scrollbarWidth:void 0};let l=!1;function u(){s.lightScrollbar=!l&&{"& ::-webkit-scrollbar":{width:11,backgroundColor:"rgba(200, 200, 200, .2)"},"& ::-webkit-scrollbar-thumb":{width:7,borderRadius:30,backgroundClip:"padding-box",border:"2px solid rgba(0, 0, 0, 0)"},"& ::-webkit-scrollbar-thumb:vertical":{backgroundColor:"#d0d0d0"}},s.darkScrollbar=!l&&{"& ::-webkit-scrollbar":{width:7,backgroundColor:"rgba(0, 0, 0, 0)"},"& ::-webkit-scrollbar-thumb:vertical":{backgroundColor:"rgba(200, 200, 200, .5)"}},s.scrollbarWidth=l?0:13}if("web"===o.OB){function d(){let e=document.createElement("div");e.innerHTML='<div style="width:100px;height:100px;overflow:scroll;position:absolute;top:-9999px;"/>',document.body.appendChild(e);let t=e.childNodes[0];return t.offsetWidth===t.clientWidth}l=d(),u(),window.addEventListener("focus",(()=>{l=d(),u()}))}const c=()=>l},5761:function(e,t,n){"use strict";n.d(t,{A:function(){return r}});const r={small:512,medium:730,wide:1100},o=Object.entries(r).reduce(((e,t)=>{let[n,r]=t;return e[`breakpoint_${n}`]=`${r}px`,e}),{});t.Z=o},2914:function(e,t,n){"use strict";n.d(t,{M:function(){return u},Y:function(){return c}});var r=n(3017),o=n(7521),i=n.n(o),a=n(7156),s=n(8993);const l=(0,r.createContext)(void 0);function u(){return(0,r.useContext)(l)}function c(e){let{children:t}=e,n=(0,r.useMemo)((()=>function(){const e={},t=new(i())({max:1200}),n={};let r=!1;return new class{observeCell(t,r){return e[t]||(e[t]=[]),e[t].push(r),()=>{e[t]=e[t].filter((e=>e!==r)),0===e[t].length&&(n[t]=null)}}disableObservers(){r=!0}enableObservers(){r=!1}prewarmCache(e,n){t.set(e,n)}listen(){return(0,a.oL)("cells-changed",(function(o){r||o.forEach((r=>{const o=e[r.name];o&&(o.forEach((e=>e(r))),n[r.name]=Promise.resolve(r),t.set(r.name,r))}))}))}bind(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"__global",r=arguments.length>1?arguments[1]:void 0,o=arguments.length>3?arguments[3]:void 0;r="string"===typeof r?{name:r,value:null}:r;let i=`${e}!${r.name}`,a=this.observeCell(i,o);if(t.has(i)&&o(t.get(i)),null!=n[i])n[i].then(o);else{const a=this.get(e,r.name);n[i]=a,a.then((e=>{n[i]===a&&(t.set(i,e),o(e))}))}return a}get(e,t){return(0,a.lW)("getCell",{sheetName:e,name:t})}getCellNames(e){return(0,a.lW)("getCellNamesInSheet",{sheetName:e})}createQuery(e,t,n){return(0,a.lW)("create-query",{sheetName:e,name:t,query:n.serialize()})}}}()),[]);return(0,r.useEffect)((()=>n.listen()),[n]),(0,s.jsx)(l.Provider,{value:n,children:t})}},3824:function(e,t,n){"use strict";n.d(t,{KT:function(){return a},Np:function(){return i},cT:function(){return l},ht:function(){return s},si:function(){return u}});var r=n(7156),o=n(5196);function i(e){return{type:o.wH,state:e}}function a(){return async e=>{n.g.Actual.applyAppUpdate(),e(i({updateInfo:null}))}}function s(e){return{type:o.HT,undoState:e}}function l(e,t){return n=>(0,r.lW)("upload-file-web",{filename:e,contents:t})}function u(){return e=>(0,r.lW)("app-focused")}},6740:function(e,t,n){"use strict";n.d(t,{$u:function(){return d},NK:function(){return h},Rb:function(){return u},S2:function(){return b},VM:function(){return g},aK:function(){return c},ef:function(){return v},ej:function(){return p},g4:function(){return w},il:function(){return x},nu:function(){return f},sX:function(){return m},xp:function(){return y}});var r=n(7156),o=n(6218),i=n(5196),a=n(3824),s=n(1669),l=n(6788);function u(e){return(t,n)=>{const{loadingText:r}=n().app;null!=r&&t((0,a.Np)({loadingText:e}))}}function c(){return async e=>{const t=await(0,r.lW)("get-budgets");e({type:i.Ud,budgets:t})}}function d(){return async e=>{const t=await(0,r.lW)("get-remote-files");e({type:i.Oi,files:t})}}function f(){return async(e,t)=>{const n=await(0,r.lW)("get-budgets"),o=await(0,r.lW)("get-remote-files");return e({type:i.GY,budgets:n,remoteFiles:o}),t().budgets.allFiles}}function h(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return async(i,u)=>{i((0,a.Np)({loadingText:t}));let{error:c}=await(0,r.lW)("load-budget",{id:e,...n});if(c){let t=(0,o.FL)(c,e);if("out-of-sync-migrations"===c||"out-of-sync-data"===c)if("undefined"!==typeof window.confirm){window.confirm(t+" Make sure the app is up-to-date. Do you want to load a backup?")&&i((0,s.Ll)("load-backup",{budgetId:e}))}else alert(t+" Make sure the app is up-to-date.");else alert(t);return void i((0,a.Np)({loadingText:null}))}i((0,s.Mr)()),await i((0,l.D0)());const d=u().prefs.local;i((0,a.Np)({loadingText:null})),i((0,a.Np)({maxMonths:d.maxMonths}))}}function p(){return async(e,t)=>{const n=t().prefs.local;n&&n.id&&(e({type:i.DC}),e((0,a.Np)({loadingText:"Closing..."})),await(0,r.lW)("close-budget"),e((0,a.Np)({loadingText:null})),localStorage.getItem("SharedArrayBufferOverride")&&window.location.reload())}}function g(){return async(e,t)=>{let n=t().prefs.local;n&&n.id&&e({type:i.DC})}}function m(e,t){return async n=>{await(0,r.lW)("delete-budget",{id:e,cloudFileId:t}),await n(f())}}function y(){let{testMode:e=!1,demoMode:t=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return async(n,o)=>{n((0,a.Np)({loadingText:e||t?"Making demo...":""})),t?await(0,r.lW)("create-demo-budget"):await(0,r.lW)("create-budget",{testMode:e}),n((0,s.Mr)()),await n(f()),await n((0,l.D0)()),n((0,a.Np)({loadingText:null}))}}function v(e,t){return async(n,o)=>{const{error:i}=await(0,r.lW)("import-budget",{filepath:e,type:t});if(i)throw new Error(i);n((0,s.Mr)()),await n((0,l.D0)()),window.__navigate("/budget")}}function x(e){return async t=>{let{error:n}=await(0,r.lW)("upload-budget",{id:e});return n?{error:n}:(await t(f()),{})}}function b(e){return async t=>{t((0,a.Np)({loadingText:"Downloading..."})),await t(p()),t(w(e,{replace:!0}))}}function w(e){let{replace:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return async n=>{n((0,a.Np)({loadingText:"Downloading..."}));let{id:i,error:u}=await(0,r.lW)("download-budget",{fileId:e,replace:t});if(u){if("decrypt-failure"===u.reason){let r={hasExistingKey:u.meta&&u.meta.isMissingKey,cloudFileId:e,onSuccess:()=>{n(w(e,{replace:t}))}};n((0,s.Ll)("fix-encryption-key",r)),n((0,a.Np)({loadingText:null}))}else{if("file-exists"===u.reason)return alert(`A file with id \u201c${u.meta.id}\u201d already exists with the name \u201c${u.meta.name}.\u201d This file will be replaced. This probably happened because files were manually moved around outside of Actual.`),n(w(e,{replace:!0}));n((0,a.Np)({loadingText:null})),alert((0,o.Ip)(u))}return null}return await Promise.all([n((0,l.Pt)()),n(f()),n(h(i))]),n((0,a.Np)({loadingText:null})),i}}},1025:function(e,t,n){"use strict";n.r(t),n.d(t,{addGenericErrorNotification:function(){return a.R},addNotification:function(){return a.wN},applyBudgetAction:function(){return r.qu},closeAccount:function(){return r.Rc},closeAndDownloadBudget:function(){return j.S2},closeBudget:function(){return j.ej},closeBudgetUI:function(){return j.VM},closeModal:function(){return S.Mr},connectAccounts:function(){return h},connectNordigenAccounts:function(){return p},createAccount:function(){return r.o1},createBudget:function(){return j.xp},createCategory:function(){return r.k4},createGroup:function(){return r.sS},createPayee:function(){return r.fz},debugCell:function(){return w},deleteBudget:function(){return j.sX},deleteCategory:function(){return r.uu},deleteGroup:function(){return r.iE},downloadBudget:function(){return j.g4},focused:function(){return k.si},forceCloseAccount:function(){return r.X_},getAccounts:function(){return r.T8},getCategories:function(){return r.CP},getPayees:function(){return r.WJ},getUserData:function(){return _.is},hideModals:function(){return S.A0},importBudget:function(){return j.ef},importTransactions:function(){return v},initiallyLoadPayees:function(){return r.Rr},linkAccount:function(){return f},loadAllFiles:function(){return j.nu},loadBackup:function(){return E},loadBudget:function(){return j.NK},loadBudgets:function(){return j.aK},loadGlobalPrefs:function(){return C.Pt},loadPrefs:function(){return C.D0},loadRemoteFiles:function(){return j.$u},loggedIn:function(){return _.Pl},makeBackup:function(){return T},markAccountFailed:function(){return l},markAccountRead:function(){return b},markAccountSuccess:function(){return u},moveCategory:function(){return r.Wr},moveCategoryGroup:function(){return r.eq},openAccountCloseModal:function(){return r.bJ},parseTransactions:function(){return y},popModal:function(){return S.GZ},pushModal:function(){return S.Ll},redo:function(){return r.KX},removeNotification:function(){return a.FV},reopenAccount:function(){return r.ly},replaceModal:function(){return S.OB},resetSync:function(){return I},saveGlobalPrefs:function(){return C.EY},savePrefs:function(){return C.p},setAccountsSyncing:function(){return s},setAppState:function(){return k.Np},setFailedAccounts:function(){return c},setLastTransaction:function(){return m},setLastUndoState:function(){return k.ht},setUndoEnabled:function(){return r.Ew},showModals:function(){return S.Yi},signOut:function(){return _.w7},sync:function(){return D},syncAccounts:function(){return g},syncAndDownload:function(){return A},undo:function(){return r.Yw},unlinkAccount:function(){return d},updateAccount:function(){return r.sG},updateApp:function(){return k.KT},updateCategory:function(){return r.yr},updateGroup:function(){return r.mD},updateNewTransactions:function(){return x},updateStatusText:function(){return j.Rb},uploadBudget:function(){return j.il},uploadFile:function(){return k.cT}});var r=n(8297),o=n(7156),i=n(5196),a=n(9122);function s(e){return{type:i._V,name:e}}function l(e,t,n){return{type:"ACCOUNT_SYNC_STATUS",id:e,failed:!0,errorType:t,errorCode:n}}function u(e){return{type:"ACCOUNT_SYNC_STATUS",id:e,failed:!1}}function c(e){return{type:"ACCOUNT_SYNC_FAILURES",syncErrors:e}}function d(e){return async t=>{await(0,o.lW)("account-unlink",{id:e}),t(u(e)),t((0,r.T8)())}}function f(e,t,n){return async i=>{await(0,o.lW)("nordigen-accounts-link",{requisitionId:e,account:t,upgradingId:n}),await i((0,r.WJ)()),await i((0,r.T8)())}}function h(e,t,n,i){return async a=>{let s=await(0,o.lW)("accounts-connect",{institution:e,publicToken:t,accountIds:n,offbudgetIds:i});return await a((0,r.WJ)()),await a((0,r.T8)()),s}}function p(e,t,n,i){return async a=>{let s=await(0,o.lW)("nordigen-accounts-connect",{institution:e,publicToken:t,accountIds:n,offbudgetIds:i});return await a((0,r.WJ)()),await a((0,r.T8)()),s}}function g(e){return async(t,n)=>{if(n().account.accountsSyncing)return!1;if(e){let r=n().queries.accounts.find((t=>t.id===e));t(s(r.name))}else t(s("__all"));const{errors:r,newTransactions:d,matchedTransactions:f,updatedAccounts:h}=await(0,o.lW)("nordigen-accounts-sync",{id:e});if(t(s(null)),e){let n=r.find((t=>t.accountId===e));n?"SyncError"===n.type&&t(l(e,n.category,n.code)):t(u(e))}else t(c(r.filter((e=>"SyncError"===e.type)).map((e=>({id:e.accountId,type:e.category,code:e.code})))));return r.forEach((e=>{"SyncError"===e.type?t((0,a.wN)({type:"error",message:e.message})):t((0,a.wN)({type:"error",message:e.message,internal:e.internal}))})),t({type:i.GZ,newTransactions:d,matchedTransactions:f,updatedAccounts:h}),d.length>0||f.length>0}}function m(e){return{type:i.Vi,transaction:e}}function y(e,t){return async n=>await(0,o.lW)("transactions-parse-file",{filepath:e,options:t})}function v(e,t){return async n=>{let{errors:r=[],added:s,updated:l}=await(0,o.lW)("transactions-import",{accountId:e,transactions:t});return r.forEach((e=>{n((0,a.wN)({type:"error",message:e.message}))})),n({type:i.GZ,newTransactions:s,matchedTransactions:l,updatedAccounts:s.length>0?[e]:[]}),s.length>0||l.length>0}}function x(e){return{type:i.kY,changedId:e}}function b(e){return{type:i.ER,accountId:e}}function w(e,t){return{type:i.Uh,sheet:e,name:t}}var S=n(1669),C=n(6788),j=n(6740),k=n(3824);function E(e,t){return async(n,r)=>{const i=r().prefs.local;i&&i.id&&await n((0,j.ej)()),await(0,o.lW)("backup-load",{id:e,backupId:t}),n((0,j.NK)(e))}}function T(){return async(e,t)=>{const n=t().prefs.local;n&&n.id&&await(0,o.lW)("backup-make",{id:n.id})}}var O=n(6218);function I(){return async(e,t)=>{let{error:n}=await(0,o.lW)("sync-reset");n?(alert((0,O.wg)(n)),"encrypt-failure"===n.reason&&n.meta.isMissingKey||"file-has-new-key"===n.reason?e((0,S.Ll)("fix-encryption-key",{onSuccess:()=>{e(I())}})):"encrypt-failure"===n.reason&&e((0,S.Ll)("create-encryption-key",{recreate:!0}))):(await e(D()),await e((0,C.D0)()))}}function D(){return async(e,t)=>{const n=t().prefs.local;if(n&&n.id){let e=await(0,o.lW)("sync");return"error"in e?{error:e.error}:{}}}}function A(e){return async(t,n)=>{let r=await t(D());if(r.error)return{error:r.error};let o=await t(g(e));if(o){let e=await t(D());return!e.error||{error:e.error}}return{hasUpdated:o||r.updated}}}var _=n(9169)},1669:function(e,t,n){"use strict";n.d(t,{A0:function(){return a},GZ:function(){return l},Ll:function(){return o},Mr:function(){return u},OB:function(){return i},Yi:function(){return s}});var r=n(5196);function o(e,t){return{type:r.jw,name:e,options:t}}function i(e,t){return{type:r.JA,name:e,options:t}}function a(){return{type:r.uI}}function s(){return{type:r.kJ}}function l(){return{type:r.TZ}}function u(){return{type:r.et}}},9122:function(e,t,n){"use strict";n.d(t,{FV:function(){return s},R:function(){return a},wN:function(){return i}});var r=n(5284),o=n(5196);function i(e){return{type:o.Dv,notification:{...e,id:e.id||(0,r.Z)()}}}function a(){return i({type:"error",message:"Something internally went wrong. You may want to restart the app if anything looks wrong. Please report this as a new issue on Github."})}function s(e){return{type:o.Kf,id:e}}},6788:function(e,t,n){"use strict";n.d(t,{D0:function(){return a},EY:function(){return u},Pt:function(){return l},p:function(){return s}});var r=n(7156),o=n(5196),i=n(1669);function a(){return async(e,t)=>{let n=await(0,r.lW)("load-prefs"),a=t().prefs.local;return n&&n.id&&!a&&e((0,i.Mr)()),e({type:o.px,prefs:n,globalPrefs:await(0,r.lW)("load-global-prefs")}),n}}function s(e){return async t=>{await(0,r.lW)("save-prefs",e),t({type:o.uF,prefs:e})}}function l(){return async(e,t)=>{let n=await(0,r.lW)("load-global-prefs");return e({type:o.px,prefs:t().prefs.local,globalPrefs:n}),n}}function u(e){return async t=>{await(0,r.lW)("save-global-prefs",e),t({type:o.CH,globalPrefs:e})}}},8297:function(e,t,n){"use strict";n.d(t,{CP:function(){return c},Ew:function(){return _},KX:function(){return M},Rc:function(){return E},Rr:function(){return b},T8:function(){return S},WJ:function(){return x},Wr:function(){return p},X_:function(){return O},Yw:function(){return P},bJ:function(){return k},eq:function(){return g},fz:function(){return w},iE:function(){return v},k4:function(){return d},ly:function(){return T},mD:function(){return y},o1:function(){return j},qu:function(){return u},sG:function(){return C},sS:function(){return m},uu:function(){return f},yr:function(){return h}});var r=n(337),o=n.n(r),i=n(7156),a=n(5196),s=n(1669),l=n(9122);function u(e,t,n){return async function(r){switch(t){case"budget-amount":await(0,i.lW)("budget/budget-amount",{month:e,category:n.category,amount:n.amount});break;case"copy-last":await(0,i.lW)("budget/copy-previous-month",{month:e});break;case"set-zero":await(0,i.lW)("budget/set-zero",{month:e});break;case"set-3-avg":await(0,i.lW)("budget/set-3month-avg",{month:e});break;case"check-templates":r((0,l.wN)(await(0,i.lW)("budget/check-templates")));break;case"apply-goal-template":r((0,l.wN)(await(0,i.lW)("budget/apply-goal-template",{month:e})));break;case"overwrite-goal-template":r((0,l.wN)(await(0,i.lW)("budget/overwrite-goal-template",{month:e})));break;case"cleanup-goal-template":r((0,l.wN)(await(0,i.lW)("budget/cleanup-goal-template",{month:e})));break;case"hold":await(0,i.lW)("budget/hold-for-next-month",{month:e,amount:n.amount});break;case"reset-hold":await(0,i.lW)("budget/reset-hold",{month:e});break;case"cover":await(0,i.lW)("budget/cover-overspending",{month:e,to:n.to,from:n.from});break;case"transfer-available":await(0,i.lW)("budget/transfer-available",{month:e,amount:n.amount,category:n.category});break;case"transfer-category":await(0,i.lW)("budget/transfer-category",{month:e,amount:n.amount,from:n.from,to:n.to});break;case"carryover":await(0,i.lW)("budget/set-carryover",{startMonth:e,category:n.category,flag:n.flag})}}}function c(){return async function(e){const t=await(0,i.lW)("get-categories");return e({type:a.X6,categories:t}),t}}function d(e,t,n){return async function(r){let o=await(0,i.lW)("category-create",{name:e,groupId:t,isIncome:n});return r(c()),o}}function f(e,t){return async function(n,r){let{error:o}=await(0,i.lW)("category-delete",{id:e,transferId:t});if(o){if("category-type"===o)n((0,l.wN)({type:"error",message:"A category must be transferred to another of the same type (expense or income)"}));else n((0,l.R)());throw new Error(o)}n(c()),n(x())}}function h(e){return async t=>{await(0,i.lW)("category-update",e),t(c())}}function p(e,t,n){return async(r,o)=>{await(0,i.lW)("category-move",{id:e,groupId:t,targetId:n}),await r(c())}}function g(e,t){return async n=>{await(0,i.lW)("category-group-move",{id:e,targetId:t}),await n(c())}}function m(e){return async t=>{let n=await(0,i.lW)("category-group-create",{name:e});return t(c()),n}}function y(e){const{categories:t,...n}=e;return async e=>{await(0,i.lW)("category-group-update",n),await e(c())}}function v(e,t){return async function(n,r){await(0,i.lW)("category-group-delete",{id:e,transferId:t}),await n(c()),await n(x())}}function x(){return async function(e){let t=await(0,i.lW)("payees-get");return e({type:a.gp,payees:t}),t}}function b(){return async function(e,t){if(0===t().queries.payees.length)return e(x())}}function w(e){return async t=>(0,i.lW)("payee-create",{name:e.trim()})}function S(){return async function(e){const t=await(0,i.lW)("accounts-get");return e({type:a.WF,accounts:t}),t}}function C(e){return async function(t){t({type:a.$E,account:e}),await(0,i.lW)("account-update",e)}}function j(e,t,n){return async function(r){let o=await(0,i.lW)("account-create",{name:e,balance:t,offBudget:n});return await r(S()),await r(x()),o}}function k(e){return async function(t,n){const{balance:r,numTransactions:o}=await(0,i.lW)("account-properties",{id:e}),a=n().queries.accounts.find((t=>t.id===e));t((0,s.Ll)("close-account",{account:a,balance:r,canDelete:0===o}))}}function E(e,t,n,r){return async function(o){await(0,i.lW)("account-close",{id:e,transferAccountId:t,categoryId:n,forced:r}),o(S())}}function T(e){return async function(t){await(0,i.lW)("account-reopen",{id:e}),t(S())}}function O(e){return E(e,null,null,!0)}let I=o()((()=>(0,i.lW)("undo")),100),D=o()((()=>(0,i.lW)("redo")),100),A=!0;function _(e){A=e}function P(){return async()=>{A&&I()}}function M(){return async()=>{A&&D()}}},9169:function(e,t,n){"use strict";n.d(t,{Pl:function(){return l},is:function(){return s},w7:function(){return u}});var r=n(7156),o=n(5196),i=n(6740),a=n(6788);function s(){return async e=>{const t=await(0,r.lW)("subscribe-get-user");return e({type:o.q1,data:t}),t}}function l(){return async e=>{await e(s()),e((0,i.nu)())}}function u(){return async e=>{await(0,r.lW)("subscribe-sign-out"),e(s()),e((0,a.Pt)()),e((0,i.ej)()),e({type:o.dp})}}},5196:function(e,t,n){"use strict";n.d(t,{$E:function(){return l},CH:function(){return y},Co:function(){return F},DC:function(){return S},Dq:function(){return d},Dv:function(){return A},ER:function(){return a},GY:function(){return b},GZ:function(){return r},HT:function(){return M},JA:function(){return E},Kf:function(){return _},Kh:function(){return p},Oi:function(){return x},TZ:function(){return D},Ud:function(){return v},Uh:function(){return j},VM:function(){return R},Vi:function(){return i},WF:function(){return s},X6:function(){return u},YC:function(){return h},Yc:function(){return w},_V:function(){return N},cV:function(){return L},dp:function(){return W},et:function(){return I},gp:function(){return f},hq:function(){return c},jw:function(){return k},kJ:function(){return O},kY:function(){return o},px:function(){return g},q1:function(){return P},uF:function(){return m},uI:function(){return T},wH:function(){return C}});const r="SET_NEW_TRANSACTIONS",o="UPDATE_NEW_TRANSACTIONS",i="SET_LAST_TRANSACTION",a="MARK_ACCOUNT_READ",s="LOAD_ACCOUNTS",l="UPDATE_ACCOUNT",u="LOAD_CATEGORIES",c="ADD_CATEGORY",d="DELETE_CATEGORY",f="LOAD_PAYEES",h="LOAD_BANKS",p="SET_PROFILE",g="SET_PREFS",m="MERGE_LOCAL_PREFS",y="MERGE_GLOBAL_PREFS",v="SET_BUDGETS",x="SET_REMOTE_FILES",b="SET_ALL_FILES",w="SET_AVAILABLE_IMPORTS",S="CLOSE_BUDGET",C="SET_APP_STATE",j="DEBUG_CELL",k="PUSH_MODAL",E="REPLACE_MODAL",T="HIDE_MODALS",O="SHOW_MODALS",I="CLOSE_MODAL",D="POP_MODAL",A="ADD_NOTIFICATION",_="REMOVE_NOTIFICATION",P="GET_USER_DATA",M="SET_LAST_UNDO_STATE",R="SET_LAST_SPLIT_STATE",N="SET_ACCOUNTS_SYNCING",L="ACCOUNT_SYNC_STATUS",F="ACCOUNT_SYNC_FAILURES",W="SIGN_OUT"},5068:function(e,t,n){"use strict";n.d(t,{BB:function(){return u},Re:function(){return c},gM:function(){return d}});var r=n(3017),o=n(9121),i=n(2328),a=n(5499),s=n(8993);let l=(0,r.createContext)(null);function u(e){let{children:t}=e,n=(0,i.y)((()=>(0,o.ZP)("accounts").select("*")),[]);return(0,s.jsx)(l.Provider,{value:n,children:t})}function c(e){let{children:t,idKey:n}=e;return t(d({idKey:n}))}function d(){let{idKey:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,r.useContext)(l);return e&&t?(0,a.gI)(t):t}},6018:function(e,t,n){"use strict";n.d(t,{m:function(){return i}});var r=n(9121),o=n(2328);function i(){return((0,o.y)((()=>(0,r.ZP)("transaction_filters").select("*")),[])||[]).map((e=>({...e.fields,id:e.id,name:e.name,tombstone:e.tombstone,conditionsOp:e.conditions_op,conditions:e.conditions})))}},9476:function(e,t,n){"use strict";n.d(t,{Zr:function(){return u},mp:function(){return c},n4:function(){return d}});var r=n(3017),o=n(9121),i=n(2328),a=n(5499),s=n(8993);let l=(0,r.createContext)(null);function u(e){let{children:t}=e,n=(0,i.y)((()=>(0,o.ZP)("payees").select("*")),[]);return(0,s.jsx)(l.Provider,{value:n,children:t})}function c(e){let{children:t,idKey:n}=e;return t(d({idKey:n}))}function d(){let{idKey:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,r.useContext)(l);return e&&t?(0,a.yG)(t):t}},3865:function(e,t,n){"use strict";n.d(t,{gZ:function(){return s},oF:function(){return c},up:function(){return u}});var r=n(3017),o=n(8370),i=n(9121),a=n(8993);function s(){let{transform:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},[t,n]=(0,r.useState)(null);return(0,r.useEffect)((()=>{let t,r,a=(0,i.ZP)("schedules").select("*");return t=(0,i.Y1)(e?e(a):a,(async e=>{t&&(r&&r.unsubscribe(),r=function(e,t){return(0,i.Y1)((0,o.eJ)(e),t,{mapper:t=>{let n=new Set(t.filter(Boolean).map((e=>e.schedule)));return new Map(e.map((e=>[e.id,(0,o.lR)(e.next_date,e.completed,n.has(e.id))])))}})}(e,(t=>n({schedules:e,statuses:t}))))})),()=>{t&&t.unsubscribe(),r&&r.unsubscribe()}}),[e]),t}let l=(0,r.createContext)(null);function u(e){let{transform:t,children:n}=e,r=s({transform:t});return(0,a.jsx)(l.Provider,{value:r,children:n})}function c(){return(0,r.useContext)(l)}},9515:function(e,t,n){"use strict";var r;n.d(t,{OB:function(){return s},OS:function(){return a},jU:function(){return l}});const o=navigator.platform&&"win32"===navigator.platform.toLowerCase(),i=navigator.platform&&navigator.platform.toUpperCase().indexOf("MAC")>=0,a=(/^((?!chrome|android).)*safari/i.test(navigator.userAgent),o?"windows":i?"mac":"linux"),s="web",l=!(null===(r=window.Actual)||void 0===r||!r.IS_FAKE_WEB)},9121:function(e,t,n){"use strict";n.d(t,{Zn:function(){return u},ZP:function(){return i},Y1:function(){return s},Fr:function(){return l},Vn:function(){return a}});var r=n(7156);var o=n(7968),i=o.ZP;async function a(e){return(0,r.lW)("query",e.serialize())}function s(e,t,n){let r=new u(e,t,n);return r.run(),r}function l(e,t,n){let r=new c(e,t,n);return r.run(),r}class u{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this._unsubscribe=void 0,this.data=void 0,this.dependencies=void 0,this.error=void 0,this.listeners=void 0,this.mappedData=void 0,this.mapper=void 0,this.onlySync=void 0,this.query=void 0,this.inflight=void 0,this.inflightRequestId=void 0,this.restart=void 0,this.onData=(e,t)=>{for(let n=0;n<this.listeners.length;n++)this.listeners[n](e,t)},this.onUpdate=e=>{(null==this.dependencies||e.find((e=>this.dependencies.has(e))))&&this.run()},this.run=()=>(this.subscribe(),this._fetchData((()=>a(this.query)))),this._fetchData=async e=>{let t=Math.random();this.inflightRequestId=t;let{data:n,dependencies:r}=await e();if(null==this.dependencies&&(this.dependencies=new Set(r)),this.inflightRequestId===t&&this._unsubscribe){let e=this.mappedData;this.data=n,this.mappedData=this.mapData(n),this.onData(this.mappedData,e),this.inflightRequestId=null}},this.subscribe=()=>{null==this._unsubscribe&&(this._unsubscribe=(0,r.oL)("sync-event",(e=>{let{type:t,tables:n}=e;-1!==(this.onlySync?["success"]:["applied","success"]).indexOf(t)&&this.onUpdate(n)})))},this.unsubscribe=()=>{this._unsubscribe&&(this._unsubscribe(),this._unsubscribe=null)},this.mapData=e=>this.mapper?this.mapper(e):e,this.getQuery=()=>this.query,this.getData=()=>this.mappedData,this.getNumListeners=()=>this.listeners.length,this.isRunning=()=>null!=this._unsubscribe,this._optimisticUpdate=(e,t)=>{this.data=e(this.data),this.mappedData=t(this.mappedData)},this.optimisticUpdate=(e,t)=>{let n=this.mappedData;this._optimisticUpdate(e,t),this.onData(this.mappedData,n)},this.error=new Error,this.query=e,this.data=null,this.mappedData=null,this.dependencies=null,this.mapper=n.mapper,this.onlySync=n.onlySync,this.listeners=[],this.inflight=!1,this.restart=!1,t&&this.addListener(t)}addListener(e){return this.listeners.push(e),()=>{this.listeners=this.listeners.filter((t=>t!==e))}}}class c extends u{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};super(e,t,n),this.done=void 0,this.onPageData=void 0,this.pageCount=void 0,this.runPromise=void 0,this.totalCount=void 0,this._fetchCount=()=>a(this.query.calculate({$count:"*"})).then((e=>{let{data:t}=e;this.totalCount=t})),this.run=()=>(this.subscribe(),this.runPromise=this._fetchData((async()=>(this.done=!1,this._fetchCount(),a(this.query.limit(null==this.data?this.pageCount:Math.max(this.data.length,this.pageCount)))))),this.runPromise),this.refetchUpToRow=async(e,t)=>(this.runPromise=this._fetchData((async()=>{this.done=!1,this._fetchCount();let n=(0,o.zW)(this.query,t);if(null==n)throw new Error("refetchUpToRow requires a query with orderBy");let{field:r,order:i}=n,s=await a(this.query.filter({id:e}).select(r));if(0===s.data.length)return;let l=s.data[0];s=await a(this.query.filter({[r]:{["asc"===i?"$lte":"$gte"]:l[r]}}));let u=s.data;return s=await a(this.query.filter({[r]:{["asc"===i?"$gt":"$lt"]:l[r]}}).limit(this.pageCount)),{data:u.concat(s.data),dependencies:s.dependencies}})),this.runPromise),this._fetchNext=async()=>{for(;this.inflightRequestId;)await this.runPromise;let e=this.data;if(!this.done){let{data:t}=await a(this.query.limit(this.pageCount).offset(e.length));if(this.inflightRequestId||e!==this.data)return this._fetchNext();if(0===t.length)this.done=!0;else{this.done=t.length<this.pageCount,this.data=this.data.concat(t);let e=this.mappedData,n=this.mapData(t);this.mappedData=this.mappedData.concat(n),this.onPageData(n),this.onData(this.mappedData,e)}}},this.fetchNext=function(e){let t=null;return function(){return t||(t=e(...arguments).finally((()=>{t=null})),t)}}(this._fetchNext),this.isFinished=()=>this.done,this.getTotalCount=()=>this.totalCount,this.optimisticUpdate=(e,t)=>{let n=this.data,r=this.mappedData;this._optimisticUpdate(e,t),this.totalCount+=this.data.length-n.length,this.onData(this.mappedData,r)},this.totalCount=null,this.pageCount=n.pageCount||500,this.runPromise=null,this.done=!1,this.onPageData=n.onPageData||(()=>{})}}},2328:function(e,t,n){"use strict";n.d(t,{n:function(){return a},y:function(){return s}});var r=n(3017),o=n(9121),i=n(8993);function a(e,t){return function(e,t,n){let o=new n(e,null,t),a=(0,r.createContext)(null);return{Provider:function(e){let{children:t}=e,[n,s]=(0,r.useState)(o.getData()),l=(0,r.useMemo)((()=>({data:n,query:o})),[n,o]);return(0,r.useEffect)((()=>{if(0!==o.getNumListeners())throw new Error("Query already has listeners. You cannot use the same query context `Provider` twice");let e=o.addListener((e=>s(e)));return o.isRunning()||o.run(),s(o.getData()),()=>{e(),o.unsubscribe()}}),[]),(0,i.jsx)(a.Provider,{value:l,children:t})},useQuery:function(){let e=(0,r.useContext)(a);if(null==e)throw new Error("`useQuery` tried to access a query that hasn\u2019t been run. You need to put its `Provider` in a parent component");return e}}}(e,t,o.Zn)}function s(e,t){let[n,i]=(0,r.useState)(null),a=(0,r.useMemo)(e,t);return(0,r.useEffect)((()=>{let e=(0,o.Y1)(a,(async t=>{e&&i(t)}));return()=>{e.unsubscribe(),e=null}}),[a]),n}},5499:function(e,t,n){"use strict";n.d(t,{ZP:function(){return s},ch:function(){return c},gI:function(){return l},nc:function(){return d},yG:function(){return u}});var r=n(1678),o=n(9585),i=n(5196);const a={newTransactions:[],matchedTransactions:[],lastTransaction:null,updatedAccounts:[],accounts:[],categories:{grouped:[],list:[]},payees:[],earliestTransaction:null};function s(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case i.GZ:return{...e,newTransactions:t.newTransactions||[],matchedTransactions:t.matchedTransactions||[],updatedAccounts:t.updatedAccounts||[]};case i.kY:return{...e,newTransactions:e.newTransactions.filter((e=>e!==t.changedId)),matchedTransactions:e.matchedTransactions.filter((e=>e!==t.changedId))};case i.Vi:return{...e,lastTransaction:t.transaction};case i.ER:return{...e,updatedAccounts:e.updatedAccounts.filter((e=>e!==t.accountId))};case i.WF:return{...e,accounts:t.accounts};case i.$E:return{...e,accounts:e.accounts.map((e=>e.id===t.account.id?{...e,...t.account}:e))};case i.X6:return{...e,categories:t.categories};case i.gp:return{...e,payees:t.payees};case i.hq:{let n={id:"temp",name:t.name};return{...e,categories:{grouped:e.categories.grouped.map((e=>e.id===t.groupId?{...e,categories:[n,...e.categories]}:e)),list:[n,...e.categories.list]}}}case i.Dq:return{...e,categories:{grouped:e.categories.grouped.map((e=>({...e,categories:e.categories.filter((e=>e.id!==t.id))}))),list:e.categories.list.filter((e=>e.id!==t.id))}}}return e}const l=(0,r.Z)((e=>(0,o.ZZ)(e))),u=(0,r.Z)((e=>(0,o.ZZ)(e))),c=(0,r.Z)((e=>{let t={};return e.forEach((e=>{e.categories.forEach((e=>{t[e.id]=e}))})),t})),d=(0,r.Z)(((e,t)=>{let n=l(t);return e.filter((e=>{if(e.transfer_acct){let t=n[e.transfer_acct];return null!=t&&!t.closed}return!0}))}))},7156:function(e,t,n){"use strict";n.d(t,{S1:function(){return d},oL:function(){return p},lW:function(){return f},OK:function(){return h},Ev:function(){return g}});var r=n(5284);var o=n(1936);let i=new Map,a=new Map,s=[],l=null;class u extends Error{constructor(e,t,n,r,o){super(e),this.url=void 0,this.line=void 0,this.column=void 0,this.name=this.constructor.name,this.message=e,Object.defineProperty(this,"stack",{get:function(){return"extended "+this._stack},set:function(e){this._stack=e}}),this.stack=t,this.url=n,this.line=r,this.column=o}}function c(e,t,n){l=e,e.onmessage=r=>{let l=r.data;var c;"connect"===l.type?(s.length>0&&(s.forEach((t=>e.postMessage(t))),s=null),t()):"app-init-failure"===l.type?n(l):"capture-exception"===l.type?(c=l.stack?new u(l.message,l.stack,l.url,l.line,l.column):l.exc,console.log("[Exception]",c),l.message&&l.message.includes("indexeddb-quota-error")&&alert("We hit a limit on the local storage available. Edits may not be saved. Please get in touch https://actualbudget.org/contact/ so we can help debug this.")):"capture-breadcrumb"===l.type?l.data:function(e){if("error"===e.type){const{id:t}=e;i.delete(t)}else if("reply"===e.type){const{id:t,result:n,mutated:r,undoTag:a}=e,s=i.get(t);s&&(i.delete(t),r||o.gc(a),s.resolve(n))}else if("push"===e.type){const{name:t,args:n}=e,r=a.get(t);if(r)for(let e=0;e<r.length&&!0!==r[e](n);e++);}else if(!e.type.startsWith("__"))throw new Error("Unknown message type: "+JSON.stringify(e))}(l)},e instanceof MessagePort&&e.start()}const d=async function(e){return new Promise(((t,n)=>c(e,t,n)))},f=function(e,t){let{catchErrors:n=!1}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return new Promise(((a,u)=>{let c=(0,r.Z)();i.set(c,{resolve:a,reject:u});let d={id:c,name:e,args:t,undoTag:o.CO(),catchErrors:n};s?s.push(d):l.postMessage(d)}))},h=function(e,t){return f(e,t,{catchErrors:!0})},p=function(e,t){return a.get(e)||a.set(e,[]),a.get(e).push(t),()=>{let n=a.get(e);a.set(e,n.filter((e=>e!==t)))}},g=function(e){a.set(e,[])}},1936:function(e,t,n){"use strict";n.d(t,{CO:function(){return u},a2:function(){return s},gc:function(){return c},kp:function(){return a},r8:function(){return l}});var r=n(5284);let o=[],i={url:null,openModal:null,selectedItems:null};const a=function(e,t){i[e]=t,i.id=(0,r.Z)()},s=function(e){return i[e]},l=function(e){return o.find((t=>t.id===e))},u=function(){let e={...i,id:(0,r.Z)()};return o.unshift(e),o=o.slice(0,40),e.id},c=function(e){o=o.filter((t=>t.id!==e))}},4812:function(e,t,n){"use strict";function r(){return"true"===String({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_BACKEND_WORKER_HASH:"7aebb51bfd02e5b1a78f"}.REACT_APP_NETLIFY)||!1}function o(){return navigator.userAgent.indexOf("Electron")>=0}n.d(t,{Ry:function(){return r},d:function(){return o}})},6218:function(e,t,n){"use strict";function r(e){let{reason:t,meta:n}=e;switch(t){case"unauthorized":return"You are not logged in.";case"encrypt-failure":return n.isMissingKey?"Encrypting your file failed because you are missing your encryption key. Create your key in the next step.":"Encrypting the file failed. You have the correct key so this is an internal bug. To fix this, generate a new key in the next step.";case"file-has-reset":return"Something went wrong while resetting your file. Please try again.";case"file-has-new-key":return"Unable to encrypt your data because you are missing the key. Create the latest key in the next step.";case"network":return"Uploading the file failed. Check your network connection.";default:return`An internal error occurred, sorry! Visit https://actualbudget.org/contact/ for support. (ref: ${t})`}}function o(e){let{reason:t,meta:n,fileName:r}=e;switch(t){case"network":case"download-failure":return"Downloading the file failed. Check your network connection.";case"not-zip-file":case"invalid-zip-file":case"invalid-meta-file":return"Downloaded file is invalid, sorry! Visit https://actualbudget.org/contact/ for support.";case"decrypt-failure":return"Unable to decrypt file "+(r||"(unknown)")+". To change your key, first download this file with the proper password.";case"out-of-sync-migrations":return"This budget cannot be loaded with this version of the app. Make sure the app is up-to-date.";default:return"Something went wrong trying to download that file, sorry! Visit https://actualbudget.org/contact/ for support. "+(n&&n.fileId?`(fileId: ${n.fileId})`:"")}}function i(e){return r(e)}function a(e){let{reason:t}=e;switch(t){case"network":return"Unable to connect to the server. We need to access the server to get some information about your keys.";case"old-key-style":return"This file is encrypted with an old unsupported key style. Recreate the key on a device where the file is available, or use an older version of Actual to download it.";case"decrypt-failure":return"Unable to decrypt file with this password. Please try again.";default:return"Something went wrong trying to create a key, sorry! Visit https://actualbudget.org/contact/ for support."}}function s(e,t){return"out-of-sync-migrations"===e||"out-of-sync-data"===e?"This budget cannot be loaded with this version of the app.":"budget-not-found"===e?`Budget \u201c${t}\u201d not found. Check the id of your budget in the Advanced section of the settings page.`:`We had an unknown problem opening \u201c${t}\u201d.`}n.d(t,{Ez:function(){return a},FL:function(){return s},Ip:function(){return o},wg:function(){return r},zJ:function(){return i}})},4917:function(e,t,n){"use strict";n.d(t,{E4:function(){return w},zI:function(){return x},PR:function(){return y},dK:function(){return m},is:function(){return g},Gn:function(){return T},WU:function(){return M},D1:function(){return R},Ze:function(){return N},jw:function(){return D},yl:function(){return O},LT:function(){return L},JC:function(){return F},_y:function(){return W},So:function(){return I},Q9:function(){return _},W8:function(){return A},Ax:function(){return C},DT:function(){return p},dy:function(){return v},Do:function(){return k},cv:function(){return P},kw:function(){return S},W9:function(){return b}});var r=n(5249),o=n(9398),i=n(9375),a=n(8116);function s(e,t){(0,a.Z)(2,arguments);var n=(0,i.Z)(e),r=(0,o.Z)(t);if(isNaN(r))return new Date(NaN);if(!r)return n;var s=n.getDate(),l=new Date(n.getTime());return l.setMonth(n.getMonth()+r+1,0),s>=l.getDate()?l:(n.setFullYear(l.getFullYear(),l.getMonth(),s),n)}function l(e,t){return(0,a.Z)(2,arguments),s(e,-(0,o.Z)(t))}var u=n(8756),c=n(9474);function d(e,t){(0,a.Z)(2,arguments);var n=(0,i.Z)(e),r=(0,i.Z)(t);return n.getTime()<r.getTime()}var f=n(1678);function h(e){if("string"===typeof e){let[t,n,r]=e.split("-");return null!=r?new Date(parseInt(t),parseInt(n)-1,parseInt(r),12):null!=n?new Date(parseInt(t),parseInt(n)-1,1,12):new Date(parseInt(t),0,1,12)}return"number"===typeof e?new Date(e):e}function p(e){return r.Z(h(e),"yyyy-MM")}function g(e){return r.Z(h(e),"yyyy-MM-dd")}function m(){return n.g.IS_TESTING?n.g.currentMonth||"2017-01":r.Z(new Date,"yyyy-MM")}function y(){return n.g.IS_TESTING?"2017-01-01":r.Z(new Date,"yyyy-MM-dd")}function v(e){return r.Z(l(h(e),1),"yyyy-MM")}function x(e,t){return r.Z(s(h(e),t),"yyyy-MM")}function b(e,t){return r.Z(l(h(e),t),"yyyy-MM")}function w(e,t){return r.Z(u.Z(h(e),t),"yyyy-MM-dd")}function S(e,t){return r.Z(c.Z(h(e),t),"yyyy-MM-dd")}function C(e,t){return function(e,t){(0,a.Z)(2,arguments);var n=(0,i.Z)(e),r=(0,i.Z)(t);return n.getTime()>r.getTime()}(h(e),h(t))}function j(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=[];let o=p(e);for(;d(h(o),h(t));)r.push(o),o=x(o,1);return n&&r.push(o),r}function k(e,t){return j(e,t,!0)}function E(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=[];let o=e;for(;d(h(o),h(t));)r.push(o),o=w(o,1);return n&&r.push(o),r}function T(e,t){return E(e,t,!0)}function O(e){return parseInt(e.slice(5,7))-1}function I(e){return e.slice(0,4)}function D(e){return e.slice(0,7)}function A(e){return I(e)+"-01"}function _(e){return I(e)+"-12"}function P(e){return"budget"+e.replace("-","")}function M(e,t){return r.Z(h(e),t)}(0,f.Z)((e=>new RegExp(e.replace(/d+/g,"\\d{1,2}").replace(/M+/g,"\\d{1,2}").replace(/y+/g,"\\d{4}"))));const R=(0,f.Z)((e=>e.replace(/y+/g,"").replace(/[^\w]$/,"").replace(/^[^\w]/,""))),N=(0,f.Z)((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+"$")})),L=(0,f.Z)((e=>e.replace(/d+/g,"").replace(/[^\w]$/,"").replace(/^[^\w]/,"").replace(/\/\//,"/").replace(/\.\./,".").replace(/--/,"-"))),F=((0,f.Z)((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+"$")})),(0,f.Z)((e=>e.replace(/y+/g,"yy")))),W=(0,f.Z)((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+"$")}))},7968:function(e,t,n){"use strict";n.d(t,{ZP:function(){return i},zW:function(){return o}});class r{constructor(e){this.state=void 0,this.state={filterExpressions:e.filterExpressions||[],selectExpressions:e.selectExpressions||[],groupExpressions:e.groupExpressions||[],orderExpressions:e.orderExpressions||[],calculation:!1,rawMode:!1,withDead:!1,validateRefs:!0,limit:null,offset:null,...e}}filter(e){return new r({...this.state,filterExpressions:[...this.state.filterExpressions,e]})}unfilter(e){let t=new Set(e);return new r({...this.state,filterExpressions:this.state.filterExpressions.filter((e=>!t.has(Object.keys(e)[0])))})}select(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];Array.isArray(e)||(e=[e]);let t=new r({...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 r({...this.state,groupExpressions:[...this.state.groupExpressions,...e]})}orderBy(e){return Array.isArray(e)||(e=[e]),new r({...this.state,orderExpressions:[...this.state.orderExpressions,...e]})}limit(e){return new r({...this.state,limit:e})}offset(e){return new r({...this.state,offset:e})}raw(){return new r({...this.state,rawMode:!0})}withDead(){return new r({...this.state,withDead:!0})}withoutValidatedRefs(){return new r({...this.state,validateRefs:!1})}options(e){return new r({...this.state,tableOptions:e})}serialize(){return this.state}}function o(e,t){let n=e.serialize().orderExpressions;if(0===n.length)return t?{order:"asc",...t}:null;let r=n[0];if("string"===typeof r)return{field:r,order:"asc"};let[o]=Object.keys(r);return{field:o,order:r[o]}}function i(e){return new r({table:e})}},837:function(e,t,n){"use strict";n.d(t,{Qc:function(){return c},Z:function(){return l},Z2:function(){return d},Z9:function(){return i},gL:function(){return a},l1:function(){return f},w8:function(){return s},wZ:function(){return o},zQ:function(){return u}});var r=n(9585);const o={date:{ops:["is","isapprox","gt","gte","lt","lte"],nullable:!1},id:{ops:["is","contains","oneOf"],nullable:!0},saved:{ops:[],nullable:!1},string:{ops:["is","contains","oneOf"],nullable:!1},number:{ops:["is","isapprox","isbetween","gt","gte","lt","lte"],nullable:!1},boolean:{ops:["is"],nullable:!1}},i=new Map(Object.entries({imported_payee:"string",payee:"id",date:"date",notes:"string",amount:"number",amountInflow:"number",amountOutfow:"number",category:"id",account:"id",cleared:"boolean",saved:"saved"}));function a(e,t){switch(t=t||{},e){case"imported_payee":return"imported payee";case"amount":return t.inflow?"amount (inflow)":t.outflow?"amount (outflow)":"amount";case"amount-inflow":return"amount (inflow)";case"amount-outflow":return"amount (outflow)";default:return e}}function s(e,t){switch(e){case"oneOf":return"one of";case"is":return"is";case"isapprox":return"is approx";case"isbetween":return"is between";case"contains":return"contains";case"gt":return"date"===t?"is after":"is greater than";case"gte":return"date"===t?"is after or equals":"is greater than or equals";case"lt":return"date"===t?"is before":"is less than";case"lte":return"date"===t?"is before or equals":"is less than or equals";case"true":return"is true";case"false":return"is false";case"set":return"set";case"link-schedule":return"link schedule";case"and":return"and";case"or":return"or";default:return""}}function l(e){return"amount-inflow"===e?{field:"amount",options:{inflow:!0}}:"amount-outflow"===e?{field:"amount",options:{outflow:!0}}:{field:e}}function u(e){switch(e){case"date-format":return"Invalid date format";case"no-null":case"no-empty-array":case"no-empty-string":return"Value cannot be empty";case"not-number":return"Value must be a number";case"invalid-field":return"Please choose a valid field for this type of rule";default:return"Internal error, sorry! Please get in touch https://actualbudget.org/contact/ for support"}}function c(e){switch(e.type){case"number":{let t=e.value;return"amount"===e.field&&"isbetween"!==e.op&&null!=t&&(t=(0,r.Bf)(t)),{...e,value:t}}case"string":{let t=null==e.value?"":e.value;return{...e,value:t}}case"boolean":{let t=e.value;return{...e,value:t}}}return{...e,error:null}}function d(e){let{error:t,inputKey:n,...o}=e;switch(o.type){case"number":{let e=o.value;return"amount"===o.field&&"isbetween"!==o.op&&(e=(0,r.l9)(e)),{...o,value:e}}case"string":{let e=null==o.value?"":o.value;return{...o,value:e}}case"boolean":{let e=null!=o.value&&o.value;return{...o,value:e}}}return o}function f(e,t){if("number"===t.type)if("isbetween"!==t.op)return{...t,error:null,value:e&&(0,r.Dz)(String(e))||0};return{...t,error:null,value:e}}},8370:function(e,t,n){"use strict";n.d(t,{eJ:function(){return a},lP:function(){return d},lR:function(){return i},lq:function(){return c},o7:function(){return u}});var r=n(4917),o=n(7968);function i(e,t,n){let o=r.PR();return t?"completed":n?"paid":e===o?"due":e>o&&e<=r.E4(o,7)?"upcoming":e<o?"missed":"scheduled"}function a(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:r.kw(e.next_date,2)}}}}));return(0,o.ZP)("transactions").filter({$or:t}).orderBy({date:"desc"}).groupBy("schedule").select(["schedule","date"])}function s(e){return r.WU(new Date(2020,0,e,12),"do")}function l(e){return{SU:"Sunday",MO:"Monday",TU:"Tuesday",WE:"Wednesday",TH:"Thursday",FR:"Friday",SA:"Saturday"}[e]}function u(e){let t=e.interval||1;switch(e.frequency){case"daily":{let e="Every ";return e+=1!==t?`${t} days`:"day",e}case"weekly":{let n="Every ";return n+=1!==t?`${t} weeks`:"week",n+=" on "+r.WU(e.start,"EEEE"),n}case"monthly":{let n="Every ";if(n+=1!==t?`${t} months`:"month",e.patterns&&e.patterns.length>0){let t=[...e.patterns].sort(((e,t)=>{let n=("day"===e.type?1:0)-("day"===t.type?1:0),r=e.value-t.value;return 0===n?r:n})).filter((e=>-1!==e.value));t=t.concat(e.patterns.filter((e=>-1===e.value))),n+=" on the ";let r=[],o=new Set(t.map((e=>e.type))),i=1===o.size&&!o.has("day");for(let e of t)if("day"===e.type)-1===e.value?r.push("last day"):r.push(s(e.value));else{let t=i?"":" "+l(e.type);-1===e.value?r.push("last"+t):r.push(s(e.value)+t)}r.length>2?(n+=r.slice(0,r.length-1).join(", "),n+=", and ",n+=r[r.length-1]):n+=r.join(" and "),i&&(n+=" "+l(t[0].type))}else n+=" on the "+r.WU(e.start,"do");return n}case"yearly":{let n="Every ";return n+=1!==t?`${t} years`:"year",n+=" on "+r.WU(e.start,"LLL do"),n}default:return"Recurring error"}}function c(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?Math.round((e.num1+e.num2)/2):e}},9585:function(e,t,n){"use strict";function r(e){return e[e.length-1]}function o(e,t){const n=e.id?{id:e.id}:{},r=Object.keys(t);let o=!1;for(let i=0;i<r.length;i++){let a=r[i];e[a]!==t[a]&&(n[a]=t[a],o=!0)}return o?n:null}function i(e,t){return t=[...t],e.added&&e.added.forEach((e=>{t.push(e)})),e.updated&&e.updated.forEach((e=>{let{id:n,...r}=e;const o=t.findIndex((e=>e.id===n));t[o]={...t[o],...r}})),e.deleted&&e.deleted.forEach((e=>{const n=t.findIndex((t=>e.id===t.id));-1!==n&&t.splice(n,1)})),t}function a(e){let t=new Map;for(let n=0;n<e.length;n++){let r=e[n];t.set(r.id,r)}return t}function s(e,t){let n=a(e),r=a(t),i=[],s=[],l=e.filter((e=>!r.has(e.id))).map((e=>({id:e.id})));return t.forEach((e=>{let t=n.get(e.id);if(t){const n=o(t,e);n&&s.push(n)}else i.push(e)})),{added:i,updated:s,deleted:l}}function l(e){let t={};for(let n=0;n<e.length;n++){let r=e[n];t[r.id]=r}return t}function u(e){return e[0].toUpperCase()+e.slice(1)}n.d(t,{Bf:function(){return j},CD:function(){return S},Dz:function(){return b},Th:function(){return s},VL:function(){return u},Z$:function(){return r},ZZ:function(){return l},eY:function(){return x},ff:function(){return h},id:function(){return c},k4:function(){return o},l9:function(){return C},qP:function(){return k},qT:function(){return w},sD:function(){return y},yC:function(){return f},zA:function(){return v},zb:function(){return i}});let c=[{value:"comma-dot",label:"1,000.33",labelNoFraction:"1,000"},{value:"dot-comma",label:"1.000,33",labelNoFraction:"1.000"},{value:"space-comma",label:"1 000,33",labelNoFraction:"1 000"},{value:"space-dot",label:"1 000.33",labelNoFraction:"1 000"}],d={value:null,formatter:null,regex:null};function f(e){let t,n,r,{format:o,hideFraction:i}=e;switch(o){case"space-comma":t="en-ZA",n=/[^-0-9,]/g,r=",";break;case"dot-comma":t="de-DE",n=/[^-0-9,]/g,r=",";break;case"space-dot":t="dje",n=/[^-0-9.]/g,r=".";break;default:t="en-US",n=/[^-0-9.]/g,r="."}d={value:o,separator:r,formatter:new Intl.NumberFormat(t,{minimumFractionDigits:i?0:2,maximumFractionDigits:i?0:2}),regex:n}}function h(){return d}f({format:"comma-dot",hideFraction:!1});const p=2**51-1,g=-p;function m(e){if(!Number.isInteger(e))throw new Error("safeNumber: number is not an integer: "+JSON.stringify(e));if(e>p||e<g)throw new Error("safeNumber: can\u2019t safely perform arithmetic with number: "+e);return e}function y(e){return j(w(e)||0)}function v(e){return d.formatter.format(m(e)/100)}function x(e){return d.formatter.format(e)}function b(e){let t=parseFloat(e.replace(d.regex,"").replace(d.separator,"."));return isNaN(t)?null:t}function w(e){let t=b(e);return null==t?null:C(t)}function S(e){let t=parseInt(e.replace(/[^-0-9.,]/g,""));return isNaN(t)?null:t}function C(e){return Math.round(100*e)}function j(e){return parseFloat((m(e)/100).toFixed(2))}function k(e){function t(e){return isNaN(e)?null:e}function n(e){return e.replace(/[^0-9-]/g,"")}e.startsWith("(")&&e.endsWith(")")&&(e=e.replace("(","-").replace(")",""));let r=e.match(/[.,][^.,]*$/);if(!r||0===r.index)return t(parseFloat(n(e)));let o=n(e.slice(0,r.index)),i=n(e.slice(r.index+1));return t(parseFloat(o+"."+i))}},6166:function(e,t,n){"use strict";function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},r.apply(this,arguments)}var o;n.d(t,{Ep:function(){return d},J0:function(){return s},LX:function(){return T},RQ:function(){return P},WK:function(){return F},Zn:function(){return I},Zq:function(){return A},aU:function(){return o},cP:function(){return f},fp:function(){return g},lX:function(){return a},pC:function(){return _}}),function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(o||(o={}));const i="popstate";function a(e){return void 0===e&&(e={}),h((function(e,t){let{pathname:n,search:r,hash:o}=e.location;return c("",{pathname:n,search:r,hash:o},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){return"string"===typeof t?t:d(t)}),null,e)}function s(e,t){if(!1===e||null===e||"undefined"===typeof e)throw new Error(t)}function l(e,t){if(!e){"undefined"!==typeof console&&console.warn(t);try{throw new Error(t)}catch(n){}}}function u(e,t){return{usr:e.state,key:e.key,idx:t}}function c(e,t,n,o){return void 0===n&&(n=null),r({pathname:"string"===typeof e?e:e.pathname,search:"",hash:""},"string"===typeof t?f(t):t,{state:n,key:t&&t.key||o||Math.random().toString(36).substr(2,8)})}function d(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&"?"!==n&&(t+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(t+="#"===r.charAt(0)?r:"#"+r),t}function f(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function h(e,t,n,a){void 0===a&&(a={});let{window:l=document.defaultView,v5Compat:f=!1}=a,h=l.history,p=o.Pop,g=null,m=y();function y(){return(h.state||{idx:null}).idx}function v(){p=o.Pop;let e=y(),t=null==e?null:e-m;m=e,g&&g({action:p,location:b.location,delta:t})}function x(e){let t="null"!==l.location.origin?l.location.origin:l.location.href,n="string"===typeof e?e:d(e);return s(t,"No window.location.(origin|href) available to create URL for href: "+n),new URL(n,t)}null==m&&(m=0,h.replaceState(r({},h.state,{idx:m}),""));let b={get action(){return p},get location(){return e(l,h)},listen(e){if(g)throw new Error("A history only accepts one active listener");return l.addEventListener(i,v),g=e,()=>{l.removeEventListener(i,v),g=null}},createHref(e){return t(l,e)},createURL:x,encodeLocation(e){let t=x(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){p=o.Push;let r=c(b.location,e,t);n&&n(r,e),m=y()+1;let i=u(r,m),a=b.createHref(r);try{h.pushState(i,"",a)}catch(s){l.location.assign(a)}f&&g&&g({action:p,location:b.location,delta:1})},replace:function(e,t){p=o.Replace;let r=c(b.location,e,t);n&&n(r,e),m=y();let i=u(r,m),a=b.createHref(r);h.replaceState(i,"",a),f&&g&&g({action:p,location:b.location,delta:0})},go(e){return h.go(e)}};return b}var p;!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(p||(p={}));new Set(["lazy","caseSensitive","path","id","index","children"]);function g(e,t,n){void 0===n&&(n="/");let r=I(("string"===typeof t?f(t):t).pathname||"/",n);if(null==r)return null;let o=m(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let n=e.length===t.length&&e.slice(0,-1).every(((e,n)=>e===t[n]));return n?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(o);let i=null;for(let a=0;null==i&&a<o.length;++a)i=E(o[a],O(r));return i}function m(e,t,n,r){void 0===t&&(t=[]),void 0===n&&(n=[]),void 0===r&&(r="");let o=(e,o,i)=>{let a={relativePath:void 0===i?e.path||"":i,caseSensitive:!0===e.caseSensitive,childrenIndex:o,route:e};a.relativePath.startsWith("/")&&(s(a.relativePath.startsWith(r),'Absolute route path "'+a.relativePath+'" nested under path "'+r+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),a.relativePath=a.relativePath.slice(r.length));let l=P([r,a.relativePath]),u=n.concat(a);e.children&&e.children.length>0&&(s(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+l+'".'),m(e.children,t,u,l)),(null!=e.path||e.index)&&t.push({path:l,score:k(l,e.index),routesMeta:u})};return e.forEach(((e,t)=>{var n;if(""!==e.path&&null!=(n=e.path)&&n.includes("?"))for(let r of y(e.path))o(e,t,r);else o(e,t)})),t}function y(e){let t=e.split("/");if(0===t.length)return[];let[n,...r]=t,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(0===r.length)return o?[i,""]:[i];let a=y(r.join("/")),s=[];return s.push(...a.map((e=>""===e?i:[i,e].join("/")))),o&&s.push(...a),s.map((t=>e.startsWith("/")&&""===t?"/":t))}const v=/^:\w+$/,x=3,b=2,w=1,S=10,C=-2,j=e=>"*"===e;function k(e,t){let n=e.split("/"),r=n.length;return n.some(j)&&(r+=C),t&&(r+=b),n.filter((e=>!j(e))).reduce(((e,t)=>e+(v.test(t)?x:""===t?w:S)),r)}function E(e,t){let{routesMeta:n}=e,r={},o="/",i=[];for(let a=0;a<n.length;++a){let e=n[a],s=a===n.length-1,l="/"===o?t:t.slice(o.length)||"/",u=T({path:e.relativePath,caseSensitive:e.caseSensitive,end:s},l);if(!u)return null;Object.assign(r,u.params);let c=e.route;i.push({params:r,pathname:P([o,u.pathname]),pathnameBase:M(P([o,u.pathnameBase])),route:c}),"/"!==u.pathnameBase&&(o=P([o,u.pathnameBase]))}return i}function T(e,t){"string"===typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=function(e,t,n){void 0===t&&(t=!1);void 0===n&&(n=!0);l("*"===e||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were "'+e.replace(/\*$/,"/*")+'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "'+e.replace(/\*$/,"/*")+'".');let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/\/:(\w+)/g,((e,t)=>(r.push(t),"/([^\\/]+)")));e.endsWith("*")?(r.push("*"),o+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":""!==e&&"/"!==e&&(o+="(?:(?=\\/|$))");let i=new RegExp(o,t?void 0:"i");return[i,r]}(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let i=o[0],a=i.replace(/(.)\/+$/,"$1"),s=o.slice(1);return{params:r.reduce(((e,t,n)=>{if("*"===t){let e=s[n]||"";a=i.slice(0,i.length-e.length).replace(/(.)\/+$/,"$1")}return e[t]=function(e,t){try{return decodeURIComponent(e)}catch(n){return l(!1,'The value for the URL param "'+t+'" will not be decoded because the string "'+e+'" is a malformed URL segment. This is probably due to a bad percent encoding ('+n+")."),e}}(s[n]||"",t),e}),{}),pathname:i,pathnameBase:a,pattern:e}}function O(e){try{return decodeURI(e)}catch(t){return l(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding ('+t+")."),e}}function I(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&"/"!==r?null:e.slice(n)||"/"}function D(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified `to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the `to."+n+'` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.'}function A(e){return e.filter(((e,t)=>0===t||e.route.path&&e.route.path.length>0))}function _(e,t,n,o){let i;void 0===o&&(o=!1),"string"===typeof e?i=f(e):(i=r({},e),s(!i.pathname||!i.pathname.includes("?"),D("?","pathname","search",i)),s(!i.pathname||!i.pathname.includes("#"),D("#","pathname","hash",i)),s(!i.search||!i.search.includes("#"),D("#","search","hash",i)));let a,l=""===e||""===i.pathname,u=l?"/":i.pathname;if(o||null==u)a=n;else{let e=t.length-1;if(u.startsWith("..")){let t=u.split("/");for(;".."===t[0];)t.shift(),e-=1;i.pathname=t.join("/")}a=e>=0?t[e]:"/"}let c=function(e,t){void 0===t&&(t="/");let{pathname:n,search:r="",hash:o=""}="string"===typeof e?f(e):e,i=n?n.startsWith("/")?n:function(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)})),n.length>1?n.join("/"):"/"}(n,t):t;return{pathname:i,search:R(r),hash:N(o)}}(i,a),d=u&&"/"!==u&&u.endsWith("/"),h=(l||"."===u)&&n.endsWith("/");return c.pathname.endsWith("/")||!d&&!h||(c.pathname+="/"),c}const P=e=>e.join("/").replace(/\/\/+/g,"/"),M=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),R=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",N=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";class L extends Error{}function F(e){return null!=e&&"number"===typeof e.status&&"string"===typeof e.statusText&&"boolean"===typeof e.internal&&"data"in e}const W=["post","put","patch","delete"],B=(new Set(W),["get",...W]);new Set(B),new Set([301,302,303,307,308]),new Set([307,308]),"undefined"!==typeof window&&"undefined"!==typeof window.document&&window.document.createElement;Symbol("deferred")},9423:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,i.default)(e)};var r,o=n(8087),i=(r=o)&&r.__esModule?r:{default:r};e.exports=t.default},5685:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return"string"===typeof e&&n.test(e)};var n=/-webkit-|-moz-|-ms-/;e.exports=t.default},2393:function(e,t,n){"use strict";n.d(t,{Z:function(){return p}});var r={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},o=function(e,t,n){var o,i=r[e];return o="string"===typeof i?i:1===t?i.one:i.other.replace("{{count}}",t.toString()),null!==n&&void 0!==n&&n.addSuffix?n.comparison&&n.comparison>0?"in "+o:o+" ago":o};function i(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var a={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"})},s={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},l=function(e,t,n,r){return s[e]};function u(e){return function(t,n){var r;if("formatting"===(null!==n&&void 0!==n&&n.context?String(n.context):"standalone")&&e.formattingValues){var o=e.defaultFormattingWidth||e.defaultWidth,i=null!==n&&void 0!==n&&n.width?String(n.width):o;r=e.formattingValues[i]||e.formattingValues[o]}else{var a=e.defaultWidth,s=null!==n&&void 0!==n&&n.width?String(n.width):e.defaultWidth;r=e.values[s]||e.values[a]}return r[e.argumentCallback?e.argumentCallback(t):t]}}var c={ordinalNumber:function(e,t){var n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:u({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:u({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:u({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:u({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:u({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})};function d(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(o);if(!i)return null;var a,s=i[0],l=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],u=Array.isArray(l)?function(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n;return}(l,(function(e){return e.test(s)})):function(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n;return}(l,(function(e){return e.test(s)}));return a=e.valueCallback?e.valueCallback(u):u,{value:a=n.valueCallback?n.valueCallback(a):a,rest:t.slice(s.length)}}}var f,h={ordinalNumber:(f={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.match(f.matchPattern);if(!n)return null;var r=n[0],o=e.match(f.parsePattern);if(!o)return null;var i=f.valueCallback?f.valueCallback(o[0]):o[0];return{value:i=t.valueCallback?t.valueCallback(i):i,rest:e.slice(r.length)}}),era:d({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:d({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:d({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:d({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:d({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"})},p={code:"en-US",formatDistance:o,formatLong:a,formatRelative:l,localize:c,match:h,options:{weekStartsOn:0,firstWeekContainsDate:1}}},643:function(e,t,n){"use strict";n.d(t,{j:function(){return o}});var r={};function o(){return r}},3387:function(e,t){"use strict";var n=function(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},r=function(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},o={p:r,P:function(e,t){var o,i=e.match(/(P+)(p+)?/)||[],a=i[1],s=i[2];if(!s)return n(e,t);switch(a){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;default:o=t.dateTime({width:"full"})}return o.replace("{{date}}",n(a,t)).replace("{{time}}",r(s,t))}};t.Z=o},8919:function(e,t,n){"use strict";function r(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}n.d(t,{Z:function(){return r}})},4394:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(9375),o=n(359),i=n(7688),a=n(8116);var s=6048e5;function l(e){(0,a.Z)(1,arguments);var t=(0,r.Z)(e),n=(0,o.Z)(t).getTime()-function(e){(0,a.Z)(1,arguments);var t=(0,i.Z)(e),n=new Date(0);return n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0),(0,o.Z)(n)}(t).getTime();return Math.round(n/s)+1}},7688:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(9375),o=n(8116),i=n(359);function a(e){(0,o.Z)(1,arguments);var t=(0,r.Z)(e),n=t.getUTCFullYear(),a=new Date(0);a.setUTCFullYear(n+1,0,4),a.setUTCHours(0,0,0,0);var s=(0,i.Z)(a),l=new Date(0);l.setUTCFullYear(n,0,4),l.setUTCHours(0,0,0,0);var u=(0,i.Z)(l);return t.getTime()>=s.getTime()?n+1:t.getTime()>=u.getTime()?n:n-1}},6088:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(9375),o=n(7561),i=n(5717),a=n(8116),s=n(9398),l=n(643);var u=6048e5;function c(e,t){(0,a.Z)(1,arguments);var n=(0,r.Z)(e),c=(0,o.Z)(n,t).getTime()-function(e,t){var n,r,u,c,d,f,h,p;(0,a.Z)(1,arguments);var g=(0,l.j)(),m=(0,s.Z)(null!==(n=null!==(r=null!==(u=null!==(c=null===t||void 0===t?void 0:t.firstWeekContainsDate)&&void 0!==c?c:null===t||void 0===t||null===(d=t.locale)||void 0===d||null===(f=d.options)||void 0===f?void 0:f.firstWeekContainsDate)&&void 0!==u?u:g.firstWeekContainsDate)&&void 0!==r?r:null===(h=g.locale)||void 0===h||null===(p=h.options)||void 0===p?void 0:p.firstWeekContainsDate)&&void 0!==n?n:1),y=(0,i.Z)(e,t),v=new Date(0);return v.setUTCFullYear(y,0,m),v.setUTCHours(0,0,0,0),(0,o.Z)(v,t)}(n,t).getTime();return Math.round(c/u)+1}},5717:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(9375),o=n(8116),i=n(7561),a=n(9398),s=n(643);function l(e,t){var n,l,u,c,d,f,h,p;(0,o.Z)(1,arguments);var g=(0,r.Z)(e),m=g.getUTCFullYear(),y=(0,s.j)(),v=(0,a.Z)(null!==(n=null!==(l=null!==(u=null!==(c=null===t||void 0===t?void 0:t.firstWeekContainsDate)&&void 0!==c?c:null===t||void 0===t||null===(d=t.locale)||void 0===d||null===(f=d.options)||void 0===f?void 0:f.firstWeekContainsDate)&&void 0!==u?u:y.firstWeekContainsDate)&&void 0!==l?l:null===(h=y.locale)||void 0===h||null===(p=h.options)||void 0===p?void 0:p.firstWeekContainsDate)&&void 0!==n?n:1);if(!(v>=1&&v<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var x=new Date(0);x.setUTCFullYear(m+1,0,v),x.setUTCHours(0,0,0,0);var b=(0,i.Z)(x,t),w=new Date(0);w.setUTCFullYear(m,0,v),w.setUTCHours(0,0,0,0);var S=(0,i.Z)(w,t);return g.getTime()>=b.getTime()?m+1:g.getTime()>=S.getTime()?m:m-1}},2706:function(e,t,n){"use strict";n.d(t,{Do:function(){return a},Iu:function(){return i},qp:function(){return s}});var r=["D","DD"],o=["YY","YYYY"];function i(e){return-1!==r.indexOf(e)}function a(e){return-1!==o.indexOf(e)}function s(e,t,n){if("YYYY"===e)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===e)throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===e)throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===e)throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}},8116:function(e,t,n){"use strict";function r(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}n.d(t,{Z:function(){return r}})},359:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(9375),o=n(8116);function i(e){(0,o.Z)(1,arguments);var t=(0,r.Z)(e),n=t.getUTCDay(),i=(n<1?7:0)+n-1;return t.setUTCDate(t.getUTCDate()-i),t.setUTCHours(0,0,0,0),t}},7561:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(9375),o=n(8116),i=n(9398),a=n(643);function s(e,t){var n,s,l,u,c,d,f,h;(0,o.Z)(1,arguments);var p=(0,a.j)(),g=(0,i.Z)(null!==(n=null!==(s=null!==(l=null!==(u=null===t||void 0===t?void 0:t.weekStartsOn)&&void 0!==u?u:null===t||void 0===t||null===(c=t.locale)||void 0===c||null===(d=c.options)||void 0===d?void 0:d.weekStartsOn)&&void 0!==l?l:p.weekStartsOn)&&void 0!==s?s:null===(f=p.locale)||void 0===f||null===(h=f.options)||void 0===h?void 0:h.weekStartsOn)&&void 0!==n?n:0);if(!(g>=0&&g<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var m=(0,r.Z)(e),y=m.getUTCDay(),v=(y<g?7:0)+y-g;return m.setUTCDate(m.getUTCDate()-v),m.setUTCHours(0,0,0,0),m}},9398:function(e,t,n){"use strict";function r(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)}n.d(t,{Z:function(){return r}})},8756:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(9398),o=n(9375),i=n(8116);function a(e,t){(0,i.Z)(2,arguments);var n=(0,o.Z)(e),a=(0,r.Z)(t);return isNaN(a)?new Date(NaN):a?(n.setDate(n.getDate()+a),n):n}},1722:function(e,t,n){"use strict";n.d(t,{qk:function(){return i},vh:function(){return o},yJ:function(){return r}});Math.pow(10,8);var r=6e4,o=36e5,i=1e3},5249:function(e,t,n){"use strict";n.d(t,{Z:function(){return R}});var r=n(8664),o=n(1898),i=n(9375),a=n(8116);var s=n(4394),l=n(7688),u=n(6088),c=n(5717);function d(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length<t;)r="0"+r;return n+r}var f={y:function(e,t){var n=e.getUTCFullYear(),r=n>0?n:1-n;return d("yy"===t?r%100:r,t.length)},M:function(e,t){var n=e.getUTCMonth();return"M"===t?String(n+1):d(n+1,2)},d:function(e,t){return d(e.getUTCDate(),t.length)},a:function(e,t){var n=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:function(e,t){return d(e.getUTCHours()%12||12,t.length)},H:function(e,t){return d(e.getUTCHours(),t.length)},m:function(e,t){return d(e.getUTCMinutes(),t.length)},s:function(e,t){return d(e.getUTCSeconds(),t.length)},S:function(e,t){var n=t.length,r=e.getUTCMilliseconds();return d(Math.floor(r*Math.pow(10,n-3)),t.length)}},h="midnight",p="noon",g="morning",m="afternoon",y="evening",v="night",x={G:function(e,t,n){var r=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if("yo"===t){var r=e.getUTCFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return f.y(e,t)},Y:function(e,t,n,r){var o=(0,c.Z)(e,r),i=o>0?o:1-o;return"YY"===t?d(i%100,2):"Yo"===t?n.ordinalNumber(i,{unit:"year"}):d(i,t.length)},R:function(e,t){return d((0,l.Z)(e),t.length)},u:function(e,t){return d(e.getUTCFullYear(),t.length)},Q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return d(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return d(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){var r=e.getUTCMonth();switch(t){case"M":case"MM":return f.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){var r=e.getUTCMonth();switch(t){case"L":return String(r+1);case"LL":return d(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){var o=(0,u.Z)(e,r);return"wo"===t?n.ordinalNumber(o,{unit:"week"}):d(o,t.length)},I:function(e,t,n){var r=(0,s.Z)(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):d(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):f.d(e,t)},D:function(e,t,n){var r=function(e){(0,a.Z)(1,arguments);var t=(0,i.Z)(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var r=n-t.getTime();return Math.floor(r/864e5)+1}(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):d(r,t.length)},E:function(e,t,n){var r=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){var o=e.getUTCDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return d(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){var o=e.getUTCDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return d(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){var r=e.getUTCDay(),o=0===r?7:r;switch(t){case"i":return String(o);case"ii":return d(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){var r=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){var r,o=e.getUTCHours();switch(r=12===o?p:0===o?h:o/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){var r,o=e.getUTCHours();switch(r=o>=17?y:o>=12?m:o>=4?g:v,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){var r=e.getUTCHours()%12;return 0===r&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return f.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):f.H(e,t)},K:function(e,t,n){var r=e.getUTCHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):d(r,t.length)},k:function(e,t,n){var r=e.getUTCHours();return 0===r&&(r=24),"ko"===t?n.ordinalNumber(r,{unit:"hour"}):d(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):f.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):f.s(e,t)},S:function(e,t){return f.S(e,t)},X:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();if(0===o)return"Z";switch(t){case"X":return w(o);case"XXXX":case"XX":return S(o);default:return S(o,":")}},x:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"x":return w(o);case"xxxx":case"xx":return S(o);default:return S(o,":")}},O:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+b(o,":");default:return"GMT"+S(o,":")}},z:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+b(o,":");default:return"GMT"+S(o,":")}},t:function(e,t,n,r){var o=r._originalDate||e;return d(Math.floor(o.getTime()/1e3),t.length)},T:function(e,t,n,r){return d((r._originalDate||e).getTime(),t.length)}};function b(e,t){var n=e>0?"-":"+",r=Math.abs(e),o=Math.floor(r/60),i=r%60;if(0===i)return n+String(o);var a=t||"";return n+String(o)+a+d(i,2)}function w(e,t){return e%60===0?(e>0?"-":"+")+d(Math.abs(e)/60,2):S(e,t)}function S(e,t){var n=t||"",r=e>0?"-":"+",o=Math.abs(e);return r+d(Math.floor(o/60),2)+n+d(o%60,2)}var C=x,j=n(3387),k=n(8919),E=n(2706),T=n(9398),O=n(643),I=n(2393),D=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,A=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,_=/^'([^]*?)'?$/,P=/''/g,M=/[a-zA-Z]/;function R(e,t,n){var s,l,u,c,d,f,h,p,g,m,y,v,x,b,w,S,R,N;(0,a.Z)(2,arguments);var L=String(t),F=(0,O.j)(),W=null!==(s=null!==(l=null===n||void 0===n?void 0:n.locale)&&void 0!==l?l:F.locale)&&void 0!==s?s:I.Z,B=(0,T.Z)(null!==(u=null!==(c=null!==(d=null!==(f=null===n||void 0===n?void 0:n.firstWeekContainsDate)&&void 0!==f?f:null===n||void 0===n||null===(h=n.locale)||void 0===h||null===(p=h.options)||void 0===p?void 0:p.firstWeekContainsDate)&&void 0!==d?d:F.firstWeekContainsDate)&&void 0!==c?c:null===(g=F.locale)||void 0===g||null===(m=g.options)||void 0===m?void 0:m.firstWeekContainsDate)&&void 0!==u?u:1);if(!(B>=1&&B<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var z=(0,T.Z)(null!==(y=null!==(v=null!==(x=null!==(b=null===n||void 0===n?void 0:n.weekStartsOn)&&void 0!==b?b:null===n||void 0===n||null===(w=n.locale)||void 0===w||null===(S=w.options)||void 0===S?void 0:S.weekStartsOn)&&void 0!==x?x:F.weekStartsOn)&&void 0!==v?v:null===(R=F.locale)||void 0===R||null===(N=R.options)||void 0===N?void 0:N.weekStartsOn)&&void 0!==y?y:0);if(!(z>=0&&z<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!W.localize)throw new RangeError("locale must contain localize property");if(!W.formatLong)throw new RangeError("locale must contain formatLong property");var G=(0,i.Z)(e);if(!(0,r.Z)(G))throw new RangeError("Invalid time value");var Z=(0,k.Z)(G),U=(0,o.Z)(G,Z),H={firstWeekContainsDate:B,weekStartsOn:z,locale:W,_originalDate:G};return L.match(A).map((function(e){var t=e[0];return"p"===t||"P"===t?(0,j.Z[t])(e,W.formatLong):e})).join("").match(D).map((function(r){if("''"===r)return"'";var o=r[0];if("'"===o)return function(e){var t=e.match(_);if(!t)return e;return t[1].replace(P,"'")}(r);var i=C[o];if(i)return null!==n&&void 0!==n&&n.useAdditionalWeekYearTokens||!(0,E.Do)(r)||(0,E.qp)(r,t,String(e)),null!==n&&void 0!==n&&n.useAdditionalDayOfYearTokens||!(0,E.Iu)(r)||(0,E.qp)(r,t,String(e)),i(U,r,W.localize,H);if(o.match(M))throw new RangeError("Format string contains an unescaped latin alphabet character `"+o+"`");return r})).join("")}},8664:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(6522),o=n(8116);var i=n(9375);function a(e){if((0,o.Z)(1,arguments),!function(e){return(0,o.Z)(1,arguments),e instanceof Date||"object"===(0,r.Z)(e)&&"[object Date]"===Object.prototype.toString.call(e)}(e)&&"number"!==typeof e)return!1;var t=(0,i.Z)(e);return!isNaN(Number(t))}},3189:function(e,t,n){"use strict";n.d(t,{Z:function(){return Fe}});var r=n(6522);function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function i(e,t){var n="undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"===typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}}(e))||t&&e&&"number"===typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){l=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(l)throw a}}}}var a=n(2393),s=n(1898),l=n(9375);function u(e,t){if(null==e)throw new TypeError("assign requires that input parameter not be null or undefined");for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}var c=n(3387),d=n(8919),f=n(2706),h=n(9398),p=n(8116),g=n(753),m=n(8960);function y(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&(0,m.Z)(e,t)}function v(e){return v=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},v(e)}function x(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=v(e);if(t){var i=v(this).constructor;n=Reflect.construct(o,arguments,i)}else n=o.apply(this,arguments);return function(e,t){if(t&&("object"===(0,r.Z)(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return(0,g.Z)(e)}(this,n)}}function b(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var w=n(5850);function S(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(0,w.Z)(r.key),r)}}function C(e,t,n){return t&&S(e.prototype,t),n&&S(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}var j=n(6666),k=function(){function e(){b(this,e),(0,j.Z)(this,"priority",void 0),(0,j.Z)(this,"subPriority",0)}return C(e,[{key:"validate",value:function(e,t){return!0}}]),e}(),E=function(e){y(n,e);var t=x(n);function n(e,r,o,i,a){var s;return b(this,n),(s=t.call(this)).value=e,s.validateValue=r,s.setValue=o,s.priority=i,a&&(s.subPriority=a),s}return C(n,[{key:"validate",value:function(e,t){return this.validateValue(e,this.value,t)}},{key:"set",value:function(e,t,n){return this.setValue(e,t,this.value,n)}}]),n}(k),T=function(e){y(n,e);var t=x(n);function n(){var e;b(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),(0,j.Z)((0,g.Z)(e),"priority",10),(0,j.Z)((0,g.Z)(e),"subPriority",-1),e}return C(n,[{key:"set",value:function(e,t){if(t.timestampIsSet)return e;var n=new Date(0);return n.setFullYear(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()),n.setHours(e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()),n}}]),n}(k),O=function(){function e(){b(this,e),(0,j.Z)(this,"incompatibleTokens",void 0),(0,j.Z)(this,"priority",void 0),(0,j.Z)(this,"subPriority",void 0)}return C(e,[{key:"run",value:function(e,t,n,r){var o=this.parse(e,t,n,r);return o?{setter:new E(o.value,this.validate,this.set,this.priority,this.subPriority),rest:o.rest}:null}},{key:"validate",value:function(e,t,n){return!0}}]),e}(),I=function(e){y(n,e);var t=x(n);function n(){var e;b(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),(0,j.Z)((0,g.Z)(e),"priority",140),(0,j.Z)((0,g.Z)(e),"incompatibleTokens",["R","u","t","T"]),e}return C(n,[{key:"parse",value:function(e,t,n){switch(t){case"G":case"GG":case"GGG":return n.era(e,{width:"abbreviated"})||n.era(e,{width:"narrow"});case"GGGGG":return n.era(e,{width:"narrow"});default:return n.era(e,{width:"wide"})||n.era(e,{width:"abbreviated"})||n.era(e,{width:"narrow"})}}},{key:"set",value:function(e,t,n){return t.era=n,e.setUTCFullYear(n,0,1),e.setUTCHours(0,0,0,0),e}}]),n}(O),D=n(1722),A={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},_=/^([+-])(\d{2})(\d{2})?|Z/,P=/^([+-])(\d{2})(\d{2})|Z/,M=/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,R=/^([+-])(\d{2}):(\d{2})|Z/,N=/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/;function L(e,t){return e?{value:t(e.value),rest:e.rest}:e}function F(e,t){var n=t.match(e);return n?{value:parseInt(n[0],10),rest:t.slice(n[0].length)}:null}function W(e,t){var n=t.match(e);if(!n)return null;if("Z"===n[0])return{value:0,rest:t.slice(1)};var r="+"===n[1]?1:-1,o=n[2]?parseInt(n[2],10):0,i=n[3]?parseInt(n[3],10):0,a=n[5]?parseInt(n[5],10):0;return{value:r*(o*D.vh+i*D.yJ+a*D.qk),rest:t.slice(n[0].length)}}function B(e){return F(A.anyDigitsSigned,e)}function z(e,t){switch(e){case 1:return F(A.singleDigit,t);case 2:return F(A.twoDigits,t);case 3:return F(A.threeDigits,t);case 4:return F(A.fourDigits,t);default:return F(new RegExp("^\\d{1,"+e+"}"),t)}}function G(e,t){switch(e){case 1:return F(A.singleDigitSigned,t);case 2:return F(A.twoDigitsSigned,t);case 3:return F(A.threeDigitsSigned,t);case 4:return F(A.fourDigitsSigned,t);default:return F(new RegExp("^-?\\d{1,"+e+"}"),t)}}function Z(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function U(e,t){var n,r=t>0,o=r?t:1-t;if(o<=50)n=e||100;else{var i=o+50;n=e+100*Math.floor(i/100)-(e>=i%100?100:0)}return r?n:1-n}function H(e){return e%400===0||e%4===0&&e%100!==0}var K=function(e){y(n,e);var t=x(n);function n(){var e;b(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),(0,j.Z)((0,g.Z)(e),"priority",130),(0,j.Z)((0,g.Z)(e),"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"]),e}return C(n,[{key:"parse",value:function(e,t,n){var r=function(e){return{year:e,isTwoDigitYear:"yy"===t}};switch(t){case"y":return L(z(4,e),r);case"yo":return L(n.ordinalNumber(e,{unit:"year"}),r);default:return L(z(t.length,e),r)}}},{key:"validate",value:function(e,t){return t.isTwoDigitYear||t.year>0}},{key:"set",value:function(e,t,n){var r=e.getUTCFullYear();if(n.isTwoDigitYear){var o=U(n.year,r);return e.setUTCFullYear(o,0,1),e.setUTCHours(0,0,0,0),e}var i="era"in t&&1!==t.era?1-n.year:n.year;return e.setUTCFullYear(i,0,1),e.setUTCHours(0,0,0,0),e}}]),n}(O),V=n(5717),q=n(7561),$=function(e){y(n,e);var t=x(n);function n(){var e;b(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),(0,j.Z)((0,g.Z)(e),"priority",130),(0,j.Z)((0,g.Z)(e),"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"]),e}return C(n,[{key:"parse",value:function(e,t,n){var r=function(e){return{year:e,isTwoDigitYear:"YY"===t}};switch(t){case"Y":return L(z(4,e),r);case"Yo":return L(n.ordinalNumber(e,{unit:"year"}),r);default:return L(z(t.length,e),r)}}},{key:"validate",value:function(e,t){return t.isTwoDigitYear||t.year>0}},{key:"set",value:function(e,t,n,r){var o=(0,V.Z)(e,r);if(n.isTwoDigitYear){var i=U(n.year,o);return e.setUTCFullYear(i,0,r.firstWeekContainsDate),e.setUTCHours(0,0,0,0),(0,q.Z)(e,r)}var a="era"in t&&1!==t.era?1-n.year:n.year;return e.setUTCFullYear(a,0,r.firstWeekContainsDate),e.setUTCHours(0,0,0,0),(0,q.Z)(e,r)}}]),n}(O),Y=n(359),Q=function(e){y(n,e);var t=x(n);function n(){var e;b(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),(0,j.Z)((0,g.Z)(e),"priority",130),(0,j.Z)((0,g.Z)(e),"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]),e}return C(n,[{key:"parse",value:function(e,t){return G("R"===t?4:t.length,e)}},{key:"set",value:function(e,t,n){var r=new Date(0);return r.setUTCFullYear(n,0,4),r.setUTCHours(0,0,0,0),(0,Y.Z)(r)}}]),n}(O),X=function(e){y(n,e);var t=x(n);function n(){var e;b(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),(0,j.Z)((0,g.Z)(e),"priority",130),(0,j.Z)((0,g.Z)(e),"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"]),e}return C(n,[{key:"parse",value:function(e,t){return G("u"===t?4:t.length,e)}},{key:"set",value:function(e,t,n){return e.setUTCFullYear(n,0,1),e.setUTCHours(0,0,0,0),e}}]),n}(O),J=function(e){y(n,e);var t=x(n);function n(){var e;b(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),(0,j.Z)((0,g.Z)(e),"priority",120),(0,j.Z)((0,g.Z)(e),"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]),e}return C(n,[{key:"parse",value:function(e,t,n){switch(t){case"Q":case"QQ":return z(t.length,e);case"Qo":return n.ordinalNumber(e,{unit:"quarter"});case"QQQ":return n.quarter(e,{width:"abbreviated",context:"formatting"})||n.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return n.quarter(e,{width:"narrow",context:"formatting"});default:return n.quarter(e,{width:"wide",context:"formatting"})||n.quarter(e,{width:"abbreviated",context:"formatting"})||n.quarter(e,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(e,t){return t>=1&&t<=4}},{key:"set",value:function(e,t,n){return e.setUTCMonth(3*(n-1),1),e.setUTCHours(0,0,0,0),e}}]),n}(O),ee=function(e){y(n,e);var t=x(n);function n(){var e;b(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),(0,j.Z)((0,g.Z)(e),"priority",120),(0,j.Z)((0,g.Z)(e),"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]),e}return C(n,[{key:"parse",value:function(e,t,n){switch(t){case"q":case"qq":return z(t.length,e);case"qo":return n.ordinalNumber(e,{unit:"quarter"});case"qqq":return n.quarter(e,{width:"abbreviated",context:"standalone"})||n.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return n.quarter(e,{width:"narrow",context:"standalone"});default:return n.quarter(e,{width:"wide",context:"standalone"})||n.quarter(e,{width:"abbreviated",context:"standalone"})||n.quarter(e,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(e,t){return t>=1&&t<=4}},{key:"set",value:function(e,t,n){return e.setUTCMonth(3*(n-1),1),e.setUTCHours(0,0,0,0),e}}]),n}(O),te=function(e){y(n,e);var t=x(n);function n(){var e;b(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),(0,j.Z)((0,g.Z)(e),"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]),(0,j.Z)((0,g.Z)(e),"priority",110),e}return C(n,[{key:"parse",value:function(e,t,n){var r=function(e){return e-1};switch(t){case"M":return L(F(A.month,e),r);case"MM":return L(z(2,e),r);case"Mo":return L(n.ordinalNumber(e,{unit:"month"}),r);case"MMM":return n.month(e,{width:"abbreviated",context:"formatting"})||n.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return n.month(e,{width:"narrow",context:"formatting"});default:return n.month(e,{width:"wide",context:"formatting"})||n.month(e,{width:"abbreviated",context:"formatting"})||n.month(e,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(e,t){return t>=0&&t<=11}},{key:"set",value:function(e,t,n){return e.setUTCMonth(n,1),e.setUTCHours(0,0,0,0),e}}]),n}(O),ne=function(e){y(n,e);var t=x(n);function n(){var e;b(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),(0,j.Z)((0,g.Z)(e),"priority",110),(0,j.Z)((0,g.Z)(e),"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]),e}return C(n,[{key:"parse",value:function(e,t,n){var r=function(e){return e-1};switch(t){case"L":return L(F(A.month,e),r);case"LL":return L(z(2,e),r);case"Lo":return L(n.ordinalNumber(e,{unit:"month"}),r);case"LLL":return n.month(e,{width:"abbreviated",context:"standalone"})||n.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return n.month(e,{width:"narrow",context:"standalone"});default:return n.month(e,{width:"wide",context:"standalone"})||n.month(e,{width:"abbreviated",context:"standalone"})||n.month(e,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(e,t){return t>=0&&t<=11}},{key:"set",value:function(e,t,n){return e.setUTCMonth(n,1),e.setUTCHours(0,0,0,0),e}}]),n}(O),re=n(6088);var oe=function(e){y(n,e);var t=x(n);function n(){var e;b(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),(0,j.Z)((0,g.Z)(e),"priority",100),(0,j.Z)((0,g.Z)(e),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"]),e}return C(n,[{key:"parse",value:function(e,t,n){switch(t){case"w":return F(A.week,e);case"wo":return n.ordinalNumber(e,{unit:"week"});default:return z(t.length,e)}}},{key:"validate",value:function(e,t){return t>=1&&t<=53}},{key:"set",value:function(e,t,n,r){return(0,q.Z)(function(e,t,n){(0,p.Z)(2,arguments);var r=(0,l.Z)(e),o=(0,h.Z)(t),i=(0,re.Z)(r,n)-o;return r.setUTCDate(r.getUTCDate()-7*i),r}(e,n,r),r)}}]),n}(O),ie=n(4394);var ae=function(e){y(n,e);var t=x(n);function n(){var e;b(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),(0,j.Z)((0,g.Z)(e),"priority",100),(0,j.Z)((0,g.Z)(e),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]),e}return C(n,[{key:"parse",value:function(e,t,n){switch(t){case"I":return F(A.week,e);case"Io":return n.ordinalNumber(e,{unit:"week"});default:return z(t.length,e)}}},{key:"validate",value:function(e,t){return t>=1&&t<=53}},{key:"set",value:function(e,t,n){return(0,Y.Z)(function(e,t){(0,p.Z)(2,arguments);var n=(0,l.Z)(e),r=(0,h.Z)(t),o=(0,ie.Z)(n)-r;return n.setUTCDate(n.getUTCDate()-7*o),n}(e,n))}}]),n}(O),se=[31,28,31,30,31,30,31,31,30,31,30,31],le=[31,29,31,30,31,30,31,31,30,31,30,31],ue=function(e){y(n,e);var t=x(n);function n(){var e;b(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),(0,j.Z)((0,g.Z)(e),"priority",90),(0,j.Z)((0,g.Z)(e),"subPriority",1),(0,j.Z)((0,g.Z)(e),"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"]),e}return C(n,[{key:"parse",value:function(e,t,n){switch(t){case"d":return F(A.date,e);case"do":return n.ordinalNumber(e,{unit:"date"});default:return z(t.length,e)}}},{key:"validate",value:function(e,t){var n=H(e.getUTCFullYear()),r=e.getUTCMonth();return n?t>=1&&t<=le[r]:t>=1&&t<=se[r]}},{key:"set",value:function(e,t,n){return e.setUTCDate(n),e.setUTCHours(0,0,0,0),e}}]),n}(O),ce=function(e){y(n,e);var t=x(n);function n(){var e;b(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),(0,j.Z)((0,g.Z)(e),"priority",90),(0,j.Z)((0,g.Z)(e),"subpriority",1),(0,j.Z)((0,g.Z)(e),"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]),e}return C(n,[{key:"parse",value:function(e,t,n){switch(t){case"D":case"DD":return F(A.dayOfYear,e);case"Do":return n.ordinalNumber(e,{unit:"date"});default:return z(t.length,e)}}},{key:"validate",value:function(e,t){return H(e.getUTCFullYear())?t>=1&&t<=366:t>=1&&t<=365}},{key:"set",value:function(e,t,n){return e.setUTCMonth(0,n),e.setUTCHours(0,0,0,0),e}}]),n}(O),de=n(643);function fe(e,t,n){var r,o,i,a,s,u,c,d;(0,p.Z)(2,arguments);var f=(0,de.j)(),g=(0,h.Z)(null!==(r=null!==(o=null!==(i=null!==(a=null===n||void 0===n?void 0:n.weekStartsOn)&&void 0!==a?a:null===n||void 0===n||null===(s=n.locale)||void 0===s||null===(u=s.options)||void 0===u?void 0:u.weekStartsOn)&&void 0!==i?i:f.weekStartsOn)&&void 0!==o?o:null===(c=f.locale)||void 0===c||null===(d=c.options)||void 0===d?void 0:d.weekStartsOn)&&void 0!==r?r:0);if(!(g>=0&&g<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var m=(0,l.Z)(e),y=(0,h.Z)(t),v=((y%7+7)%7<g?7:0)+y-m.getUTCDay();return m.setUTCDate(m.getUTCDate()+v),m}var he=function(e){y(n,e);var t=x(n);function n(){var e;b(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),(0,j.Z)((0,g.Z)(e),"priority",90),(0,j.Z)((0,g.Z)(e),"incompatibleTokens",["D","i","e","c","t","T"]),e}return C(n,[{key:"parse",value:function(e,t,n){switch(t){case"E":case"EE":case"EEE":return n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return n.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});default:return n.day(e,{width:"wide",context:"formatting"})||n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(e,t){return t>=0&&t<=6}},{key:"set",value:function(e,t,n,r){return(e=fe(e,n,r)).setUTCHours(0,0,0,0),e}}]),n}(O),pe=function(e){y(n,e);var t=x(n);function n(){var e;b(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),(0,j.Z)((0,g.Z)(e),"priority",90),(0,j.Z)((0,g.Z)(e),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]),e}return C(n,[{key:"parse",value:function(e,t,n,r){var o=function(e){var t=7*Math.floor((e-1)/7);return(e+r.weekStartsOn+6)%7+t};switch(t){case"e":case"ee":return L(z(t.length,e),o);case"eo":return L(n.ordinalNumber(e,{unit:"day"}),o);case"eee":return n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});case"eeeee":return n.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});default:return n.day(e,{width:"wide",context:"formatting"})||n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(e,t){return t>=0&&t<=6}},{key:"set",value:function(e,t,n,r){return(e=fe(e,n,r)).setUTCHours(0,0,0,0),e}}]),n}(O),ge=function(e){y(n,e);var t=x(n);function n(){var e;b(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),(0,j.Z)((0,g.Z)(e),"priority",90),(0,j.Z)((0,g.Z)(e),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]),e}return C(n,[{key:"parse",value:function(e,t,n,r){var o=function(e){var t=7*Math.floor((e-1)/7);return(e+r.weekStartsOn+6)%7+t};switch(t){case"c":case"cc":return L(z(t.length,e),o);case"co":return L(n.ordinalNumber(e,{unit:"day"}),o);case"ccc":return n.day(e,{width:"abbreviated",context:"standalone"})||n.day(e,{width:"short",context:"standalone"})||n.day(e,{width:"narrow",context:"standalone"});case"ccccc":return n.day(e,{width:"narrow",context:"standalone"});case"cccccc":return n.day(e,{width:"short",context:"standalone"})||n.day(e,{width:"narrow",context:"standalone"});default:return n.day(e,{width:"wide",context:"standalone"})||n.day(e,{width:"abbreviated",context:"standalone"})||n.day(e,{width:"short",context:"standalone"})||n.day(e,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(e,t){return t>=0&&t<=6}},{key:"set",value:function(e,t,n,r){return(e=fe(e,n,r)).setUTCHours(0,0,0,0),e}}]),n}(O);var me=function(e){y(n,e);var t=x(n);function n(){var e;b(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),(0,j.Z)((0,g.Z)(e),"priority",90),(0,j.Z)((0,g.Z)(e),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]),e}return C(n,[{key:"parse",value:function(e,t,n){var r=function(e){return 0===e?7:e};switch(t){case"i":case"ii":return z(t.length,e);case"io":return n.ordinalNumber(e,{unit:"day"});case"iii":return L(n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"}),r);case"iiiii":return L(n.day(e,{width:"narrow",context:"formatting"}),r);case"iiiiii":return L(n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"}),r);default:return L(n.day(e,{width:"wide",context:"formatting"})||n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"}),r)}}},{key:"validate",value:function(e,t){return t>=1&&t<=7}},{key:"set",value:function(e,t,n){return e=function(e,t){(0,p.Z)(2,arguments);var n=(0,h.Z)(t);n%7===0&&(n-=7);var r=(0,l.Z)(e),o=((n%7+7)%7<1?7:0)+n-r.getUTCDay();return r.setUTCDate(r.getUTCDate()+o),r}(e,n),e.setUTCHours(0,0,0,0),e}}]),n}(O),ye=function(e){y(n,e);var t=x(n);function n(){var e;b(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),(0,j.Z)((0,g.Z)(e),"priority",80),(0,j.Z)((0,g.Z)(e),"incompatibleTokens",["b","B","H","k","t","T"]),e}return C(n,[{key:"parse",value:function(e,t,n){switch(t){case"a":case"aa":case"aaa":return n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return n.dayPeriod(e,{width:"narrow",context:"formatting"});default:return n.dayPeriod(e,{width:"wide",context:"formatting"})||n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(e,t,n){return e.setUTCHours(Z(n),0,0,0),e}}]),n}(O),ve=function(e){y(n,e);var t=x(n);function n(){var e;b(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),(0,j.Z)((0,g.Z)(e),"priority",80),(0,j.Z)((0,g.Z)(e),"incompatibleTokens",["a","B","H","k","t","T"]),e}return C(n,[{key:"parse",value:function(e,t,n){switch(t){case"b":case"bb":case"bbb":return n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return n.dayPeriod(e,{width:"narrow",context:"formatting"});default:return n.dayPeriod(e,{width:"wide",context:"formatting"})||n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(e,t,n){return e.setUTCHours(Z(n),0,0,0),e}}]),n}(O),xe=function(e){y(n,e);var t=x(n);function n(){var e;b(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),(0,j.Z)((0,g.Z)(e),"priority",80),(0,j.Z)((0,g.Z)(e),"incompatibleTokens",["a","b","t","T"]),e}return C(n,[{key:"parse",value:function(e,t,n){switch(t){case"B":case"BB":case"BBB":return n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return n.dayPeriod(e,{width:"narrow",context:"formatting"});default:return n.dayPeriod(e,{width:"wide",context:"formatting"})||n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(e,t,n){return e.setUTCHours(Z(n),0,0,0),e}}]),n}(O),be=function(e){y(n,e);var t=x(n);function n(){var e;b(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),(0,j.Z)((0,g.Z)(e),"priority",70),(0,j.Z)((0,g.Z)(e),"incompatibleTokens",["H","K","k","t","T"]),e}return C(n,[{key:"parse",value:function(e,t,n){switch(t){case"h":return F(A.hour12h,e);case"ho":return n.ordinalNumber(e,{unit:"hour"});default:return z(t.length,e)}}},{key:"validate",value:function(e,t){return t>=1&&t<=12}},{key:"set",value:function(e,t,n){var r=e.getUTCHours()>=12;return r&&n<12?e.setUTCHours(n+12,0,0,0):r||12!==n?e.setUTCHours(n,0,0,0):e.setUTCHours(0,0,0,0),e}}]),n}(O),we=function(e){y(n,e);var t=x(n);function n(){var e;b(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),(0,j.Z)((0,g.Z)(e),"priority",70),(0,j.Z)((0,g.Z)(e),"incompatibleTokens",["a","b","h","K","k","t","T"]),e}return C(n,[{key:"parse",value:function(e,t,n){switch(t){case"H":return F(A.hour23h,e);case"Ho":return n.ordinalNumber(e,{unit:"hour"});default:return z(t.length,e)}}},{key:"validate",value:function(e,t){return t>=0&&t<=23}},{key:"set",value:function(e,t,n){return e.setUTCHours(n,0,0,0),e}}]),n}(O),Se=function(e){y(n,e);var t=x(n);function n(){var e;b(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),(0,j.Z)((0,g.Z)(e),"priority",70),(0,j.Z)((0,g.Z)(e),"incompatibleTokens",["h","H","k","t","T"]),e}return C(n,[{key:"parse",value:function(e,t,n){switch(t){case"K":return F(A.hour11h,e);case"Ko":return n.ordinalNumber(e,{unit:"hour"});default:return z(t.length,e)}}},{key:"validate",value:function(e,t){return t>=0&&t<=11}},{key:"set",value:function(e,t,n){return e.getUTCHours()>=12&&n<12?e.setUTCHours(n+12,0,0,0):e.setUTCHours(n,0,0,0),e}}]),n}(O),Ce=function(e){y(n,e);var t=x(n);function n(){var e;b(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),(0,j.Z)((0,g.Z)(e),"priority",70),(0,j.Z)((0,g.Z)(e),"incompatibleTokens",["a","b","h","H","K","t","T"]),e}return C(n,[{key:"parse",value:function(e,t,n){switch(t){case"k":return F(A.hour24h,e);case"ko":return n.ordinalNumber(e,{unit:"hour"});default:return z(t.length,e)}}},{key:"validate",value:function(e,t){return t>=1&&t<=24}},{key:"set",value:function(e,t,n){var r=n<=24?n%24:n;return e.setUTCHours(r,0,0,0),e}}]),n}(O),je=function(e){y(n,e);var t=x(n);function n(){var e;b(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),(0,j.Z)((0,g.Z)(e),"priority",60),(0,j.Z)((0,g.Z)(e),"incompatibleTokens",["t","T"]),e}return C(n,[{key:"parse",value:function(e,t,n){switch(t){case"m":return F(A.minute,e);case"mo":return n.ordinalNumber(e,{unit:"minute"});default:return z(t.length,e)}}},{key:"validate",value:function(e,t){return t>=0&&t<=59}},{key:"set",value:function(e,t,n){return e.setUTCMinutes(n,0,0),e}}]),n}(O),ke=function(e){y(n,e);var t=x(n);function n(){var e;b(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),(0,j.Z)((0,g.Z)(e),"priority",50),(0,j.Z)((0,g.Z)(e),"incompatibleTokens",["t","T"]),e}return C(n,[{key:"parse",value:function(e,t,n){switch(t){case"s":return F(A.second,e);case"so":return n.ordinalNumber(e,{unit:"second"});default:return z(t.length,e)}}},{key:"validate",value:function(e,t){return t>=0&&t<=59}},{key:"set",value:function(e,t,n){return e.setUTCSeconds(n,0),e}}]),n}(O),Ee=function(e){y(n,e);var t=x(n);function n(){var e;b(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),(0,j.Z)((0,g.Z)(e),"priority",30),(0,j.Z)((0,g.Z)(e),"incompatibleTokens",["t","T"]),e}return C(n,[{key:"parse",value:function(e,t){return L(z(t.length,e),(function(e){return Math.floor(e*Math.pow(10,3-t.length))}))}},{key:"set",value:function(e,t,n){return e.setUTCMilliseconds(n),e}}]),n}(O),Te=function(e){y(n,e);var t=x(n);function n(){var e;b(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),(0,j.Z)((0,g.Z)(e),"priority",10),(0,j.Z)((0,g.Z)(e),"incompatibleTokens",["t","T","x"]),e}return C(n,[{key:"parse",value:function(e,t){switch(t){case"X":return W(_,e);case"XX":return W(P,e);case"XXXX":return W(M,e);case"XXXXX":return W(N,e);default:return W(R,e)}}},{key:"set",value:function(e,t,n){return t.timestampIsSet?e:new Date(e.getTime()-n)}}]),n}(O),Oe=function(e){y(n,e);var t=x(n);function n(){var e;b(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),(0,j.Z)((0,g.Z)(e),"priority",10),(0,j.Z)((0,g.Z)(e),"incompatibleTokens",["t","T","X"]),e}return C(n,[{key:"parse",value:function(e,t){switch(t){case"x":return W(_,e);case"xx":return W(P,e);case"xxxx":return W(M,e);case"xxxxx":return W(N,e);default:return W(R,e)}}},{key:"set",value:function(e,t,n){return t.timestampIsSet?e:new Date(e.getTime()-n)}}]),n}(O),Ie=function(e){y(n,e);var t=x(n);function n(){var e;b(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),(0,j.Z)((0,g.Z)(e),"priority",40),(0,j.Z)((0,g.Z)(e),"incompatibleTokens","*"),e}return C(n,[{key:"parse",value:function(e){return B(e)}},{key:"set",value:function(e,t,n){return[new Date(1e3*n),{timestampIsSet:!0}]}}]),n}(O),De=function(e){y(n,e);var t=x(n);function n(){var e;b(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),(0,j.Z)((0,g.Z)(e),"priority",20),(0,j.Z)((0,g.Z)(e),"incompatibleTokens","*"),e}return C(n,[{key:"parse",value:function(e){return B(e)}},{key:"set",value:function(e,t,n){return[new Date(n),{timestampIsSet:!0}]}}]),n}(O),Ae={G:new I,y:new K,Y:new $,R:new Q,u:new X,Q:new J,q:new ee,M:new te,L:new ne,w:new oe,I:new ae,d:new ue,D:new ce,E:new he,e:new pe,c:new ge,i:new me,a:new ye,b:new ve,B:new xe,h:new be,H:new we,K:new Se,k:new Ce,m:new je,s:new ke,S:new Ee,X:new Te,x:new Oe,t:new Ie,T:new De},_e=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Pe=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Me=/^'([^]*?)'?$/,Re=/''/g,Ne=/\S/,Le=/[a-zA-Z]/;function Fe(e,t,n,o){var g,m,y,v,x,b,w,S,C,j,k,E,O,I,D,A,_,P;(0,p.Z)(3,arguments);var M=String(e),R=String(t),N=(0,de.j)(),L=null!==(g=null!==(m=null===o||void 0===o?void 0:o.locale)&&void 0!==m?m:N.locale)&&void 0!==g?g:a.Z;if(!L.match)throw new RangeError("locale must contain match property");var F=(0,h.Z)(null!==(y=null!==(v=null!==(x=null!==(b=null===o||void 0===o?void 0:o.firstWeekContainsDate)&&void 0!==b?b:null===o||void 0===o||null===(w=o.locale)||void 0===w||null===(S=w.options)||void 0===S?void 0:S.firstWeekContainsDate)&&void 0!==x?x:N.firstWeekContainsDate)&&void 0!==v?v:null===(C=N.locale)||void 0===C||null===(j=C.options)||void 0===j?void 0:j.firstWeekContainsDate)&&void 0!==y?y:1);if(!(F>=1&&F<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var W=(0,h.Z)(null!==(k=null!==(E=null!==(O=null!==(I=null===o||void 0===o?void 0:o.weekStartsOn)&&void 0!==I?I:null===o||void 0===o||null===(D=o.locale)||void 0===D||null===(A=D.options)||void 0===A?void 0:A.weekStartsOn)&&void 0!==O?O:N.weekStartsOn)&&void 0!==E?E:null===(_=N.locale)||void 0===_||null===(P=_.options)||void 0===P?void 0:P.weekStartsOn)&&void 0!==k?k:0);if(!(W>=0&&W<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(""===R)return""===M?(0,l.Z)(n):new Date(NaN);var B,z={firstWeekContainsDate:F,weekStartsOn:W,locale:L},G=[new T],Z=R.match(Pe).map((function(e){var t=e[0];return t in c.Z?(0,c.Z[t])(e,L.formatLong):e})).join("").match(_e),U=[],H=i(Z);try{var K=function(){var t=B.value;null!==o&&void 0!==o&&o.useAdditionalWeekYearTokens||!(0,f.Do)(t)||(0,f.qp)(t,R,e),null!==o&&void 0!==o&&o.useAdditionalDayOfYearTokens||!(0,f.Iu)(t)||(0,f.qp)(t,R,e);var n=t[0],r=Ae[n];if(r){var i=r.incompatibleTokens;if(Array.isArray(i)){var a=U.find((function(e){return i.includes(e.token)||e.token===n}));if(a)throw new RangeError("The format string mustn't contain `".concat(a.fullToken,"` and `").concat(t,"` at the same time"))}else if("*"===r.incompatibleTokens&&U.length>0)throw new RangeError("The format string mustn't contain `".concat(t,"` and any other token at the same time"));U.push({token:n,fullToken:t});var s=r.run(M,t,L.match,z);if(!s)return{v:new Date(NaN)};G.push(s.setter),M=s.rest}else{if(n.match(Le))throw new RangeError("Format string contains an unescaped latin alphabet character `"+n+"`");if("''"===t?t="'":"'"===n&&(t=t.match(Me)[1].replace(Re,"'")),0!==M.indexOf(t))return{v:new Date(NaN)};M=M.slice(t.length)}};for(H.s();!(B=H.n()).done;){var V=K();if("object"===(0,r.Z)(V))return V.v}}catch(ne){H.e(ne)}finally{H.f()}if(M.length>0&&Ne.test(M))return new Date(NaN);var q=G.map((function(e){return e.priority})).sort((function(e,t){return t-e})).filter((function(e,t,n){return n.indexOf(e)===t})).map((function(e){return G.filter((function(t){return t.priority===e})).sort((function(e,t){return t.subPriority-e.subPriority}))})).map((function(e){return e[0]})),$=(0,l.Z)(n);if(isNaN($.getTime()))return new Date(NaN);var Y,Q=(0,s.Z)($,(0,d.Z)($)),X={},J=i(q);try{for(J.s();!(Y=J.n()).done;){var ee=Y.value;if(!ee.validate(Q,z))return new Date(NaN);var te=ee.set(Q,X,z);Array.isArray(te)?(Q=te[0],u(X,te[1])):Q=te}}catch(ne){J.e(ne)}finally{J.f()}return Q}},1785:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(1722),o=n(8116),i=n(9398);function a(e,t){var n;(0,o.Z)(1,arguments);var a=(0,i.Z)(null!==(n=null===t||void 0===t?void 0:t.additionalDigits)&&void 0!==n?n:2);if(2!==a&&1!==a&&0!==a)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 g,m=function(e){var t,n={},r=e.split(s.dateTimeDelimiter);if(r.length>2)return n;/:/.test(r[0])?t=r[0]:(n.date=r[0],t=r[1],s.timeZoneDelimiter.test(n.date)&&(n.date=e.split(s.timeZoneDelimiter)[0],t=e.substr(n.date.length,e.length)));if(t){var o=s.timezone.exec(t);o?(n.time=t.replace(o[1],""),n.timezone=o[1]):n.time=t}return n}(e);if(m.date){var y=function(e,t){var n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),r=e.match(n);if(!r)return{year:NaN,restDateString:""};var o=r[1]?parseInt(r[1]):null,i=r[2]?parseInt(r[2]):null;return{year:null===i?o:100*i,restDateString:e.slice((r[1]||r[2]).length)}}(m.date,a);g=function(e,t){if(null===t)return new Date(NaN);var n=e.match(l);if(!n)return new Date(NaN);var r=!!n[4],o=d(n[1]),i=d(n[2])-1,a=d(n[3]),s=d(n[4]),u=d(n[5])-1;if(r)return function(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}(0,s,u)?function(e,t,n){var r=new Date(0);r.setUTCFullYear(e,0,4);var o=r.getUTCDay()||7,i=7*(t-1)+n+1-o;return r.setUTCDate(r.getUTCDate()+i),r}(t,s,u):new Date(NaN);var c=new Date(0);return function(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(h[t]||(p(e)?29:28))}(t,i,a)&&function(e,t){return t>=1&&t<=(p(e)?366:365)}(t,o)?(c.setUTCFullYear(t,i,Math.max(o,a)),c):new Date(NaN)}(y.restDateString,y.year)}if(!g||isNaN(g.getTime()))return new Date(NaN);var v,x=g.getTime(),b=0;if(m.time&&(b=function(e){var t=e.match(u);if(!t)return NaN;var n=f(t[1]),o=f(t[2]),i=f(t[3]);if(!function(e,t,n){if(24===e)return 0===t&&0===n;return n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}(n,o,i))return NaN;return n*r.vh+o*r.yJ+1e3*i}(m.time),isNaN(b)))return new Date(NaN);if(!m.timezone){var w=new Date(x+b),S=new Date(0);return S.setFullYear(w.getUTCFullYear(),w.getUTCMonth(),w.getUTCDate()),S.setHours(w.getUTCHours(),w.getUTCMinutes(),w.getUTCSeconds(),w.getUTCMilliseconds()),S}return v=function(e){if("Z"===e)return 0;var t=e.match(c);if(!t)return 0;var n="+"===t[1]?-1:1,o=parseInt(t[2]),i=t[3]&&parseInt(t[3])||0;if(!function(e,t){return t>=0&&t<=59}(0,i))return NaN;return n*(o*r.vh+i*r.yJ)}(m.timezone),isNaN(v)?new Date(NaN):new Date(x+b+v)}var s={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},l=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,u=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,c=/^([+-])(\d{2})(?::?(\d{2}))?$/;function d(e){return e?parseInt(e):1}function f(e){return e&&parseFloat(e.replace(",","."))||0}var h=[31,null,31,30,31,30,31,31,30,31,30,31];function p(e){return e%400===0||e%4===0&&e%100!==0}},9474:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(8756),o=n(8116),i=n(9398);function a(e,t){(0,o.Z)(2,arguments);var n=(0,i.Z)(t);return(0,r.Z)(e,-n)}},1898:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(9398),o=n(9375),i=n(8116);function a(e,t){return(0,i.Z)(2,arguments),function(e,t){(0,i.Z)(2,arguments);var n=(0,o.Z)(e).getTime(),a=(0,r.Z)(t);return new Date(n+a)}(e,-(0,r.Z)(t))}},9375:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(6522),o=n(8116);function i(e){(0,o.Z)(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"===(0,r.Z)(e)&&"[object Date]"===t?new Date(e.getTime()):"number"===typeof e||"[object Number]"===t?new Date(e):("string"!==typeof e&&"[object String]"!==t||"undefined"===typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}},4881:function(e){function t(e,t,n){var r,o,i,a,s;function l(){var u=Date.now()-a;u<t&&u>=0?r=setTimeout(l,t-u):(r=null,n||(s=e.apply(i,o),i=o=null))}null==t&&(t=100);var u=function(){i=this,o=arguments,a=Date.now();var u=n&&!r;return r||(r=setTimeout(l,t)),u&&(s=e.apply(i,o),i=o=null),s};return u.clear=function(){r&&(clearTimeout(r),r=null)},u.flush=function(){r&&(s=e.apply(i,o),i=o=null,clearTimeout(r),r=null)},u}t.debounce=t,e.exports=t},6881:function(e,t){"use strict";var n=60103,r=60106,o=60107,i=60108,a=60114,s=60109,l=60110,u=60112,c=60113,d=60120,f=60115,h=60116,p=60121,g=60122,m=60117,y=60129,v=60131;if("function"===typeof Symbol&&Symbol.for){var x=Symbol.for;n=x("react.element"),r=x("react.portal"),o=x("react.fragment"),i=x("react.strict_mode"),a=x("react.profiler"),s=x("react.provider"),l=x("react.context"),u=x("react.forward_ref"),c=x("react.suspense"),d=x("react.suspense_list"),f=x("react.memo"),h=x("react.lazy"),p=x("react.block"),g=x("react.server.block"),m=x("react.fundamental"),y=x("react.debug_trace_mode"),v=x("react.legacy_hidden")}function b(e){if("object"===typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:switch(e=e.type){case o:case a:case i:case c:case d:return e;default:switch(e=e&&e.$$typeof){case l:case u:case h:case f:case s:return e;default:return t}}case r:return t}}}},3612:function(e,t,n){"use strict";n(6881)},7276:function(e,t,n){var r;!function(){"use strict";var o=!("undefined"===typeof window||!window.document||!window.document.createElement),i={canUseDOM:o,canUseWorkers:"undefined"!==typeof Worker,canUseEventListeners:o&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:o&&!!window.screen};void 0===(r=function(){return i}.call(t,n,t,e))||(e.exports=r)}()},1231:function(e){"use strict";e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,o,i;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(o=r;0!==o--;)if(!e(t[o],n[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(i=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(o=r;0!==o--;)if(!Object.prototype.hasOwnProperty.call(n,i[o]))return!1;for(o=r;0!==o--;){var a=i[o];if(!e(t[a],n[a]))return!1}return!0}return t!==t&&n!==n}},6184:function(e){"use strict";var t=/-(.)/g;e.exports=function(e){return e.replace(t,(function(e,t){return t.toUpperCase()}))}},5114:function(e,t,n){"use strict";var r=n(6184),o=/^-ms-/;e.exports=function(e){return r(e.replace(o,"ms-"))}},2341:function(e){"use strict";function t(e){return function(){return e}}var n=function(){};n.thatReturns=t,n.thatReturnsFalse=t(!1),n.thatReturnsTrue=t(!0),n.thatReturnsNull=t(null),n.thatReturnsThis=function(){return this},n.thatReturnsArgument=function(e){return e},e.exports=n},6791:function(e){"use strict";var t=/([A-Z])/g;e.exports=function(e){return e.replace(t,"-$1").toLowerCase()}},6800:function(e,t,n){"use strict";var r=n(6791),o=/^ms-/;e.exports=function(e){return r(e).replace(o,"-ms-")}},1963:function(e){"use strict";e.exports=function(e){var t={};return function(n){return t.hasOwnProperty(n)||(t[n]=e.call(this,n)),t[n]}}},565:function(e,t,n){"use strict";var r=n(2341);e.exports=r},1503:function(){!function(){"use strict";function e(){var e=!0,t=!1,n=null,r={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function o(e){return!!(e&&e!==document&&"HTML"!==e.nodeName&&"BODY"!==e.nodeName&&"classList"in e&&"contains"in e.classList)}function i(e){var t=e.type,n=e.tagName;return!("INPUT"!=n||!r[t]||e.readOnly)||"TEXTAREA"==n&&!e.readOnly||!!e.isContentEditable}function a(e){e.classList.contains("focus-visible")||(e.classList.add("focus-visible"),e.setAttribute("data-focus-visible-added",""))}function s(e){e.hasAttribute("data-focus-visible-added")&&(e.classList.remove("focus-visible"),e.removeAttribute("data-focus-visible-added"))}function l(t){o(document.activeElement)&&a(document.activeElement),e=!0}function u(t){e=!1}function c(t){o(t.target)&&(e||i(t.target))&&a(t.target)}function d(e){o(e.target)&&(e.target.classList.contains("focus-visible")||e.target.hasAttribute("data-focus-visible-added"))&&(t=!0,window.clearTimeout(n),n=window.setTimeout((function(){t=!1,window.clearTimeout(n)}),100),s(e.target))}function f(n){"hidden"==document.visibilityState&&(t&&(e=!0),h())}function h(){document.addEventListener("mousemove",g),document.addEventListener("mousedown",g),document.addEventListener("mouseup",g),document.addEventListener("pointermove",g),document.addEventListener("pointerdown",g),document.addEventListener("pointerup",g),document.addEventListener("touchmove",g),document.addEventListener("touchstart",g),document.addEventListener("touchend",g)}function p(){document.removeEventListener("mousemove",g),document.removeEventListener("mousedown",g),document.removeEventListener("mouseup",g),document.removeEventListener("pointermove",g),document.removeEventListener("pointerdown",g),document.removeEventListener("pointerup",g),document.removeEventListener("touchmove",g),document.removeEventListener("touchstart",g),document.removeEventListener("touchend",g)}function g(t){"html"!==t.target.nodeName.toLowerCase()&&(e=!1,p())}document.addEventListener("keydown",l,!0),document.addEventListener("mousedown",u,!0),document.addEventListener("pointerdown",u,!0),document.addEventListener("touchstart",u,!0),document.addEventListener("focus",c,!0),document.addEventListener("blur",d,!0),document.addEventListener("visibilitychange",f,!0),h(),document.body.classList.add("js-focus-visible")}function t(e){var t;function n(){t||(t=!0,e())}["interactive","complete"].indexOf(document.readyState)>=0?e():(t=!1,document.addEventListener("DOMContentLoaded",n,!1),window.addEventListener("load",n,!1))}"undefined"!==typeof document&&t(e)}()},5607:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowStart:!0,gridRowEnd:!0,gridColumn:!0,gridColumnStart:!0,gridColumnEnd:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};var r=["Webkit","ms","Moz","O"];Object.keys(n).forEach((function(e){r.forEach((function(t){n[function(e,t){return e+t.charAt(0).toUpperCase()+t.substring(1)}(t,e)]=n[e]}))}));var o={isUnitlessNumber:n,shorthandPropertyExpansions:{background:{backgroundAttachment:!0,backgroundColor:!0,backgroundImage:!0,backgroundPositionX:!0,backgroundPositionY:!0,backgroundRepeat:!0},backgroundPosition:{backgroundPositionX:!0,backgroundPositionY:!0},border:{borderWidth:!0,borderStyle:!0,borderColor:!0},borderBottom:{borderBottomWidth:!0,borderBottomStyle:!0,borderBottomColor:!0},borderLeft:{borderLeftWidth:!0,borderLeftStyle:!0,borderLeftColor:!0},borderRight:{borderRightWidth:!0,borderRightStyle:!0,borderRightColor:!0},borderTop:{borderTopWidth:!0,borderTopStyle:!0,borderTopColor:!0},font:{fontStyle:!0,fontVariant:!0,fontWeight:!0,fontSize:!0,lineHeight:!0,fontFamily:!0},outline:{outlineWidth:!0,outlineStyle:!0,outlineColor:!0}}};t.default=o},7135:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(n(5607));o(n(565));function o(e){return e&&e.__esModule?e:{default:e}}var i=r.default.isUnitlessNumber;t.default=function(e,t,n){return null==t||"boolean"===typeof t||""===t?"":isNaN(t)||0===t||i.hasOwnProperty(e)&&i[e]?""+t:("string"===typeof t&&(t=t.trim()),t+"px")}},373:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.processStyleName=void 0,t.createMarkupForStyles=function(e,t){var n="";for(var o in e){var i=0===o.indexOf("--");if(e.hasOwnProperty(o)&&"label"!==o){var a=e[o];0,null!=a&&(i?n+=o+":"+a+";":(n+=s(o)+":",n+=(0,r.default)(o,a,t)+";"))}}return n||null};a(n(5114));var r=a(n(7135)),o=a(n(6800)),i=a(n(1963));a(n(565));function a(e){return e&&e.__esModule?e:{default:e}}var s=t.processStyleName=(0,i.default)(o.default)},578:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function r(e){if(function(e){return null===e||void 0===e||!1===e||"object"===("undefined"===typeof e?"undefined":n(e))&&0===Object.keys(e).length}(e))return null;if("object"!==("undefined"===typeof e?"undefined":n(e)))return e;for(var t={},r=Object.keys(e),i=!1,a=0;a<r.length;a++){var s=e[r[a]],l=o(s);null!==l&&l===s||(i=!0),null!==l&&(t[r[a]]=l)}return 0===Object.keys(t).length?null:i?t:e}function o(e){return Array.isArray(e)?function(e){var t=!1,n=[];return e.forEach((function(e){var r=o(e);null!==r&&r===e||(t=!0),null!==r&&n.push(r)})),0==n.length?null:t?n:e}(e):r(e)}t.default=o},5726:function(e,t){"use strict";function n(e,t){return e.charCodeAt(t++)+(e.charCodeAt(t++)<<8)+(e.charCodeAt(t++)<<16)+(e.charCodeAt(t)<<24)}function r(e,t){return e.charCodeAt(t++)+(e.charCodeAt(t++)<<8)}function o(e,t){return(65535&(e|=0))*(t|=0)+(((e>>>16)*t&65535)<<16)|0}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var i=1540483477,a=t^e.length,s=e.length,l=0;for(;s>=4;){var u=n(e,l);u=o(u,i),u=o(u^=u>>>24,i),a=o(a,i),a^=u,l+=4,s-=4}switch(s){case 3:a^=r(e,l),a=o(a^=e.charCodeAt(l+2)<<16,i);break;case 2:a=o(a^=r(e,l),i);break;case 1:a=o(a^=e.charCodeAt(l),i)}return a=o(a^=a>>>13,i),(a^=a>>>15)>>>0}},6634:function(e,t,n){"use strict";t.F4=void 0,t.iv=K,t.BC=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return K(c({},"@media "+e,n))},t.bb=function(e){return $("::before",e)};var r=u(n(5832)),o=n(6349),i=n(373),a=u(n(578)),s=n(5221),l=u(n(5726));function u(e){return e&&e.__esModule?e:{default:e}}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var d=new o.StyleSheet;d.inject();var f=d.plugins=new s.PluginSet([s.prefixes,s.contentWrap,s.fallbacks]);f.media=new s.PluginSet,f.fontFace=new s.PluginSet,f.keyframes=new s.PluginSet([s.prefixes,s.fallbacks]);var h=!1,p=!1,g="undefined"!==typeof window,m=h,y=!1,v=!1;var x=h;function b(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.toLowerCase().replace(/[^a-z0-9]/g,t)}function w(e){var t=JSON.stringify(e),n=(0,l.default)(t).toString(36);return e.label&&e.label.length>0&&h?b(e.label.join("."),"-")+"-"+n:n}function S(e){var t=Object.keys(e).filter((function(e){return"toString"!==e}));return 1===t.length&&!!/data\-css\-([a-zA-Z0-9\-_]+)/.exec(t[0])}function C(e){var t=Object.keys(e).filter((function(e){return"toString"!==e}));if(1!==t.length)throw new Error("not a rule");var n=/data\-css\-([a-zA-Z0-9\-_]+)/.exec(t[0]);if(!n)throw new Error("not a rule");return n[1]}var j=/[(),]|"(?:\\.|[^"\n])*"|'(?:\\.|[^'\n])*'|\/\*[\s\S]*?\*\//g;function k(e){if(-1===e.indexOf(","))return[e];for(var t,n=[],r=[],o=0;t=j.exec(e);)switch(t[0]){case"(":o++;break;case")":o--;break;case",":if(o)break;n.push(t.index)}for(t=n.length;t--;)r.unshift(e.slice(n[t]+1)),e=e.slice(0,n[t]);return r.unshift(e),r}function E(e,t){if(!e)return t.replace(/\&/g,"");if(!t)return".css-"+e+",[data-css-"+e+"]";var n=k(t).map((function(t){return t.indexOf("&")>=0?[t.replace(/\&/gm,".css-"+e),t.replace(/\&/gm,"[data-css-"+e+"]")].join(","):".css-"+e+t+",[data-css-"+e+"]"+t})).join(",");return m&&/^\&\:/.exec(t)&&!/\s/.exec(t)&&(n+=",.css-"+e+"[data-simulate-"+b(t)+"],[data-css-"+e+"][data-simulate-"+b(t)+"]"),n}function T(e){var t=e.selector,n=e.style,r=f.transform({selector:t,style:n});return r.selector+"{"+(0,i.createMarkupForStyles)(r.style)+"}"}function O(e){var t=void 0,n=void 0,r=void 0,o=void 0;return Object.keys(e).forEach((function(i){i.indexOf("&")>=0?(n=n||{})[i]=e[i]:0===i.indexOf("@media")?(r=r||{})[i]=O(e[i]):0===i.indexOf("@supports")?(o=o||{})[i]=O(e[i]):"label"===i?e.label.length>0&&((t=t||{}).label=x?e.label.join("."):""):(t=t||{})[i]=e[i]})),{plain:t,selects:n,medias:r,supports:o}}function I(e,t){var n=[],r=t.plain,o=t.selects,i=t.medias,a=t.supports;return r&&n.push(T({style:r,selector:E(e)})),o&&Object.keys(o).forEach((function(t){return n.push(T({style:o[t],selector:E(e,t)}))})),i&&Object.keys(i).forEach((function(t){return n.push(t+"{"+I(e,i[t]).join("")+"}")})),a&&Object.keys(a).forEach((function(t){return n.push(t+"{"+I(e,a[t]).join("")+"}")})),n}var D=d.inserted={};var A=d.registered={};function _(e){A[e.id]||(A[e.id]=e)}var P={};function M(e){if(_(e),function(e){if(!D[e.id]){D[e.id]=!0;var t=O(e.style),n=I(e.id,t);D[e.id]=!!g||n,n.forEach((function(e){return d.insert(e)}))}}(e),P[e.id])return P[e.id];var t=c({},"data-css-"+e.id,x&&e.label||"");return Object.defineProperty(t,"toString",{enumerable:!1,value:function(){return"css-"+e.id}}),P[e.id]=t,t}function R(e,t){var n=k(e).map((function(e){return e.indexOf("&")>=0?e:"&"+e})),r=k(t).map((function(e){return e.indexOf("&")>=0?e:"&"+e}));return r.reduce((function(e,t){return e.concat(n.map((function(e){return t.replace(/\&/g,e)})))}),[]).join(",")}function N(e,t){return e?"@supports "+e.substring(9)+" and "+t.substring(9):t}function L(e){for(var t=[],n=0;n<e.length;n++)t=Array.isArray(e[n])?t.concat(L(e[n])):t.concat(e[n]);return t}var F={"::placeholder":["::-webkit-input-placeholder","::-moz-placeholder","::-ms-input-placeholder"],":fullscreen":[":-webkit-full-screen",":-moz-full-screen",":-ms-fullscreen"]};function W(e,t){var n=t.selector,r=void 0===n?"":n,o=t.mq,i=void 0===o?"":o,s=t.supp,l=void 0===s?"":s,u=t.src,c=void 0===u?{}:u;Array.isArray(c)||(c=[c]),(c=L(c)).forEach((function(t){if(S(t)){var n=function(e){if(S(e)){var t=A[C(e)];if(null==t)throw new Error("[glamor] an unexpected rule cache miss occurred. This is probably a sign of multiple glamor instances in your app. See https://github.com/threepointone/glamor/issues/79");return t}return e}(t);if("css"!==n.type)throw new Error("cannot merge this rule");t=n.style}(t=(0,a.default)(t))&&t.composes&&W(e,{selector:r,mq:i,supp:l,src:t.composes}),Object.keys(t||{}).forEach((function(n){if(function(e){for(var t=[":",".","[",">"," "],n=!1,r=e.charAt(0),o=0;o<t.length;o++)if(r===t[o]){n=!0;break}return n||e.indexOf("&")>=0}(n))F[n]&&F[n].forEach((function(o){return W(e,{selector:R(r,o),mq:i,supp:l,src:t[n]})})),W(e,{selector:R(r,n),mq:i,supp:l,src:t[n]});else if(function(e){return 0===e.indexOf("@media")}(n))W(e,{selector:r,mq:(a=i,s=n,a?"@media "+a.substring(6)+" and "+s.substring(6):s),supp:l,src:t[n]});else if(function(e){return 0===e.indexOf("@supports")}(n))W(e,{selector:r,mq:i,supp:N(l,n),src:t[n]});else if("composes"===n);else{var o=e;l&&(o[l]=o[l]||{},o=o[l]),i&&(o[i]=o[i]||{},o=o[i]),r&&(o[r]=o[r]||{},o=o[r]),"label"===n?x&&(e.label=e.label.concat(t.label)):o[n]=t[n]}var a,s}))}))}function B(e){var t={label:[]};return W(t,{src:e}),M({id:w(t),style:t,label:x?t.label.join("."):"",type:"css"})}var z={};Object.defineProperty(z,"toString",{enumerable:!1,value:function(){return"css-nil"}});var G="undefined"!==typeof WeakMap?[z,new WeakMap,new WeakMap,new WeakMap]:[z],Z=!1;var U,H="undefined"!==typeof WeakMap?(U=B,function(e){if(G[e.length]){for(var t=G[e.length],n=0;n<e.length-1;)t.has(e[n])||t.set(e[n],new WeakMap),t=t.get(e[n]),n++;if(t.has(e[e.length-1])){var r=t.get(e[n]);if(A[r.toString().substring(4)])return r}}var o=U(e);if(G[e.length]){for(var i=0,a=G[e.length];i<e.length-1;)a=a.get(e[i]),i++;try{a.set(e[i],o)}catch(l){var s;h&&!Z&&(Z=!0,(s=console).warn.apply(s,["failed setting the WeakMap cache for args:"].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(e))),console.warn("this should NOT happen, please file a bug on the github repo."))}}return o}):B;function K(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];if(t[0]&&t[0].length&&t[0].raw)throw new Error("you forgot to include glamor/babel in your babel plugins.");return(t=(0,a.default)(t))?H(t):z}K.insert=function(e){var t={id:w(e),css:e,type:"raw"};_(t),D[t.id]||(d.insert(t.css),D[t.id]=!!g||[t.css])};K.insert;K.global=function(e,t){if(t=(0,a.default)(t))return K.insert(T({selector:e,style:t}))};K.global;K.keyframes=function(e,t){t||(t=e,e="animation");var n={id:w({name:e,kfs:t=(0,a.default)(t)||{}}),type:"keyframes",name:e,keyframes:t};return _(n),function(e){if(!D[e.id]){var t=Object.keys(e.keyframes).map((function(t){var n=f.keyframes.transform({id:e.id,name:t,style:e.keyframes[t]});return n.name+"{"+(0,i.createMarkupForStyles)(n.style)+"}"})).join(""),n=["-webkit-","-moz-","-o-",""].map((function(n){return"@"+n+"keyframes "+e.name+"_"+e.id+"{"+t+"}"}));n.forEach((function(e){return d.insert(e)})),D[e.id]=!!g||n}}(n),e+"_"+n.id},K.fontFace=function(e){var t={id:w(e=(0,a.default)(e)),type:"font-face",font:e};return _(t),function(e){if(!D[e.id]){var t="@font-face{"+(0,i.createMarkupForStyles)(e.font)+"}";d.insert(t),D[e.id]=!!g||[t]}}(t),e.fontFamily};K.fontFace,t.F4=K.keyframes;var V=K;function q(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e?K(c({},e,n)):V(n)}function $(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return K(c({},e,n))}},5221:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.PluginSet=l,t.fallbacks=function(e){if(Object.keys(e.style).map((function(t){return Array.isArray(e.style[t])})).indexOf(!0)>=0){var t=e.style,n=Object.keys(t).reduce((function(e,n){return e[n]=Array.isArray(t[n])?t[n].join("; "+(0,i.processStyleName)(n)+": "):t[n],e}),{});return(0,o.default)({},e,{style:n})}return e},t.contentWrap=function(e){if(e.style.content){var t=e.style.content;return u.indexOf(t)>=0||/^(attr|calc|counters?|url)\(/.test(t)?e:t.charAt(0)!==t.charAt(t.length-1)||'"'!==t.charAt(0)&&"'"!==t.charAt(0)?r({},e,{style:r({},e.style,{content:'"'+t+'"'})}):e}return e},t.prefixes=function(e){return(0,o.default)({},e,{style:(0,a.default)(r({},e.style))})};var o=s(n(5832)),i=n(373),a=s(n(8490));function s(e){return e&&e.__esModule?e:{default:e}}function l(e){this.fns=e||[]}(0,o.default)(l.prototype,{add:function(){for(var e=this,t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];n.forEach((function(t){e.fns.indexOf(t)>=0||(e.fns=[t].concat(e.fns))}))},remove:function(e){this.fns=this.fns.filter((function(t){return t!==e}))},clear:function(){this.fns=[]},transform:function(e){return this.fns.reduce((function(e,t){return t(e)}),e)}});var u=["normal","none","counter","open-quote","close-quote","no-open-quote","no-close-quote","initial","inherit"]},8490:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){for(var t in e){var n=e[t],r=(0,i.default)(y,t,n,e,v);r&&(e[t]=r),(0,o.default)(v,t,e)}return e};var r=m(n(5699)),o=m(n(4761)),i=m(n(5485)),a=m(n(9733)),s=m(n(3425)),l=m(n(4214)),u=m(n(2518)),c=m(n(2105)),d=m(n(5441)),f=m(n(3047)),h=m(n(3920)),p=m(n(5180)),g=m(n(3886));function m(e){return e&&e.__esModule?e:{default:e}}var y=[s.default,a.default,l.default,c.default,d.default,f.default,h.default,p.default,g.default,u.default],v=r.default.prefixMap},6349:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StyleSheet=h;var r,o=n(5832),i=(r=o)&&r.__esModule?r:{default:r};function a(e){return e[e.length-1]}function s(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}var l="undefined"!==typeof window,u=!1,c=!1,d=function(){if(l){var e=document.createElement("div");return e.innerHTML="\x3c!--[if lt IE 10]><i></i><![endif]--\x3e",1===e.getElementsByTagName("i").length}}();function f(){var e=document.createElement("style");return e.type="text/css",e.setAttribute("data-glamor",""),e.appendChild(document.createTextNode("")),(document.head||document.getElementsByTagName("head")[0]).appendChild(e),e}function h(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.speedy,n=void 0===t?!u&&!c:t,r=e.maxLength,o=void 0===r?l&&d?4e3:65e3:r;this.isSpeedy=n,this.sheet=void 0,this.tags=[],this.maxLength=o,this.ctr=0}(0,i.default)(h.prototype,{getSheet:function(){return s(a(this.tags))},inject:function(){var e=this;if(this.injected)throw new Error("already injected stylesheet!");l?this.tags[0]=f():this.sheet={cssRules:[],insertRule:function(t){e.sheet.cssRules.push({cssText:t})}},this.injected=!0},speedy:function(e){if(0!==this.ctr)throw new Error("cannot change speedy mode after inserting any rule to sheet. Either call speedy("+e+") earlier in your app, or call flush() before speedy("+e+")");this.isSpeedy=!!e},_insert:function(e){try{var t=this.getSheet();t.insertRule(e,-1!==e.indexOf("@import")?0:t.cssRules.length)}catch(n){u&&console.warn("whoops, illegal rule inserted",e)}},insert:function(e){if(l)if(this.isSpeedy&&this.getSheet().insertRule)this._insert(e);else if(-1!==e.indexOf("@import")){var t=a(this.tags);t.insertBefore(document.createTextNode(e),t.firstChild)}else a(this.tags).appendChild(document.createTextNode(e));else this.sheet.insertRule(e,-1!==e.indexOf("@import")?0:this.sheet.cssRules.length);return this.ctr++,l&&this.ctr%this.maxLength===0&&this.tags.push(f()),this.ctr-1},delete:function(e){return this.replace(e,"")},flush:function(){l?(this.tags.forEach((function(e){return e.parentNode.removeChild(e)})),this.tags=[],this.sheet=null,this.ctr=0):this.sheet.cssRules=[],this.injected=!1},rules:function(){if(!l)return this.sheet.cssRules;var e=[];return this.tags.forEach((function(t){return e.splice.apply(e,[e.length,0].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(Array.from(s(t).cssRules))))})),e}})},7204:function(e,t,n){"use strict";var r=n(5412),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function l(e){return r.isMemo(e)?a:s[e.$$typeof]||o}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=a;var u=Object.defineProperty,c=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,h=Object.getPrototypeOf,p=Object.prototype;e.exports=function e(t,n,r){if("string"!==typeof n){if(p){var o=h(n);o&&o!==p&&e(t,o,r)}var a=c(n);d&&(a=a.concat(d(n)));for(var s=l(t),g=l(n),m=0;m<a.length;++m){var y=a[m];if(!i[y]&&(!r||!r[y])&&(!g||!g[y])&&(!s||!s[y])){var v=f(n,y);try{u(t,y,v)}catch(x){}}}}return t}},702:function(e,t,n){"use strict";n.d(t,{Z:function(){return C}});var r="undefined"!==typeof navigator&&navigator.userAgent.toLowerCase().indexOf("firefox")>0;function o(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r):e.attachEvent&&e.attachEvent("on".concat(t),(function(){n(window.event)}))}function i(e,t){for(var n=t.slice(0,t.length-1),r=0;r<n.length;r++)n[r]=e[n[r].toLowerCase()];return n}function a(e){"string"!==typeof e&&(e="");for(var t=(e=e.replace(/\s/g,"")).split(","),n=t.lastIndexOf("");n>=0;)t[n-1]+=",",t.splice(n,1),n=t.lastIndexOf("");return t}for(var s={backspace:8,"\u232b":8,tab:9,clear:12,enter:13,"\u21a9":13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"\u21ea":20,",":188,".":190,"/":191,"`":192,"-":r?173:189,"=":r?61:187,";":r?59:186,"'":222,"[":219,"]":221,"\\":220},l={"\u21e7":16,shift:16,"\u2325":18,alt:18,option:18,"\u2303":17,ctrl:17,control:17,"\u2318":91,cmd:91,command:91},u={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},c={16:!1,18:!1,17:!1,91:!1},d={},f=1;f<20;f++)s["f".concat(f)]=111+f;var h=[],p=!1,g="all",m=[],y=function(e){return s[e.toLowerCase()]||l[e.toLowerCase()]||e.toUpperCase().charCodeAt(0)};function v(e){g=e||"all"}function x(){return g||"all"}var b=function(e){var t=e.key,n=e.scope,r=e.method,o=e.splitKey,s=void 0===o?"+":o;a(t).forEach((function(e){var t=e.split(s),o=t.length,a=t[o-1],u="*"===a?"*":y(a);if(d[u]){n||(n=x());var c=o>1?i(l,t):[];d[u]=d[u].filter((function(e){return!((!r||e.method===r)&&e.scope===n&&function(e,t){for(var n=e.length>=t.length?e:t,r=e.length>=t.length?t:e,o=!0,i=0;i<n.length;i++)-1===r.indexOf(n[i])&&(o=!1);return o}(e.mods,c))}))}}))};function w(e,t,n,r){var o;if(t.element===r&&(t.scope===n||"all"===t.scope)){for(var i in o=t.mods.length>0,c)Object.prototype.hasOwnProperty.call(c,i)&&(!c[i]&&t.mods.indexOf(+i)>-1||c[i]&&-1===t.mods.indexOf(+i))&&(o=!1);(0!==t.mods.length||c[16]||c[18]||c[17]||c[91])&&!o&&"*"!==t.shortcut||!1===t.method(e,t)&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}function S(e,t){var n=d["*"],r=e.keyCode||e.which||e.charCode;if(C.filter.call(this,e)){if(93!==r&&224!==r||(r=91),-1===h.indexOf(r)&&229!==r&&h.push(r),["ctrlKey","altKey","shiftKey","metaKey"].forEach((function(t){var n=u[t];e[t]&&-1===h.indexOf(n)?h.push(n):!e[t]&&h.indexOf(n)>-1?h.splice(h.indexOf(n),1):"metaKey"===t&&e[t]&&3===h.length&&(e.ctrlKey||e.shiftKey||e.altKey||(h=h.slice(h.indexOf(n))))})),r in c){for(var o in c[r]=!0,l)l[o]===r&&(C[o]=!0);if(!n)return}for(var i in c)Object.prototype.hasOwnProperty.call(c,i)&&(c[i]=e[u[i]]);e.getModifierState&&(!e.altKey||e.ctrlKey)&&e.getModifierState("AltGraph")&&(-1===h.indexOf(17)&&h.push(17),-1===h.indexOf(18)&&h.push(18),c[17]=!0,c[18]=!0);var a=x();if(n)for(var s=0;s<n.length;s++)n[s].scope===a&&("keydown"===e.type&&n[s].keydown||"keyup"===e.type&&n[s].keyup)&&w(e,n[s],a,t);if(r in d)for(var f=0;f<d[r].length;f++)if(("keydown"===e.type&&d[r][f].keydown||"keyup"===e.type&&d[r][f].keyup)&&d[r][f].key&&d[r][f].scope===a){for(var p=d[r][f],g=p.splitKey,m=p.key.split(g),v=[],b=0;b<m.length;b++)v.push(y(m[b]));v.sort().join("")===h.slice().sort().join("")&&w(e,p,a,t)}}}function C(e,t,n){h=[];var r=a(e),s=[],u="all",f=document,g=0,v=!1,x=!0,b="+",w=!1;for(void 0===n&&"function"===typeof t&&(n=t),"[object Object]"===Object.prototype.toString.call(t)&&(t.scope&&(u=t.scope),t.element&&(f=t.element),t.keyup&&(v=t.keyup),void 0!==t.keydown&&(x=t.keydown),void 0!==t.capture&&(w=t.capture),"string"===typeof t.splitKey&&(b=t.splitKey)),"string"===typeof t&&(u=t);g<r.length;g++)s=[],(e=r[g].split(b)).length>1&&(s=i(l,e)),(e="*"===(e=e[e.length-1])?"*":y(e))in d||(d[e]=[]),d[e].push({keyup:v,keydown:x,scope:u,mods:s,shortcut:r[g],method:n,key:r[g],splitKey:b,element:f});"undefined"!==typeof f&&!function(e){return m.indexOf(e)>-1}(f)&&window&&(m.push(f),o(f,"keydown",(function(e){S(e,f)}),w),p||(p=!0,o(window,"focus",(function(){h=[]}),w)),o(f,"keyup",(function(e){S(e,f),function(e){var t=e.keyCode||e.which||e.charCode,n=h.indexOf(t);if(n>=0&&h.splice(n,1),e.key&&"meta"===e.key.toLowerCase()&&h.splice(0,h.length),93!==t&&224!==t||(t=91),t in c)for(var r in c[t]=!1,l)l[r]===t&&(C[r]=!1)}(e)}),w))}var j={getPressedKeyString:function(){return h.map((function(e){return t=e,Object.keys(s).find((function(e){return s[e]===t}))||function(e){return Object.keys(l).find((function(t){return l[t]===e}))}(e)||String.fromCharCode(e);var t}))},setScope:v,getScope:x,deleteScope:function(e,t){var n,r;for(var o in e||(e=x()),d)if(Object.prototype.hasOwnProperty.call(d,o))for(n=d[o],r=0;r<n.length;)n[r].scope===e?n.splice(r,1):r++;x()===e&&v(t||"all")},getPressedKeyCodes:function(){return h.slice(0)},isPressed:function(e){return"string"===typeof e&&(e=y(e)),-1!==h.indexOf(e)},filter:function(e){var t=e.target||e.srcElement,n=t.tagName,r=!0;return!t.isContentEditable&&("INPUT"!==n&&"TEXTAREA"!==n&&"SELECT"!==n||t.readOnly)||(r=!1),r},trigger:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"all";Object.keys(d).forEach((function(n){d[n].filter((function(n){return n.scope===t&&n.shortcut===e})).forEach((function(e){e&&e.method&&e.method()}))}))},unbind:function(e){if("undefined"===typeof e)Object.keys(d).forEach((function(e){return delete d[e]}));else if(Array.isArray(e))e.forEach((function(e){e.key&&b(e)}));else if("object"===typeof e)e.key&&b(e);else if("string"===typeof e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=n[0],i=n[1];"function"===typeof o&&(i=o,o=""),b({key:e,scope:o,method:i,splitKey:"+"})}},keyMap:s,modifier:l,modifierMap:u};for(var k in j)Object.prototype.hasOwnProperty.call(j,k)&&(C[k]=j[k]);if("undefined"!==typeof window){var E=window.hotkeys;C.noConflict=function(e){return e&&window.hotkeys===C&&(window.hotkeys=E),C},window.hotkeys=C}},8087:function(e,t,n){"use strict";n.r(t);var r=/[A-Z]/g,o=/^ms-/,i={};function a(e){return"-"+e.toLowerCase()}t.default=function(e){if(i.hasOwnProperty(e))return i[e];var t=e.replace(r,a);return i[e]=o.test(t)?"-"+t:t}},3425:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if("string"===typeof t&&!(0,i.default)(t)&&t.indexOf("cross-fade(")>-1)return a.map((function(e){return t.replace(/cross-fade\(/g,e+"cross-fade(")}))};var r,o=n(5685),i=(r=o)&&r.__esModule?r:{default:r};var a=["-webkit-",""];e.exports=t.default},9733:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if("cursor"===e&&r.hasOwnProperty(t))return n.map((function(e){return e+t}))};var n=["-webkit-","-moz-",""],r={"zoom-in":!0,"zoom-out":!0,grab:!0,grabbing:!0};e.exports=t.default},4214:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if("string"===typeof t&&!(0,i.default)(t)&&t.indexOf("filter(")>-1)return a.map((function(e){return t.replace(/filter\(/g,e+"filter(")}))};var r,o=n(5685),i=(r=o)&&r.__esModule?r:{default:r};var a=["-webkit-",""];e.exports=t.default},2518:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if("display"===e&&n.hasOwnProperty(t))return n[t]};var n={flex:["-webkit-box","-moz-box","-ms-flexbox","-webkit-flex","flex"],"inline-flex":["-webkit-inline-box","-moz-inline-box","-ms-inline-flexbox","-webkit-inline-flex","inline-flex"]};e.exports=t.default},2105:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,o){"flexDirection"===e&&"string"===typeof t&&(t.indexOf("column")>-1?o.WebkitBoxOrient="vertical":o.WebkitBoxOrient="horizontal",t.indexOf("reverse")>-1?o.WebkitBoxDirection="reverse":o.WebkitBoxDirection="normal");r.hasOwnProperty(e)&&(o[r[e]]=n[t]||t)};var n={"space-around":"justify","space-between":"justify","flex-start":"start","flex-end":"end","wrap-reverse":"multiple",wrap:"multiple"},r={alignItems:"WebkitBoxAlign",justifyContent:"WebkitBoxPack",flexWrap:"WebkitBoxLines"};e.exports=t.default},5441:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if("string"===typeof t&&!(0,i.default)(t)&&s.test(t))return a.map((function(e){return e+t}))};var r,o=n(5685),i=(r=o)&&r.__esModule?r:{default:r};var a=["-webkit-","-moz-",""],s=/linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient/;e.exports=t.default},3047:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if("string"===typeof t&&!(0,i.default)(t)&&t.indexOf("image-set(")>-1)return a.map((function(e){return t.replace(/image-set\(/g,e+"image-set(")}))};var r,o=n(5685),i=(r=o)&&r.__esModule?r:{default:r};var a=["-webkit-",""];e.exports=t.default},3920:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if("position"===e&&"sticky"===t)return["-webkit-sticky","sticky"]},e.exports=t.default},5180:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(r.hasOwnProperty(e)&&o.hasOwnProperty(t))return n.map((function(e){return e+t}))};var n=["-webkit-","-moz-",""],r={maxHeight:!0,maxWidth:!0,width:!0,height:!0,columnWidth:!0,minWidth:!0,minHeight:!0},o={"min-content":!0,"max-content":!0,"fill-available":!0,"fit-content":!0,"contain-floats":!0};e.exports=t.default},3886:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n,a){if("string"===typeof t&&s.hasOwnProperty(e)){var u=function(e,t){if((0,o.default)(e))return e;for(var n=e.split(/,(?![^()]*(?:\([^()]*\))?\))/g),i=0,a=n.length;i<a;++i){var s=n[i],u=[s];for(var c in t){var d=(0,r.default)(c);if(s.indexOf(d)>-1&&"order"!==d)for(var f=t[c],h=0,p=f.length;h<p;++h)u.unshift(s.replace(d,l[f[h]]+d))}n[i]=u.join(",")}return n.join(",")}(t,a),c=u.split(/,(?![^()]*(?:\([^()]*\))?\))/g).filter((function(e){return!/-moz-|-ms-/.test(e)})).join(",");if(e.indexOf("Webkit")>-1)return c;var d=u.split(/,(?![^()]*(?:\([^()]*\))?\))/g).filter((function(e){return!/-webkit-|-ms-/.test(e)})).join(",");return e.indexOf("Moz")>-1?d:(n["Webkit"+(0,i.default)(e)]=c,n["Moz"+(0,i.default)(e)]=d,u)}};var r=a(n(9423)),o=a(n(5685)),i=a(n(6059));function a(e){return e&&e.__esModule?e:{default:e}}var s={transition:!0,transitionProperty:!0,WebkitTransition:!0,WebkitTransitionProperty:!0,MozTransition:!0,MozTransitionProperty:!0},l={Webkit:"-webkit-",Moz:"-moz-",ms:"-ms-"};e.exports=t.default},5699:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=["Webkit"],r=["Moz"],o=["ms"],i=["Webkit","Moz"],a=["Webkit","ms"],s=["Webkit","Moz","ms"];t.default={plugins:[],prefixMap:{appearance:i,userSelect:s,textEmphasisPosition:n,textEmphasis:n,textEmphasisStyle:n,textEmphasisColor:n,boxDecorationBreak:n,clipPath:n,maskImage:n,maskMode:n,maskRepeat:n,maskPosition:n,maskClip:n,maskOrigin:n,maskSize:n,maskComposite:n,mask:n,maskBorderSource:n,maskBorderMode:n,maskBorderSlice:n,maskBorderWidth:n,maskBorderOutset:n,maskBorderRepeat:n,maskBorder:n,maskType:n,textDecorationStyle:n,textDecorationSkip:n,textDecorationLine:n,textDecorationColor:n,filter:n,fontFeatureSettings:n,breakAfter:s,breakBefore:s,breakInside:s,columnCount:i,columnFill:i,columnGap:i,columnRule:i,columnRuleColor:i,columnRuleStyle:i,columnRuleWidth:i,columns:i,columnSpan:i,columnWidth:i,writingMode:a,flex:n,flexBasis:n,flexDirection:n,flexGrow:n,flexFlow:n,flexShrink:n,flexWrap:n,alignContent:n,alignItems:n,alignSelf:n,justifyContent:n,order:n,transform:n,transformOrigin:n,transformOriginX:n,transformOriginY:n,backfaceVisibility:n,perspective:n,perspectiveOrigin:n,transformStyle:n,transformOriginZ:n,animation:n,animationDelay:n,animationDirection:n,animationFillMode:n,animationDuration:n,animationIterationCount:n,animationName:n,animationPlayState:n,animationTimingFunction:n,backdropFilter:n,fontKerning:n,scrollSnapType:a,scrollSnapPointsX:a,scrollSnapPointsY:a,scrollSnapDestination:a,scrollSnapCoordinate:a,shapeImageThreshold:n,shapeImageMargin:n,shapeImageOutside:n,hyphens:s,flowInto:a,flowFrom:a,regionFragment:a,textAlignLast:r,tabSize:r,wrapFlow:o,wrapThrough:o,wrapMargin:o,gridTemplateColumns:o,gridTemplateRows:o,gridTemplateAreas:o,gridTemplate:o,gridAutoColumns:o,gridAutoRows:o,gridAutoFlow:o,grid:o,gridRowStart:o,gridColumnStart:o,gridRowEnd:o,gridRow:o,gridColumn:o,gridColumnEnd:o,gridColumnGap:o,gridRowGap:o,gridArea:o,gridGap:o,textSizeAdjust:a,borderImage:n,borderImageOutset:n,borderImageRepeat:n,borderImageSlice:n,borderImageSource:n,borderImageWidth:n,transitionDelay:n,transitionDuration:n,transitionProperty:n,transitionTimingFunction:n}},e.exports=t.default},6059:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},e.exports=t.default},4761:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){if(e.hasOwnProperty(t))for(var r=e[t],o=0,a=r.length;o<a;++o)n[r[o]+(0,i.default)(t)]=n[t]};var r,o=n(6059),i=(r=o)&&r.__esModule?r:{default:r};e.exports=t.default},5485:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n,r,o){for(var i=0,a=e.length;i<a;++i){var s=e[i](t,n,r,o);if(s)return s}},e.exports=t.default},7521:function(e,t,n){"use strict";const r=n(1438),o=Symbol("max"),i=Symbol("length"),a=Symbol("lengthCalculator"),s=Symbol("allowStale"),l=Symbol("maxAge"),u=Symbol("dispose"),c=Symbol("noDisposeOnSet"),d=Symbol("lruList"),f=Symbol("cache"),h=Symbol("updateAgeOnGet"),p=()=>1;const g=(e,t,n)=>{const r=e[f].get(t);if(r){const t=r.value;if(m(e,t)){if(v(e,r),!e[s])return}else n&&(e[h]&&(r.value.now=Date.now()),e[d].unshiftNode(r));return t.value}},m=(e,t)=>{if(!t||!t.maxAge&&!e[l])return!1;const n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[l]&&n>e[l]},y=e=>{if(e[i]>e[o])for(let t=e[d].tail;e[i]>e[o]&&null!==t;){const n=t.prev;v(e,t),t=n}},v=(e,t)=>{if(t){const n=t.value;e[u]&&e[u](n.key,n.value),e[i]-=n.length,e[f].delete(n.key),e[d].removeNode(t)}};class x{constructor(e,t,n,r,o){this.key=e,this.value=t,this.length=n,this.now=r,this.maxAge=o||0}}const b=(e,t,n,r)=>{let o=n.value;m(e,o)&&(v(e,n),e[s]||(o=void 0)),o&&t.call(r,o.value,o.key,e)};e.exports=class{constructor(e){if("number"===typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!==typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[o]=e.max||1/0;const t=e.length||p;if(this[a]="function"!==typeof t?p:t,this[s]=e.stale||!1,e.maxAge&&"number"!==typeof e.maxAge)throw new TypeError("maxAge must be a number");this[l]=e.maxAge||0,this[u]=e.dispose,this[c]=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[o]=e||1/0,y(this)}get max(){return this[o]}set allowStale(e){this[s]=!!e}get allowStale(){return this[s]}set maxAge(e){if("number"!==typeof e)throw new TypeError("maxAge must be a non-negative number");this[l]=e,y(this)}get maxAge(){return this[l]}set lengthCalculator(e){"function"!==typeof e&&(e=p),e!==this[a]&&(this[a]=e,this[i]=0,this[d].forEach((e=>{e.length=this[a](e.value,e.key),this[i]+=e.length}))),y(this)}get lengthCalculator(){return this[a]}get length(){return this[i]}get itemCount(){return this[d].length}rforEach(e,t){t=t||this;for(let n=this[d].tail;null!==n;){const r=n.prev;b(this,e,n,t),n=r}}forEach(e,t){t=t||this;for(let n=this[d].head;null!==n;){const r=n.next;b(this,e,n,t),n=r}}keys(){return this[d].toArray().map((e=>e.key))}values(){return this[d].toArray().map((e=>e.value))}reset(){this[u]&&this[d]&&this[d].length&&this[d].forEach((e=>this[u](e.key,e.value))),this[f]=new Map,this[d]=new r,this[i]=0}dump(){return this[d].map((e=>!m(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[d]}set(e,t,n){if((n=n||this[l])&&"number"!==typeof n)throw new TypeError("maxAge must be a number");const r=n?Date.now():0,s=this[a](t,e);if(this[f].has(e)){if(s>this[o])return v(this,this[f].get(e)),!1;const a=this[f].get(e).value;return this[u]&&(this[c]||this[u](e,a.value)),a.now=r,a.maxAge=n,a.value=t,this[i]+=s-a.length,a.length=s,this.get(e),y(this),!0}const h=new x(e,t,s,r,n);return h.length>this[o]?(this[u]&&this[u](e,t),!1):(this[i]+=h.length,this[d].unshift(h),this[f].set(e,this[d].head),y(this),!0)}has(e){if(!this[f].has(e))return!1;const t=this[f].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[d].tail;return e?(v(this,e),e.value):null}del(e){v(this,this[f].get(e))}load(e){this.reset();const t=Date.now();for(let n=e.length-1;n>=0;n--){const r=e[n],o=r.e||0;if(0===o)this.set(r.k,r.v);else{const e=o-t;e>0&&this.set(r.k,r.v,e)}}}prune(){this[f].forEach(((e,t)=>g(this,t,!1)))}}},1288:function(e){"use strict";e.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}},1438:function(e,t,n){"use strict";function r(e){var t=this;if(t instanceof r||(t=new r),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 n=0,o=arguments.length;n<o;n++)t.push(arguments[n]);return t}function o(e,t,n){var r=t===e.head?new s(n,null,t,e):new s(n,t,t.next,e);return null===r.next&&(e.tail=r),null===r.prev&&(e.head=r),e.length++,r}function i(e,t){e.tail=new s(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function a(e,t){e.head=new s(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function s(e,t,n,r){if(!(this instanceof s))return new s(e,t,n,r);this.list=r,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,n?(n.prev=this,this.next=n):this.next=null}e.exports=r,r.Node=s,r.create=r,r.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,n=e.prev;return t&&(t.prev=n),n&&(n.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=n),e.list.length--,e.next=null,e.prev=null,e.list=null,t},r.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++}},r.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++}},r.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)i(this,arguments[e]);return this.length},r.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)a(this,arguments[e]);return this.length},r.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}},r.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}},r.prototype.forEach=function(e,t){t=t||this;for(var n=this.head,r=0;null!==n;r++)e.call(t,n.value,r,this),n=n.next},r.prototype.forEachReverse=function(e,t){t=t||this;for(var n=this.tail,r=this.length-1;null!==n;r--)e.call(t,n.value,r,this),n=n.prev},r.prototype.get=function(e){for(var t=0,n=this.head;null!==n&&t<e;t++)n=n.next;if(t===e&&null!==n)return n.value},r.prototype.getReverse=function(e){for(var t=0,n=this.tail;null!==n&&t<e;t++)n=n.prev;if(t===e&&null!==n)return n.value},r.prototype.map=function(e,t){t=t||this;for(var n=new r,o=this.head;null!==o;)n.push(e.call(t,o.value,this)),o=o.next;return n},r.prototype.mapReverse=function(e,t){t=t||this;for(var n=new r,o=this.tail;null!==o;)n.push(e.call(t,o.value,this)),o=o.prev;return n},r.prototype.reduce=function(e,t){var n,r=this.head;if(arguments.length>1)n=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");r=this.head.next,n=this.head.value}for(var o=0;null!==r;o++)n=e(n,r.value,o),r=r.next;return n},r.prototype.reduceReverse=function(e,t){var n,r=this.tail;if(arguments.length>1)n=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");r=this.tail.prev,n=this.tail.value}for(var o=this.length-1;null!==r;o--)n=e(n,r.value,o),r=r.prev;return n},r.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;null!==n;t++)e[t]=n.value,n=n.next;return e},r.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;null!==n;t++)e[t]=n.value,n=n.prev;return e},r.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var n=new r;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var o=0,i=this.head;null!==i&&o<e;o++)i=i.next;for(;null!==i&&o<t;o++,i=i.next)n.push(i.value);return n},r.prototype.sliceReverse=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var n=new r;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var o=this.length,i=this.tail;null!==i&&o>t;o--)i=i.prev;for(;null!==i&&o>e;o--,i=i.prev)n.push(i.value);return n},r.prototype.splice=function(e,t){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var n=0,r=this.head;null!==r&&n<e;n++)r=r.next;var i=[];for(n=0;r&&n<t;n++)i.push(r.value),r=this.removeNode(r);null===r&&(r=this.tail),r!==this.head&&r!==this.tail&&(r=r.prev);for(n=2;n<arguments.length;n++)r=o(this,r,arguments[n]);return i},r.prototype.reverse=function(){for(var e=this.head,t=this.tail,n=e;null!==n;n=n.prev){var r=n.prev;n.prev=n.next,n.next=r}return this.head=t,this.tail=e,this};try{n(1288)(r)}catch(l){}},1678:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=Number.isNaN||function(e){return"number"===typeof e&&e!==e};function o(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(o=e[n],i=t[n],!(o===i||r(o)&&r(i)))return!1;var o,i;return!0}function i(e,t){void 0===t&&(t=o);var n=null;function r(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];if(n&&n.lastThis===this&&t(r,n.lastArgs))return n.lastResult;var i=e.apply(this,r);return n={lastResult:i,lastArgs:r,lastThis:this},i}return r.clear=function(){n=null},r}},5832:function(e){"use strict";var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;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={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(o){return!1}}()?Object.assign:function(e,o){for(var i,a,s=function(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),l=1;l<arguments.length;l++){for(var u in i=Object(arguments[l]))n.call(i,u)&&(s[u]=i[u]);if(t){a=t(i);for(var c=0;c<a.length;c++)r.call(i,a[c])&&(s[a[c]]=i[a[c]])}}return s}},8582:function(e){!function(t,n){"use strict";e.exports=function(e){var t="function"===typeof e,n=!!window.addEventListener,r=window.document,o=window.setTimeout,i=function(e,t,r,o){n?e.addEventListener(t,r,!!o):e.attachEvent("on"+t,r)},a=function(e,t,r,o){n?e.removeEventListener(t,r,!!o):e.detachEvent("on"+t,r)},s=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},l=function(e,t){return-1!==(" "+e.className+" ").indexOf(" "+t+" ")},u=function(e,t){l(e,t)||(e.className=""===e.className?t:e.className+" "+t)},c=function(e,t){e.className=s((" "+e.className+" ").replace(" "+t+" "," "))},d=function(e){return/Array/.test(Object.prototype.toString.call(e))},f=function(e){return/Date/.test(Object.prototype.toString.call(e))&&!isNaN(e.getTime())},h=function(e){var t=e.getDay();return 0===t||6===t},p=function(e){return e%4===0&&e%100!==0||e%400===0},g=function(e,t){return[31,p(e)?29:28,31,30,31,30,31,31,30,31,30,31][t]},m=function(e){f(e)&&e.setHours(0,0,0,0)},y=function(e,t){return e.getTime()===t.getTime()},v=function(e,t,n){var r,o;for(r in t)(o=void 0!==e[r])&&"object"===typeof t[r]&&null!==t[r]&&void 0===t[r].nodeName?f(t[r])?n&&(e[r]=new Date(t[r].getTime())):d(t[r])?n&&(e[r]=t[r].slice(0)):e[r]=v({},t[r],n):!n&&o||(e[r]=t[r]);return e},x=function(e,t,n){var o;r.createEvent?((o=r.createEvent("HTMLEvents")).initEvent(t,!0,!1),o=v(o,n),e.dispatchEvent(o)):r.createEventObject&&(o=r.createEventObject(),o=v(o,n),e.fireEvent("on"+t,o))},b=function(e){return e.month<0&&(e.year-=Math.ceil(Math.abs(e.month)/12),e.month+=12),e.month>11&&(e.year+=Math.floor(Math.abs(e.month)/12),e.month-=12),e},w={field:null,bound:void 0,ariaLabel:"Use the arrow keys to pick a date",position:"bottom left",reposition:!0,format:"YYYY-MM-DD",toString:null,parse:null,defaultDate:null,setDefaultDate:!1,firstDay:0,formatStrict:!1,minDate:null,maxDate:null,yearRange:10,showWeekNumber:!1,pickWholeWeek:!1,minYear:0,maxYear:9999,minMonth:void 0,maxMonth:void 0,startRange:null,endRange:null,isRTL:!1,yearSuffix:"",showMonthAfterYear:!1,showDaysInNextAndPreviousMonths:!1,enableSelectionDaysInNextAndPreviousMonths:!1,numberOfMonths:1,mainCalendar:"left",container:void 0,blurFieldOnSelect:!0,i18n:{previousMonth:"Previous Month",nextMonth:"Next Month",months:["January","February","March","April","May","June","July","August","September","October","November","December"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},theme:null,events:[],onSelect:null,onOpen:null,onClose:null,onDraw:null,keyboardInput:!0},S=function(e,t,n){for(t+=e.firstDay;t>=7;)t-=7;return n?e.i18n.weekdaysShort[t]:e.i18n.weekdays[t]},C=function(e){var t=[],n="false";if(e.isEmpty){if(!e.showDaysInNextAndPreviousMonths)return'<td class="is-empty"></td>';t.push("is-outside-current-month"),e.enableSelectionDaysInNextAndPreviousMonths||t.push("is-selection-disabled")}return e.isDisabled&&t.push("is-disabled"),e.isToday&&t.push("is-today"),e.isSelected&&(t.push("is-selected"),n="true"),e.hasEvent&&t.push("has-event"),e.isInRange&&t.push("is-inrange"),e.isStartRange&&t.push("is-startrange"),e.isEndRange&&t.push("is-endrange"),'<td data-day="'+e.day+'" class="'+t.join(" ")+'" aria-selected="'+n+'"><button class="pika-button pika-day" type="button" data-pika-year="'+e.year+'" data-pika-month="'+e.month+'" data-pika-day="'+e.day+'">'+e.day+"</button></td>"},j=function(e,t,n){var r=new Date(n,0,1);return'<td class="pika-week">'+Math.ceil(((new Date(n,t,e)-r)/864e5+r.getDay()+1)/7)+"</td>"},k=function(e,t,n,r){return'<tr class="pika-row'+(n?" pick-whole-week":"")+(r?" is-selected":"")+'">'+(t?e.reverse():e).join("")+"</tr>"},E=function(e){return"<tbody>"+e.join("")+"</tbody>"},T=function(e){var t,n=[];for(e.showWeekNumber&&n.push("<th></th>"),t=0;t<7;t++)n.push('<th scope="col"><abbr title="'+S(e,t)+'">'+S(e,t,!0)+"</abbr></th>");return"<thead><tr>"+(e.isRTL?n.reverse():n).join("")+"</tr></thead>"},O=function(e,t,n,r,o,i){var a,s,l,u,c,f=e._o,h=n===f.minYear,p=n===f.maxYear,g='<div id="'+i+'" class="pika-title" role="heading" aria-live="assertive">',m=!0,y=!0;for(l=[],a=0;a<12;a++)l.push('<option value="'+(n===o?a-t:12+a-t)+'"'+(a===r?' selected="selected"':"")+(h&&a<f.minMonth||p&&a>f.maxMonth?'disabled="disabled"':"")+">"+f.i18n.months[a]+"</option>");for(u='<div class="pika-label">'+f.i18n.months[r]+'<select class="pika-select pika-select-month" tabindex="-1">'+l.join("")+"</select></div>",d(f.yearRange)?(a=f.yearRange[0],s=f.yearRange[1]+1):(a=n-f.yearRange,s=1+n+f.yearRange),l=[];a<s&&a<=f.maxYear;a++)a>=f.minYear&&l.push('<option value="'+a+'"'+(a===n?' selected="selected"':"")+">"+a+"</option>");return c='<div class="pika-label">'+n+f.yearSuffix+'<select class="pika-select pika-select-year" tabindex="-1">'+l.join("")+"</select></div>",f.showMonthAfterYear?g+=c+u:g+=u+c,h&&(0===r||f.minMonth>=r)&&(m=!1),p&&(11===r||f.maxMonth<=r)&&(y=!1),0===t&&(g+='<button class="pika-prev'+(m?"":" is-disabled")+'" type="button">'+f.i18n.previousMonth+"</button>"),t===e._o.numberOfMonths-1&&(g+='<button class="pika-next'+(y?"":" is-disabled")+'" type="button">'+f.i18n.nextMonth+"</button>"),g+"</div>"},I=function(e,t,n){return'<table cellpadding="0" cellspacing="0" class="pika-table" role="grid" aria-labelledby="'+n+'">'+T(e)+E(t)+"</table>"},D=function(a){var s=this,u=s.config(a);s._onMouseDown=function(e){if(s._v){var t=(e=e||window.event).target||e.srcElement;if(t)if(l(t,"is-disabled")||(!l(t,"pika-button")||l(t,"is-empty")||l(t.parentNode,"is-disabled")?l(t,"pika-prev")?s.prevMonth():l(t,"pika-next")&&s.nextMonth():(s.setDate(new Date(t.getAttribute("data-pika-year"),t.getAttribute("data-pika-month"),t.getAttribute("data-pika-day"))),u.bound&&o((function(){s.hide(),u.blurFieldOnSelect&&u.field&&u.field.blur()}),100))),l(t,"pika-select"))s._c=!0;else{if(!e.preventDefault)return e.returnValue=!1,!1;e.preventDefault()}}},s._onChange=function(e){var t=(e=e||window.event).target||e.srcElement;t&&(l(t,"pika-select-month")?s.gotoMonth(t.value):l(t,"pika-select-year")&&s.gotoYear(t.value))},s._onKeyChange=function(e){if(e=e||window.event,s.isVisible())switch(e.keyCode){case 13:case 27:u.field&&u.field.blur();break;case 37:e.preventDefault(),s.adjustDate("subtract",1);break;case 38:s.adjustDate("subtract",7);break;case 39:s.adjustDate("add",1);break;case 40:s.adjustDate("add",7)}},s._onInputChange=function(n){var r;n.firedBy!==s&&(r=u.parse?u.parse(u.field.value,u.format):t?(r=e(u.field.value,u.format,u.formatStrict))&&r.isValid()?r.toDate():null:new Date(Date.parse(u.field.value)),f(r)&&s.setDate(r),s._v||s.show())},s._onInputFocus=function(){s.show()},s._onInputClick=function(){s.show()},s._onInputBlur=function(){var e=r.activeElement;do{if(l(e,"pika-single"))return}while(e=e.parentNode);s._c||(s._b=o((function(){s.hide()}),50)),s._c=!1},s._onClick=function(e){var t=(e=e||window.event).target||e.srcElement,r=t;if(t){!n&&l(t,"pika-select")&&(t.onchange||(t.setAttribute("onchange","return;"),i(t,"change",s._onChange)));do{if(l(r,"pika-single")||r===u.trigger)return}while(r=r.parentNode);s._v&&t!==u.trigger&&r!==u.trigger&&s.hide()}},s.el=r.createElement("div"),s.el.className="pika-single"+(u.isRTL?" is-rtl":"")+(u.theme?" "+u.theme:""),i(s.el,"mousedown",s._onMouseDown,!0),i(s.el,"touchend",s._onMouseDown,!0),i(s.el,"change",s._onChange),u.keyboardInput&&i(r,"keydown",s._onKeyChange),u.field&&(u.container?u.container.appendChild(s.el):u.bound?r.body.appendChild(s.el):u.field.parentNode.insertBefore(s.el,u.field.nextSibling),i(u.field,"change",s._onInputChange),u.defaultDate||(t&&u.field.value?u.defaultDate=e(u.field.value,u.format).toDate():u.defaultDate=new Date(Date.parse(u.field.value)),u.setDefaultDate=!0));var c=u.defaultDate;f(c)?u.setDefaultDate?s.setDate(c,!0):s.gotoDate(c):s.gotoDate(new Date),u.bound?(this.hide(),s.el.className+=" is-bound",i(u.trigger,"click",s._onInputClick),i(u.trigger,"focus",s._onInputFocus),i(u.trigger,"blur",s._onInputBlur)):this.show()};return D.prototype={config:function(e){this._o||(this._o=v({},w,!0));var t=v(this._o,e,!0);t.isRTL=!!t.isRTL,t.field=t.field&&t.field.nodeName?t.field:null,t.theme="string"===typeof t.theme&&t.theme?t.theme:null,t.bound=!!(void 0!==t.bound?t.field&&t.bound:t.field),t.trigger=t.trigger&&t.trigger.nodeName?t.trigger:t.field,t.disableWeekends=!!t.disableWeekends,t.disableDayFn="function"===typeof t.disableDayFn?t.disableDayFn:null;var n=parseInt(t.numberOfMonths,10)||1;if(t.numberOfMonths=n>4?4:n,f(t.minDate)||(t.minDate=!1),f(t.maxDate)||(t.maxDate=!1),t.minDate&&t.maxDate&&t.maxDate<t.minDate&&(t.maxDate=t.minDate=!1),t.minDate&&this.setMinDate(t.minDate),t.maxDate&&this.setMaxDate(t.maxDate),d(t.yearRange)){var r=(new Date).getFullYear()-10;t.yearRange[0]=parseInt(t.yearRange[0],10)||r,t.yearRange[1]=parseInt(t.yearRange[1],10)||r}else t.yearRange=Math.abs(parseInt(t.yearRange,10))||w.yearRange,t.yearRange>100&&(t.yearRange=100);return t},toString:function(n){return n=n||this._o.format,f(this._d)?this._o.toString?this._o.toString(this._d,n):t?e(this._d).format(n):this._d.toDateString():""},getMoment:function(){return t?e(this._d):null},setMoment:function(n,r){t&&e.isMoment(n)&&this.setDate(n.toDate(),r)},getDate:function(){return f(this._d)?new Date(this._d.getTime()):null},setDate:function(e,t){if(!e)return this._d=null,this._o.field&&(this._o.field.value="",x(this._o.field,"change",{firedBy:this})),this.draw();if("string"===typeof e&&(e=new Date(Date.parse(e))),f(e)){var n=this._o.minDate,r=this._o.maxDate;f(n)&&e<n?e=n:f(r)&&e>r&&(e=r),this._d=new Date(e.getTime()),m(this._d),this.gotoDate(this._d),this._o.field&&(this._o.field.value=this.toString(),x(this._o.field,"change",{firedBy:this})),t||"function"!==typeof this._o.onSelect||this._o.onSelect.call(this,this.getDate())}},gotoDate:function(e){var t=!0;if(f(e)){if(this.calendars){var n=new Date(this.calendars[0].year,this.calendars[0].month,1),r=new Date(this.calendars[this.calendars.length-1].year,this.calendars[this.calendars.length-1].month,1),o=e.getTime();r.setMonth(r.getMonth()+1),r.setDate(r.getDate()-1),t=o<n.getTime()||r.getTime()<o}t&&(this.calendars=[{month:e.getMonth(),year:e.getFullYear()}],"right"===this._o.mainCalendar&&(this.calendars[0].month+=1-this._o.numberOfMonths)),this.adjustCalendars()}},adjustDate:function(e,t){var n,r=this.getDate()||new Date,o=24*parseInt(t)*60*60*1e3;"add"===e?n=new Date(r.valueOf()+o):"subtract"===e&&(n=new Date(r.valueOf()-o)),this.setDate(n)},adjustCalendars:function(){this.calendars[0]=b(this.calendars[0]);for(var e=1;e<this._o.numberOfMonths;e++)this.calendars[e]=b({month:this.calendars[0].month+e,year:this.calendars[0].year});this.draw()},gotoToday:function(){this.gotoDate(new Date)},gotoMonth:function(e){isNaN(e)||(this.calendars[0].month=parseInt(e,10),this.adjustCalendars())},nextMonth:function(){this.calendars[0].month++,this.adjustCalendars()},prevMonth:function(){this.calendars[0].month--,this.adjustCalendars()},gotoYear:function(e){isNaN(e)||(this.calendars[0].year=parseInt(e,10),this.adjustCalendars())},setMinDate:function(e){e instanceof Date?(m(e),this._o.minDate=e,this._o.minYear=e.getFullYear(),this._o.minMonth=e.getMonth()):(this._o.minDate=w.minDate,this._o.minYear=w.minYear,this._o.minMonth=w.minMonth,this._o.startRange=w.startRange),this.draw()},setMaxDate:function(e){e instanceof Date?(m(e),this._o.maxDate=e,this._o.maxYear=e.getFullYear(),this._o.maxMonth=e.getMonth()):(this._o.maxDate=w.maxDate,this._o.maxYear=w.maxYear,this._o.maxMonth=w.maxMonth,this._o.endRange=w.endRange),this.draw()},setStartRange:function(e){this._o.startRange=e},setEndRange:function(e){this._o.endRange=e},draw:function(e){if(this._v||e){var t,n=this._o,r=n.minYear,i=n.maxYear,a=n.minMonth,s=n.maxMonth,l="";this._y<=r&&(this._y=r,!isNaN(a)&&this._m<a&&(this._m=a)),this._y>=i&&(this._y=i,!isNaN(s)&&this._m>s&&(this._m=s)),t="pika-title-"+Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,2);for(var u=0;u<n.numberOfMonths;u++)l+='<div class="pika-lendar">'+O(this,u,this.calendars[u].year,this.calendars[u].month,this.calendars[0].year,t)+this.render(this.calendars[u].year,this.calendars[u].month,t)+"</div>";this.el.innerHTML=l,n.bound&&"hidden"!==n.field.type&&o((function(){n.trigger.focus()}),1),"function"===typeof this._o.onDraw&&this._o.onDraw(this),n.bound&&n.field.setAttribute("aria-label",n.ariaLabel)}},adjustPosition:function(){var e,t,n,o,i,a,s,l,d,f,h,p;if(!this._o.container){if(this.el.style.position="absolute",t=e=this._o.trigger,n=this.el.offsetWidth,o=this.el.offsetHeight,i=window.innerWidth||r.documentElement.clientWidth,a=window.innerHeight||r.documentElement.clientHeight,s=window.pageYOffset||r.body.scrollTop||r.documentElement.scrollTop,h=!0,p=!0,"function"===typeof e.getBoundingClientRect)l=(f=e.getBoundingClientRect()).left+window.pageXOffset,d=f.bottom+window.pageYOffset;else for(l=t.offsetLeft,d=t.offsetTop+t.offsetHeight;t=t.offsetParent;)l+=t.offsetLeft,d+=t.offsetTop;(this._o.reposition&&l+n>i||this._o.position.indexOf("right")>-1&&l-n+e.offsetWidth>0)&&(l=l-n+e.offsetWidth,h=!1),(this._o.reposition&&d+o>a+s||this._o.position.indexOf("top")>-1&&d-o-e.offsetHeight>0)&&(d=d-o-e.offsetHeight,p=!1),this.el.style.left=l+"px",this.el.style.top=d+"px",u(this.el,h?"left-aligned":"right-aligned"),u(this.el,p?"bottom-aligned":"top-aligned"),c(this.el,h?"right-aligned":"left-aligned"),c(this.el,p?"top-aligned":"bottom-aligned")}},render:function(e,t,n){var r=this._o,o=new Date,i=g(e,t),a=new Date(e,t,1).getDay(),s=[],l=[];m(o),r.firstDay>0&&(a-=r.firstDay)<0&&(a+=7);for(var u=0===t?11:t-1,c=11===t?0:t+1,d=0===t?e-1:e,p=11===t?e+1:e,v=g(d,u),x=i+a,b=x;b>7;)b-=7;x+=7-b;for(var w=!1,S=0,E=0;S<x;S++){var T=new Date(e,t,S-a+1),O=!!f(this._d)&&y(T,this._d),D=y(T,o),A=-1!==r.events.indexOf(T.toDateString()),_=S<a||S>=i+a,P=S-a+1,M=t,R=e,N=r.startRange&&y(r.startRange,T),L=r.endRange&&y(r.endRange,T),F=r.startRange&&r.endRange&&r.startRange<T&&T<r.endRange;_&&(S<a?(P=v+P,M=u,R=d):(P-=i,M=c,R=p));var W={day:P,month:M,year:R,hasEvent:A,isSelected:O,isToday:D,isDisabled:r.minDate&&T<r.minDate||r.maxDate&&T>r.maxDate||r.disableWeekends&&h(T)||r.disableDayFn&&r.disableDayFn(T),isEmpty:_,isStartRange:N,isEndRange:L,isInRange:F,showDaysInNextAndPreviousMonths:r.showDaysInNextAndPreviousMonths,enableSelectionDaysInNextAndPreviousMonths:r.enableSelectionDaysInNextAndPreviousMonths};r.pickWholeWeek&&O&&(w=!0),l.push(C(W)),7===++E&&(r.showWeekNumber&&l.unshift(j(S-a,t,e)),s.push(k(l,r.isRTL,r.pickWholeWeek,w)),l=[],E=0,w=!1)}return I(r,s,n)},isVisible:function(){return this._v},show:function(){this.isVisible()||(this._v=!0,this.draw(),c(this.el,"is-hidden"),this._o.bound&&(i(r,"click",this._onClick),this.adjustPosition()),"function"===typeof this._o.onOpen&&this._o.onOpen.call(this))},hide:function(){var e=this._v;!1!==e&&(this._o.bound&&a(r,"click",this._onClick),this.el.style.position="static",this.el.style.left="auto",this.el.style.top="auto",u(this.el,"is-hidden"),this._v=!1,void 0!==e&&"function"===typeof this._o.onClose&&this._o.onClose.call(this))},destroy:function(){var e=this._o;this.hide(),a(this.el,"mousedown",this._onMouseDown,!0),a(this.el,"touchend",this._onMouseDown,!0),a(this.el,"change",this._onChange),e.keyboardInput&&a(r,"keydown",this._onKeyChange),e.field&&(a(e.field,"change",this._onInputChange),e.bound&&(a(e.trigger,"click",this._onInputClick),a(e.trigger,"focus",this._onInputFocus),a(e.trigger,"blur",this._onInputBlur))),this.el.parentNode&&this.el.parentNode.removeChild(this.el)}},D}(null)}()},1266:function(e,t,n){"use strict";var r=n(5092);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,a){if(a!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},7633:function(e,t,n){e.exports=n(1266)()},5092:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},2663:function(e,t,n){"use strict";var r=n(3017),o=n(4796);function i(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var a=new Set,s={};function l(e,t){u(e,t),u(e+"Capture",t)}function u(e,t){for(s[e]=t,e=0;e<t.length;e++)a.add(t[e])}var c=!("undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement),d=Object.prototype.hasOwnProperty,f=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,h={},p={};function g(e,t,n,r,o,i,a){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=a}var m={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){m[e]=new g(e,0,!1,e,null,!1,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];m[t]=new g(t,1,!1,e[1],null,!1,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){m[e]=new g(e,2,!1,e.toLowerCase(),null,!1,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){m[e]=new g(e,2,!1,e,null,!1,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){m[e]=new g(e,3,!1,e.toLowerCase(),null,!1,!1)})),["checked","multiple","muted","selected"].forEach((function(e){m[e]=new g(e,3,!0,e,null,!1,!1)})),["capture","download"].forEach((function(e){m[e]=new g(e,4,!1,e,null,!1,!1)})),["cols","rows","size","span"].forEach((function(e){m[e]=new g(e,6,!1,e,null,!1,!1)})),["rowSpan","start"].forEach((function(e){m[e]=new g(e,5,!1,e.toLowerCase(),null,!1,!1)}));var y=/[\-:]([a-z])/g;function v(e){return e[1].toUpperCase()}function x(e,t,n,r){var o=m.hasOwnProperty(t)?m[t]:null;(null!==o?0!==o.type:r||!(2<t.length)||"o"!==t[0]&&"O"!==t[0]||"n"!==t[1]&&"N"!==t[1])&&(function(e,t,n,r){if(null===t||"undefined"===typeof t||function(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,n,o,r)&&(n=null),r||null===o?function(e){return!!d.call(p,e)||!d.call(h,e)&&(f.test(e)?p[e]=!0:(h[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=null===n?3!==o.type&&"":n:(t=o.attributeName,r=o.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(o=o.type)||4===o&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(y,v);m[t]=new g(t,1,!1,e,null,!1,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(y,v);m[t]=new g(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(y,v);m[t]=new g(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)})),["tabIndex","crossOrigin"].forEach((function(e){m[e]=new g(e,1,!1,e.toLowerCase(),null,!1,!1)})),m.xlinkHref=new g("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach((function(e){m[e]=new g(e,1,!1,e.toLowerCase(),null,!0,!0)}));var b=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,w=Symbol.for("react.element"),S=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),E=Symbol.for("react.provider"),T=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),A=Symbol.for("react.memo"),_=Symbol.for("react.lazy");Symbol.for("react.scope"),Symbol.for("react.debug_trace_mode");var P=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden"),Symbol.for("react.cache"),Symbol.for("react.tracing_marker");var M=Symbol.iterator;function R(e){return null===e||"object"!==typeof e?null:"function"===typeof(e=M&&e[M]||e["@@iterator"])?e:null}var N,L=Object.assign;function F(e){if(void 0===N)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);N=t&&t[1]||""}return"\n"+N+e}var W=!1;function B(e,t){if(!e||W)return"";W=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"===typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&"string"===typeof u.stack){for(var o=u.stack.split("\n"),i=r.stack.split("\n"),a=o.length-1,s=i.length-1;1<=a&&0<=s&&o[a]!==i[s];)s--;for(;1<=a&&0<=s;a--,s--)if(o[a]!==i[s]){if(1!==a||1!==s)do{if(a--,0>--s||o[a]!==i[s]){var l="\n"+o[a].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}}while(1<=a&&0<=s);break}}}finally{W=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?F(e):""}function z(e){switch(e.tag){case 5:return F(e.type);case 16:return F("Lazy");case 13:return F("Suspense");case 19:return F("SuspenseList");case 0:case 2:case 15:return e=B(e.type,!1);case 11:return e=B(e.type.render,!1);case 1:return e=B(e.type,!0);default:return""}}function G(e){if(null==e)return null;if("function"===typeof e)return e.displayName||e.name||null;if("string"===typeof e)return e;switch(e){case C:return"Fragment";case S:return"Portal";case k:return"Profiler";case j:return"StrictMode";case I:return"Suspense";case D:return"SuspenseList"}if("object"===typeof e)switch(e.$$typeof){case T:return(e.displayName||"Context")+".Consumer";case E:return(e._context.displayName||"Context")+".Provider";case O:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case A:return null!==(t=e.displayName||null)?t:G(e.type)||"Memo";case _:t=e._payload,e=e._init;try{return G(e(t))}catch(n){}}return null}function Z(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=(e=t.render).displayName||e.name||"",t.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return G(t);case 8:return t===j?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"===typeof t)return t.displayName||t.name||null;if("string"===typeof t)return t}return null}function U(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function H(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function K(e){e._valueTracker||(e._valueTracker=function(e){var t=H(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&"undefined"!==typeof n&&"function"===typeof n.get&&"function"===typeof n.set){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(e){r=""+e,i.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function V(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=H(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function q(e){if("undefined"===typeof(e=e||("undefined"!==typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function $(e,t){var n=t.checked;return L({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function Y(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=U(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function Q(e,t){null!=(t=t.checked)&&x(e,"checked",t,!1)}function X(e,t){Q(e,t);var n=U(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?ee(e,t.type,n):t.hasOwnProperty("defaultValue")&&ee(e,t.type,U(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function J(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function ee(e,t,n){"number"===t&&q(e.ownerDocument)===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var te=Array.isArray;function ne(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+U(n),t=null,o=0;o<e.length;o++){if(e[o].value===n)return e[o].selected=!0,void(r&&(e[o].defaultSelected=!0));null!==t||e[o].disabled||(t=e[o])}null!==t&&(t.selected=!0)}}function re(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(i(91));return L({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function oe(e,t){var n=t.value;if(null==n){if(n=t.children,t=t.defaultValue,null!=n){if(null!=t)throw Error(i(92));if(te(n)){if(1<n.length)throw Error(i(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:U(n)}}function ie(e,t){var n=U(t.value),r=U(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function ae(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}function se(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function le(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?se(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var ue,ce,de=(ce=function(e,t){if("http://www.w3.org/2000/svg"!==e.namespaceURI||"innerHTML"in e)e.innerHTML=t;else{for((ue=ue||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ue.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,r){MSApp.execUnsafeLocalFunction((function(){return ce(e,t)}))}:ce);function fe(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var he={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},pe=["Webkit","ms","Moz","O"];function ge(e,t,n){return null==t||"boolean"===typeof t||""===t?"":n||"number"!==typeof t||0===t||he.hasOwnProperty(e)&&he[e]?(""+t).trim():t+"px"}function me(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),o=ge(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}Object.keys(he).forEach((function(e){pe.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),he[t]=he[e]}))}));var ye=L({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ve(e,t){if(t){if(ye[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(i(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(i(60));if("object"!==typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(i(61))}if(null!=t.style&&"object"!==typeof t.style)throw Error(i(62))}}function xe(e,t){if(-1===e.indexOf("-"))return"string"===typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var be=null;function we(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var Se=null,Ce=null,je=null;function ke(e){if(e=bo(e)){if("function"!==typeof Se)throw Error(i(280));var t=e.stateNode;t&&(t=So(t),Se(e.stateNode,e.type,t))}}function Ee(e){Ce?je?je.push(e):je=[e]:Ce=e}function Te(){if(Ce){var e=Ce,t=je;if(je=Ce=null,ke(e),t)for(e=0;e<t.length;e++)ke(t[e])}}function Oe(e,t){return e(t)}function Ie(){}var De=!1;function Ae(e,t,n){if(De)return e(t,n);De=!0;try{return Oe(e,t,n)}finally{De=!1,(null!==Ce||null!==je)&&(Ie(),Te())}}function _e(e,t){var n=e.stateNode;if(null===n)return null;var r=So(n);if(null===r)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break e;default:e=!1}if(e)return null;if(n&&"function"!==typeof n)throw Error(i(231,t,typeof n));return n}var Pe=!1;if(c)try{var Me={};Object.defineProperty(Me,"passive",{get:function(){Pe=!0}}),window.addEventListener("test",Me,Me),window.removeEventListener("test",Me,Me)}catch(ce){Pe=!1}function Re(e,t,n,r,o,i,a,s,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(c){this.onError(c)}}var Ne=!1,Le=null,Fe=!1,We=null,Be={onError:function(e){Ne=!0,Le=e}};function ze(e,t,n,r,o,i,a,s,l){Ne=!1,Le=null,Re.apply(Be,arguments)}function Ge(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!==(4098&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function Ze(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function Ue(e){if(Ge(e)!==e)throw Error(i(188))}function He(e){return null!==(e=function(e){var t=e.alternate;if(!t){if(null===(t=Ge(e)))throw Error(i(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(null===o)break;var a=o.alternate;if(null===a){if(null!==(r=o.return)){n=r;continue}break}if(o.child===a.child){for(a=o.child;a;){if(a===n)return Ue(o),e;if(a===r)return Ue(o),t;a=a.sibling}throw Error(i(188))}if(n.return!==r.return)n=o,r=a;else{for(var s=!1,l=o.child;l;){if(l===n){s=!0,n=o,r=a;break}if(l===r){s=!0,r=o,n=a;break}l=l.sibling}if(!s){for(l=a.child;l;){if(l===n){s=!0,n=a,r=o;break}if(l===r){s=!0,r=a,n=o;break}l=l.sibling}if(!s)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(3!==n.tag)throw Error(i(188));return n.stateNode.current===n?e:t}(e))?Ke(e):null}function Ke(e){if(5===e.tag||6===e.tag)return e;for(e=e.child;null!==e;){var t=Ke(e);if(null!==t)return t;e=e.sibling}return null}var Ve=o.unstable_scheduleCallback,qe=o.unstable_cancelCallback,$e=o.unstable_shouldYield,Ye=o.unstable_requestPaint,Qe=o.unstable_now,Xe=o.unstable_getCurrentPriorityLevel,Je=o.unstable_ImmediatePriority,et=o.unstable_UserBlockingPriority,tt=o.unstable_NormalPriority,nt=o.unstable_LowPriority,rt=o.unstable_IdlePriority,ot=null,it=null;var at=Math.clz32?Math.clz32:function(e){return e>>>=0,0===e?32:31-(st(e)/lt|0)|0},st=Math.log,lt=Math.LN2;var ut=64,ct=4194304;function dt(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function ft(e,t){var n=e.pendingLanes;if(0===n)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,a=268435455&n;if(0!==a){var s=a&~o;0!==s?r=dt(s):0!==(i&=a)&&(r=dt(i))}else 0!==(a=n&~o)?r=dt(a):0!==i&&(r=dt(i));if(0===r)return 0;if(0!==t&&t!==r&&0===(t&o)&&((o=r&-r)>=(i=t&-t)||16===o&&0!==(4194240&i)))return t;if(0!==(4&r)&&(r|=16&n),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0<t;)o=1<<(n=31-at(t)),r|=e[n],t&=~o;return r}function ht(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return-1}}function pt(e){return 0!==(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function gt(){var e=ut;return 0===(4194240&(ut<<=1))&&(ut=64),e}function mt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function yt(e,t,n){e.pendingLanes|=t,536870912!==t&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[t=31-at(t)]=n}function vt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-at(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var xt=0;function bt(e){return 1<(e&=-e)?4<e?0!==(268435455&e)?16:536870912:4:1}var wt,St,Ct,jt,kt,Et=!1,Tt=[],Ot=null,It=null,Dt=null,At=new Map,_t=new Map,Pt=[],Mt="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Rt(e,t){switch(e){case"focusin":case"focusout":Ot=null;break;case"dragenter":case"dragleave":It=null;break;case"mouseover":case"mouseout":Dt=null;break;case"pointerover":case"pointerout":At.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":_t.delete(t.pointerId)}}function Nt(e,t,n,r,o,i){return null===e||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[o]},null!==t&&(null!==(t=bo(t))&&St(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,null!==o&&-1===t.indexOf(o)&&t.push(o),e)}function Lt(e){var t=xo(e.target);if(null!==t){var n=Ge(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=Ze(n)))return e.blockedOn=t,void kt(e.priority,(function(){Ct(n)}))}else if(3===t&&n.stateNode.current.memoizedState.isDehydrated)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function Ft(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=$t(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n)return null!==(t=bo(n))&&St(t),e.blockedOn=n,!1;var r=new(n=e.nativeEvent).constructor(n.type,n);be=r,n.target.dispatchEvent(r),be=null,t.shift()}return!0}function Wt(e,t,n){Ft(e)&&n.delete(t)}function Bt(){Et=!1,null!==Ot&&Ft(Ot)&&(Ot=null),null!==It&&Ft(It)&&(It=null),null!==Dt&&Ft(Dt)&&(Dt=null),At.forEach(Wt),_t.forEach(Wt)}function zt(e,t){e.blockedOn===t&&(e.blockedOn=null,Et||(Et=!0,o.unstable_scheduleCallback(o.unstable_NormalPriority,Bt)))}function Gt(e){function t(t){return zt(t,e)}if(0<Tt.length){zt(Tt[0],e);for(var n=1;n<Tt.length;n++){var r=Tt[n];r.blockedOn===e&&(r.blockedOn=null)}}for(null!==Ot&&zt(Ot,e),null!==It&&zt(It,e),null!==Dt&&zt(Dt,e),At.forEach(t),_t.forEach(t),n=0;n<Pt.length;n++)(r=Pt[n]).blockedOn===e&&(r.blockedOn=null);for(;0<Pt.length&&null===(n=Pt[0]).blockedOn;)Lt(n),null===n.blockedOn&&Pt.shift()}var Zt=b.ReactCurrentBatchConfig,Ut=!0;function Ht(e,t,n,r){var o=xt,i=Zt.transition;Zt.transition=null;try{xt=1,Vt(e,t,n,r)}finally{xt=o,Zt.transition=i}}function Kt(e,t,n,r){var o=xt,i=Zt.transition;Zt.transition=null;try{xt=4,Vt(e,t,n,r)}finally{xt=o,Zt.transition=i}}function Vt(e,t,n,r){if(Ut){var o=$t(e,t,n,r);if(null===o)Ur(e,t,r,qt,n),Rt(e,r);else if(function(e,t,n,r,o){switch(t){case"focusin":return Ot=Nt(Ot,e,t,n,r,o),!0;case"dragenter":return It=Nt(It,e,t,n,r,o),!0;case"mouseover":return Dt=Nt(Dt,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return At.set(i,Nt(At.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,_t.set(i,Nt(_t.get(i)||null,e,t,n,r,o)),!0}return!1}(o,e,t,n,r))r.stopPropagation();else if(Rt(e,r),4&t&&-1<Mt.indexOf(e)){for(;null!==o;){var i=bo(o);if(null!==i&&wt(i),null===(i=$t(e,t,n,r))&&Ur(e,t,r,qt,n),i===o)break;o=i}null!==o&&r.stopPropagation()}else Ur(e,t,r,null,n)}}var qt=null;function $t(e,t,n,r){if(qt=null,null!==(e=xo(e=we(r))))if(null===(t=Ge(e)))e=null;else if(13===(n=t.tag)){if(null!==(e=Ze(t)))return e;e=null}else if(3===n){if(t.stateNode.current.memoizedState.isDehydrated)return 3===t.tag?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return qt=e,null}function Yt(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Xe()){case Je:return 1;case et:return 4;case tt:case nt:return 16;case rt:return 536870912;default:return 16}default:return 16}}var Qt=null,Xt=null,Jt=null;function en(){if(Jt)return Jt;var e,t,n=Xt,r=n.length,o="value"in Qt?Qt.value:Qt.textContent,i=o.length;for(e=0;e<r&&n[e]===o[e];e++);var a=r-e;for(t=1;t<=a&&n[r-t]===o[i-t];t++);return Jt=o.slice(e,1<t?1-t:void 0)}function tn(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function nn(){return!0}function rn(){return!1}function on(e){function t(t,n,r,o,i){for(var a in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=o,this.target=i,this.currentTarget=null,e)e.hasOwnProperty(a)&&(t=e[a],this[a]=t?t(o):o[a]);return this.isDefaultPrevented=(null!=o.defaultPrevented?o.defaultPrevented:!1===o.returnValue)?nn:rn,this.isPropagationStopped=rn,this}return L(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!==typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=nn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!==typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=nn)},persist:function(){},isPersistent:nn}),t}var an,sn,ln,un={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},cn=on(un),dn=L({},un,{view:0,detail:0}),fn=on(dn),hn=L({},dn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:kn,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==ln&&(ln&&"mousemove"===e.type?(an=e.screenX-ln.screenX,sn=e.screenY-ln.screenY):sn=an=0,ln=e),an)},movementY:function(e){return"movementY"in e?e.movementY:sn}}),pn=on(hn),gn=on(L({},hn,{dataTransfer:0})),mn=on(L({},dn,{relatedTarget:0})),yn=on(L({},un,{animationName:0,elapsedTime:0,pseudoElement:0})),vn=L({},un,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),xn=on(vn),bn=on(L({},un,{data:0})),wn={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Sn={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Cn={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function jn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=Cn[e])&&!!t[e]}function kn(){return jn}var En=L({},dn,{key:function(e){if(e.key){var t=wn[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=tn(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?Sn[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:kn,charCode:function(e){return"keypress"===e.type?tn(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?tn(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),Tn=on(En),On=on(L({},hn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),In=on(L({},dn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:kn})),Dn=on(L({},un,{propertyName:0,elapsedTime:0,pseudoElement:0})),An=L({},hn,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),_n=on(An),Pn=[9,13,27,32],Mn=c&&"CompositionEvent"in window,Rn=null;c&&"documentMode"in document&&(Rn=document.documentMode);var Nn=c&&"TextEvent"in window&&!Rn,Ln=c&&(!Mn||Rn&&8<Rn&&11>=Rn),Fn=String.fromCharCode(32),Wn=!1;function Bn(e,t){switch(e){case"keyup":return-1!==Pn.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function zn(e){return"object"===typeof(e=e.detail)&&"data"in e?e.data:null}var Gn=!1;var Zn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Un(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Zn[e.type]:"textarea"===t}function Hn(e,t,n,r){Ee(r),0<(t=Kr(t,"onChange")).length&&(n=new cn("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Kn=null,Vn=null;function qn(e){Fr(e,0)}function $n(e){if(V(wo(e)))return e}function Yn(e,t){if("change"===e)return t}var Qn=!1;if(c){var Xn;if(c){var Jn="oninput"in document;if(!Jn){var er=document.createElement("div");er.setAttribute("oninput","return;"),Jn="function"===typeof er.oninput}Xn=Jn}else Xn=!1;Qn=Xn&&(!document.documentMode||9<document.documentMode)}function tr(){Kn&&(Kn.detachEvent("onpropertychange",nr),Vn=Kn=null)}function nr(e){if("value"===e.propertyName&&$n(Vn)){var t=[];Hn(t,Vn,e,we(e)),Ae(qn,t)}}function rr(e,t,n){"focusin"===e?(tr(),Vn=n,(Kn=t).attachEvent("onpropertychange",nr)):"focusout"===e&&tr()}function or(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return $n(Vn)}function ir(e,t){if("click"===e)return $n(t)}function ar(e,t){if("input"===e||"change"===e)return $n(t)}var sr="function"===typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e===1/t)||e!==e&&t!==t};function lr(e,t){if(sr(e,t))return!0;if("object"!==typeof e||null===e||"object"!==typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!d.call(t,o)||!sr(e[o],t[o]))return!1}return!0}function ur(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function cr(e,t){var n,r=ur(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=ur(r)}}function dr(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?dr(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function fr(){for(var e=window,t=q();t instanceof e.HTMLIFrameElement;){try{var n="string"===typeof t.contentWindow.location.href}catch(r){n=!1}if(!n)break;t=q((e=t.contentWindow).document)}return t}function hr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}function pr(e){var t=fr(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&dr(n.ownerDocument.documentElement,n)){if(null!==r&&hr(n))if(t=r.start,void 0===(e=r.end)&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if((e=(t=n.ownerDocument||document)&&t.defaultView||window).getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=void 0===r.end?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=cr(n,i);var a=cr(n,r);o&&a&&(1!==e.rangeCount||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&((t=t.createRange()).setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}for(t=[],e=n;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"===typeof n.focus&&n.focus(),n=0;n<t.length;n++)(e=t[n]).element.scrollLeft=e.left,e.element.scrollTop=e.top}}var gr=c&&"documentMode"in document&&11>=document.documentMode,mr=null,yr=null,vr=null,xr=!1;function br(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;xr||null==mr||mr!==q(r)||("selectionStart"in(r=mr)&&hr(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},vr&&lr(vr,r)||(vr=r,0<(r=Kr(yr,"onSelect")).length&&(t=new cn("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=mr)))}function wr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Sr={animationend:wr("Animation","AnimationEnd"),animationiteration:wr("Animation","AnimationIteration"),animationstart:wr("Animation","AnimationStart"),transitionend:wr("Transition","TransitionEnd")},Cr={},jr={};function kr(e){if(Cr[e])return Cr[e];if(!Sr[e])return e;var t,n=Sr[e];for(t in n)if(n.hasOwnProperty(t)&&t in jr)return Cr[e]=n[t];return e}c&&(jr=document.createElement("div").style,"AnimationEvent"in window||(delete Sr.animationend.animation,delete Sr.animationiteration.animation,delete Sr.animationstart.animation),"TransitionEvent"in window||delete Sr.transitionend.transition);var Er=kr("animationend"),Tr=kr("animationiteration"),Or=kr("animationstart"),Ir=kr("transitionend"),Dr=new Map,Ar="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function _r(e,t){Dr.set(e,t),l(t,[e])}for(var Pr=0;Pr<Ar.length;Pr++){var Mr=Ar[Pr];_r(Mr.toLowerCase(),"on"+(Mr[0].toUpperCase()+Mr.slice(1)))}_r(Er,"onAnimationEnd"),_r(Tr,"onAnimationIteration"),_r(Or,"onAnimationStart"),_r("dblclick","onDoubleClick"),_r("focusin","onFocus"),_r("focusout","onBlur"),_r(Ir,"onTransitionEnd"),u("onMouseEnter",["mouseout","mouseover"]),u("onMouseLeave",["mouseout","mouseover"]),u("onPointerEnter",["pointerout","pointerover"]),u("onPointerLeave",["pointerout","pointerover"]),l("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),l("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),l("onBeforeInput",["compositionend","keypress","textInput","paste"]),l("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Rr="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Nr=new Set("cancel close invalid load scroll toggle".split(" ").concat(Rr));function Lr(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,function(e,t,n,r,o,a,s,l,u){if(ze.apply(this,arguments),Ne){if(!Ne)throw Error(i(198));var c=Le;Ne=!1,Le=null,Fe||(Fe=!0,We=c)}}(r,t,void 0,e),e.currentTarget=null}function Fr(e,t){t=0!==(4&t);for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var a=r.length-1;0<=a;a--){var s=r[a],l=s.instance,u=s.currentTarget;if(s=s.listener,l!==i&&o.isPropagationStopped())break e;Lr(o,s,u),i=l}else for(a=0;a<r.length;a++){if(l=(s=r[a]).instance,u=s.currentTarget,s=s.listener,l!==i&&o.isPropagationStopped())break e;Lr(o,s,u),i=l}}}if(Fe)throw e=We,Fe=!1,We=null,e}function Wr(e,t){var n=t[mo];void 0===n&&(n=t[mo]=new Set);var r=e+"__bubble";n.has(r)||(Zr(t,e,2,!1),n.add(r))}function Br(e,t,n){var r=0;t&&(r|=4),Zr(n,e,r,t)}var zr="_reactListening"+Math.random().toString(36).slice(2);function Gr(e){if(!e[zr]){e[zr]=!0,a.forEach((function(t){"selectionchange"!==t&&(Nr.has(t)||Br(t,!1,e),Br(t,!0,e))}));var t=9===e.nodeType?e:e.ownerDocument;null===t||t[zr]||(t[zr]=!0,Br("selectionchange",!1,t))}}function Zr(e,t,n,r){switch(Yt(t)){case 1:var o=Ht;break;case 4:o=Kt;break;default:o=Vt}n=o.bind(null,t,n,e),o=void 0,!Pe||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(o=!0),r?void 0!==o?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):void 0!==o?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function Ur(e,t,n,r,o){var i=r;if(0===(1&t)&&0===(2&t)&&null!==r)e:for(;;){if(null===r)return;var a=r.tag;if(3===a||4===a){var s=r.stateNode.containerInfo;if(s===o||8===s.nodeType&&s.parentNode===o)break;if(4===a)for(a=r.return;null!==a;){var l=a.tag;if((3===l||4===l)&&((l=a.stateNode.containerInfo)===o||8===l.nodeType&&l.parentNode===o))return;a=a.return}for(;null!==s;){if(null===(a=xo(s)))return;if(5===(l=a.tag)||6===l){r=i=a;continue e}s=s.parentNode}}r=r.return}Ae((function(){var r=i,o=we(n),a=[];e:{var s=Dr.get(e);if(void 0!==s){var l=cn,u=e;switch(e){case"keypress":if(0===tn(n))break e;case"keydown":case"keyup":l=Tn;break;case"focusin":u="focus",l=mn;break;case"focusout":u="blur",l=mn;break;case"beforeblur":case"afterblur":l=mn;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":l=pn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":l=gn;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":l=In;break;case Er:case Tr:case Or:l=yn;break;case Ir:l=Dn;break;case"scroll":l=fn;break;case"wheel":l=_n;break;case"copy":case"cut":case"paste":l=xn;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":l=On}var c=0!==(4&t),d=!c&&"scroll"===e,f=c?null!==s?s+"Capture":null:s;c=[];for(var h,p=r;null!==p;){var g=(h=p).stateNode;if(5===h.tag&&null!==g&&(h=g,null!==f&&(null!=(g=_e(p,f))&&c.push(Hr(p,g,h)))),d)break;p=p.return}0<c.length&&(s=new l(s,u,null,n,o),a.push({event:s,listeners:c}))}}if(0===(7&t)){if(l="mouseout"===e||"pointerout"===e,(!(s="mouseover"===e||"pointerover"===e)||n===be||!(u=n.relatedTarget||n.fromElement)||!xo(u)&&!u[go])&&(l||s)&&(s=o.window===o?o:(s=o.ownerDocument)?s.defaultView||s.parentWindow:window,l?(l=r,null!==(u=(u=n.relatedTarget||n.toElement)?xo(u):null)&&(u!==(d=Ge(u))||5!==u.tag&&6!==u.tag)&&(u=null)):(l=null,u=r),l!==u)){if(c=pn,g="onMouseLeave",f="onMouseEnter",p="mouse","pointerout"!==e&&"pointerover"!==e||(c=On,g="onPointerLeave",f="onPointerEnter",p="pointer"),d=null==l?s:wo(l),h=null==u?s:wo(u),(s=new c(g,p+"leave",l,n,o)).target=d,s.relatedTarget=h,g=null,xo(o)===r&&((c=new c(f,p+"enter",u,n,o)).target=h,c.relatedTarget=d,g=c),d=g,l&&u)e:{for(f=u,p=0,h=c=l;h;h=Vr(h))p++;for(h=0,g=f;g;g=Vr(g))h++;for(;0<p-h;)c=Vr(c),p--;for(;0<h-p;)f=Vr(f),h--;for(;p--;){if(c===f||null!==f&&c===f.alternate)break e;c=Vr(c),f=Vr(f)}c=null}else c=null;null!==l&&qr(a,s,l,c,!1),null!==u&&null!==d&&qr(a,d,u,c,!0)}if("select"===(l=(s=r?wo(r):window).nodeName&&s.nodeName.toLowerCase())||"input"===l&&"file"===s.type)var m=Yn;else if(Un(s))if(Qn)m=ar;else{m=or;var y=rr}else(l=s.nodeName)&&"input"===l.toLowerCase()&&("checkbox"===s.type||"radio"===s.type)&&(m=ir);switch(m&&(m=m(e,r))?Hn(a,m,n,o):(y&&y(e,s,r),"focusout"===e&&(y=s._wrapperState)&&y.controlled&&"number"===s.type&&ee(s,"number",s.value)),y=r?wo(r):window,e){case"focusin":(Un(y)||"true"===y.contentEditable)&&(mr=y,yr=r,vr=null);break;case"focusout":vr=yr=mr=null;break;case"mousedown":xr=!0;break;case"contextmenu":case"mouseup":case"dragend":xr=!1,br(a,n,o);break;case"selectionchange":if(gr)break;case"keydown":case"keyup":br(a,n,o)}var v;if(Mn)e:{switch(e){case"compositionstart":var x="onCompositionStart";break e;case"compositionend":x="onCompositionEnd";break e;case"compositionupdate":x="onCompositionUpdate";break e}x=void 0}else Gn?Bn(e,n)&&(x="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(x="onCompositionStart");x&&(Ln&&"ko"!==n.locale&&(Gn||"onCompositionStart"!==x?"onCompositionEnd"===x&&Gn&&(v=en()):(Xt="value"in(Qt=o)?Qt.value:Qt.textContent,Gn=!0)),0<(y=Kr(r,x)).length&&(x=new bn(x,e,null,n,o),a.push({event:x,listeners:y}),v?x.data=v:null!==(v=zn(n))&&(x.data=v))),(v=Nn?function(e,t){switch(e){case"compositionend":return zn(t);case"keypress":return 32!==t.which?null:(Wn=!0,Fn);case"textInput":return(e=t.data)===Fn&&Wn?null:e;default:return null}}(e,n):function(e,t){if(Gn)return"compositionend"===e||!Mn&&Bn(e,t)?(e=en(),Jt=Xt=Qt=null,Gn=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Ln&&"ko"!==t.locale?null:t.data}}(e,n))&&(0<(r=Kr(r,"onBeforeInput")).length&&(o=new bn("onBeforeInput","beforeinput",null,n,o),a.push({event:o,listeners:r}),o.data=v))}Fr(a,t)}))}function Hr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Kr(e,t){for(var n=t+"Capture",r=[];null!==e;){var o=e,i=o.stateNode;5===o.tag&&null!==i&&(o=i,null!=(i=_e(e,n))&&r.unshift(Hr(e,i,o)),null!=(i=_e(e,t))&&r.push(Hr(e,i,o))),e=e.return}return r}function Vr(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag);return e||null}function qr(e,t,n,r,o){for(var i=t._reactName,a=[];null!==n&&n!==r;){var s=n,l=s.alternate,u=s.stateNode;if(null!==l&&l===r)break;5===s.tag&&null!==u&&(s=u,o?null!=(l=_e(n,i))&&a.unshift(Hr(n,l,s)):o||null!=(l=_e(n,i))&&a.push(Hr(n,l,s))),n=n.return}0!==a.length&&e.push({event:t,listeners:a})}var $r=/\r\n?/g,Yr=/\u0000|\uFFFD/g;function Qr(e){return("string"===typeof e?e:""+e).replace($r,"\n").replace(Yr,"")}function Xr(e,t,n){if(t=Qr(t),Qr(e)!==t&&n)throw Error(i(425))}function Jr(){}var eo=null,to=null;function no(e,t){return"textarea"===e||"noscript"===e||"string"===typeof t.children||"number"===typeof t.children||"object"===typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var ro="function"===typeof setTimeout?setTimeout:void 0,oo="function"===typeof clearTimeout?clearTimeout:void 0,io="function"===typeof Promise?Promise:void 0,ao="function"===typeof queueMicrotask?queueMicrotask:"undefined"!==typeof io?function(e){return io.resolve(null).then(e).catch(so)}:ro;function so(e){setTimeout((function(){throw e}))}function lo(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&8===o.nodeType)if("/$"===(n=o.data)){if(0===r)return e.removeChild(o),void Gt(t);r--}else"$"!==n&&"$?"!==n&&"$!"!==n||r++;n=o}while(n);Gt(t)}function uo(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){if("$"===(t=e.data)||"$!"===t||"$?"===t)break;if("/$"===t)return null}}return e}function co(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var fo=Math.random().toString(36).slice(2),ho="__reactFiber$"+fo,po="__reactProps$"+fo,go="__reactContainer$"+fo,mo="__reactEvents$"+fo,yo="__reactListeners$"+fo,vo="__reactHandles$"+fo;function xo(e){var t=e[ho];if(t)return t;for(var n=e.parentNode;n;){if(t=n[go]||n[ho]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=co(e);null!==e;){if(n=e[ho])return n;e=co(e)}return t}n=(e=n).parentNode}return null}function bo(e){return!(e=e[ho]||e[go])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function wo(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(i(33))}function So(e){return e[po]||null}var Co=[],jo=-1;function ko(e){return{current:e}}function Eo(e){0>jo||(e.current=Co[jo],Co[jo]=null,jo--)}function To(e,t){jo++,Co[jo]=e.current,e.current=t}var Oo={},Io=ko(Oo),Do=ko(!1),Ao=Oo;function _o(e,t){var n=e.type.contextTypes;if(!n)return Oo;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o,i={};for(o in n)i[o]=t[o];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Po(e){return null!==(e=e.childContextTypes)&&void 0!==e}function Mo(){Eo(Do),Eo(Io)}function Ro(e,t,n){if(Io.current!==Oo)throw Error(i(168));To(Io,t),To(Do,n)}function No(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,"function"!==typeof r.getChildContext)return n;for(var o in r=r.getChildContext())if(!(o in t))throw Error(i(108,Z(e)||"Unknown",o));return L({},n,r)}function Lo(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Oo,Ao=Io.current,To(Io,e),To(Do,Do.current),!0}function Fo(e,t,n){var r=e.stateNode;if(!r)throw Error(i(169));n?(e=No(e,t,Ao),r.__reactInternalMemoizedMergedChildContext=e,Eo(Do),Eo(Io),To(Io,e)):Eo(Do),To(Do,n)}var Wo=null,Bo=!1,zo=!1;function Go(e){null===Wo?Wo=[e]:Wo.push(e)}function Zo(){if(!zo&&null!==Wo){zo=!0;var e=0,t=xt;try{var n=Wo;for(xt=1;e<n.length;e++){var r=n[e];do{r=r(!0)}while(null!==r)}Wo=null,Bo=!1}catch(o){throw null!==Wo&&(Wo=Wo.slice(e+1)),Ve(Je,Zo),o}finally{xt=t,zo=!1}}return null}var Uo=[],Ho=0,Ko=null,Vo=0,qo=[],$o=0,Yo=null,Qo=1,Xo="";function Jo(e,t){Uo[Ho++]=Vo,Uo[Ho++]=Ko,Ko=e,Vo=t}function ei(e,t,n){qo[$o++]=Qo,qo[$o++]=Xo,qo[$o++]=Yo,Yo=e;var r=Qo;e=Xo;var o=32-at(r)-1;r&=~(1<<o),n+=1;var i=32-at(t)+o;if(30<i){var a=o-o%5;i=(r&(1<<a)-1).toString(32),r>>=a,o-=a,Qo=1<<32-at(t)+o|n<<o|r,Xo=i+e}else Qo=1<<i|n<<o|r,Xo=e}function ti(e){null!==e.return&&(Jo(e,1),ei(e,1,0))}function ni(e){for(;e===Ko;)Ko=Uo[--Ho],Uo[Ho]=null,Vo=Uo[--Ho],Uo[Ho]=null;for(;e===Yo;)Yo=qo[--$o],qo[$o]=null,Xo=qo[--$o],qo[$o]=null,Qo=qo[--$o],qo[$o]=null}var ri=null,oi=null,ii=!1,ai=null;function si(e,t){var n=_u(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,null===(t=e.deletions)?(e.deletions=[n],e.flags|=16):t.push(n)}function li(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,ri=e,oi=uo(t.firstChild),!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,ri=e,oi=null,!0);case 13:return null!==(t=8!==t.nodeType?null:t)&&(n=null!==Yo?{id:Qo,overflow:Xo}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},(n=_u(18,null,null,0)).stateNode=t,n.return=e,e.child=n,ri=e,oi=null,!0);default:return!1}}function ui(e){return 0!==(1&e.mode)&&0===(128&e.flags)}function ci(e){if(ii){var t=oi;if(t){var n=t;if(!li(e,t)){if(ui(e))throw Error(i(418));t=uo(n.nextSibling);var r=ri;t&&li(e,t)?si(r,n):(e.flags=-4097&e.flags|2,ii=!1,ri=e)}}else{if(ui(e))throw Error(i(418));e.flags=-4097&e.flags|2,ii=!1,ri=e}}}function di(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;ri=e}function fi(e){if(e!==ri)return!1;if(!ii)return di(e),ii=!0,!1;var t;if((t=3!==e.tag)&&!(t=5!==e.tag)&&(t="head"!==(t=e.type)&&"body"!==t&&!no(e.type,e.memoizedProps)),t&&(t=oi)){if(ui(e))throw hi(),Error(i(418));for(;t;)si(e,t),t=uo(t.nextSibling)}if(di(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(i(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n){if(0===t){oi=uo(e.nextSibling);break e}t--}else"$"!==n&&"$!"!==n&&"$?"!==n||t++}e=e.nextSibling}oi=null}}else oi=ri?uo(e.stateNode.nextSibling):null;return!0}function hi(){for(var e=oi;e;)e=uo(e.nextSibling)}function pi(){oi=ri=null,ii=!1}function gi(e){null===ai?ai=[e]:ai.push(e)}var mi=b.ReactCurrentBatchConfig;function yi(e,t){if(e&&e.defaultProps){for(var n in t=L({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}return t}var vi=ko(null),xi=null,bi=null,wi=null;function Si(){wi=bi=xi=null}function Ci(e){var t=vi.current;Eo(vi),e._currentValue=t}function ji(e,t,n){for(;null!==e;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==r&&(r.childLanes|=t)):null!==r&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function ki(e,t){xi=e,wi=bi=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!==(e.lanes&t)&&(bs=!0),e.firstContext=null)}function Ei(e){var t=e._currentValue;if(wi!==e)if(e={context:e,memoizedValue:t,next:null},null===bi){if(null===xi)throw Error(i(308));bi=e,xi.dependencies={lanes:0,firstContext:e}}else bi=bi.next=e;return t}var Ti=null;function Oi(e){null===Ti?Ti=[e]:Ti.push(e)}function Ii(e,t,n,r){var o=t.interleaved;return null===o?(n.next=n,Oi(t)):(n.next=o.next,o.next=n),t.interleaved=n,Di(e,r)}function Di(e,t){e.lanes|=t;var n=e.alternate;for(null!==n&&(n.lanes|=t),n=e,e=e.return;null!==e;)e.childLanes|=t,null!==(n=e.alternate)&&(n.childLanes|=t),n=e,e=e.return;return 3===n.tag?n.stateNode:null}var Ai=!1;function _i(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Pi(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Mi(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ri(e,t,n){var r=e.updateQueue;if(null===r)return null;if(r=r.shared,0!==(2&Il)){var o=r.pending;return null===o?t.next=t:(t.next=o.next,o.next=t),r.pending=t,Di(e,n)}return null===(o=r.interleaved)?(t.next=t,Oi(r)):(t.next=o.next,o.next=t),r.interleaved=t,Di(e,n)}function Ni(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,0!==(4194240&n))){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,vt(e,n)}}function Li(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var o=null,i=null;if(null!==(n=n.firstBaseUpdate)){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===i?o=i=a:i=i.next=a,n=n.next}while(null!==n);null===i?o=i=t:i=i.next=t}else o=i=t;return n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Fi(e,t,n,r){var o=e.updateQueue;Ai=!1;var i=o.firstBaseUpdate,a=o.lastBaseUpdate,s=o.shared.pending;if(null!==s){o.shared.pending=null;var l=s,u=l.next;l.next=null,null===a?i=u:a.next=u,a=l;var c=e.alternate;null!==c&&((s=(c=c.updateQueue).lastBaseUpdate)!==a&&(null===s?c.firstBaseUpdate=u:s.next=u,c.lastBaseUpdate=l))}if(null!==i){var d=o.baseState;for(a=0,c=u=l=null,s=i;;){var f=s.lane,h=s.eventTime;if((r&f)===f){null!==c&&(c=c.next={eventTime:h,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var p=e,g=s;switch(f=t,h=n,g.tag){case 1:if("function"===typeof(p=g.payload)){d=p.call(h,d,f);break e}d=p;break e;case 3:p.flags=-65537&p.flags|128;case 0:if(null===(f="function"===typeof(p=g.payload)?p.call(h,d,f):p)||void 0===f)break e;d=L({},d,f);break e;case 2:Ai=!0}}null!==s.callback&&0!==s.lane&&(e.flags|=64,null===(f=o.effects)?o.effects=[s]:f.push(s))}else h={eventTime:h,lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},null===c?(u=c=h,l=d):c=c.next=h,a|=f;if(null===(s=s.next)){if(null===(s=o.shared.pending))break;s=(f=s).next,f.next=null,o.lastBaseUpdate=f,o.shared.pending=null}}if(null===c&&(l=d),o.baseState=l,o.firstBaseUpdate=u,o.lastBaseUpdate=c,null!==(t=o.shared.interleaved)){o=t;do{a|=o.lane,o=o.next}while(o!==t)}else null===i&&(o.shared.lanes=0);Ll|=a,e.lanes=a,e.memoizedState=d}}function Wi(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(null!==o){if(r.callback=null,r=n,"function"!==typeof o)throw Error(i(191,o));o.call(r)}}}var Bi=(new r.Component).refs;function zi(e,t,n,r){n=null===(n=n(r,t=e.memoizedState))||void 0===n?t:L({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var Gi={isMounted:function(e){return!!(e=e._reactInternals)&&Ge(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=tu(),o=nu(e),i=Mi(r,o);i.payload=t,void 0!==n&&null!==n&&(i.callback=n),null!==(t=Ri(e,i,o))&&(ru(t,e,o,r),Ni(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=tu(),o=nu(e),i=Mi(r,o);i.tag=1,i.payload=t,void 0!==n&&null!==n&&(i.callback=n),null!==(t=Ri(e,i,o))&&(ru(t,e,o,r),Ni(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=tu(),r=nu(e),o=Mi(n,r);o.tag=2,void 0!==t&&null!==t&&(o.callback=t),null!==(t=Ri(e,o,r))&&(ru(t,e,r,n),Ni(t,e,r))}};function Zi(e,t,n,r,o,i,a){return"function"===typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,i,a):!t.prototype||!t.prototype.isPureReactComponent||(!lr(n,r)||!lr(o,i))}function Ui(e,t,n){var r=!1,o=Oo,i=t.contextType;return"object"===typeof i&&null!==i?i=Ei(i):(o=Po(t)?Ao:Io.current,i=(r=null!==(r=t.contextTypes)&&void 0!==r)?_o(e,o):Oo),t=new t(n,i),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=Gi,e.stateNode=t,t._reactInternals=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function Hi(e,t,n,r){e=t.state,"function"===typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"===typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Gi.enqueueReplaceState(t,t.state,null)}function Ki(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs=Bi,_i(e);var i=t.contextType;"object"===typeof i&&null!==i?o.context=Ei(i):(i=Po(t)?Ao:Io.current,o.context=_o(e,i)),o.state=e.memoizedState,"function"===typeof(i=t.getDerivedStateFromProps)&&(zi(e,t,i,n),o.state=e.memoizedState),"function"===typeof t.getDerivedStateFromProps||"function"===typeof o.getSnapshotBeforeUpdate||"function"!==typeof o.UNSAFE_componentWillMount&&"function"!==typeof o.componentWillMount||(t=o.state,"function"===typeof o.componentWillMount&&o.componentWillMount(),"function"===typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount(),t!==o.state&&Gi.enqueueReplaceState(o,o.state,null),Fi(e,n,o,r),o.state=e.memoizedState),"function"===typeof o.componentDidMount&&(e.flags|=4194308)}function Vi(e,t,n){if(null!==(e=n.ref)&&"function"!==typeof e&&"object"!==typeof e){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(i(309));var r=n.stateNode}if(!r)throw Error(i(147,e));var o=r,a=""+e;return null!==t&&null!==t.ref&&"function"===typeof t.ref&&t.ref._stringRef===a?t.ref:(t=function(e){var t=o.refs;t===Bi&&(t=o.refs={}),null===e?delete t[a]:t[a]=e},t._stringRef=a,t)}if("string"!==typeof e)throw Error(i(284));if(!n._owner)throw Error(i(290,e))}return e}function qi(e,t){throw e=Object.prototype.toString.call(t),Error(i(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function $i(e){return(0,e._init)(e._payload)}function Yi(e){function t(t,n){if(e){var r=t.deletions;null===r?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function r(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function o(e,t){return(e=Mu(e,t)).index=0,e.sibling=null,e}function a(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.flags|=2,n):r:(t.flags|=2,n):(t.flags|=1048576,n)}function s(t){return e&&null===t.alternate&&(t.flags|=2),t}function l(e,t,n,r){return null===t||6!==t.tag?((t=Fu(n,e.mode,r)).return=e,t):((t=o(t,n)).return=e,t)}function u(e,t,n,r){var i=n.type;return i===C?d(e,t,n.props.children,r,n.key):null!==t&&(t.elementType===i||"object"===typeof i&&null!==i&&i.$$typeof===_&&$i(i)===t.type)?((r=o(t,n.props)).ref=Vi(e,t,n),r.return=e,r):((r=Ru(n.type,n.key,n.props,null,e.mode,r)).ref=Vi(e,t,n),r.return=e,r)}function c(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Wu(n,e.mode,r)).return=e,t):((t=o(t,n.children||[])).return=e,t)}function d(e,t,n,r,i){return null===t||7!==t.tag?((t=Nu(n,e.mode,r,i)).return=e,t):((t=o(t,n)).return=e,t)}function f(e,t,n){if("string"===typeof t&&""!==t||"number"===typeof t)return(t=Fu(""+t,e.mode,n)).return=e,t;if("object"===typeof t&&null!==t){switch(t.$$typeof){case w:return(n=Ru(t.type,t.key,t.props,null,e.mode,n)).ref=Vi(e,null,t),n.return=e,n;case S:return(t=Wu(t,e.mode,n)).return=e,t;case _:return f(e,(0,t._init)(t._payload),n)}if(te(t)||R(t))return(t=Nu(t,e.mode,n,null)).return=e,t;qi(e,t)}return null}function h(e,t,n,r){var o=null!==t?t.key:null;if("string"===typeof n&&""!==n||"number"===typeof n)return null!==o?null:l(e,t,""+n,r);if("object"===typeof n&&null!==n){switch(n.$$typeof){case w:return n.key===o?u(e,t,n,r):null;case S:return n.key===o?c(e,t,n,r):null;case _:return h(e,t,(o=n._init)(n._payload),r)}if(te(n)||R(n))return null!==o?null:d(e,t,n,r,null);qi(e,n)}return null}function p(e,t,n,r,o){if("string"===typeof r&&""!==r||"number"===typeof r)return l(t,e=e.get(n)||null,""+r,o);if("object"===typeof r&&null!==r){switch(r.$$typeof){case w:return u(t,e=e.get(null===r.key?n:r.key)||null,r,o);case S:return c(t,e=e.get(null===r.key?n:r.key)||null,r,o);case _:return p(e,t,n,(0,r._init)(r._payload),o)}if(te(r)||R(r))return d(t,e=e.get(n)||null,r,o,null);qi(t,r)}return null}function g(o,i,s,l){for(var u=null,c=null,d=i,g=i=0,m=null;null!==d&&g<s.length;g++){d.index>g?(m=d,d=null):m=d.sibling;var y=h(o,d,s[g],l);if(null===y){null===d&&(d=m);break}e&&d&&null===y.alternate&&t(o,d),i=a(y,i,g),null===c?u=y:c.sibling=y,c=y,d=m}if(g===s.length)return n(o,d),ii&&Jo(o,g),u;if(null===d){for(;g<s.length;g++)null!==(d=f(o,s[g],l))&&(i=a(d,i,g),null===c?u=d:c.sibling=d,c=d);return ii&&Jo(o,g),u}for(d=r(o,d);g<s.length;g++)null!==(m=p(d,o,g,s[g],l))&&(e&&null!==m.alternate&&d.delete(null===m.key?g:m.key),i=a(m,i,g),null===c?u=m:c.sibling=m,c=m);return e&&d.forEach((function(e){return t(o,e)})),ii&&Jo(o,g),u}function m(o,s,l,u){var c=R(l);if("function"!==typeof c)throw Error(i(150));if(null==(l=c.call(l)))throw Error(i(151));for(var d=c=null,g=s,m=s=0,y=null,v=l.next();null!==g&&!v.done;m++,v=l.next()){g.index>m?(y=g,g=null):y=g.sibling;var x=h(o,g,v.value,u);if(null===x){null===g&&(g=y);break}e&&g&&null===x.alternate&&t(o,g),s=a(x,s,m),null===d?c=x:d.sibling=x,d=x,g=y}if(v.done)return n(o,g),ii&&Jo(o,m),c;if(null===g){for(;!v.done;m++,v=l.next())null!==(v=f(o,v.value,u))&&(s=a(v,s,m),null===d?c=v:d.sibling=v,d=v);return ii&&Jo(o,m),c}for(g=r(o,g);!v.done;m++,v=l.next())null!==(v=p(g,o,m,v.value,u))&&(e&&null!==v.alternate&&g.delete(null===v.key?m:v.key),s=a(v,s,m),null===d?c=v:d.sibling=v,d=v);return e&&g.forEach((function(e){return t(o,e)})),ii&&Jo(o,m),c}return function e(r,i,a,l){if("object"===typeof a&&null!==a&&a.type===C&&null===a.key&&(a=a.props.children),"object"===typeof a&&null!==a){switch(a.$$typeof){case w:e:{for(var u=a.key,c=i;null!==c;){if(c.key===u){if((u=a.type)===C){if(7===c.tag){n(r,c.sibling),(i=o(c,a.props.children)).return=r,r=i;break e}}else if(c.elementType===u||"object"===typeof u&&null!==u&&u.$$typeof===_&&$i(u)===c.type){n(r,c.sibling),(i=o(c,a.props)).ref=Vi(r,c,a),i.return=r,r=i;break e}n(r,c);break}t(r,c),c=c.sibling}a.type===C?((i=Nu(a.props.children,r.mode,l,a.key)).return=r,r=i):((l=Ru(a.type,a.key,a.props,null,r.mode,l)).ref=Vi(r,i,a),l.return=r,r=l)}return s(r);case S:e:{for(c=a.key;null!==i;){if(i.key===c){if(4===i.tag&&i.stateNode.containerInfo===a.containerInfo&&i.stateNode.implementation===a.implementation){n(r,i.sibling),(i=o(i,a.children||[])).return=r,r=i;break e}n(r,i);break}t(r,i),i=i.sibling}(i=Wu(a,r.mode,l)).return=r,r=i}return s(r);case _:return e(r,i,(c=a._init)(a._payload),l)}if(te(a))return g(r,i,a,l);if(R(a))return m(r,i,a,l);qi(r,a)}return"string"===typeof a&&""!==a||"number"===typeof a?(a=""+a,null!==i&&6===i.tag?(n(r,i.sibling),(i=o(i,a)).return=r,r=i):(n(r,i),(i=Fu(a,r.mode,l)).return=r,r=i),s(r)):n(r,i)}}var Qi=Yi(!0),Xi=Yi(!1),Ji={},ea=ko(Ji),ta=ko(Ji),na=ko(Ji);function ra(e){if(e===Ji)throw Error(i(174));return e}function oa(e,t){switch(To(na,t),To(ta,e),To(ea,Ji),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:le(null,"");break;default:t=le(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}Eo(ea),To(ea,t)}function ia(){Eo(ea),Eo(ta),Eo(na)}function aa(e){ra(na.current);var t=ra(ea.current),n=le(t,e.type);t!==n&&(To(ta,e),To(ea,n))}function sa(e){ta.current===e&&(Eo(ea),Eo(ta))}var la=ko(0);function ua(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!==(128&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ca=[];function da(){for(var e=0;e<ca.length;e++)ca[e]._workInProgressVersionPrimary=null;ca.length=0}var fa=b.ReactCurrentDispatcher,ha=b.ReactCurrentBatchConfig,pa=0,ga=null,ma=null,ya=null,va=!1,xa=!1,ba=0,wa=0;function Sa(){throw Error(i(321))}function Ca(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!sr(e[n],t[n]))return!1;return!0}function ja(e,t,n,r,o,a){if(pa=a,ga=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,fa.current=null===e||null===e.memoizedState?ss:ls,e=n(r,o),xa){a=0;do{if(xa=!1,ba=0,25<=a)throw Error(i(301));a+=1,ya=ma=null,t.updateQueue=null,fa.current=us,e=n(r,o)}while(xa)}if(fa.current=as,t=null!==ma&&null!==ma.next,pa=0,ya=ma=ga=null,va=!1,t)throw Error(i(300));return e}function ka(){var e=0!==ba;return ba=0,e}function Ea(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===ya?ga.memoizedState=ya=e:ya=ya.next=e,ya}function Ta(){if(null===ma){var e=ga.alternate;e=null!==e?e.memoizedState:null}else e=ma.next;var t=null===ya?ga.memoizedState:ya.next;if(null!==t)ya=t,ma=e;else{if(null===e)throw Error(i(310));e={memoizedState:(ma=e).memoizedState,baseState:ma.baseState,baseQueue:ma.baseQueue,queue:ma.queue,next:null},null===ya?ga.memoizedState=ya=e:ya=ya.next=e}return ya}function Oa(e,t){return"function"===typeof t?t(e):t}function Ia(e){var t=Ta(),n=t.queue;if(null===n)throw Error(i(311));n.lastRenderedReducer=e;var r=ma,o=r.baseQueue,a=n.pending;if(null!==a){if(null!==o){var s=o.next;o.next=a.next,a.next=s}r.baseQueue=o=a,n.pending=null}if(null!==o){a=o.next,r=r.baseState;var l=s=null,u=null,c=a;do{var d=c.lane;if((pa&d)===d)null!==u&&(u=u.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var f={lane:d,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};null===u?(l=u=f,s=r):u=u.next=f,ga.lanes|=d,Ll|=d}c=c.next}while(null!==c&&c!==a);null===u?s=r:u.next=l,sr(r,t.memoizedState)||(bs=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=u,n.lastRenderedState=r}if(null!==(e=n.interleaved)){o=e;do{a=o.lane,ga.lanes|=a,Ll|=a,o=o.next}while(o!==e)}else null===o&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Da(e){var t=Ta(),n=t.queue;if(null===n)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,a=t.memoizedState;if(null!==o){n.pending=null;var s=o=o.next;do{a=e(a,s.action),s=s.next}while(s!==o);sr(a,t.memoizedState)||(bs=!0),t.memoizedState=a,null===t.baseQueue&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function Aa(){}function _a(e,t){var n=ga,r=Ta(),o=t(),a=!sr(r.memoizedState,o);if(a&&(r.memoizedState=o,bs=!0),r=r.queue,Ua(Ra.bind(null,n,r,e),[e]),r.getSnapshot!==t||a||null!==ya&&1&ya.memoizedState.tag){if(n.flags|=2048,Wa(9,Ma.bind(null,n,r,o,t),void 0,null),null===Dl)throw Error(i(349));0!==(30&pa)||Pa(n,t,o)}return o}function Pa(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},null===(t=ga.updateQueue)?(t={lastEffect:null,stores:null},ga.updateQueue=t,t.stores=[e]):null===(n=t.stores)?t.stores=[e]:n.push(e)}function Ma(e,t,n,r){t.value=n,t.getSnapshot=r,Na(t)&&La(e)}function Ra(e,t,n){return n((function(){Na(t)&&La(e)}))}function Na(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!sr(e,n)}catch(r){return!0}}function La(e){var t=Di(e,1);null!==t&&ru(t,e,1,-1)}function Fa(e){var t=Ea();return"function"===typeof e&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Oa,lastRenderedState:e},t.queue=e,e=e.dispatch=ns.bind(null,ga,e),[t.memoizedState,e]}function Wa(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=ga.updateQueue)?(t={lastEffect:null,stores:null},ga.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Ba(){return Ta().memoizedState}function za(e,t,n,r){var o=Ea();ga.flags|=e,o.memoizedState=Wa(1|t,n,void 0,void 0===r?null:r)}function Ga(e,t,n,r){var o=Ta();r=void 0===r?null:r;var i=void 0;if(null!==ma){var a=ma.memoizedState;if(i=a.destroy,null!==r&&Ca(r,a.deps))return void(o.memoizedState=Wa(t,n,i,r))}ga.flags|=e,o.memoizedState=Wa(1|t,n,i,r)}function Za(e,t){return za(8390656,8,e,t)}function Ua(e,t){return Ga(2048,8,e,t)}function Ha(e,t){return Ga(4,2,e,t)}function Ka(e,t){return Ga(4,4,e,t)}function Va(e,t){return"function"===typeof t?(e=e(),t(e),function(){t(null)}):null!==t&&void 0!==t?(e=e(),t.current=e,function(){t.current=null}):void 0}function qa(e,t,n){return n=null!==n&&void 0!==n?n.concat([e]):null,Ga(4,4,Va.bind(null,t,e),n)}function $a(){}function Ya(e,t){var n=Ta();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&Ca(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Qa(e,t){var n=Ta();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&Ca(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Xa(e,t,n){return 0===(21&pa)?(e.baseState&&(e.baseState=!1,bs=!0),e.memoizedState=n):(sr(n,t)||(n=gt(),ga.lanes|=n,Ll|=n,e.baseState=!0),t)}function Ja(e,t){var n=xt;xt=0!==n&&4>n?n:4,e(!0);var r=ha.transition;ha.transition={};try{e(!1),t()}finally{xt=n,ha.transition=r}}function es(){return Ta().memoizedState}function ts(e,t,n){var r=nu(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},rs(e))os(t,n);else if(null!==(n=Ii(e,t,n,r))){ru(n,e,r,tu()),is(n,t,r)}}function ns(e,t,n){var r=nu(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(rs(e))os(t,o);else{var i=e.alternate;if(0===e.lanes&&(null===i||0===i.lanes)&&null!==(i=t.lastRenderedReducer))try{var a=t.lastRenderedState,s=i(a,n);if(o.hasEagerState=!0,o.eagerState=s,sr(s,a)){var l=t.interleaved;return null===l?(o.next=o,Oi(t)):(o.next=l.next,l.next=o),void(t.interleaved=o)}}catch(u){}null!==(n=Ii(e,t,o,r))&&(ru(n,e,r,o=tu()),is(n,t,r))}}function rs(e){var t=e.alternate;return e===ga||null!==t&&t===ga}function os(e,t){xa=va=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function is(e,t,n){if(0!==(4194240&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,vt(e,n)}}var as={readContext:Ei,useCallback:Sa,useContext:Sa,useEffect:Sa,useImperativeHandle:Sa,useInsertionEffect:Sa,useLayoutEffect:Sa,useMemo:Sa,useReducer:Sa,useRef:Sa,useState:Sa,useDebugValue:Sa,useDeferredValue:Sa,useTransition:Sa,useMutableSource:Sa,useSyncExternalStore:Sa,useId:Sa,unstable_isNewReconciler:!1},ss={readContext:Ei,useCallback:function(e,t){return Ea().memoizedState=[e,void 0===t?null:t],e},useContext:Ei,useEffect:Za,useImperativeHandle:function(e,t,n){return n=null!==n&&void 0!==n?n.concat([e]):null,za(4194308,4,Va.bind(null,t,e),n)},useLayoutEffect:function(e,t){return za(4194308,4,e,t)},useInsertionEffect:function(e,t){return za(4,2,e,t)},useMemo:function(e,t){var n=Ea();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ea();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=ts.bind(null,ga,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},Ea().memoizedState=e},useState:Fa,useDebugValue:$a,useDeferredValue:function(e){return Ea().memoizedState=e},useTransition:function(){var e=Fa(!1),t=e[0];return e=Ja.bind(null,e[1]),Ea().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ga,o=Ea();if(ii){if(void 0===n)throw Error(i(407));n=n()}else{if(n=t(),null===Dl)throw Error(i(349));0!==(30&pa)||Pa(r,t,n)}o.memoizedState=n;var a={value:n,getSnapshot:t};return o.queue=a,Za(Ra.bind(null,r,a,e),[e]),r.flags|=2048,Wa(9,Ma.bind(null,r,a,n,t),void 0,null),n},useId:function(){var e=Ea(),t=Dl.identifierPrefix;if(ii){var n=Xo;t=":"+t+"R"+(n=(Qo&~(1<<32-at(Qo)-1)).toString(32)+n),0<(n=ba++)&&(t+="H"+n.toString(32)),t+=":"}else t=":"+t+"r"+(n=wa++).toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},ls={readContext:Ei,useCallback:Ya,useContext:Ei,useEffect:Ua,useImperativeHandle:qa,useInsertionEffect:Ha,useLayoutEffect:Ka,useMemo:Qa,useReducer:Ia,useRef:Ba,useState:function(){return Ia(Oa)},useDebugValue:$a,useDeferredValue:function(e){return Xa(Ta(),ma.memoizedState,e)},useTransition:function(){return[Ia(Oa)[0],Ta().memoizedState]},useMutableSource:Aa,useSyncExternalStore:_a,useId:es,unstable_isNewReconciler:!1},us={readContext:Ei,useCallback:Ya,useContext:Ei,useEffect:Ua,useImperativeHandle:qa,useInsertionEffect:Ha,useLayoutEffect:Ka,useMemo:Qa,useReducer:Da,useRef:Ba,useState:function(){return Da(Oa)},useDebugValue:$a,useDeferredValue:function(e){var t=Ta();return null===ma?t.memoizedState=e:Xa(t,ma.memoizedState,e)},useTransition:function(){return[Da(Oa)[0],Ta().memoizedState]},useMutableSource:Aa,useSyncExternalStore:_a,useId:es,unstable_isNewReconciler:!1};function cs(e,t){try{var n="",r=t;do{n+=z(r),r=r.return}while(r);var o=n}catch(i){o="\nError generating stack: "+i.message+"\n"+i.stack}return{value:e,source:t,stack:o,digest:null}}function ds(e,t,n){return{value:e,source:null,stack:null!=n?n:null,digest:null!=t?t:null}}function fs(e,t){try{console.error(t.value)}catch(n){setTimeout((function(){throw n}))}}var hs="function"===typeof WeakMap?WeakMap:Map;function ps(e,t,n){(n=Mi(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Hl||(Hl=!0,Kl=r),fs(0,t)},n}function gs(e,t,n){(n=Mi(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"===typeof r){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){fs(0,t)}}var i=e.stateNode;return null!==i&&"function"===typeof i.componentDidCatch&&(n.callback=function(){fs(0,t),"function"!==typeof r&&(null===Vl?Vl=new Set([this]):Vl.add(this));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}function ms(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new hs;var o=new Set;r.set(t,o)}else void 0===(o=r.get(t))&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=Eu.bind(null,e,t,n),t.then(e,e))}function ys(e){do{var t;if((t=13===e.tag)&&(t=null===(t=e.memoizedState)||null!==t.dehydrated),t)return e;e=e.return}while(null!==e);return null}function vs(e,t,n,r,o){return 0===(1&e.mode)?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,1===n.tag&&(null===n.alternate?n.tag=17:((t=Mi(-1,1)).tag=2,Ri(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=o,e)}var xs=b.ReactCurrentOwner,bs=!1;function ws(e,t,n,r){t.child=null===e?Xi(t,null,n,r):Qi(t,e.child,n,r)}function Ss(e,t,n,r,o){n=n.render;var i=t.ref;return ki(t,o),r=ja(e,t,n,r,i,o),n=ka(),null===e||bs?(ii&&n&&ti(t),t.flags|=1,ws(e,t,r,o),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Hs(e,t,o))}function Cs(e,t,n,r,o){if(null===e){var i=n.type;return"function"!==typeof i||Pu(i)||void 0!==i.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=Ru(n.type,null,r,t,t.mode,o)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=i,js(e,t,i,r,o))}if(i=e.child,0===(e.lanes&o)){var a=i.memoizedProps;if((n=null!==(n=n.compare)?n:lr)(a,r)&&e.ref===t.ref)return Hs(e,t,o)}return t.flags|=1,(e=Mu(i,r)).ref=t.ref,e.return=t,t.child=e}function js(e,t,n,r,o){if(null!==e){var i=e.memoizedProps;if(lr(i,r)&&e.ref===t.ref){if(bs=!1,t.pendingProps=r=i,0===(e.lanes&o))return t.lanes=e.lanes,Hs(e,t,o);0!==(131072&e.flags)&&(bs=!0)}}return Ts(e,t,n,r,o)}function ks(e,t,n){var r=t.pendingProps,o=r.children,i=null!==e?e.memoizedState:null;if("hidden"===r.mode)if(0===(1&t.mode))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},To(Ml,Pl),Pl|=n;else{if(0===(1073741824&n))return e=null!==i?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,To(Ml,Pl),Pl|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=null!==i?i.baseLanes:n,To(Ml,Pl),Pl|=r}else null!==i?(r=i.baseLanes|n,t.memoizedState=null):r=n,To(Ml,Pl),Pl|=r;return ws(e,t,o,n),t.child}function Es(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Ts(e,t,n,r,o){var i=Po(n)?Ao:Io.current;return i=_o(t,i),ki(t,o),n=ja(e,t,n,r,i,o),r=ka(),null===e||bs?(ii&&r&&ti(t),t.flags|=1,ws(e,t,n,o),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Hs(e,t,o))}function Os(e,t,n,r,o){if(Po(n)){var i=!0;Lo(t)}else i=!1;if(ki(t,o),null===t.stateNode)Us(e,t),Ui(t,n,r),Ki(t,n,r,o),r=!0;else if(null===e){var a=t.stateNode,s=t.memoizedProps;a.props=s;var l=a.context,u=n.contextType;"object"===typeof u&&null!==u?u=Ei(u):u=_o(t,u=Po(n)?Ao:Io.current);var c=n.getDerivedStateFromProps,d="function"===typeof c||"function"===typeof a.getSnapshotBeforeUpdate;d||"function"!==typeof a.UNSAFE_componentWillReceiveProps&&"function"!==typeof a.componentWillReceiveProps||(s!==r||l!==u)&&Hi(t,a,r,u),Ai=!1;var f=t.memoizedState;a.state=f,Fi(t,r,a,o),l=t.memoizedState,s!==r||f!==l||Do.current||Ai?("function"===typeof c&&(zi(t,n,c,r),l=t.memoizedState),(s=Ai||Zi(t,n,s,r,f,l,u))?(d||"function"!==typeof a.UNSAFE_componentWillMount&&"function"!==typeof a.componentWillMount||("function"===typeof a.componentWillMount&&a.componentWillMount(),"function"===typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"===typeof a.componentDidMount&&(t.flags|=4194308)):("function"===typeof a.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=u,r=s):("function"===typeof a.componentDidMount&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Pi(e,t),s=t.memoizedProps,u=t.type===t.elementType?s:yi(t.type,s),a.props=u,d=t.pendingProps,f=a.context,"object"===typeof(l=n.contextType)&&null!==l?l=Ei(l):l=_o(t,l=Po(n)?Ao:Io.current);var h=n.getDerivedStateFromProps;(c="function"===typeof h||"function"===typeof a.getSnapshotBeforeUpdate)||"function"!==typeof a.UNSAFE_componentWillReceiveProps&&"function"!==typeof a.componentWillReceiveProps||(s!==d||f!==l)&&Hi(t,a,r,l),Ai=!1,f=t.memoizedState,a.state=f,Fi(t,r,a,o);var p=t.memoizedState;s!==d||f!==p||Do.current||Ai?("function"===typeof h&&(zi(t,n,h,r),p=t.memoizedState),(u=Ai||Zi(t,n,u,r,f,p,l)||!1)?(c||"function"!==typeof a.UNSAFE_componentWillUpdate&&"function"!==typeof a.componentWillUpdate||("function"===typeof a.componentWillUpdate&&a.componentWillUpdate(r,p,l),"function"===typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(r,p,l)),"function"===typeof a.componentDidUpdate&&(t.flags|=4),"function"===typeof a.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!==typeof a.componentDidUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!==typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=l,r=u):("function"!==typeof a.componentDidUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!==typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return Is(e,t,n,r,i,o)}function Is(e,t,n,r,o,i){Es(e,t);var a=0!==(128&t.flags);if(!r&&!a)return o&&Fo(t,n,!1),Hs(e,t,i);r=t.stateNode,xs.current=t;var s=a&&"function"!==typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&a?(t.child=Qi(t,e.child,null,i),t.child=Qi(t,null,s,i)):ws(e,t,s,i),t.memoizedState=r.state,o&&Fo(t,n,!0),t.child}function Ds(e){var t=e.stateNode;t.pendingContext?Ro(0,t.pendingContext,t.pendingContext!==t.context):t.context&&Ro(0,t.context,!1),oa(e,t.containerInfo)}function As(e,t,n,r,o){return pi(),gi(o),t.flags|=256,ws(e,t,n,r),t.child}var _s,Ps,Ms,Rs,Ns={dehydrated:null,treeContext:null,retryLane:0};function Ls(e){return{baseLanes:e,cachePool:null,transitions:null}}function Fs(e,t,n){var r,o=t.pendingProps,a=la.current,s=!1,l=0!==(128&t.flags);if((r=l)||(r=(null===e||null!==e.memoizedState)&&0!==(2&a)),r?(s=!0,t.flags&=-129):null!==e&&null===e.memoizedState||(a|=1),To(la,1&a),null===e)return ci(t),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated)?(0===(1&t.mode)?t.lanes=1:"$!"===e.data?t.lanes=8:t.lanes=1073741824,null):(l=o.children,e=o.fallback,s?(o=t.mode,s=t.child,l={mode:"hidden",children:l},0===(1&o)&&null!==s?(s.childLanes=0,s.pendingProps=l):s=Lu(l,o,0,null),e=Nu(e,o,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=Ls(n),t.memoizedState=Ns,e):Ws(t,l));if(null!==(a=e.memoizedState)&&null!==(r=a.dehydrated))return function(e,t,n,r,o,a,s){if(n)return 256&t.flags?(t.flags&=-257,Bs(e,t,s,r=ds(Error(i(422))))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(a=r.fallback,o=t.mode,r=Lu({mode:"visible",children:r.children},o,0,null),(a=Nu(a,o,s,null)).flags|=2,r.return=t,a.return=t,r.sibling=a,t.child=r,0!==(1&t.mode)&&Qi(t,e.child,null,s),t.child.memoizedState=Ls(s),t.memoizedState=Ns,a);if(0===(1&t.mode))return Bs(e,t,s,null);if("$!"===o.data){if(r=o.nextSibling&&o.nextSibling.dataset)var l=r.dgst;return r=l,Bs(e,t,s,r=ds(a=Error(i(419)),r,void 0))}if(l=0!==(s&e.childLanes),bs||l){if(null!==(r=Dl)){switch(s&-s){case 4:o=2;break;case 16:o=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}0!==(o=0!==(o&(r.suspendedLanes|s))?0:o)&&o!==a.retryLane&&(a.retryLane=o,Di(e,o),ru(r,e,o,-1))}return mu(),Bs(e,t,s,r=ds(Error(i(421))))}return"$?"===o.data?(t.flags|=128,t.child=e.child,t=Ou.bind(null,e),o._reactRetry=t,null):(e=a.treeContext,oi=uo(o.nextSibling),ri=t,ii=!0,ai=null,null!==e&&(qo[$o++]=Qo,qo[$o++]=Xo,qo[$o++]=Yo,Qo=e.id,Xo=e.overflow,Yo=t),t=Ws(t,r.children),t.flags|=4096,t)}(e,t,l,o,r,a,n);if(s){s=o.fallback,l=t.mode,r=(a=e.child).sibling;var u={mode:"hidden",children:o.children};return 0===(1&l)&&t.child!==a?((o=t.child).childLanes=0,o.pendingProps=u,t.deletions=null):(o=Mu(a,u)).subtreeFlags=14680064&a.subtreeFlags,null!==r?s=Mu(r,s):(s=Nu(s,l,n,null)).flags|=2,s.return=t,o.return=t,o.sibling=s,t.child=o,o=s,s=t.child,l=null===(l=e.child.memoizedState)?Ls(n):{baseLanes:l.baseLanes|n,cachePool:null,transitions:l.transitions},s.memoizedState=l,s.childLanes=e.childLanes&~n,t.memoizedState=Ns,o}return e=(s=e.child).sibling,o=Mu(s,{mode:"visible",children:o.children}),0===(1&t.mode)&&(o.lanes=n),o.return=t,o.sibling=null,null!==e&&(null===(n=t.deletions)?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=o,t.memoizedState=null,o}function Ws(e,t){return(t=Lu({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function Bs(e,t,n,r){return null!==r&&gi(r),Qi(t,e.child,null,n),(e=Ws(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function zs(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),ji(e.return,t,n)}function Gs(e,t,n,r,o){var i=e.memoizedState;null===i?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o)}function Zs(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(ws(e,t,r.children,n),0!==(2&(r=la.current)))r=1&r|2,t.flags|=128;else{if(null!==e&&0!==(128&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&zs(e,n,t);else if(19===e.tag)zs(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(To(la,r),0===(1&t.mode))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;null!==n;)null!==(e=n.alternate)&&null===ua(e)&&(o=n),n=n.sibling;null===(n=o)?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),Gs(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;null!==o;){if(null!==(e=o.alternate)&&null===ua(e)){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}Gs(t,!0,n,null,i);break;case"together":Gs(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Us(e,t){0===(1&t.mode)&&null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Hs(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),Ll|=t.lanes,0===(n&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(i(153));if(null!==t.child){for(n=Mu(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=Mu(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function Ks(e,t){if(!ii)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Vs(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;null!==o;)n|=o.lanes|o.childLanes,r|=14680064&o.subtreeFlags,r|=14680064&o.flags,o.return=e,o=o.sibling;else for(o=e.child;null!==o;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function qs(e,t,n){var r=t.pendingProps;switch(ni(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Vs(t),null;case 1:case 17:return Po(t.type)&&Mo(),Vs(t),null;case 3:return r=t.stateNode,ia(),Eo(Do),Eo(Io),da(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),null!==e&&null!==e.child||(fi(t)?t.flags|=4:null===e||e.memoizedState.isDehydrated&&0===(256&t.flags)||(t.flags|=1024,null!==ai&&(su(ai),ai=null))),Ps(e,t),Vs(t),null;case 5:sa(t);var o=ra(na.current);if(n=t.type,null!==e&&null!=t.stateNode)Ms(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(null===t.stateNode)throw Error(i(166));return Vs(t),null}if(e=ra(ea.current),fi(t)){r=t.stateNode,n=t.type;var a=t.memoizedProps;switch(r[ho]=t,r[po]=a,e=0!==(1&t.mode),n){case"dialog":Wr("cancel",r),Wr("close",r);break;case"iframe":case"object":case"embed":Wr("load",r);break;case"video":case"audio":for(o=0;o<Rr.length;o++)Wr(Rr[o],r);break;case"source":Wr("error",r);break;case"img":case"image":case"link":Wr("error",r),Wr("load",r);break;case"details":Wr("toggle",r);break;case"input":Y(r,a),Wr("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!a.multiple},Wr("invalid",r);break;case"textarea":oe(r,a),Wr("invalid",r)}for(var l in ve(n,a),o=null,a)if(a.hasOwnProperty(l)){var u=a[l];"children"===l?"string"===typeof u?r.textContent!==u&&(!0!==a.suppressHydrationWarning&&Xr(r.textContent,u,e),o=["children",u]):"number"===typeof u&&r.textContent!==""+u&&(!0!==a.suppressHydrationWarning&&Xr(r.textContent,u,e),o=["children",""+u]):s.hasOwnProperty(l)&&null!=u&&"onScroll"===l&&Wr("scroll",r)}switch(n){case"input":K(r),J(r,a,!0);break;case"textarea":K(r),ae(r);break;case"select":case"option":break;default:"function"===typeof a.onClick&&(r.onclick=Jr)}r=o,t.updateQueue=r,null!==r&&(t.flags|=4)}else{l=9===o.nodeType?o:o.ownerDocument,"http://www.w3.org/1999/xhtml"===e&&(e=se(n)),"http://www.w3.org/1999/xhtml"===e?"script"===n?((e=l.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"===typeof r.is?e=l.createElement(n,{is:r.is}):(e=l.createElement(n),"select"===n&&(l=e,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):e=l.createElementNS(e,n),e[ho]=t,e[po]=r,_s(e,t,!1,!1),t.stateNode=e;e:{switch(l=xe(n,r),n){case"dialog":Wr("cancel",e),Wr("close",e),o=r;break;case"iframe":case"object":case"embed":Wr("load",e),o=r;break;case"video":case"audio":for(o=0;o<Rr.length;o++)Wr(Rr[o],e);o=r;break;case"source":Wr("error",e),o=r;break;case"img":case"image":case"link":Wr("error",e),Wr("load",e),o=r;break;case"details":Wr("toggle",e),o=r;break;case"input":Y(e,r),o=$(e,r),Wr("invalid",e);break;case"option":default:o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=L({},r,{value:void 0}),Wr("invalid",e);break;case"textarea":oe(e,r),o=re(e,r),Wr("invalid",e)}for(a in ve(n,o),u=o)if(u.hasOwnProperty(a)){var c=u[a];"style"===a?me(e,c):"dangerouslySetInnerHTML"===a?null!=(c=c?c.__html:void 0)&&de(e,c):"children"===a?"string"===typeof c?("textarea"!==n||""!==c)&&fe(e,c):"number"===typeof c&&fe(e,""+c):"suppressContentEditableWarning"!==a&&"suppressHydrationWarning"!==a&&"autoFocus"!==a&&(s.hasOwnProperty(a)?null!=c&&"onScroll"===a&&Wr("scroll",e):null!=c&&x(e,a,c,l))}switch(n){case"input":K(e),J(e,r,!1);break;case"textarea":K(e),ae(e);break;case"option":null!=r.value&&e.setAttribute("value",""+U(r.value));break;case"select":e.multiple=!!r.multiple,null!=(a=r.value)?ne(e,!!r.multiple,a,!1):null!=r.defaultValue&&ne(e,!!r.multiple,r.defaultValue,!0);break;default:"function"===typeof o.onClick&&(e.onclick=Jr)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}null!==t.ref&&(t.flags|=512,t.flags|=2097152)}return Vs(t),null;case 6:if(e&&null!=t.stateNode)Rs(e,t,e.memoizedProps,r);else{if("string"!==typeof r&&null===t.stateNode)throw Error(i(166));if(n=ra(na.current),ra(ea.current),fi(t)){if(r=t.stateNode,n=t.memoizedProps,r[ho]=t,(a=r.nodeValue!==n)&&null!==(e=ri))switch(e.tag){case 3:Xr(r.nodeValue,n,0!==(1&e.mode));break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&Xr(r.nodeValue,n,0!==(1&e.mode))}a&&(t.flags|=4)}else(r=(9===n.nodeType?n:n.ownerDocument).createTextNode(r))[ho]=t,t.stateNode=r}return Vs(t),null;case 13:if(Eo(la),r=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(ii&&null!==oi&&0!==(1&t.mode)&&0===(128&t.flags))hi(),pi(),t.flags|=98560,a=!1;else if(a=fi(t),null!==r&&null!==r.dehydrated){if(null===e){if(!a)throw Error(i(318));if(!(a=null!==(a=t.memoizedState)?a.dehydrated:null))throw Error(i(317));a[ho]=t}else pi(),0===(128&t.flags)&&(t.memoizedState=null),t.flags|=4;Vs(t),a=!1}else null!==ai&&(su(ai),ai=null),a=!0;if(!a)return 65536&t.flags?t:null}return 0!==(128&t.flags)?(t.lanes=n,t):((r=null!==r)!==(null!==e&&null!==e.memoizedState)&&r&&(t.child.flags|=8192,0!==(1&t.mode)&&(null===e||0!==(1&la.current)?0===Rl&&(Rl=3):mu())),null!==t.updateQueue&&(t.flags|=4),Vs(t),null);case 4:return ia(),Ps(e,t),null===e&&Gr(t.stateNode.containerInfo),Vs(t),null;case 10:return Ci(t.type._context),Vs(t),null;case 19:if(Eo(la),null===(a=t.memoizedState))return Vs(t),null;if(r=0!==(128&t.flags),null===(l=a.rendering))if(r)Ks(a,!1);else{if(0!==Rl||null!==e&&0!==(128&e.flags))for(e=t.child;null!==e;){if(null!==(l=ua(e))){for(t.flags|=128,Ks(a,!1),null!==(r=l.updateQueue)&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;null!==n;)e=r,(a=n).flags&=14680066,null===(l=a.alternate)?(a.childLanes=0,a.lanes=e,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=l.childLanes,a.lanes=l.lanes,a.child=l.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=l.memoizedProps,a.memoizedState=l.memoizedState,a.updateQueue=l.updateQueue,a.type=l.type,e=l.dependencies,a.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return To(la,1&la.current|2),t.child}e=e.sibling}null!==a.tail&&Qe()>Zl&&(t.flags|=128,r=!0,Ks(a,!1),t.lanes=4194304)}else{if(!r)if(null!==(e=ua(l))){if(t.flags|=128,r=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.flags|=4),Ks(a,!0),null===a.tail&&"hidden"===a.tailMode&&!l.alternate&&!ii)return Vs(t),null}else 2*Qe()-a.renderingStartTime>Zl&&1073741824!==n&&(t.flags|=128,r=!0,Ks(a,!1),t.lanes=4194304);a.isBackwards?(l.sibling=t.child,t.child=l):(null!==(n=a.last)?n.sibling=l:t.child=l,a.last=l)}return null!==a.tail?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=Qe(),t.sibling=null,n=la.current,To(la,r?1&n|2:1&n),t):(Vs(t),null);case 22:case 23:return fu(),r=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==r&&(t.flags|=8192),r&&0!==(1&t.mode)?0!==(1073741824&Pl)&&(Vs(t),6&t.subtreeFlags&&(t.flags|=8192)):Vs(t),null;case 24:case 25:return null}throw Error(i(156,t.tag))}function $s(e,t){switch(ni(t),t.tag){case 1:return Po(t.type)&&Mo(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return ia(),Eo(Do),Eo(Io),da(),0!==(65536&(e=t.flags))&&0===(128&e)?(t.flags=-65537&e|128,t):null;case 5:return sa(t),null;case 13:if(Eo(la),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(i(340));pi()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return Eo(la),null;case 4:return ia(),null;case 10:return Ci(t.type._context),null;case 22:case 23:return fu(),null;default:return null}}_s=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Ps=function(){},Ms=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,ra(ea.current);var i,a=null;switch(n){case"input":o=$(e,o),r=$(e,r),a=[];break;case"select":o=L({},o,{value:void 0}),r=L({},r,{value:void 0}),a=[];break;case"textarea":o=re(e,o),r=re(e,r),a=[];break;default:"function"!==typeof o.onClick&&"function"===typeof r.onClick&&(e.onclick=Jr)}for(c in ve(n,r),n=null,o)if(!r.hasOwnProperty(c)&&o.hasOwnProperty(c)&&null!=o[c])if("style"===c){var l=o[c];for(i in l)l.hasOwnProperty(i)&&(n||(n={}),n[i]="")}else"dangerouslySetInnerHTML"!==c&&"children"!==c&&"suppressContentEditableWarning"!==c&&"suppressHydrationWarning"!==c&&"autoFocus"!==c&&(s.hasOwnProperty(c)?a||(a=[]):(a=a||[]).push(c,null));for(c in r){var u=r[c];if(l=null!=o?o[c]:void 0,r.hasOwnProperty(c)&&u!==l&&(null!=u||null!=l))if("style"===c)if(l){for(i in l)!l.hasOwnProperty(i)||u&&u.hasOwnProperty(i)||(n||(n={}),n[i]="");for(i in u)u.hasOwnProperty(i)&&l[i]!==u[i]&&(n||(n={}),n[i]=u[i])}else n||(a||(a=[]),a.push(c,n)),n=u;else"dangerouslySetInnerHTML"===c?(u=u?u.__html:void 0,l=l?l.__html:void 0,null!=u&&l!==u&&(a=a||[]).push(c,u)):"children"===c?"string"!==typeof u&&"number"!==typeof u||(a=a||[]).push(c,""+u):"suppressContentEditableWarning"!==c&&"suppressHydrationWarning"!==c&&(s.hasOwnProperty(c)?(null!=u&&"onScroll"===c&&Wr("scroll",e),a||l===u||(a=[])):(a=a||[]).push(c,u))}n&&(a=a||[]).push("style",n);var c=a;(t.updateQueue=c)&&(t.flags|=4)}},Rs=function(e,t,n,r){n!==r&&(t.flags|=4)};var Ys=!1,Qs=!1,Xs="function"===typeof WeakSet?WeakSet:Set,Js=null;function el(e,t){var n=e.ref;if(null!==n)if("function"===typeof n)try{n(null)}catch(r){ku(e,t,r)}else n.current=null}function tl(e,t,n){try{n()}catch(r){ku(e,t,r)}}var nl=!1;function rl(e,t,n){var r=t.updateQueue;if(null!==(r=null!==r?r.lastEffect:null)){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,void 0!==i&&tl(t,n,i)}o=o.next}while(o!==r)}}function ol(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function il(e){var t=e.ref;if(null!==t){var n=e.stateNode;e.tag,e=n,"function"===typeof t?t(e):t.current=e}}function al(e){var t=e.alternate;null!==t&&(e.alternate=null,al(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&(delete t[ho],delete t[po],delete t[mo],delete t[yo],delete t[vo])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function sl(e){return 5===e.tag||3===e.tag||4===e.tag}function ll(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||sl(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function ul(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?8===n.nodeType?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(8===n.nodeType?(t=n.parentNode).insertBefore(e,n):(t=n).appendChild(e),null!==(n=n._reactRootContainer)&&void 0!==n||null!==t.onclick||(t.onclick=Jr));else if(4!==r&&null!==(e=e.child))for(ul(e,t,n),e=e.sibling;null!==e;)ul(e,t,n),e=e.sibling}function cl(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&null!==(e=e.child))for(cl(e,t,n),e=e.sibling;null!==e;)cl(e,t,n),e=e.sibling}var dl=null,fl=!1;function hl(e,t,n){for(n=n.child;null!==n;)pl(e,t,n),n=n.sibling}function pl(e,t,n){if(it&&"function"===typeof it.onCommitFiberUnmount)try{it.onCommitFiberUnmount(ot,n)}catch(s){}switch(n.tag){case 5:Qs||el(n,t);case 6:var r=dl,o=fl;dl=null,hl(e,t,n),fl=o,null!==(dl=r)&&(fl?(e=dl,n=n.stateNode,8===e.nodeType?e.parentNode.removeChild(n):e.removeChild(n)):dl.removeChild(n.stateNode));break;case 18:null!==dl&&(fl?(e=dl,n=n.stateNode,8===e.nodeType?lo(e.parentNode,n):1===e.nodeType&&lo(e,n),Gt(e)):lo(dl,n.stateNode));break;case 4:r=dl,o=fl,dl=n.stateNode.containerInfo,fl=!0,hl(e,t,n),dl=r,fl=o;break;case 0:case 11:case 14:case 15:if(!Qs&&(null!==(r=n.updateQueue)&&null!==(r=r.lastEffect))){o=r=r.next;do{var i=o,a=i.destroy;i=i.tag,void 0!==a&&(0!==(2&i)||0!==(4&i))&&tl(n,t,a),o=o.next}while(o!==r)}hl(e,t,n);break;case 1:if(!Qs&&(el(n,t),"function"===typeof(r=n.stateNode).componentWillUnmount))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){ku(n,t,s)}hl(e,t,n);break;case 21:hl(e,t,n);break;case 22:1&n.mode?(Qs=(r=Qs)||null!==n.memoizedState,hl(e,t,n),Qs=r):hl(e,t,n);break;default:hl(e,t,n)}}function gl(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new Xs),t.forEach((function(t){var r=Iu.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))}))}}function ml(e,t){var n=t.deletions;if(null!==n)for(var r=0;r<n.length;r++){var o=n[r];try{var a=e,s=t,l=s;e:for(;null!==l;){switch(l.tag){case 5:dl=l.stateNode,fl=!1;break e;case 3:case 4:dl=l.stateNode.containerInfo,fl=!0;break e}l=l.return}if(null===dl)throw Error(i(160));pl(a,s,o),dl=null,fl=!1;var u=o.alternate;null!==u&&(u.return=null),o.return=null}catch(c){ku(o,t,c)}}if(12854&t.subtreeFlags)for(t=t.child;null!==t;)yl(t,e),t=t.sibling}function yl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(ml(t,e),vl(e),4&r){try{rl(3,e,e.return),ol(3,e)}catch(m){ku(e,e.return,m)}try{rl(5,e,e.return)}catch(m){ku(e,e.return,m)}}break;case 1:ml(t,e),vl(e),512&r&&null!==n&&el(n,n.return);break;case 5:if(ml(t,e),vl(e),512&r&&null!==n&&el(n,n.return),32&e.flags){var o=e.stateNode;try{fe(o,"")}catch(m){ku(e,e.return,m)}}if(4&r&&null!=(o=e.stateNode)){var a=e.memoizedProps,s=null!==n?n.memoizedProps:a,l=e.type,u=e.updateQueue;if(e.updateQueue=null,null!==u)try{"input"===l&&"radio"===a.type&&null!=a.name&&Q(o,a),xe(l,s);var c=xe(l,a);for(s=0;s<u.length;s+=2){var d=u[s],f=u[s+1];"style"===d?me(o,f):"dangerouslySetInnerHTML"===d?de(o,f):"children"===d?fe(o,f):x(o,d,f,c)}switch(l){case"input":X(o,a);break;case"textarea":ie(o,a);break;case"select":var h=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!a.multiple;var p=a.value;null!=p?ne(o,!!a.multiple,p,!1):h!==!!a.multiple&&(null!=a.defaultValue?ne(o,!!a.multiple,a.defaultValue,!0):ne(o,!!a.multiple,a.multiple?[]:"",!1))}o[po]=a}catch(m){ku(e,e.return,m)}}break;case 6:if(ml(t,e),vl(e),4&r){if(null===e.stateNode)throw Error(i(162));o=e.stateNode,a=e.memoizedProps;try{o.nodeValue=a}catch(m){ku(e,e.return,m)}}break;case 3:if(ml(t,e),vl(e),4&r&&null!==n&&n.memoizedState.isDehydrated)try{Gt(t.containerInfo)}catch(m){ku(e,e.return,m)}break;case 4:default:ml(t,e),vl(e);break;case 13:ml(t,e),vl(e),8192&(o=e.child).flags&&(a=null!==o.memoizedState,o.stateNode.isHidden=a,!a||null!==o.alternate&&null!==o.alternate.memoizedState||(Gl=Qe())),4&r&&gl(e);break;case 22:if(d=null!==n&&null!==n.memoizedState,1&e.mode?(Qs=(c=Qs)||d,ml(t,e),Qs=c):ml(t,e),vl(e),8192&r){if(c=null!==e.memoizedState,(e.stateNode.isHidden=c)&&!d&&0!==(1&e.mode))for(Js=e,d=e.child;null!==d;){for(f=Js=d;null!==Js;){switch(p=(h=Js).child,h.tag){case 0:case 11:case 14:case 15:rl(4,h,h.return);break;case 1:el(h,h.return);var g=h.stateNode;if("function"===typeof g.componentWillUnmount){r=h,n=h.return;try{t=r,g.props=t.memoizedProps,g.state=t.memoizedState,g.componentWillUnmount()}catch(m){ku(r,n,m)}}break;case 5:el(h,h.return);break;case 22:if(null!==h.memoizedState){Sl(f);continue}}null!==p?(p.return=h,Js=p):Sl(f)}d=d.sibling}e:for(d=null,f=e;;){if(5===f.tag){if(null===d){d=f;try{o=f.stateNode,c?"function"===typeof(a=o.style).setProperty?a.setProperty("display","none","important"):a.display="none":(l=f.stateNode,s=void 0!==(u=f.memoizedProps.style)&&null!==u&&u.hasOwnProperty("display")?u.display:null,l.style.display=ge("display",s))}catch(m){ku(e,e.return,m)}}}else if(6===f.tag){if(null===d)try{f.stateNode.nodeValue=c?"":f.memoizedProps}catch(m){ku(e,e.return,m)}}else if((22!==f.tag&&23!==f.tag||null===f.memoizedState||f===e)&&null!==f.child){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;null===f.sibling;){if(null===f.return||f.return===e)break e;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:ml(t,e),vl(e),4&r&&gl(e);case 21:}}function vl(e){var t=e.flags;if(2&t){try{e:{for(var n=e.return;null!==n;){if(sl(n)){var r=n;break e}n=n.return}throw Error(i(160))}switch(r.tag){case 5:var o=r.stateNode;32&r.flags&&(fe(o,""),r.flags&=-33),cl(e,ll(e),o);break;case 3:case 4:var a=r.stateNode.containerInfo;ul(e,ll(e),a);break;default:throw Error(i(161))}}catch(s){ku(e,e.return,s)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function xl(e,t,n){Js=e,bl(e,t,n)}function bl(e,t,n){for(var r=0!==(1&e.mode);null!==Js;){var o=Js,i=o.child;if(22===o.tag&&r){var a=null!==o.memoizedState||Ys;if(!a){var s=o.alternate,l=null!==s&&null!==s.memoizedState||Qs;s=Ys;var u=Qs;if(Ys=a,(Qs=l)&&!u)for(Js=o;null!==Js;)l=(a=Js).child,22===a.tag&&null!==a.memoizedState?Cl(o):null!==l?(l.return=a,Js=l):Cl(o);for(;null!==i;)Js=i,bl(i,t,n),i=i.sibling;Js=o,Ys=s,Qs=u}wl(e)}else 0!==(8772&o.subtreeFlags)&&null!==i?(i.return=o,Js=i):wl(e)}}function wl(e){for(;null!==Js;){var t=Js;if(0!==(8772&t.flags)){var n=t.alternate;try{if(0!==(8772&t.flags))switch(t.tag){case 0:case 11:case 15:Qs||ol(5,t);break;case 1:var r=t.stateNode;if(4&t.flags&&!Qs)if(null===n)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:yi(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;null!==a&&Wi(t,a,r);break;case 3:var s=t.updateQueue;if(null!==s){if(n=null,null!==t.child)switch(t.child.tag){case 5:case 1:n=t.child.stateNode}Wi(t,s,n)}break;case 5:var l=t.stateNode;if(null===n&&4&t.flags){n=l;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&n.focus();break;case"img":u.src&&(n.src=u.src)}}break;case 6:case 4:case 12:case 19:case 17:case 21:case 22:case 23:case 25:break;case 13:if(null===t.memoizedState){var c=t.alternate;if(null!==c){var d=c.memoizedState;if(null!==d){var f=d.dehydrated;null!==f&&Gt(f)}}}break;default:throw Error(i(163))}Qs||512&t.flags&&il(t)}catch(h){ku(t,t.return,h)}}if(t===e){Js=null;break}if(null!==(n=t.sibling)){n.return=t.return,Js=n;break}Js=t.return}}function Sl(e){for(;null!==Js;){var t=Js;if(t===e){Js=null;break}var n=t.sibling;if(null!==n){n.return=t.return,Js=n;break}Js=t.return}}function Cl(e){for(;null!==Js;){var t=Js;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{ol(4,t)}catch(l){ku(t,n,l)}break;case 1:var r=t.stateNode;if("function"===typeof r.componentDidMount){var o=t.return;try{r.componentDidMount()}catch(l){ku(t,o,l)}}var i=t.return;try{il(t)}catch(l){ku(t,i,l)}break;case 5:var a=t.return;try{il(t)}catch(l){ku(t,a,l)}}}catch(l){ku(t,t.return,l)}if(t===e){Js=null;break}var s=t.sibling;if(null!==s){s.return=t.return,Js=s;break}Js=t.return}}var jl,kl=Math.ceil,El=b.ReactCurrentDispatcher,Tl=b.ReactCurrentOwner,Ol=b.ReactCurrentBatchConfig,Il=0,Dl=null,Al=null,_l=0,Pl=0,Ml=ko(0),Rl=0,Nl=null,Ll=0,Fl=0,Wl=0,Bl=null,zl=null,Gl=0,Zl=1/0,Ul=null,Hl=!1,Kl=null,Vl=null,ql=!1,$l=null,Yl=0,Ql=0,Xl=null,Jl=-1,eu=0;function tu(){return 0!==(6&Il)?Qe():-1!==Jl?Jl:Jl=Qe()}function nu(e){return 0===(1&e.mode)?1:0!==(2&Il)&&0!==_l?_l&-_l:null!==mi.transition?(0===eu&&(eu=gt()),eu):0!==(e=xt)?e:e=void 0===(e=window.event)?16:Yt(e.type)}function ru(e,t,n,r){if(50<Ql)throw Ql=0,Xl=null,Error(i(185));yt(e,n,r),0!==(2&Il)&&e===Dl||(e===Dl&&(0===(2&Il)&&(Fl|=n),4===Rl&&lu(e,_l)),ou(e,r),1===n&&0===Il&&0===(1&t.mode)&&(Zl=Qe()+500,Bo&&Zo()))}function ou(e,t){var n=e.callbackNode;!function(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var a=31-at(i),s=1<<a,l=o[a];-1===l?0!==(s&n)&&0===(s&r)||(o[a]=ht(s,t)):l<=t&&(e.expiredLanes|=s),i&=~s}}(e,t);var r=ft(e,e===Dl?_l:0);if(0===r)null!==n&&qe(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(null!=n&&qe(n),1===t)0===e.tag?function(e){Bo=!0,Go(e)}(uu.bind(null,e)):Go(uu.bind(null,e)),ao((function(){0===(6&Il)&&Zo()})),n=null;else{switch(bt(r)){case 1:n=Je;break;case 4:n=et;break;case 16:default:n=tt;break;case 536870912:n=rt}n=Du(n,iu.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function iu(e,t){if(Jl=-1,eu=0,0!==(6&Il))throw Error(i(327));var n=e.callbackNode;if(Cu()&&e.callbackNode!==n)return null;var r=ft(e,e===Dl?_l:0);if(0===r)return null;if(0!==(30&r)||0!==(r&e.expiredLanes)||t)t=yu(e,r);else{t=r;var o=Il;Il|=2;var a=gu();for(Dl===e&&_l===t||(Ul=null,Zl=Qe()+500,hu(e,t));;)try{xu();break}catch(l){pu(e,l)}Si(),El.current=a,Il=o,null!==Al?t=0:(Dl=null,_l=0,t=Rl)}if(0!==t){if(2===t&&(0!==(o=pt(e))&&(r=o,t=au(e,o))),1===t)throw n=Nl,hu(e,0),lu(e,r),ou(e,Qe()),n;if(6===t)lu(e,r);else{if(o=e.current.alternate,0===(30&r)&&!function(e){for(var t=e;;){if(16384&t.flags){var n=t.updateQueue;if(null!==n&&null!==(n=n.stores))for(var r=0;r<n.length;r++){var o=n[r],i=o.getSnapshot;o=o.value;try{if(!sr(i(),o))return!1}catch(s){return!1}}}if(n=t.child,16384&t.subtreeFlags&&null!==n)n.return=t,t=n;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}(o)&&(2===(t=yu(e,r))&&(0!==(a=pt(e))&&(r=a,t=au(e,a))),1===t))throw n=Nl,hu(e,0),lu(e,r),ou(e,Qe()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(i(345));case 2:case 5:Su(e,zl,Ul);break;case 3:if(lu(e,r),(130023424&r)===r&&10<(t=Gl+500-Qe())){if(0!==ft(e,0))break;if(((o=e.suspendedLanes)&r)!==r){tu(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=ro(Su.bind(null,e,zl,Ul),t);break}Su(e,zl,Ul);break;case 4:if(lu(e,r),(4194240&r)===r)break;for(t=e.eventTimes,o=-1;0<r;){var s=31-at(r);a=1<<s,(s=t[s])>o&&(o=s),r&=~a}if(r=o,10<(r=(120>(r=Qe()-r)?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*kl(r/1960))-r)){e.timeoutHandle=ro(Su.bind(null,e,zl,Ul),r);break}Su(e,zl,Ul);break;default:throw Error(i(329))}}}return ou(e,Qe()),e.callbackNode===n?iu.bind(null,e):null}function au(e,t){var n=Bl;return e.current.memoizedState.isDehydrated&&(hu(e,t).flags|=256),2!==(e=yu(e,t))&&(t=zl,zl=n,null!==t&&su(t)),e}function su(e){null===zl?zl=e:zl.push.apply(zl,e)}function lu(e,t){for(t&=~Wl,t&=~Fl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-at(t),r=1<<n;e[n]=-1,t&=~r}}function uu(e){if(0!==(6&Il))throw Error(i(327));Cu();var t=ft(e,0);if(0===(1&t))return ou(e,Qe()),null;var n=yu(e,t);if(0!==e.tag&&2===n){var r=pt(e);0!==r&&(t=r,n=au(e,r))}if(1===n)throw n=Nl,hu(e,0),lu(e,t),ou(e,Qe()),n;if(6===n)throw Error(i(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Su(e,zl,Ul),ou(e,Qe()),null}function cu(e,t){var n=Il;Il|=1;try{return e(t)}finally{0===(Il=n)&&(Zl=Qe()+500,Bo&&Zo())}}function du(e){null!==$l&&0===$l.tag&&0===(6&Il)&&Cu();var t=Il;Il|=1;var n=Ol.transition,r=xt;try{if(Ol.transition=null,xt=1,e)return e()}finally{xt=r,Ol.transition=n,0===(6&(Il=t))&&Zo()}}function fu(){Pl=Ml.current,Eo(Ml)}function hu(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,oo(n)),null!==Al)for(n=Al.return;null!==n;){var r=n;switch(ni(r),r.tag){case 1:null!==(r=r.type.childContextTypes)&&void 0!==r&&Mo();break;case 3:ia(),Eo(Do),Eo(Io),da();break;case 5:sa(r);break;case 4:ia();break;case 13:case 19:Eo(la);break;case 10:Ci(r.type._context);break;case 22:case 23:fu()}n=n.return}if(Dl=e,Al=e=Mu(e.current,null),_l=Pl=t,Rl=0,Nl=null,Wl=Fl=Ll=0,zl=Bl=null,null!==Ti){for(t=0;t<Ti.length;t++)if(null!==(r=(n=Ti[t]).interleaved)){n.interleaved=null;var o=r.next,i=n.pending;if(null!==i){var a=i.next;i.next=o,r.next=a}n.pending=r}Ti=null}return e}function pu(e,t){for(;;){var n=Al;try{if(Si(),fa.current=as,va){for(var r=ga.memoizedState;null!==r;){var o=r.queue;null!==o&&(o.pending=null),r=r.next}va=!1}if(pa=0,ya=ma=ga=null,xa=!1,ba=0,Tl.current=null,null===n||null===n.return){Rl=1,Nl=t,Al=null;break}e:{var a=e,s=n.return,l=n,u=t;if(t=_l,l.flags|=32768,null!==u&&"object"===typeof u&&"function"===typeof u.then){var c=u,d=l,f=d.tag;if(0===(1&d.mode)&&(0===f||11===f||15===f)){var h=d.alternate;h?(d.updateQueue=h.updateQueue,d.memoizedState=h.memoizedState,d.lanes=h.lanes):(d.updateQueue=null,d.memoizedState=null)}var p=ys(s);if(null!==p){p.flags&=-257,vs(p,s,l,0,t),1&p.mode&&ms(a,c,t),u=c;var g=(t=p).updateQueue;if(null===g){var m=new Set;m.add(u),t.updateQueue=m}else g.add(u);break e}if(0===(1&t)){ms(a,c,t),mu();break e}u=Error(i(426))}else if(ii&&1&l.mode){var y=ys(s);if(null!==y){0===(65536&y.flags)&&(y.flags|=256),vs(y,s,l,0,t),gi(cs(u,l));break e}}a=u=cs(u,l),4!==Rl&&(Rl=2),null===Bl?Bl=[a]:Bl.push(a),a=s;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t,Li(a,ps(0,u,t));break e;case 1:l=u;var v=a.type,x=a.stateNode;if(0===(128&a.flags)&&("function"===typeof v.getDerivedStateFromError||null!==x&&"function"===typeof x.componentDidCatch&&(null===Vl||!Vl.has(x)))){a.flags|=65536,t&=-t,a.lanes|=t,Li(a,gs(a,l,t));break e}}a=a.return}while(null!==a)}wu(n)}catch(b){t=b,Al===n&&null!==n&&(Al=n=n.return);continue}break}}function gu(){var e=El.current;return El.current=as,null===e?as:e}function mu(){0!==Rl&&3!==Rl&&2!==Rl||(Rl=4),null===Dl||0===(268435455&Ll)&&0===(268435455&Fl)||lu(Dl,_l)}function yu(e,t){var n=Il;Il|=2;var r=gu();for(Dl===e&&_l===t||(Ul=null,hu(e,t));;)try{vu();break}catch(o){pu(e,o)}if(Si(),Il=n,El.current=r,null!==Al)throw Error(i(261));return Dl=null,_l=0,Rl}function vu(){for(;null!==Al;)bu(Al)}function xu(){for(;null!==Al&&!$e();)bu(Al)}function bu(e){var t=jl(e.alternate,e,Pl);e.memoizedProps=e.pendingProps,null===t?wu(e):Al=t,Tl.current=null}function wu(e){var t=e;do{var n=t.alternate;if(e=t.return,0===(32768&t.flags)){if(null!==(n=qs(n,t,Pl)))return void(Al=n)}else{if(null!==(n=$s(n,t)))return n.flags&=32767,void(Al=n);if(null===e)return Rl=6,void(Al=null);e.flags|=32768,e.subtreeFlags=0,e.deletions=null}if(null!==(t=t.sibling))return void(Al=t);Al=t=e}while(null!==t);0===Rl&&(Rl=5)}function Su(e,t,n){var r=xt,o=Ol.transition;try{Ol.transition=null,xt=1,function(e,t,n,r){do{Cu()}while(null!==$l);if(0!==(6&Il))throw Error(i(327));n=e.finishedWork;var o=e.finishedLanes;if(null===n)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(i(177));e.callbackNode=null,e.callbackPriority=0;var a=n.lanes|n.childLanes;if(function(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var o=31-at(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}(e,a),e===Dl&&(Al=Dl=null,_l=0),0===(2064&n.subtreeFlags)&&0===(2064&n.flags)||ql||(ql=!0,Du(tt,(function(){return Cu(),null}))),a=0!==(15990&n.flags),0!==(15990&n.subtreeFlags)||a){a=Ol.transition,Ol.transition=null;var s=xt;xt=1;var l=Il;Il|=4,Tl.current=null,function(e,t){if(eo=Ut,hr(e=fr())){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{var r=(n=(n=e.ownerDocument)&&n.defaultView||window).getSelection&&n.getSelection();if(r&&0!==r.rangeCount){n=r.anchorNode;var o=r.anchorOffset,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.nodeType}catch(w){n=null;break e}var s=0,l=-1,u=-1,c=0,d=0,f=e,h=null;t:for(;;){for(var p;f!==n||0!==o&&3!==f.nodeType||(l=s+o),f!==a||0!==r&&3!==f.nodeType||(u=s+r),3===f.nodeType&&(s+=f.nodeValue.length),null!==(p=f.firstChild);)h=f,f=p;for(;;){if(f===e)break t;if(h===n&&++c===o&&(l=s),h===a&&++d===r&&(u=s),null!==(p=f.nextSibling))break;h=(f=h).parentNode}f=p}n=-1===l||-1===u?null:{start:l,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(to={focusedElem:e,selectionRange:n},Ut=!1,Js=t;null!==Js;)if(e=(t=Js).child,0!==(1028&t.subtreeFlags)&&null!==e)e.return=t,Js=e;else for(;null!==Js;){t=Js;try{var g=t.alternate;if(0!==(1024&t.flags))switch(t.tag){case 0:case 11:case 15:case 5:case 6:case 4:case 17:break;case 1:if(null!==g){var m=g.memoizedProps,y=g.memoizedState,v=t.stateNode,x=v.getSnapshotBeforeUpdate(t.elementType===t.type?m:yi(t.type,m),y);v.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var b=t.stateNode.containerInfo;1===b.nodeType?b.textContent="":9===b.nodeType&&b.documentElement&&b.removeChild(b.documentElement);break;default:throw Error(i(163))}}catch(w){ku(t,t.return,w)}if(null!==(e=t.sibling)){e.return=t.return,Js=e;break}Js=t.return}g=nl,nl=!1}(e,n),yl(n,e),pr(to),Ut=!!eo,to=eo=null,e.current=n,xl(n,e,o),Ye(),Il=l,xt=s,Ol.transition=a}else e.current=n;if(ql&&(ql=!1,$l=e,Yl=o),a=e.pendingLanes,0===a&&(Vl=null),function(e){if(it&&"function"===typeof it.onCommitFiberRoot)try{it.onCommitFiberRoot(ot,e,void 0,128===(128&e.current.flags))}catch(t){}}(n.stateNode),ou(e,Qe()),null!==t)for(r=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],r(o.value,{componentStack:o.stack,digest:o.digest});if(Hl)throw Hl=!1,e=Kl,Kl=null,e;0!==(1&Yl)&&0!==e.tag&&Cu(),a=e.pendingLanes,0!==(1&a)?e===Xl?Ql++:(Ql=0,Xl=e):Ql=0,Zo()}(e,t,n,r)}finally{Ol.transition=o,xt=r}return null}function Cu(){if(null!==$l){var e=bt(Yl),t=Ol.transition,n=xt;try{if(Ol.transition=null,xt=16>e?16:e,null===$l)var r=!1;else{if(e=$l,$l=null,Yl=0,0!==(6&Il))throw Error(i(331));var o=Il;for(Il|=4,Js=e.current;null!==Js;){var a=Js,s=a.child;if(0!==(16&Js.flags)){var l=a.deletions;if(null!==l){for(var u=0;u<l.length;u++){var c=l[u];for(Js=c;null!==Js;){var d=Js;switch(d.tag){case 0:case 11:case 15:rl(8,d,a)}var f=d.child;if(null!==f)f.return=d,Js=f;else for(;null!==Js;){var h=(d=Js).sibling,p=d.return;if(al(d),d===c){Js=null;break}if(null!==h){h.return=p,Js=h;break}Js=p}}}var g=a.alternate;if(null!==g){var m=g.child;if(null!==m){g.child=null;do{var y=m.sibling;m.sibling=null,m=y}while(null!==m)}}Js=a}}if(0!==(2064&a.subtreeFlags)&&null!==s)s.return=a,Js=s;else e:for(;null!==Js;){if(0!==(2048&(a=Js).flags))switch(a.tag){case 0:case 11:case 15:rl(9,a,a.return)}var v=a.sibling;if(null!==v){v.return=a.return,Js=v;break e}Js=a.return}}var x=e.current;for(Js=x;null!==Js;){var b=(s=Js).child;if(0!==(2064&s.subtreeFlags)&&null!==b)b.return=s,Js=b;else e:for(s=x;null!==Js;){if(0!==(2048&(l=Js).flags))try{switch(l.tag){case 0:case 11:case 15:ol(9,l)}}catch(S){ku(l,l.return,S)}if(l===s){Js=null;break e}var w=l.sibling;if(null!==w){w.return=l.return,Js=w;break e}Js=l.return}}if(Il=o,Zo(),it&&"function"===typeof it.onPostCommitFiberRoot)try{it.onPostCommitFiberRoot(ot,e)}catch(S){}r=!0}return r}finally{xt=n,Ol.transition=t}}return!1}function ju(e,t,n){e=Ri(e,t=ps(0,t=cs(n,t),1),1),t=tu(),null!==e&&(yt(e,1,t),ou(e,t))}function ku(e,t,n){if(3===e.tag)ju(e,e,n);else for(;null!==t;){if(3===t.tag){ju(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"===typeof t.type.getDerivedStateFromError||"function"===typeof r.componentDidCatch&&(null===Vl||!Vl.has(r))){t=Ri(t,e=gs(t,e=cs(n,e),1),1),e=tu(),null!==t&&(yt(t,1,e),ou(t,e));break}}t=t.return}}function Eu(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),t=tu(),e.pingedLanes|=e.suspendedLanes&n,Dl===e&&(_l&n)===n&&(4===Rl||3===Rl&&(130023424&_l)===_l&&500>Qe()-Gl?hu(e,0):Wl|=n),ou(e,t)}function Tu(e,t){0===t&&(0===(1&e.mode)?t=1:(t=ct,0===(130023424&(ct<<=1))&&(ct=4194304)));var n=tu();null!==(e=Di(e,t))&&(yt(e,t,n),ou(e,n))}function Ou(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),Tu(e,n)}function Iu(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;null!==o&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(i(314))}null!==r&&r.delete(t),Tu(e,n)}function Du(e,t){return Ve(e,t)}function Au(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function _u(e,t,n,r){return new Au(e,t,n,r)}function Pu(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Mu(e,t){var n=e.alternate;return null===n?((n=_u(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=14680064&e.flags,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Ru(e,t,n,r,o,a){var s=2;if(r=e,"function"===typeof e)Pu(e)&&(s=1);else if("string"===typeof e)s=5;else e:switch(e){case C:return Nu(n.children,o,a,t);case j:s=8,o|=8;break;case k:return(e=_u(12,n,t,2|o)).elementType=k,e.lanes=a,e;case I:return(e=_u(13,n,t,o)).elementType=I,e.lanes=a,e;case D:return(e=_u(19,n,t,o)).elementType=D,e.lanes=a,e;case P:return Lu(n,o,a,t);default:if("object"===typeof e&&null!==e)switch(e.$$typeof){case E:s=10;break e;case T:s=9;break e;case O:s=11;break e;case A:s=14;break e;case _:s=16,r=null;break e}throw Error(i(130,null==e?e:typeof e,""))}return(t=_u(s,n,t,o)).elementType=e,t.type=r,t.lanes=a,t}function Nu(e,t,n,r){return(e=_u(7,e,r,t)).lanes=n,e}function Lu(e,t,n,r){return(e=_u(22,e,r,t)).elementType=P,e.lanes=n,e.stateNode={isHidden:!1},e}function Fu(e,t,n){return(e=_u(6,e,null,t)).lanes=n,e}function Wu(e,t,n){return(t=_u(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Bu(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=mt(0),this.expirationTimes=mt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=mt(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function zu(e,t,n,r,o,i,a,s,l){return e=new Bu(e,t,n,s,l),1===t?(t=1,!0===i&&(t|=8)):t=0,i=_u(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},_i(i),e}function Gu(e){if(!e)return Oo;e:{if(Ge(e=e._reactInternals)!==e||1!==e.tag)throw Error(i(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Po(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(null!==t);throw Error(i(171))}if(1===e.tag){var n=e.type;if(Po(n))return No(e,n,t)}return t}function Zu(e,t,n,r,o,i,a,s,l){return(e=zu(n,r,!0,e,0,i,0,s,l)).context=Gu(null),n=e.current,(i=Mi(r=tu(),o=nu(n))).callback=void 0!==t&&null!==t?t:null,Ri(n,i,o),e.current.lanes=o,yt(e,o,r),ou(e,r),e}function Uu(e,t,n,r){var o=t.current,i=tu(),a=nu(o);return n=Gu(n),null===t.context?t.context=n:t.pendingContext=n,(t=Mi(i,a)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),null!==(e=Ri(o,t,a))&&(ru(e,o,a,i),Ni(e,o,a)),a}function Hu(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function Ku(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function Vu(e,t){Ku(e,t),(e=e.alternate)&&Ku(e,t)}jl=function(e,t,n){if(null!==e)if(e.memoizedProps!==t.pendingProps||Do.current)bs=!0;else{if(0===(e.lanes&n)&&0===(128&t.flags))return bs=!1,function(e,t,n){switch(t.tag){case 3:Ds(t),pi();break;case 5:aa(t);break;case 1:Po(t.type)&&Lo(t);break;case 4:oa(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;To(vi,r._currentValue),r._currentValue=o;break;case 13:if(null!==(r=t.memoizedState))return null!==r.dehydrated?(To(la,1&la.current),t.flags|=128,null):0!==(n&t.child.childLanes)?Fs(e,t,n):(To(la,1&la.current),null!==(e=Hs(e,t,n))?e.sibling:null);To(la,1&la.current);break;case 19:if(r=0!==(n&t.childLanes),0!==(128&e.flags)){if(r)return Zs(e,t,n);t.flags|=128}if(null!==(o=t.memoizedState)&&(o.rendering=null,o.tail=null,o.lastEffect=null),To(la,la.current),r)break;return null;case 22:case 23:return t.lanes=0,ks(e,t,n)}return Hs(e,t,n)}(e,t,n);bs=0!==(131072&e.flags)}else bs=!1,ii&&0!==(1048576&t.flags)&&ei(t,Vo,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Us(e,t),e=t.pendingProps;var o=_o(t,Io.current);ki(t,n),o=ja(null,t,r,e,o,n);var a=ka();return t.flags|=1,"object"===typeof o&&null!==o&&"function"===typeof o.render&&void 0===o.$$typeof?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Po(r)?(a=!0,Lo(t)):a=!1,t.memoizedState=null!==o.state&&void 0!==o.state?o.state:null,_i(t),o.updater=Gi,t.stateNode=o,o._reactInternals=t,Ki(t,r,e,n),t=Is(null,t,r,!0,a,n)):(t.tag=0,ii&&a&&ti(t),ws(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Us(e,t),e=t.pendingProps,r=(o=r._init)(r._payload),t.type=r,o=t.tag=function(e){if("function"===typeof e)return Pu(e)?1:0;if(void 0!==e&&null!==e){if((e=e.$$typeof)===O)return 11;if(e===A)return 14}return 2}(r),e=yi(r,e),o){case 0:t=Ts(null,t,r,e,n);break e;case 1:t=Os(null,t,r,e,n);break e;case 11:t=Ss(null,t,r,e,n);break e;case 14:t=Cs(null,t,r,yi(r.type,e),n);break e}throw Error(i(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,Ts(e,t,r,o=t.elementType===r?o:yi(r,o),n);case 1:return r=t.type,o=t.pendingProps,Os(e,t,r,o=t.elementType===r?o:yi(r,o),n);case 3:e:{if(Ds(t),null===e)throw Error(i(387));r=t.pendingProps,o=(a=t.memoizedState).element,Pi(e,t),Fi(t,r,null,n);var s=t.memoizedState;if(r=s.element,a.isDehydrated){if(a={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=a,t.memoizedState=a,256&t.flags){t=As(e,t,r,n,o=cs(Error(i(423)),t));break e}if(r!==o){t=As(e,t,r,n,o=cs(Error(i(424)),t));break e}for(oi=uo(t.stateNode.containerInfo.firstChild),ri=t,ii=!0,ai=null,n=Xi(t,null,r,n),t.child=n;n;)n.flags=-3&n.flags|4096,n=n.sibling}else{if(pi(),r===o){t=Hs(e,t,n);break e}ws(e,t,r,n)}t=t.child}return t;case 5:return aa(t),null===e&&ci(t),r=t.type,o=t.pendingProps,a=null!==e?e.memoizedProps:null,s=o.children,no(r,o)?s=null:null!==a&&no(r,a)&&(t.flags|=32),Es(e,t),ws(e,t,s,n),t.child;case 6:return null===e&&ci(t),null;case 13:return Fs(e,t,n);case 4:return oa(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=Qi(t,null,r,n):ws(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,Ss(e,t,r,o=t.elementType===r?o:yi(r,o),n);case 7:return ws(e,t,t.pendingProps,n),t.child;case 8:case 12:return ws(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,a=t.memoizedProps,s=o.value,To(vi,r._currentValue),r._currentValue=s,null!==a)if(sr(a.value,s)){if(a.children===o.children&&!Do.current){t=Hs(e,t,n);break e}}else for(null!==(a=t.child)&&(a.return=t);null!==a;){var l=a.dependencies;if(null!==l){s=a.child;for(var u=l.firstContext;null!==u;){if(u.context===r){if(1===a.tag){(u=Mi(-1,n&-n)).tag=2;var c=a.updateQueue;if(null!==c){var d=(c=c.shared).pending;null===d?u.next=u:(u.next=d.next,d.next=u),c.pending=u}}a.lanes|=n,null!==(u=a.alternate)&&(u.lanes|=n),ji(a.return,n,t),l.lanes|=n;break}u=u.next}}else if(10===a.tag)s=a.type===t.type?null:a.child;else if(18===a.tag){if(null===(s=a.return))throw Error(i(341));s.lanes|=n,null!==(l=s.alternate)&&(l.lanes|=n),ji(s,n,t),s=a.sibling}else s=a.child;if(null!==s)s.return=a;else for(s=a;null!==s;){if(s===t){s=null;break}if(null!==(a=s.sibling)){a.return=s.return,s=a;break}s=s.return}a=s}ws(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,ki(t,n),r=r(o=Ei(o)),t.flags|=1,ws(e,t,r,n),t.child;case 14:return o=yi(r=t.type,t.pendingProps),Cs(e,t,r,o=yi(r.type,o),n);case 15:return js(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:yi(r,o),Us(e,t),t.tag=1,Po(r)?(e=!0,Lo(t)):e=!1,ki(t,n),Ui(t,r,o),Ki(t,r,o,n),Is(null,t,r,!0,e,n);case 19:return Zs(e,t,n);case 22:return ks(e,t,n)}throw Error(i(156,t.tag))};var qu="function"===typeof reportError?reportError:function(e){console.error(e)};function $u(e){this._internalRoot=e}function Yu(e){this._internalRoot=e}function Qu(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}function Xu(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function Ju(){}function ec(e,t,n,r,o){var i=n._reactRootContainer;if(i){var a=i;if("function"===typeof o){var s=o;o=function(){var e=Hu(a);s.call(e)}}Uu(t,a,e,o)}else a=function(e,t,n,r,o){if(o){if("function"===typeof r){var i=r;r=function(){var e=Hu(a);i.call(e)}}var a=Zu(t,r,e,0,null,!1,0,"",Ju);return e._reactRootContainer=a,e[go]=a.current,Gr(8===e.nodeType?e.parentNode:e),du(),a}for(;o=e.lastChild;)e.removeChild(o);if("function"===typeof r){var s=r;r=function(){var e=Hu(l);s.call(e)}}var l=zu(e,0,!1,null,0,!1,0,"",Ju);return e._reactRootContainer=l,e[go]=l.current,Gr(8===e.nodeType?e.parentNode:e),du((function(){Uu(t,l,n,r)})),l}(n,t,e,o,r);return Hu(a)}Yu.prototype.render=$u.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw Error(i(409));Uu(e,t,null,null)},Yu.prototype.unmount=$u.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;du((function(){Uu(null,e,null,null)})),t[go]=null}},Yu.prototype.unstable_scheduleHydration=function(e){if(e){var t=jt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Pt.length&&0!==t&&t<Pt[n].priority;n++);Pt.splice(n,0,e),0===n&&Lt(e)}},wt=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=dt(t.pendingLanes);0!==n&&(vt(t,1|n),ou(t,Qe()),0===(6&Il)&&(Zl=Qe()+500,Zo()))}break;case 13:du((function(){var t=Di(e,1);if(null!==t){var n=tu();ru(t,e,1,n)}})),Vu(e,1)}},St=function(e){if(13===e.tag){var t=Di(e,134217728);if(null!==t)ru(t,e,134217728,tu());Vu(e,134217728)}},Ct=function(e){if(13===e.tag){var t=nu(e),n=Di(e,t);if(null!==n)ru(n,e,t,tu());Vu(e,t)}},jt=function(){return xt},kt=function(e,t){var n=xt;try{return xt=e,t()}finally{xt=n}},Se=function(e,t,n){switch(t){case"input":if(X(e,n),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=So(r);if(!o)throw Error(i(90));V(r),X(r,o)}}}break;case"textarea":ie(e,n);break;case"select":null!=(t=n.value)&&ne(e,!!n.multiple,t,!1)}},Oe=cu,Ie=du;var tc={usingClientEntryPoint:!1,Events:[bo,wo,So,Ee,Te,cu]},nc={findFiberByHostInstance:xo,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},rc={bundleType:nc.bundleType,version:nc.version,rendererPackageName:nc.rendererPackageName,rendererConfig:nc.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:b.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=He(e))?null:e.stateNode},findFiberByHostInstance:nc.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var oc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!oc.isDisabled&&oc.supportsFiber)try{ot=oc.inject(rc),it=oc}catch(ce){}}t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=tc,t.createPortal=function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!Qu(t))throw Error(i(200));return function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:S,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,t,null,n)},t.createRoot=function(e,t){if(!Qu(e))throw Error(i(299));var n=!1,r="",o=qu;return null!==t&&void 0!==t&&(!0===t.unstable_strictMode&&(n=!0),void 0!==t.identifierPrefix&&(r=t.identifierPrefix),void 0!==t.onRecoverableError&&(o=t.onRecoverableError)),t=zu(e,1,!1,null,0,n,0,r,o),e[go]=t.current,Gr(8===e.nodeType?e.parentNode:e),new $u(t)},t.findDOMNode=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternals;if(void 0===t){if("function"===typeof e.render)throw Error(i(188));throw e=Object.keys(e).join(","),Error(i(268,e))}return e=null===(e=He(t))?null:e.stateNode},t.flushSync=function(e){return du(e)},t.hydrate=function(e,t,n){if(!Xu(t))throw Error(i(200));return ec(null,e,t,!0,n)},t.hydrateRoot=function(e,t,n){if(!Qu(e))throw Error(i(405));var r=null!=n&&n.hydratedSources||null,o=!1,a="",s=qu;if(null!==n&&void 0!==n&&(!0===n.unstable_strictMode&&(o=!0),void 0!==n.identifierPrefix&&(a=n.identifierPrefix),void 0!==n.onRecoverableError&&(s=n.onRecoverableError)),t=Zu(t,null,e,1,null!=n?n:null,o,0,a,s),e[go]=t.current,Gr(e),r)for(e=0;e<r.length;e++)o=(o=(n=r[e])._getVersion)(n._source),null==t.mutableSourceEagerHydrationData?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new Yu(t)},t.render=function(e,t,n){if(!Xu(t))throw Error(i(200));return ec(null,e,t,!1,n)},t.unmountComponentAtNode=function(e){if(!Xu(e))throw Error(i(40));return!!e._reactRootContainer&&(du((function(){ec(null,null,e,!1,(function(){e._reactRootContainer=null,e[go]=null}))})),!0)},t.unstable_batchedUpdates=cu,t.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Xu(n))throw Error(i(200));if(null==e||void 0===e._reactInternals)throw Error(i(38));return ec(e,t,n,!1,r)},t.version="18.2.0-next-9e3b772b8-20220608"},7282:function(e,t,n){"use strict";var r=n(6214);t.s=r.createRoot,r.hydrateRoot},6214:function(e,t,n){"use strict";!function e(){if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),e.exports=n(2663)},4740:function(e,t){"use strict";var n="function"===typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,i=n?Symbol.for("react.fragment"):60107,a=n?Symbol.for("react.strict_mode"):60108,s=n?Symbol.for("react.profiler"):60114,l=n?Symbol.for("react.provider"):60109,u=n?Symbol.for("react.context"):60110,c=n?Symbol.for("react.async_mode"):60111,d=n?Symbol.for("react.concurrent_mode"):60111,f=n?Symbol.for("react.forward_ref"):60112,h=n?Symbol.for("react.suspense"):60113,p=n?Symbol.for("react.suspense_list"):60120,g=n?Symbol.for("react.memo"):60115,m=n?Symbol.for("react.lazy"):60116,y=n?Symbol.for("react.block"):60121,v=n?Symbol.for("react.fundamental"):60117,x=n?Symbol.for("react.responder"):60118,b=n?Symbol.for("react.scope"):60119;function w(e){if("object"===typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case c:case d:case i:case s:case a:case h:return e;default:switch(e=e&&e.$$typeof){case u:case f:case m:case g:case l:return e;default:return t}}case o:return t}}}function S(e){return w(e)===d}t.AsyncMode=c,t.ConcurrentMode=d,t.ContextConsumer=u,t.ContextProvider=l,t.Element=r,t.ForwardRef=f,t.Fragment=i,t.Lazy=m,t.Memo=g,t.Portal=o,t.Profiler=s,t.StrictMode=a,t.Suspense=h,t.isAsyncMode=function(e){return S(e)||w(e)===c},t.isConcurrentMode=S,t.isContextConsumer=function(e){return w(e)===u},t.isContextProvider=function(e){return w(e)===l},t.isElement=function(e){return"object"===typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return w(e)===f},t.isFragment=function(e){return w(e)===i},t.isLazy=function(e){return w(e)===m},t.isMemo=function(e){return w(e)===g},t.isPortal=function(e){return w(e)===o},t.isProfiler=function(e){return w(e)===s},t.isStrictMode=function(e){return w(e)===a},t.isSuspense=function(e){return w(e)===h},t.isValidElementType=function(e){return"string"===typeof e||"function"===typeof e||e===i||e===d||e===s||e===a||e===h||e===p||"object"===typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===g||e.$$typeof===l||e.$$typeof===u||e.$$typeof===f||e.$$typeof===v||e.$$typeof===x||e.$$typeof===b||e.$$typeof===y)},t.typeOf=w},5412:function(e,t,n){"use strict";e.exports=n(4740)},4370:function(e,t,n){"use strict";function r(){var e=this.constructor.getDerivedStateFromProps(this.props,this.state);null!==e&&void 0!==e&&this.setState(e)}function o(e){this.setState(function(t){var n=this.constructor.getDerivedStateFromProps(e,t);return null!==n&&void 0!==n?n:null}.bind(this))}function i(e,t){try{var n=this.props,r=this.state;this.props=e,this.state=t,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(n,r)}finally{this.props=n,this.state=r}}function a(e){var t=e.prototype;if(!t||!t.isReactComponent)throw new Error("Can only polyfill class components");if("function"!==typeof e.getDerivedStateFromProps&&"function"!==typeof t.getSnapshotBeforeUpdate)return e;var n=null,a=null,s=null;if("function"===typeof t.componentWillMount?n="componentWillMount":"function"===typeof t.UNSAFE_componentWillMount&&(n="UNSAFE_componentWillMount"),"function"===typeof t.componentWillReceiveProps?a="componentWillReceiveProps":"function"===typeof t.UNSAFE_componentWillReceiveProps&&(a="UNSAFE_componentWillReceiveProps"),"function"===typeof t.componentWillUpdate?s="componentWillUpdate":"function"===typeof t.UNSAFE_componentWillUpdate&&(s="UNSAFE_componentWillUpdate"),null!==n||null!==a||null!==s){var l=e.displayName||e.name,u="function"===typeof e.getDerivedStateFromProps?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error("Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n"+l+" uses "+u+" but also contains the following legacy lifecycles:"+(null!==n?"\n "+n:"")+(null!==a?"\n "+a:"")+(null!==s?"\n "+s:"")+"\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://fb.me/react-async-component-lifecycle-hooks")}if("function"===typeof e.getDerivedStateFromProps&&(t.componentWillMount=r,t.componentWillReceiveProps=o),"function"===typeof t.getSnapshotBeforeUpdate){if("function"!==typeof t.componentDidUpdate)throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");t.componentWillUpdate=i;var c=t.componentDidUpdate;t.componentDidUpdate=function(e,t,n){var r=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:n;c.call(this,e,t,r)}}return e}n.r(t),n.d(t,{polyfill:function(){return a}}),r.__suppressDeprecationWarning=!0,o.__suppressDeprecationWarning=!0,i.__suppressDeprecationWarning=!0},5818:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bodyOpenClassName=t.portalClassName=void 0;var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(3017),a=p(i),s=p(n(6214)),l=p(n(7633)),u=p(n(8108)),c=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(631)),d=n(7328),f=p(d),h=n(4370);function p(e){return e&&e.__esModule?e:{default:e}}function g(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}var m=t.portalClassName="ReactModalPortal",y=t.bodyOpenClassName="ReactModal__Body--open",v=d.canUseDOM&&void 0!==s.default.createPortal,x=function(e){return document.createElement(e)},b=function(){return v?s.default.createPortal:s.default.unstable_renderSubtreeIntoContainer};function w(e){return e()}var S=function(e){function t(){var e,n,o;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var i=arguments.length,l=Array(i),c=0;c<i;c++)l[c]=arguments[c];return n=o=g(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(l))),o.removePortal=function(){!v&&s.default.unmountComponentAtNode(o.node);var e=w(o.props.parentSelector);e&&e.contains(o.node)?e.removeChild(o.node):console.warn('React-Modal: "parentSelector" prop did not returned any DOM element. Make sure that the parent element is unmounted to avoid any memory leaks.')},o.portalRef=function(e){o.portal=e},o.renderPortal=function(e){var n=b()(o,a.default.createElement(u.default,r({defaultStyles:t.defaultStyles},e)),o.node);o.portalRef(n)},g(o,n)}return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"componentDidMount",value:function(){d.canUseDOM&&(v||(this.node=x("div")),this.node.className=this.props.portalClassName,w(this.props.parentSelector).appendChild(this.node),!v&&this.renderPortal(this.props))}},{key:"getSnapshotBeforeUpdate",value:function(e){return{prevParent:w(e.parentSelector),nextParent:w(this.props.parentSelector)}}},{key:"componentDidUpdate",value:function(e,t,n){if(d.canUseDOM){var r=this.props,o=r.isOpen,i=r.portalClassName;e.portalClassName!==i&&(this.node.className=i);var a=n.prevParent,s=n.nextParent;s!==a&&(a.removeChild(this.node),s.appendChild(this.node)),(e.isOpen||o)&&!v&&this.renderPortal(this.props)}}},{key:"componentWillUnmount",value:function(){if(d.canUseDOM&&this.node&&this.portal){var e=this.portal.state,t=Date.now(),n=e.isOpen&&this.props.closeTimeoutMS&&(e.closesAt||t+this.props.closeTimeoutMS);n?(e.beforeClose||this.portal.closeWithTimeout(),setTimeout(this.removePortal,n-t)):this.removePortal()}}},{key:"render",value:function(){return d.canUseDOM&&v?(!this.node&&v&&(this.node=x("div")),b()(a.default.createElement(u.default,r({ref:this.portalRef,defaultStyles:t.defaultStyles},this.props)),this.node)):null}}],[{key:"setAppElement",value:function(e){c.setElement(e)}}]),t}(i.Component);S.propTypes={isOpen:l.default.bool.isRequired,style:l.default.shape({content:l.default.object,overlay:l.default.object}),portalClassName:l.default.string,bodyOpenClassName:l.default.string,htmlOpenClassName:l.default.string,className:l.default.oneOfType([l.default.string,l.default.shape({base:l.default.string.isRequired,afterOpen:l.default.string.isRequired,beforeClose:l.default.string.isRequired})]),overlayClassName:l.default.oneOfType([l.default.string,l.default.shape({base:l.default.string.isRequired,afterOpen:l.default.string.isRequired,beforeClose:l.default.string.isRequired})]),appElement:l.default.oneOfType([l.default.instanceOf(f.default),l.default.instanceOf(d.SafeHTMLCollection),l.default.instanceOf(d.SafeNodeList),l.default.arrayOf(l.default.instanceOf(f.default))]),onAfterOpen:l.default.func,onRequestClose:l.default.func,closeTimeoutMS:l.default.number,ariaHideApp:l.default.bool,shouldFocusAfterRender:l.default.bool,shouldCloseOnOverlayClick:l.default.bool,shouldReturnFocusAfterClose:l.default.bool,preventScroll:l.default.bool,parentSelector:l.default.func,aria:l.default.object,data:l.default.object,role:l.default.string,contentLabel:l.default.string,shouldCloseOnEsc:l.default.bool,overlayRef:l.default.func,contentRef:l.default.func,id:l.default.string,overlayElement:l.default.func,contentElement:l.default.func},S.defaultProps={isOpen:!1,portalClassName:m,bodyOpenClassName:y,role:"dialog",ariaHideApp:!0,closeTimeoutMS:0,shouldFocusAfterRender:!0,shouldCloseOnEsc:!0,shouldCloseOnOverlayClick:!0,shouldReturnFocusAfterClose:!0,preventScroll:!1,parentSelector:function(){return document.body},overlayElement:function(e,t){return a.default.createElement("div",e,t)},contentElement:function(e,t){return a.default.createElement("div",e,t)}},S.defaultStyles={overlay:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(255, 255, 255, 0.75)"},content:{position:"absolute",top:"40px",left:"40px",right:"40px",bottom:"40px",border:"1px solid #ccc",background:"#fff",overflow:"auto",WebkitOverflowScrolling:"touch",borderRadius:"4px",outline:"none",padding:"20px"}},(0,h.polyfill)(S),t.default=S},8108:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(3017),s=m(n(7633)),l=g(n(6276)),u=m(n(576)),c=g(n(631)),d=g(n(8066)),f=n(7328),h=m(f),p=m(n(7127));function g(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function m(e){return e&&e.__esModule?e:{default:e}}n(2201);var y={overlay:"ReactModal__Overlay",content:"ReactModal__Content"},v=0,x=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.setOverlayRef=function(e){n.overlay=e,n.props.overlayRef&&n.props.overlayRef(e)},n.setContentRef=function(e){n.content=e,n.props.contentRef&&n.props.contentRef(e)},n.afterClose=function(){var e=n.props,t=e.appElement,r=e.ariaHideApp,o=e.htmlOpenClassName,i=e.bodyOpenClassName,a=e.parentSelector,s=a&&a().ownerDocument||document;i&&d.remove(s.body,i),o&&d.remove(s.getElementsByTagName("html")[0],o),r&&v>0&&0===(v-=1)&&c.show(t),n.props.shouldFocusAfterRender&&(n.props.shouldReturnFocusAfterClose?(l.returnFocus(n.props.preventScroll),l.teardownScopedFocus()):l.popWithoutFocus()),n.props.onAfterClose&&n.props.onAfterClose(),p.default.deregister(n)},n.open=function(){n.beforeOpen(),n.state.afterOpen&&n.state.beforeClose?(clearTimeout(n.closeTimer),n.setState({beforeClose:!1})):(n.props.shouldFocusAfterRender&&(l.setupScopedFocus(n.node),l.markForFocusLater()),n.setState({isOpen:!0},(function(){n.openAnimationFrame=requestAnimationFrame((function(){n.setState({afterOpen:!0}),n.props.isOpen&&n.props.onAfterOpen&&n.props.onAfterOpen({overlayEl:n.overlay,contentEl:n.content})}))})))},n.close=function(){n.props.closeTimeoutMS>0?n.closeWithTimeout():n.closeWithoutTimeout()},n.focusContent=function(){return n.content&&!n.contentHasFocus()&&n.content.focus({preventScroll:!0})},n.closeWithTimeout=function(){var e=Date.now()+n.props.closeTimeoutMS;n.setState({beforeClose:!0,closesAt:e},(function(){n.closeTimer=setTimeout(n.closeWithoutTimeout,n.state.closesAt-Date.now())}))},n.closeWithoutTimeout=function(){n.setState({beforeClose:!1,isOpen:!1,afterOpen:!1,closesAt:null},n.afterClose)},n.handleKeyDown=function(e){(function(e){return"Tab"===e.code||9===e.keyCode})(e)&&(0,u.default)(n.content,e),n.props.shouldCloseOnEsc&&function(e){return"Escape"===e.code||27===e.keyCode}(e)&&(e.stopPropagation(),n.requestClose(e))},n.handleOverlayOnClick=function(e){null===n.shouldClose&&(n.shouldClose=!0),n.shouldClose&&n.props.shouldCloseOnOverlayClick&&(n.ownerHandlesClose()?n.requestClose(e):n.focusContent()),n.shouldClose=null},n.handleContentOnMouseUp=function(){n.shouldClose=!1},n.handleOverlayOnMouseDown=function(e){n.props.shouldCloseOnOverlayClick||e.target!=n.overlay||e.preventDefault()},n.handleContentOnClick=function(){n.shouldClose=!1},n.handleContentOnMouseDown=function(){n.shouldClose=!1},n.requestClose=function(e){return n.ownerHandlesClose()&&n.props.onRequestClose(e)},n.ownerHandlesClose=function(){return n.props.onRequestClose},n.shouldBeClosed=function(){return!n.state.isOpen&&!n.state.beforeClose},n.contentHasFocus=function(){return document.activeElement===n.content||n.content.contains(document.activeElement)},n.buildClassName=function(e,t){var r="object"===("undefined"===typeof t?"undefined":o(t))?t:{base:y[e],afterOpen:y[e]+"--after-open",beforeClose:y[e]+"--before-close"},i=r.base;return n.state.afterOpen&&(i=i+" "+r.afterOpen),n.state.beforeClose&&(i=i+" "+r.beforeClose),"string"===typeof t&&t?i+" "+t:i},n.attributesFromObject=function(e,t){return Object.keys(t).reduce((function(n,r){return n[e+"-"+r]=t[r],n}),{})},n.state={afterOpen:!1,beforeClose:!1},n.shouldClose=null,n.moveFromContentToOverlay=null,n}return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"componentDidMount",value:function(){this.props.isOpen&&this.open()}},{key:"componentDidUpdate",value:function(e,t){this.props.isOpen&&!e.isOpen?this.open():!this.props.isOpen&&e.isOpen&&this.close(),this.props.shouldFocusAfterRender&&this.state.isOpen&&!t.isOpen&&this.focusContent()}},{key:"componentWillUnmount",value:function(){this.state.isOpen&&this.afterClose(),clearTimeout(this.closeTimer),cancelAnimationFrame(this.openAnimationFrame)}},{key:"beforeOpen",value:function(){var e=this.props,t=e.appElement,n=e.ariaHideApp,r=e.htmlOpenClassName,o=e.bodyOpenClassName,i=e.parentSelector,a=i&&i().ownerDocument||document;o&&d.add(a.body,o),r&&d.add(a.getElementsByTagName("html")[0],r),n&&(v+=1,c.hide(t)),p.default.register(this)}},{key:"render",value:function(){var e=this.props,t=e.id,n=e.className,o=e.overlayClassName,i=e.defaultStyles,a=e.children,s=n?{}:i.content,l=o?{}:i.overlay;if(this.shouldBeClosed())return null;var u={ref:this.setOverlayRef,className:this.buildClassName("overlay",o),style:r({},l,this.props.style.overlay),onClick:this.handleOverlayOnClick,onMouseDown:this.handleOverlayOnMouseDown},c=r({id:t,ref:this.setContentRef,style:r({},s,this.props.style.content),className:this.buildClassName("content",n),tabIndex:"-1",onKeyDown:this.handleKeyDown,onMouseDown:this.handleContentOnMouseDown,onMouseUp:this.handleContentOnMouseUp,onClick:this.handleContentOnClick,role:this.props.role,"aria-label":this.props.contentLabel},this.attributesFromObject("aria",r({modal:!0},this.props.aria)),this.attributesFromObject("data",this.props.data||{}),{"data-testid":this.props.testId}),d=this.props.contentElement(c,a);return this.props.overlayElement(u,d)}}]),t}(a.Component);x.defaultProps={style:{overlay:{},content:{}},defaultStyles:{}},x.propTypes={isOpen:s.default.bool.isRequired,defaultStyles:s.default.shape({content:s.default.object,overlay:s.default.object}),style:s.default.shape({content:s.default.object,overlay:s.default.object}),className:s.default.oneOfType([s.default.string,s.default.object]),overlayClassName:s.default.oneOfType([s.default.string,s.default.object]),parentSelector:s.default.func,bodyOpenClassName:s.default.string,htmlOpenClassName:s.default.string,ariaHideApp:s.default.bool,appElement:s.default.oneOfType([s.default.instanceOf(h.default),s.default.instanceOf(f.SafeHTMLCollection),s.default.instanceOf(f.SafeNodeList),s.default.arrayOf(s.default.instanceOf(h.default))]),onAfterOpen:s.default.func,onAfterClose:s.default.func,onRequestClose:s.default.func,closeTimeoutMS:s.default.number,shouldFocusAfterRender:s.default.bool,shouldCloseOnOverlayClick:s.default.bool,shouldReturnFocusAfterClose:s.default.bool,preventScroll:s.default.bool,role:s.default.string,contentLabel:s.default.string,aria:s.default.object,data:s.default.object,children:s.default.node,shouldCloseOnEsc:s.default.bool,overlayRef:s.default.func,contentRef:s.default.func,id:s.default.string,overlayElement:s.default.func,contentElement:s.default.func,testId:s.default.string},t.default=x,e.exports=t.default},631:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resetState=function(){s&&(s.removeAttribute?s.removeAttribute("aria-hidden"):null!=s.length?s.forEach((function(e){return e.removeAttribute("aria-hidden")})):document.querySelectorAll(s).forEach((function(e){return e.removeAttribute("aria-hidden")})));s=null},t.log=function(){0},t.assertNodeList=l,t.setElement=function(e){var t=e;if("string"===typeof t&&a.canUseDOM){var n=document.querySelectorAll(t);l(n,t),t=n}return s=t||s},t.validateElement=u,t.hide=function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=u(e)[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){o.value.setAttribute("aria-hidden","true")}}catch(a){n=!0,r=a}finally{try{!t&&i.return&&i.return()}finally{if(n)throw r}}},t.show=function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=u(e)[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){o.value.removeAttribute("aria-hidden")}}catch(a){n=!0,r=a}finally{try{!t&&i.return&&i.return()}finally{if(n)throw r}}},t.documentNotReadyOrSSRTesting=function(){s=null};var r,o=n(8136),i=(r=o)&&r.__esModule?r:{default:r},a=n(7328);var s=null;function l(e,t){if(!e||!e.length)throw new Error("react-modal: No elements were found for selector "+t+".")}function u(e){var t=e||s;return t?Array.isArray(t)||t instanceof HTMLCollection||t instanceof NodeList?t:[t]:((0,i.default)(!1,["react-modal: App element is not defined.","Please use `Modal.setAppElement(el)` or set `appElement={el}`.","This is needed so screen readers don't see main content","when modal is opened. It is not recommended, but you can opt-out","by setting `ariaHideApp={false}`."].join(" ")),[])}},2201:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resetState=function(){for(var e=[a,s],t=0;t<e.length;t++){var n=e[t];n&&(n.parentNode&&n.parentNode.removeChild(n))}a=s=null,l=[]},t.log=function(){console.log("bodyTrap ----------"),console.log(l.length);for(var e=[a,s],t=0;t<e.length;t++){var n=e[t]||{};console.log(n.nodeName,n.className,n.id)}console.log("edn bodyTrap ----------")};var r,o=n(7127),i=(r=o)&&r.__esModule?r:{default:r};var a=void 0,s=void 0,l=[];function u(){0!==l.length&&l[l.length-1].focusContent()}i.default.subscribe((function(e,t){a||s||((a=document.createElement("div")).setAttribute("data-react-modal-body-trap",""),a.style.position="absolute",a.style.opacity="0",a.setAttribute("tabindex","0"),a.addEventListener("focus",u),(s=a.cloneNode()).addEventListener("focus",u)),(l=t).length>0?(document.body.firstChild!==a&&document.body.insertBefore(a,document.body.firstChild),document.body.lastChild!==s&&document.body.appendChild(s)):(a.parentElement&&a.parentElement.removeChild(a),s.parentElement&&s.parentElement.removeChild(s))}))},8066:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resetState=function(){var e=document.getElementsByTagName("html")[0];for(var t in n)o(e,n[t]);var i=document.body;for(var a in r)o(i,r[a]);n={},r={}},t.log=function(){0};var n={},r={};function o(e,t){e.classList.remove(t)}t.add=function(e,t){return o=e.classList,i="html"==e.nodeName.toLowerCase()?n:r,void t.split(" ").forEach((function(e){!function(e,t){e[t]||(e[t]=0),e[t]+=1}(i,e),o.add(e)}));var o,i},t.remove=function(e,t){return o=e.classList,i="html"==e.nodeName.toLowerCase()?n:r,void t.split(" ").forEach((function(e){!function(e,t){e[t]&&(e[t]-=1)}(i,e),0===i[e]&&o.remove(e)}));var o,i}},6276:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resetState=function(){a=[]},t.log=function(){0},t.handleBlur=u,t.handleFocus=c,t.markForFocusLater=function(){a.push(document.activeElement)},t.returnFocus=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=null;try{return void(0!==a.length&&(t=a.pop()).focus({preventScroll:e}))}catch(n){console.warn(["You tried to return focus to",t,"but it is not in the DOM anymore"].join(" "))}},t.popWithoutFocus=function(){a.length>0&&a.pop()},t.setupScopedFocus=function(e){s=e,window.addEventListener?(window.addEventListener("blur",u,!1),document.addEventListener("focus",c,!0)):(window.attachEvent("onBlur",u),document.attachEvent("onFocus",c))},t.teardownScopedFocus=function(){s=null,window.addEventListener?(window.removeEventListener("blur",u),document.removeEventListener("focus",c)):(window.detachEvent("onBlur",u),document.detachEvent("onFocus",c))};var r,o=n(4926),i=(r=o)&&r.__esModule?r:{default:r};var a=[],s=null,l=!1;function u(){l=!0}function c(){if(l){if(l=!1,!s)return;setTimeout((function(){s.contains(document.activeElement)||((0,i.default)(s)[0]||s).focus()}),0)}}},7127:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.log=function(){console.log("portalOpenInstances ----------"),console.log(r.openInstances.length),r.openInstances.forEach((function(e){return console.log(e)})),console.log("end portalOpenInstances ----------")},t.resetState=function(){r=new n};var n=function e(){var t=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.register=function(e){-1===t.openInstances.indexOf(e)&&(t.openInstances.push(e),t.emit("register"))},this.deregister=function(e){var n=t.openInstances.indexOf(e);-1!==n&&(t.openInstances.splice(n,1),t.emit("deregister"))},this.subscribe=function(e){t.subscribers.push(e)},this.emit=function(e){t.subscribers.forEach((function(n){return n(e,t.openInstances.slice())}))},this.openInstances=[],this.subscribers=[]},r=new n;t.default=r},7328:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.canUseDOM=t.SafeNodeList=t.SafeHTMLCollection=void 0;var r,o=n(7276);var i=((r=o)&&r.__esModule?r:{default:r}).default,a=i.canUseDOM?window.HTMLElement:{};t.SafeHTMLCollection=i.canUseDOM?window.HTMLCollection:{},t.SafeNodeList=i.canUseDOM?window.NodeList:{},t.canUseDOM=i.canUseDOM;t.default=a},576:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=(0,i.default)(e);if(!n.length)return void t.preventDefault();var r=void 0,o=t.shiftKey,s=n[0],l=n[n.length-1],u=a();if(e===u){if(!o)return;r=l}l!==u||o||(r=s);s===u&&o&&(r=l);if(r)return t.preventDefault(),void r.focus();var c=/(\bChrome\b|\bSafari\b)\//.exec(navigator.userAgent);if(null==c||"Chrome"==c[1]||null!=/\biPod\b|\biPad\b/g.exec(navigator.userAgent))return;var d=n.indexOf(u);d>-1&&(d+=o?-1:1);if("undefined"===typeof(r=n[d]))return t.preventDefault(),void(r=o?l:s).focus();t.preventDefault(),r.focus()};var r,o=n(4926),i=(r=o)&&r.__esModule?r:{default:r};function a(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document;return e.activeElement.shadowRoot?a(e.activeElement.shadowRoot):e.activeElement}e.exports=t.default},4926:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t){var n=[].slice.call(t.querySelectorAll("*"),0).reduce((function(t,n){return t.concat(n.shadowRoot?e(n.shadowRoot):[n])}),[]);return n.filter(s)};var n="none",r="contents",o=/input|select|textarea|button|object|iframe/;function i(e){var t=e.offsetWidth<=0&&e.offsetHeight<=0;if(t&&!e.innerHTML)return!0;try{var o=window.getComputedStyle(e),i=o.getPropertyValue("display");return t?i!==r&&function(e,t){return"visible"!==t.getPropertyValue("overflow")||e.scrollWidth<=0&&e.scrollHeight<=0}(e,o):i===n}catch(a){return console.warn("Failed to inspect element style"),!1}}function a(e,t){var n=e.nodeName.toLowerCase();return(o.test(n)&&!e.disabled||"a"===n&&e.href||t)&&function(e){for(var t=e,n=e.getRootNode&&e.getRootNode();t&&t!==document.body;){if(n&&t===n&&(t=n.host.parentNode),i(t))return!1;t=t.parentNode}return!0}(e)}function s(e){var t=e.getAttribute("tabindex");null===t&&(t=void 0);var n=isNaN(t);return(n||t>=0)&&a(e,!n)}e.exports=t.default},2942:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(5818),i=(r=o)&&r.__esModule?r:{default:r};t.default=i.default,e.exports=t.default},8989:function(e,t,n){"use strict";n.d(t,{zt:function(){return u},$j:function(){return B},I0:function(){return H},v9:function(){return $},oR:function(){return Z}});var r=n(3017),o=r.createContext(null);var i=function(e){e()},a=function(){return i},s={notify:function(){}};var l=function(){function e(e,t){this.store=e,this.parentSub=t,this.unsubscribe=null,this.listeners=s,this.handleChangeWrapper=this.handleChangeWrapper.bind(this)}var t=e.prototype;return t.addNestedSub=function(e){return this.trySubscribe(),this.listeners.subscribe(e)},t.notifyNestedSubs=function(){this.listeners.notify()},t.handleChangeWrapper=function(){this.onStateChange&&this.onStateChange()},t.isSubscribed=function(){return Boolean(this.unsubscribe)},t.trySubscribe=function(){this.unsubscribe||(this.unsubscribe=this.parentSub?this.parentSub.addNestedSub(this.handleChangeWrapper):this.store.subscribe(this.handleChangeWrapper),this.listeners=function(){var e=a(),t=null,n=null;return{clear:function(){t=null,n=null},notify:function(){e((function(){for(var e=t;e;)e.callback(),e=e.next}))},get:function(){for(var e=[],n=t;n;)e.push(n),n=n.next;return e},subscribe:function(e){var r=!0,o=n={callback:e,next:null,prev:n};return o.prev?o.prev.next=o:t=o,function(){r&&null!==t&&(r=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}())},t.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null,this.listeners.clear(),this.listeners=s)},e}();var u=function(e){var t=e.store,n=e.context,i=e.children,a=(0,r.useMemo)((function(){var e=new l(t);return e.onStateChange=e.notifyNestedSubs,{store:t,subscription:e}}),[t]),s=(0,r.useMemo)((function(){return t.getState()}),[t]);(0,r.useEffect)((function(){var e=a.subscription;return e.trySubscribe(),s!==t.getState()&&e.notifyNestedSubs(),function(){e.tryUnsubscribe(),e.onStateChange=null}}),[a,s]);var u=n||o;return r.createElement(u.Provider,{value:a},i)},c=n(7896),d=n(1461),f=n(7204),h=n.n(f),p=n(5412),g="undefined"!==typeof window&&"undefined"!==typeof window.document&&"undefined"!==typeof window.document.createElement?r.useLayoutEffect:r.useEffect,m=[],y=[null,null];function v(e,t){var n=e[1];return[t.payload,n+1]}function x(e,t,n){g((function(){return e.apply(void 0,t)}),n)}function b(e,t,n,r,o,i,a){e.current=r,t.current=o,n.current=!1,i.current&&(i.current=null,a())}function w(e,t,n,r,o,i,a,s,l,u){if(e){var c=!1,d=null,f=function(){if(!c){var e,n,f=t.getState();try{e=r(f,o.current)}catch(h){n=h,d=h}n||(d=null),e===i.current?a.current||l():(i.current=e,s.current=e,a.current=!0,u({type:"STORE_UPDATED",payload:{error:n}}))}};n.onStateChange=f,n.trySubscribe(),f();return function(){if(c=!0,n.tryUnsubscribe(),n.onStateChange=null,d)throw d}}}var S=function(){return[null,0]};function C(e,t){void 0===t&&(t={});var n=t,i=n.getDisplayName,a=void 0===i?function(e){return"ConnectAdvanced("+e+")"}:i,s=n.methodName,u=void 0===s?"connectAdvanced":s,f=n.renderCountProp,g=void 0===f?void 0:f,C=n.shouldHandleStateChanges,j=void 0===C||C,k=n.storeKey,E=void 0===k?"store":k,T=(n.withRef,n.forwardRef),O=void 0!==T&&T,I=n.context,D=void 0===I?o:I,A=(0,d.Z)(n,["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"]),_=D;return function(t){var n=t.displayName||t.name||"Component",o=a(n),i=(0,c.Z)({},A,{getDisplayName:a,methodName:u,renderCountProp:g,shouldHandleStateChanges:j,storeKey:E,displayName:o,wrappedComponentName:n,WrappedComponent:t}),s=A.pure;var f=s?r.useMemo:function(e){return e()};function C(n){var o=(0,r.useMemo)((function(){var e=n.reactReduxForwardedRef,t=(0,d.Z)(n,["reactReduxForwardedRef"]);return[n.context,e,t]}),[n]),a=o[0],s=o[1],u=o[2],h=(0,r.useMemo)((function(){return a&&a.Consumer&&(0,p.isContextConsumer)(r.createElement(a.Consumer,null))?a:_}),[a,_]),g=(0,r.useContext)(h),C=Boolean(n.store)&&Boolean(n.store.getState)&&Boolean(n.store.dispatch);Boolean(g)&&Boolean(g.store);var k=C?n.store:g.store,E=(0,r.useMemo)((function(){return function(t){return e(t.dispatch,i)}(k)}),[k]),T=(0,r.useMemo)((function(){if(!j)return y;var e=new l(k,C?null:g.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]}),[k,C,g]),O=T[0],I=T[1],D=(0,r.useMemo)((function(){return C?g:(0,c.Z)({},g,{subscription:O})}),[C,g,O]),A=(0,r.useReducer)(v,m,S),P=A[0][0],M=A[1];if(P&&P.error)throw P.error;var R=(0,r.useRef)(),N=(0,r.useRef)(u),L=(0,r.useRef)(),F=(0,r.useRef)(!1),W=f((function(){return L.current&&u===N.current?L.current:E(k.getState(),u)}),[k,P,u]);x(b,[N,R,F,u,W,L,I]),x(w,[j,k,O,E,N,R,F,L,I,M],[k,O,E]);var B=(0,r.useMemo)((function(){return r.createElement(t,(0,c.Z)({},W,{ref:s}))}),[s,t,W]);return(0,r.useMemo)((function(){return j?r.createElement(h.Provider,{value:D},B):B}),[h,B,D])}var k=s?r.memo(C):C;if(k.WrappedComponent=t,k.displayName=o,O){var T=r.forwardRef((function(e,t){return r.createElement(k,(0,c.Z)({},e,{reactReduxForwardedRef:t}))}));return T.displayName=o,T.WrappedComponent=t,h()(T,t)}return h()(k,t)}}function j(e,t){return e===t?0!==e||0!==t||1/e===1/t:e!==e&&t!==t}function k(e,t){if(j(e,t))return!0;if("object"!==typeof e||null===e||"object"!==typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var o=0;o<n.length;o++)if(!Object.prototype.hasOwnProperty.call(t,n[o])||!j(e[n[o]],t[n[o]]))return!1;return!0}var E=n(8753);function T(e){return function(t,n){var r=e(t,n);function o(){return r}return o.dependsOnOwnProps=!1,o}}function O(e){return null!==e.dependsOnOwnProps&&void 0!==e.dependsOnOwnProps?Boolean(e.dependsOnOwnProps):1!==e.length}function I(e,t){return function(t,n){n.displayName;var r=function(e,t){return r.dependsOnOwnProps?r.mapToProps(e,t):r.mapToProps(e)};return r.dependsOnOwnProps=!0,r.mapToProps=function(t,n){r.mapToProps=e,r.dependsOnOwnProps=O(e);var o=r(t,n);return"function"===typeof o&&(r.mapToProps=o,r.dependsOnOwnProps=O(o),o=r(t,n)),o},r}}var D=[function(e){return"function"===typeof e?I(e):void 0},function(e){return e?void 0:T((function(e){return{dispatch:e}}))},function(e){return e&&"object"===typeof e?T((function(t){return(0,E.DE)(e,t)})):void 0}];var A=[function(e){return"function"===typeof e?I(e):void 0},function(e){return e?void 0:T((function(){return{}}))}];function _(e,t,n){return(0,c.Z)({},n,{},e,{},t)}var P=[function(e){return"function"===typeof e?function(e){return function(t,n){n.displayName;var r,o=n.pure,i=n.areMergedPropsEqual,a=!1;return function(t,n,s){var l=e(t,n,s);return a?o&&i(l,r)||(r=l):(a=!0,r=l),r}}}(e):void 0},function(e){return e?void 0:function(){return _}}];function M(e,t,n,r){return function(o,i){return n(e(o,i),t(r,i),i)}}function R(e,t,n,r,o){var i,a,s,l,u,c=o.areStatesEqual,d=o.areOwnPropsEqual,f=o.areStatePropsEqual,h=!1;function p(o,h){var p=!d(h,a),g=!c(o,i);return i=o,a=h,p&&g?(s=e(i,a),t.dependsOnOwnProps&&(l=t(r,a)),u=n(s,l,a)):p?(e.dependsOnOwnProps&&(s=e(i,a)),t.dependsOnOwnProps&&(l=t(r,a)),u=n(s,l,a)):g?function(){var t=e(i,a),r=!f(t,s);return s=t,r&&(u=n(s,l,a)),u}():u}return function(o,c){return h?p(o,c):(s=e(i=o,a=c),l=t(r,a),u=n(s,l,a),h=!0,u)}}function N(e,t){var n=t.initMapStateToProps,r=t.initMapDispatchToProps,o=t.initMergeProps,i=(0,d.Z)(t,["initMapStateToProps","initMapDispatchToProps","initMergeProps"]),a=n(e,i),s=r(e,i),l=o(e,i);return(i.pure?R:M)(a,s,l,e,i)}function L(e,t,n){for(var r=t.length-1;r>=0;r--){var o=t[r](e);if(o)return o}return function(t,r){throw new Error("Invalid value of type "+typeof e+" for "+n+" argument when connecting component "+r.wrappedComponentName+".")}}function F(e,t){return e===t}function W(e){var t=void 0===e?{}:e,n=t.connectHOC,r=void 0===n?C:n,o=t.mapStateToPropsFactories,i=void 0===o?A:o,a=t.mapDispatchToPropsFactories,s=void 0===a?D:a,l=t.mergePropsFactories,u=void 0===l?P:l,f=t.selectorFactory,h=void 0===f?N:f;return function(e,t,n,o){void 0===o&&(o={});var a=o,l=a.pure,f=void 0===l||l,p=a.areStatesEqual,g=void 0===p?F:p,m=a.areOwnPropsEqual,y=void 0===m?k:m,v=a.areStatePropsEqual,x=void 0===v?k:v,b=a.areMergedPropsEqual,w=void 0===b?k:b,S=(0,d.Z)(a,["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"]),C=L(e,i,"mapStateToProps"),j=L(t,s,"mapDispatchToProps"),E=L(n,u,"mergeProps");return r(h,(0,c.Z)({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:C,initMapDispatchToProps:j,initMergeProps:E,pure:f,areStatesEqual:g,areOwnPropsEqual:y,areStatePropsEqual:x,areMergedPropsEqual:w},S))}}var B=W();function z(){return(0,r.useContext)(o)}function G(e){void 0===e&&(e=o);var t=e===o?z:function(){return(0,r.useContext)(e)};return function(){return t().store}}var Z=G();function U(e){void 0===e&&(e=o);var t=e===o?Z:G(e);return function(){return t().dispatch}}var H=U(),K=function(e,t){return e===t};function V(e){void 0===e&&(e=o);var t=e===o?z:function(){return(0,r.useContext)(e)};return function(e,n){void 0===n&&(n=K);var o=t(),i=function(e,t,n,o){var i,a=(0,r.useReducer)((function(e){return e+1}),0)[1],s=(0,r.useMemo)((function(){return new l(n,o)}),[n,o]),u=(0,r.useRef)(),c=(0,r.useRef)(),d=(0,r.useRef)(),f=(0,r.useRef)(),h=n.getState();try{i=e!==c.current||h!==d.current||u.current?e(h):f.current}catch(p){throw u.current&&(p.message+="\nThe error may be correlated with this previous error:\n"+u.current.stack+"\n\n"),p}return g((function(){c.current=e,d.current=h,f.current=i,u.current=void 0})),g((function(){function e(){try{var e=c.current(n.getState());if(t(e,f.current))return;f.current=e}catch(p){u.current=p}a()}return s.onStateChange=e,s.trySubscribe(),e(),function(){return s.tryUnsubscribe()}}),[n,s]),i}(e,n,o.store,o.subscription);return(0,r.useDebugValue)(i),i}}var q,$=V(),Y=n(6214);q=Y.unstable_batchedUpdates,i=q},7745:function(e,t,n){"use strict";n.d(t,{OL:function(){return p},VK:function(){return c},rU:function(){return h}});var r=n(3017),o=n(9274),i=n(6166);function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a.apply(this,arguments)}function s(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}const l=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset"],u=["aria-current","caseSensitive","className","end","style","to","children"];function c(e){let{basename:t,children:n,window:a}=e,s=r.useRef();null==s.current&&(s.current=(0,i.lX)({window:a,v5Compat:!0}));let l=s.current,[u,c]=r.useState({action:l.action,location:l.location});return r.useLayoutEffect((()=>l.listen(c)),[l]),r.createElement(o.F0,{basename:t,children:n,location:u.location,navigationType:u.action,navigator:l})}const d="undefined"!==typeof window&&"undefined"!==typeof window.document&&"undefined"!==typeof window.document.createElement,f=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,h=r.forwardRef((function(e,t){let n,{onClick:u,relative:c,reloadDocument:h,replace:p,state:g,target:m,to:y,preventScrollReset:v}=e,x=s(e,l),{basename:b}=r.useContext(o.Us),w=!1;if("string"===typeof y&&f.test(y)&&(n=y,d))try{let e=new URL(window.location.href),t=y.startsWith("//")?new URL(e.protocol+y):new URL(y),n=(0,i.Zn)(t.pathname,b);t.origin===e.origin&&null!=n?y=n+t.search+t.hash:w=!0}catch(j){}let S=(0,o.oQ)(y,{relative:c}),C=function(e,t){let{target:n,replace:a,state:s,preventScrollReset:l,relative:u}=void 0===t?{}:t,c=(0,o.s0)(),d=(0,o.TH)(),f=(0,o.WU)(e,{relative:u});return r.useCallback((t=>{if(function(e,t){return 0===e.button&&(!t||"_self"===t)&&!function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)}(t,n)){t.preventDefault();let n=void 0!==a?a:(0,i.Ep)(d)===(0,i.Ep)(f);c(e,{replace:n,state:s,preventScrollReset:l,relative:u})}}),[d,c,f,a,s,n,e,l,u])}(y,{replace:p,state:g,target:m,preventScrollReset:v,relative:c});return r.createElement("a",a({},x,{href:n||S,onClick:w||h?u:function(e){u&&u(e),e.defaultPrevented||C(e)},ref:t,target:m}))}));const p=r.forwardRef((function(e,t){let{"aria-current":n="page",caseSensitive:i=!1,className:l="",end:c=!1,style:d,to:f,children:p}=e,g=s(e,u),m=(0,o.WU)(f,{relative:g.relative}),y=(0,o.TH)(),v=r.useContext(o.FR),{navigator:x}=r.useContext(o.Us),b=x.encodeLocation?x.encodeLocation(m).pathname:m.pathname,w=y.pathname,S=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;i||(w=w.toLowerCase(),S=S?S.toLowerCase():null,b=b.toLowerCase());let C,j=w===b||!c&&w.startsWith(b)&&"/"===w.charAt(b.length),k=null!=S&&(S===b||!c&&S.startsWith(b)&&"/"===S.charAt(b.length)),E=j?n:void 0;C="function"===typeof l?l({isActive:j,isPending:k}):[l,j?"active":null,k?"pending":null].filter(Boolean).join(" ");let T="function"===typeof d?d({isActive:j,isPending:k}):d;return r.createElement(h,a({},g,{"aria-current":E,className:C,ref:t,style:T,to:f}),"function"===typeof p?p({isActive:j,isPending:k}):p)}));var g,m;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmitImpl="useSubmitImpl",e.UseFetcher="useFetcher"})(g||(g={})),function(e){e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(m||(m={}))},9274:function(e,t,n){"use strict";n.d(t,{AW:function(){return _},F0:function(){return P},FR:function(){return s},Fg:function(){return A},TH:function(){return p},UO:function(){return v},Us:function(){return l},WU:function(){return x},Z5:function(){return M},bS:function(){return g},oQ:function(){return f},s0:function(){return y}});var r=n(3017),o=n(6166);function i(){return i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i.apply(this,arguments)}const a=r.createContext(null);const s=r.createContext(null);const l=r.createContext(null);const u=r.createContext(null);const c=r.createContext({outlet:null,matches:[],isDataRoute:!1});const d=r.createContext(null);function f(e,t){let{relative:n}=void 0===t?{}:t;h()||(0,o.J0)(!1);let{basename:i,navigator:a}=r.useContext(l),{hash:s,pathname:u,search:c}=x(e,{relative:n}),d=u;return"/"!==i&&(d="/"===u?i:(0,o.RQ)([i,u])),a.createHref({pathname:d,search:c,hash:s})}function h(){return null!=r.useContext(u)}function p(){return h()||(0,o.J0)(!1),r.useContext(u).location}function g(e){h()||(0,o.J0)(!1);let{pathname:t}=p();return r.useMemo((()=>(0,o.LX)(e,t)),[t,e])}function m(e){r.useContext(l).static||r.useLayoutEffect(e)}function y(){let{isDataRoute:e}=r.useContext(c);return e?function(){let{router:e}=O(E.UseNavigateStable),t=D(T.UseNavigateStable),n=r.useRef(!1);return m((()=>{n.current=!0})),r.useCallback((function(r,o){void 0===o&&(o={}),n.current&&("number"===typeof r?e.navigate(r):e.navigate(r,i({fromRouteId:t},o)))}),[e,t])}():function(){h()||(0,o.J0)(!1);let e=r.useContext(a),{basename:t,navigator:n}=r.useContext(l),{matches:i}=r.useContext(c),{pathname:s}=p(),u=JSON.stringify((0,o.Zq)(i).map((e=>e.pathnameBase))),d=r.useRef(!1);return m((()=>{d.current=!0})),r.useCallback((function(r,i){if(void 0===i&&(i={}),!d.current)return;if("number"===typeof r)return void n.go(r);let a=(0,o.pC)(r,JSON.parse(u),s,"path"===i.relative);null==e&&"/"!==t&&(a.pathname="/"===a.pathname?t:(0,o.RQ)([t,a.pathname])),(i.replace?n.replace:n.push)(a,i.state,i)}),[t,n,u,s,e])}()}function v(){let{matches:e}=r.useContext(c),t=e[e.length-1];return t?t.params:{}}function x(e,t){let{relative:n}=void 0===t?{}:t,{matches:i}=r.useContext(c),{pathname:a}=p(),s=JSON.stringify((0,o.Zq)(i).map((e=>e.pathnameBase)));return r.useMemo((()=>(0,o.pC)(e,JSON.parse(s),a,"path"===n)),[e,s,a,n])}function b(e,t,n){h()||(0,o.J0)(!1);let{navigator:a}=r.useContext(l),{matches:s}=r.useContext(c),d=s[s.length-1],f=d?d.params:{},g=(d&&d.pathname,d?d.pathnameBase:"/");d&&d.route;let m,y=p();if(t){var v;let e="string"===typeof t?(0,o.cP)(t):t;"/"===g||(null==(v=e.pathname)?void 0:v.startsWith(g))||(0,o.J0)(!1),m=e}else m=y;let x=m.pathname||"/",b="/"===g?x:x.slice(g.length)||"/",w=(0,o.fp)(e,{pathname:b});let S=k(w&&w.map((e=>Object.assign({},e,{params:Object.assign({},f,e.params),pathname:(0,o.RQ)([g,a.encodeLocation?a.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?g:(0,o.RQ)([g,a.encodeLocation?a.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),s,n);return t&&S?r.createElement(u.Provider,{value:{location:i({pathname:"/",search:"",hash:"",state:null,key:"default"},m),navigationType:o.aU.Pop}},S):S}function w(){let e=function(){var e;let t=r.useContext(d),n=I(T.UseRouteError),o=D(T.UseRouteError);if(t)return t;return null==(e=n.errors)?void 0:e[o]}(),t=(0,o.WK)(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:i};return r.createElement(r.Fragment,null,r.createElement("h2",null,"Unexpected Application Error!"),r.createElement("h3",{style:{fontStyle:"italic"}},t),n?r.createElement("pre",{style:a},n):null,null)}const S=r.createElement(w,null);class C extends r.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error||t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error?r.createElement(c.Provider,{value:this.props.routeContext},r.createElement(d.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function j(e){let{routeContext:t,match:n,children:o}=e,i=r.useContext(a);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),r.createElement(c.Provider,{value:t},o)}function k(e,t,n){var i;if(void 0===t&&(t=[]),void 0===n&&(n=null),null==e){var a;if(null==(a=n)||!a.errors)return null;e=n.matches}let s=e,l=null==(i=n)?void 0:i.errors;if(null!=l){let e=s.findIndex((e=>e.route.id&&(null==l?void 0:l[e.route.id])));e>=0||(0,o.J0)(!1),s=s.slice(0,Math.min(s.length,e+1))}return s.reduceRight(((e,o,i)=>{let a=o.route.id?null==l?void 0:l[o.route.id]:null,u=null;n&&(u=o.route.errorElement||S);let c=t.concat(s.slice(0,i+1)),d=()=>{let t;return t=a?u:o.route.Component?r.createElement(o.route.Component,null):o.route.element?o.route.element:e,r.createElement(j,{match:o,routeContext:{outlet:e,matches:c,isDataRoute:null!=n},children:t})};return n&&(o.route.ErrorBoundary||o.route.errorElement||0===i)?r.createElement(C,{location:n.location,revalidation:n.revalidation,component:u,error:a,children:d(),routeContext:{outlet:null,matches:c,isDataRoute:!0}}):d()}),null)}var E,T;function O(e){let t=r.useContext(a);return t||(0,o.J0)(!1),t}function I(e){let t=r.useContext(s);return t||(0,o.J0)(!1),t}function D(e){let t=function(e){let t=r.useContext(c);return t||(0,o.J0)(!1),t}(),n=t.matches[t.matches.length-1];return n.route.id||(0,o.J0)(!1),n.route.id}!function(e){e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate"}(E||(E={})),function(e){e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId"}(T||(T={}));function A(e){let{to:t,replace:n,state:i,relative:a}=e;h()||(0,o.J0)(!1);let{matches:s}=r.useContext(c),{pathname:l}=p(),u=y(),d=(0,o.pC)(t,(0,o.Zq)(s).map((e=>e.pathnameBase)),l,"path"===a),f=JSON.stringify(d);return r.useEffect((()=>u(JSON.parse(f),{replace:n,state:i,relative:a})),[u,f,a,n,i]),null}function _(e){(0,o.J0)(!1)}function P(e){let{basename:t="/",children:n=null,location:i,navigationType:a=o.aU.Pop,navigator:s,static:c=!1}=e;h()&&(0,o.J0)(!1);let d=t.replace(/^\/*/,"/"),f=r.useMemo((()=>({basename:d,navigator:s,static:c})),[d,s,c]);"string"===typeof i&&(i=(0,o.cP)(i));let{pathname:p="/",search:g="",hash:m="",state:y=null,key:v="default"}=i,x=r.useMemo((()=>{let e=(0,o.Zn)(p,d);return null==e?null:{location:{pathname:e,search:g,hash:m,state:y,key:v},navigationType:a}}),[d,p,g,m,y,v,a]);return null==x?null:r.createElement(l.Provider,{value:f},r.createElement(u.Provider,{children:n,value:x}))}function M(e){let{children:t,location:n}=e;return b(L(t),n)}var R;!function(e){e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error"}(R||(R={}));new Promise((()=>{}));class N extends r.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error("<Await> caught the following error during render",e,t)}render(){let{children:e,errorElement:t,resolve:n}=this.props,r=null,o=R.pending;if(n instanceof Promise)if(this.state.error){R.error;let e=this.state.error;Promise.reject().catch((()=>{})),Object.defineProperty(r,"_tracked",{get:()=>!0}),Object.defineProperty(r,"_error",{get:()=>e})}else n._tracked?(n,void 0!==r._error?R.error:void 0!==r._data?R.success:R.pending):(R.pending,Object.defineProperty(n,"_tracked",{get:()=>!0}),n.then((e=>Object.defineProperty(n,"_data",{get:()=>e})),(e=>Object.defineProperty(n,"_error",{get:()=>e}))));else R.success,Promise.resolve(),Object.defineProperty(r,"_tracked",{get:()=>!0}),Object.defineProperty(r,"_data",{get:()=>n});if(o===R.error&&r._error instanceof AbortedDeferredError)throw neverSettledPromise;if(o===R.error&&!t)throw r._error;if(o===R.error)return React.createElement(AwaitContext.Provider,{value:r,children:t});if(o===R.success)return React.createElement(AwaitContext.Provider,{value:r,children:e});throw r}}function L(e,t){void 0===t&&(t=[]);let n=[];return r.Children.forEach(e,((e,i)=>{if(!r.isValidElement(e))return;let a=[...t,i];if(e.type===r.Fragment)return void n.push.apply(n,L(e.props.children,a));e.type!==_&&(0,o.J0)(!1),e.props.index&&e.props.children&&(0,o.J0)(!1);let s={id:e.props.id||a.join("-"),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:null!=e.props.ErrorBoundary||null!=e.props.errorElement,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(s.children=L(e.props.children,a)),n.push(s)})),n}},2644:function(e,t,n){"use strict";n.d(t,{Z:function(){return g}});var r,o=n(3017),i="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof self?self:"undefined"!==typeof window?window:"undefined"!==typeof n.g?n.g:{};let a;a="undefined"!==typeof window?window:"undefined"!==typeof self?self:i;let s=null,l=null;const u=a.clearTimeout,c=a.setTimeout,d=a.cancelAnimationFrame||a.mozCancelAnimationFrame||a.webkitCancelAnimationFrame,f=a.requestAnimationFrame||a.mozRequestAnimationFrame||a.webkitRequestAnimationFrame;function h(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}null==d||null==f?(s=u,l=function(e){return c(e,20)}):(s=function(e){let[t,n]=e;d(t),u(n)},l=function(e){const t=f((function(){u(n),e()})),n=c((function(){d(t),e()}),20);return[t,n]}),r={createDetectElementResize:function(e){let t,n,r,o,i,u,c;const d="undefined"!==typeof document&&document.attachEvent;if(!d){u=function(e){const t=e.__resizeTriggers__,n=t.firstElementChild,r=t.lastElementChild,o=n.firstElementChild;r.scrollLeft=r.scrollWidth,r.scrollTop=r.scrollHeight,o.style.width=n.offsetWidth+1+"px",o.style.height=n.offsetHeight+1+"px",n.scrollLeft=n.scrollWidth,n.scrollTop=n.scrollHeight},i=function(e){return e.offsetWidth!==e.__resizeLast__.width||e.offsetHeight!==e.__resizeLast__.height},c=function(e){if(e.target.className&&"function"===typeof e.target.className.indexOf&&e.target.className.indexOf("contract-trigger")<0&&e.target.className.indexOf("expand-trigger")<0)return;const t=this;u(this),this.__resizeRAF__&&s(this.__resizeRAF__),this.__resizeRAF__=l((function(){i(t)&&(t.__resizeLast__.width=t.offsetWidth,t.__resizeLast__.height=t.offsetHeight,t.__resizeListeners__.forEach((function(n){n.call(t,e)})))}))};let e=!1,a="";r="animationstart";const d="Webkit Moz O ms".split(" ");let f="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),h="";{const t=document.createElement("fakeelement");if(void 0!==t.style.animationName&&(e=!0),!1===e)for(let n=0;n<d.length;n++)if(void 0!==t.style[d[n]+"AnimationName"]){h=d[n],a="-"+h.toLowerCase()+"-",r=f[n],e=!0;break}}n="resizeanim",t="@"+a+"keyframes "+n+" { from { opacity: 0; } to { opacity: 0; } } ",o=a+"animation: 1ms "+n+"; "}return{addResizeListener:function(i,s){if(d)i.attachEvent("onresize",s);else{if(!i.__resizeTriggers__){const s=i.ownerDocument,l=a.getComputedStyle(i);l&&"static"===l.position&&(i.style.position="relative"),function(n){if(!n.getElementById("detectElementResize")){const r=(t||"")+".resize-triggers { "+(o||"")+'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',i=n.head||n.getElementsByTagName("head")[0],a=n.createElement("style");a.id="detectElementResize",a.type="text/css",null!=e&&a.setAttribute("nonce",e),a.styleSheet?a.styleSheet.cssText=r:a.appendChild(n.createTextNode(r)),i.appendChild(a)}}(s),i.__resizeLast__={},i.__resizeListeners__=[],(i.__resizeTriggers__=s.createElement("div")).className="resize-triggers";const d=s.createElement("div");d.className="expand-trigger",d.appendChild(s.createElement("div"));const f=s.createElement("div");f.className="contract-trigger",i.__resizeTriggers__.appendChild(d),i.__resizeTriggers__.appendChild(f),i.appendChild(i.__resizeTriggers__),u(i),i.addEventListener("scroll",c,!0),r&&(i.__resizeTriggers__.__animationListener__=function(e){e.animationName===n&&u(i)},i.__resizeTriggers__.addEventListener(r,i.__resizeTriggers__.__animationListener__))}i.__resizeListeners__.push(s)}},removeResizeListener:function(e,t){if(d)e.detachEvent("onresize",t);else if(e.__resizeListeners__.splice(e.__resizeListeners__.indexOf(t),1),!e.__resizeListeners__.length){e.removeEventListener("scroll",c,!0),e.__resizeTriggers__.__animationListener__&&(e.__resizeTriggers__.removeEventListener(r,e.__resizeTriggers__.__animationListener__),e.__resizeTriggers__.__animationListener__=null);try{e.__resizeTriggers__=!e.removeChild(e.__resizeTriggers__)}catch(n){}}}}}};class p extends o.Component{constructor(){super(...arguments),h(this,"state",{height:this.props.defaultHeight||0,scaledHeight:this.props.defaultHeight||0,scaledWidth:this.props.defaultWidth||0,width:this.props.defaultWidth||0}),h(this,"_autoSizer",null),h(this,"_detectElementResize",null),h(this,"_parentNode",null),h(this,"_resizeObserver",null),h(this,"_onResize",(()=>{const{disableHeight:e,disableWidth:t,onResize:n}=this.props;if(this._parentNode){var r,o,i,a;const s=window.getComputedStyle(this._parentNode)||{},l=parseInt(null!==(r=s.paddingLeft)&&void 0!==r?r:"0",10),u=parseInt(null!==(o=s.paddingRight)&&void 0!==o?o:"0",10),c=parseInt(null!==(i=s.paddingTop)&&void 0!==i?i:"0",10),d=parseInt(null!==(a=s.paddingBottom)&&void 0!==a?a:"0",10),f=this._parentNode.getBoundingClientRect(),h=f.height-c-d,p=f.width-l-u,g=this._parentNode.offsetHeight-c-d,m=this._parentNode.offsetWidth-l-u;(e||this.state.height===g&&this.state.scaledHeight===h)&&(t||this.state.width===m&&this.state.scaledWidth===p)||(this.setState({height:g,width:m,scaledHeight:h,scaledWidth:p}),"function"===typeof n&&n({height:g,scaledHeight:h,scaledWidth:p,width:m}))}})),h(this,"_setRef",(e=>{this._autoSizer=e}))}componentDidMount(){const{nonce:e}=this.props;this._autoSizer&&this._autoSizer.parentNode&&this._autoSizer.parentNode.ownerDocument&&this._autoSizer.parentNode.ownerDocument.defaultView&&this._autoSizer.parentNode instanceof this._autoSizer.parentNode.ownerDocument.defaultView.HTMLElement&&(this._parentNode=this._autoSizer.parentNode,null!=this._parentNode&&("undefined"!==typeof ResizeObserver?(this._resizeObserver=new ResizeObserver((()=>{setTimeout(this._onResize,0)})),this._resizeObserver.observe(this._parentNode)):(this._detectElementResize=(0,r.createDetectElementResize)(e),this._detectElementResize.addResizeListener(this._parentNode,this._onResize)),this._onResize()))}componentWillUnmount(){this._parentNode&&(this._detectElementResize&&this._detectElementResize.removeResizeListener(this._parentNode,this._onResize),this._resizeObserver&&(this._resizeObserver.observe(this._parentNode),this._resizeObserver.disconnect()))}render(){const{children:e,defaultHeight:t,defaultWidth:n,disableHeight:r,disableWidth:i,nonce:a,onResize:s,style:l,tagName:u="div",...c}=this.props,{height:d,scaledHeight:f,scaledWidth:h,width:p}=this.state,g={overflow:"visible"},m={};let y=!1;return r||(0===d&&(y=!0),g.height=0,m.height=d,m.scaledHeight=f),i||(0===p&&(y=!0),g.width=0,m.width=p,m.scaledWidth=h),(0,o.createElement)(u,{ref:this._setRef,style:{...g,...l},...c},!y&&e(m))}}h(p,"defaultProps",{onResize:()=>{},disableHeight:!1,disableWidth:!1,style:{}});var g=p},2786:function(e,t,n){"use strict";var r=n(3017),o=Symbol.for("react.element"),i=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,s=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function u(e,t,n){var r,i={},u=null,c=null;for(r in void 0!==n&&(u=""+n),void 0!==t.key&&(u=""+t.key),void 0!==t.ref&&(c=t.ref),t)a.call(t,r)&&!l.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===i[r]&&(i[r]=t[r]);return{$$typeof:o,type:e,key:u,ref:c,props:i,_owner:s.current}}t.Fragment=i,t.jsx=u,t.jsxs=u},6519:function(e,t){"use strict";var n=Symbol.for("react.element"),r=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),h=Symbol.iterator;var p={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,m={};function y(e,t,n){this.props=e,this.context=t,this.refs=m,this.updater=n||p}function v(){}function x(e,t,n){this.props=e,this.context=t,this.refs=m,this.updater=n||p}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if("object"!==typeof e&&"function"!==typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},v.prototype=y.prototype;var b=x.prototype=new v;b.constructor=x,g(b,y.prototype),b.isPureReactComponent=!0;var w=Array.isArray,S=Object.prototype.hasOwnProperty,C={current:null},j={key:!0,ref:!0,__self:!0,__source:!0};function k(e,t,r){var o,i={},a=null,s=null;if(null!=t)for(o in void 0!==t.ref&&(s=t.ref),void 0!==t.key&&(a=""+t.key),t)S.call(t,o)&&!j.hasOwnProperty(o)&&(i[o]=t[o]);var l=arguments.length-2;if(1===l)i.children=r;else if(1<l){for(var u=Array(l),c=0;c<l;c++)u[c]=arguments[c+2];i.children=u}if(e&&e.defaultProps)for(o in l=e.defaultProps)void 0===i[o]&&(i[o]=l[o]);return{$$typeof:n,type:e,key:a,ref:s,props:i,_owner:C.current}}function E(e){return"object"===typeof e&&null!==e&&e.$$typeof===n}var T=/\/+/g;function O(e,t){return"object"===typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,(function(e){return t[e]}))}(""+e.key):t.toString(36)}function I(e,t,o,i,a){var s=typeof e;"undefined"!==s&&"boolean"!==s||(e=null);var l=!1;if(null===e)l=!0;else switch(s){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case n:case r:l=!0}}if(l)return a=a(l=e),e=""===i?"."+O(l,0):i,w(a)?(o="",null!=e&&(o=e.replace(T,"$&/")+"/"),I(a,t,o,"",(function(e){return e}))):null!=a&&(E(a)&&(a=function(e,t){return{$$typeof:n,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(a,o+(!a.key||l&&l.key===a.key?"":(""+a.key).replace(T,"$&/")+"/")+e)),t.push(a)),1;if(l=0,i=""===i?".":i+":",w(e))for(var u=0;u<e.length;u++){var c=i+O(s=e[u],u);l+=I(s,t,o,c,a)}else if(c=function(e){return null===e||"object"!==typeof e?null:"function"===typeof(e=h&&e[h]||e["@@iterator"])?e:null}(e),"function"===typeof c)for(e=c.call(e),u=0;!(s=e.next()).done;)l+=I(s=s.value,t,o,c=i+O(s,u++),a);else if("object"===s)throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return l}function D(e,t,n){if(null==e)return e;var r=[],o=0;return I(e,r,"","",(function(e){return t.call(n,e,o++)})),r}function A(e){if(-1===e._status){var t=e._result;(t=t()).then((function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)}),(function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)})),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var _={current:null},P={transition:null},M={ReactCurrentDispatcher:_,ReactCurrentBatchConfig:P,ReactCurrentOwner:C};t.Children={map:D,forEach:function(e,t,n){D(e,(function(){t.apply(this,arguments)}),n)},count:function(e){var t=0;return D(e,(function(){t++})),t},toArray:function(e){return D(e,(function(e){return e}))||[]},only:function(e){if(!E(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},t.Component=y,t.Fragment=o,t.Profiler=a,t.PureComponent=x,t.StrictMode=i,t.Suspense=c,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=M,t.cloneElement=function(e,t,r){if(null===e||void 0===e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var o=g({},e.props),i=e.key,a=e.ref,s=e._owner;if(null!=t){if(void 0!==t.ref&&(a=t.ref,s=C.current),void 0!==t.key&&(i=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(u in t)S.call(t,u)&&!j.hasOwnProperty(u)&&(o[u]=void 0===t[u]&&void 0!==l?l[u]:t[u])}var u=arguments.length-2;if(1===u)o.children=r;else if(1<u){l=Array(u);for(var c=0;c<u;c++)l[c]=arguments[c+2];o.children=l}return{$$typeof:n,type:e.type,key:i,ref:a,props:o,_owner:s}},t.createContext=function(e){return(e={$$typeof:l,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:s,_context:e},e.Consumer=e},t.createElement=k,t.createFactory=function(e){var t=k.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:u,render:e}},t.isValidElement=E,t.lazy=function(e){return{$$typeof:f,_payload:{_status:-1,_result:e},_init:A}},t.memo=function(e,t){return{$$typeof:d,type:e,compare:void 0===t?null:t}},t.startTransition=function(e){var t=P.transition;P.transition={};try{e()}finally{P.transition=t}},t.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},t.useCallback=function(e,t){return _.current.useCallback(e,t)},t.useContext=function(e){return _.current.useContext(e)},t.useDebugValue=function(){},t.useDeferredValue=function(e){return _.current.useDeferredValue(e)},t.useEffect=function(e,t){return _.current.useEffect(e,t)},t.useId=function(){return _.current.useId()},t.useImperativeHandle=function(e,t,n){return _.current.useImperativeHandle(e,t,n)},t.useInsertionEffect=function(e,t){return _.current.useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return _.current.useLayoutEffect(e,t)},t.useMemo=function(e,t){return _.current.useMemo(e,t)},t.useReducer=function(e,t,n){return _.current.useReducer(e,t,n)},t.useRef=function(e){return _.current.useRef(e)},t.useState=function(e){return _.current.useState(e)},t.useSyncExternalStore=function(e,t,n){return _.current.useSyncExternalStore(e,t,n)},t.useTransition=function(){return _.current.useTransition()},t.version="18.2.0"},3017:function(e,t,n){"use strict";e.exports=n(6519)},8993:function(e,t,n){"use strict";e.exports=n(2786)},8753:function(e,t,n){"use strict";n.d(t,{md:function(){return m},DE:function(){return p},UY:function(){return f},MT:function(){return d}});var r=n(6666);function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function a(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var s="function"===typeof Symbol&&Symbol.observable||"@@observable",l=function(){return Math.random().toString(36).substring(7).split("").join(".")},u={INIT:"@@redux/INIT"+l(),REPLACE:"@@redux/REPLACE"+l(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+l()}};function c(e){if("object"!==typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function d(e,t,n){var r;if("function"===typeof t&&"function"===typeof n||"function"===typeof n&&"function"===typeof arguments[3])throw new Error(a(0));if("function"===typeof t&&"undefined"===typeof n&&(n=t,t=void 0),"undefined"!==typeof n){if("function"!==typeof n)throw new Error(a(1));return n(d)(e,t)}if("function"!==typeof e)throw new Error(a(2));var o=e,i=t,l=[],f=l,h=!1;function p(){f===l&&(f=l.slice())}function g(){if(h)throw new Error(a(3));return i}function m(e){if("function"!==typeof e)throw new Error(a(4));if(h)throw new Error(a(5));var t=!0;return p(),f.push(e),function(){if(t){if(h)throw new Error(a(6));t=!1,p();var n=f.indexOf(e);f.splice(n,1),l=null}}}function y(e){if(!c(e))throw new Error(a(7));if("undefined"===typeof e.type)throw new Error(a(8));if(h)throw new Error(a(9));try{h=!0,i=o(i,e)}finally{h=!1}for(var t=l=f,n=0;n<t.length;n++){(0,t[n])()}return e}return y({type:u.INIT}),(r={dispatch:y,subscribe:m,getState:g,replaceReducer:function(e){if("function"!==typeof e)throw new Error(a(10));o=e,y({type:u.REPLACE})}})[s]=function(){var e,t=m;return(e={subscribe:function(e){if("object"!==typeof e||null===e)throw new Error(a(11));function n(){e.next&&e.next(g())}return n(),{unsubscribe:t(n)}}})[s]=function(){return this},e},r}function f(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++){var o=t[r];0,"function"===typeof e[o]&&(n[o]=e[o])}var i,s=Object.keys(n);try{!function(e){Object.keys(e).forEach((function(t){var n=e[t];if("undefined"===typeof n(void 0,{type:u.INIT}))throw new Error(a(12));if("undefined"===typeof n(void 0,{type:u.PROBE_UNKNOWN_ACTION()}))throw new Error(a(13))}))}(n)}catch(l){i=l}return function(e,t){if(void 0===e&&(e={}),i)throw i;for(var r=!1,o={},l=0;l<s.length;l++){var u=s[l],c=n[u],d=e[u],f=c(d,t);if("undefined"===typeof f){t&&t.type;throw new Error(a(14))}o[u]=f,r=r||f!==d}return(r=r||s.length!==Object.keys(e).length)?o:e}}function h(e,t){return function(){return t(e.apply(this,arguments))}}function p(e,t){if("function"===typeof e)return h(e,t);if("object"!==typeof e||null===e)throw new Error(a(16));var n={};for(var r in e){var o=e[r];"function"===typeof o&&(n[r]=h(o,t))}return n}function g(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce((function(e,t){return function(){return e(t.apply(void 0,arguments))}}))}function m(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return function(){var n=e.apply(void 0,arguments),r=function(){throw new Error(a(15))},o={getState:n.getState,dispatch:function(){return r.apply(void 0,arguments)}},s=t.map((function(e){return e(o)}));return r=g.apply(void 0,s)(n.dispatch),i(i({},n),{},{dispatch:r})}}}},2383:function(e,t){"use strict";function n(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,o=e[r];if(!(0<i(o,t)))break e;e[r]=t,e[n]=o,n=r}}function r(e){return 0===e.length?null:e[0]}function o(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,o=e.length,a=o>>>1;r<a;){var s=2*(r+1)-1,l=e[s],u=s+1,c=e[u];if(0>i(l,n))u<o&&0>i(c,l)?(e[r]=c,e[u]=n,r=u):(e[r]=l,e[s]=n,r=s);else{if(!(u<o&&0>i(c,n)))break e;e[r]=c,e[u]=n,r=u}}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"===typeof performance&&"function"===typeof performance.now){var a=performance;t.unstable_now=function(){return a.now()}}else{var s=Date,l=s.now();t.unstable_now=function(){return s.now()-l}}var u=[],c=[],d=1,f=null,h=3,p=!1,g=!1,m=!1,y="function"===typeof setTimeout?setTimeout:null,v="function"===typeof clearTimeout?clearTimeout:null,x="undefined"!==typeof setImmediate?setImmediate:null;function b(e){for(var t=r(c);null!==t;){if(null===t.callback)o(c);else{if(!(t.startTime<=e))break;o(c),t.sortIndex=t.expirationTime,n(u,t)}t=r(c)}}function w(e){if(m=!1,b(e),!g)if(null!==r(u))g=!0,P(S);else{var t=r(c);null!==t&&M(w,t.startTime-e)}}function S(e,n){g=!1,m&&(m=!1,v(E),E=-1),p=!0;var i=h;try{for(b(n),f=r(u);null!==f&&(!(f.expirationTime>n)||e&&!I());){var a=f.callback;if("function"===typeof a){f.callback=null,h=f.priorityLevel;var s=a(f.expirationTime<=n);n=t.unstable_now(),"function"===typeof s?f.callback=s:f===r(u)&&o(u),b(n)}else o(u);f=r(u)}if(null!==f)var l=!0;else{var d=r(c);null!==d&&M(w,d.startTime-n),l=!1}return l}finally{f=null,h=i,p=!1}}"undefined"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var C,j=!1,k=null,E=-1,T=5,O=-1;function I(){return!(t.unstable_now()-O<T)}function D(){if(null!==k){var e=t.unstable_now();O=e;var n=!0;try{n=k(!0,e)}finally{n?C():(j=!1,k=null)}}else j=!1}if("function"===typeof x)C=function(){x(D)};else if("undefined"!==typeof MessageChannel){var A=new MessageChannel,_=A.port2;A.port1.onmessage=D,C=function(){_.postMessage(null)}}else C=function(){y(D,0)};function P(e){k=e,j||(j=!0,C())}function M(e,n){E=y((function(){e(t.unstable_now())}),n)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){g||p||(g=!0,P(S))},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<e?Math.floor(1e3/e):5},t.unstable_getCurrentPriorityLevel=function(){return h},t.unstable_getFirstCallbackNode=function(){return r(u)},t.unstable_next=function(e){switch(h){case 1:case 2:case 3:var t=3;break;default:t=h}var n=h;h=t;try{return e()}finally{h=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=h;h=e;try{return t()}finally{h=n}},t.unstable_scheduleCallback=function(e,o,i){var a=t.unstable_now();switch("object"===typeof i&&null!==i?i="number"===typeof(i=i.delay)&&0<i?a+i:a:i=a,e){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return e={id:d++,callback:o,priorityLevel:e,startTime:i,expirationTime:s=i+s,sortIndex:-1},i>a?(e.sortIndex=i,n(c,e),null===r(u)&&e===r(c)&&(m?(v(E),E=-1):m=!0,M(w,i-a))):(e.sortIndex=s,n(u,e),g||p||(g=!0,P(S))),e},t.unstable_shouldYield=I,t.unstable_wrapCallback=function(e){var t=h;return function(){var n=h;h=t;try{return e.apply(this,arguments)}finally{h=n}}}},4796:function(e,t,n){"use strict";e.exports=n(2383)},337:function(e){e.exports=function(e,t){var n,r,o,i,a=0;return function(){n=this,r=arguments;var e=new Date-a;return i||(e>=t?s():i=setTimeout(s,t-e)),o};function s(){i=0,a=+new Date,o=e.apply(n,r),n=null,r=null}}},5284:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r={randomUUID:"undefined"!==typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let o;const i=new Uint8Array(16);function a(){if(!o&&(o="undefined"!==typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!o))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return o(i)}const s=[];for(let c=0;c<256;++c)s.push((c+256).toString(16).slice(1));function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(s[e[t+0]]+s[e[t+1]]+s[e[t+2]]+s[e[t+3]]+"-"+s[e[t+4]]+s[e[t+5]]+"-"+s[e[t+6]]+s[e[t+7]]+"-"+s[e[t+8]]+s[e[t+9]]+"-"+s[e[t+10]]+s[e[t+11]]+s[e[t+12]]+s[e[t+13]]+s[e[t+14]]+s[e[t+15]]).toLowerCase()}var u=function(e,t,n){if(r.randomUUID&&!t&&!e)return r.randomUUID();const o=(e=e||{}).random||(e.rng||a)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=o[e];return t}return l(o)}},8136:function(e){"use strict";var t=function(){};e.exports=t},6104:function(e,t,n){"use strict";e.exports=n.p+"static/media/browser-server.14ed34b8682d7b10163f.js"},753:function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,{Z:function(){return r}})},6666:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(5850);function o(e,t,n){return(t=(0,r.Z)(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},7896:function(e,t,n){"use strict";function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},r.apply(this,arguments)}n.d(t,{Z:function(){return r}})},1461:function(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}n.d(t,{Z:function(){return r}})},8960:function(e,t,n){"use strict";function r(e,t){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},r(e,t)}n.d(t,{Z:function(){return r}})},5850:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(6522);function o(e){var t=function(e,t){if("object"!==(0,r.Z)(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!==(0,r.Z)(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===(0,r.Z)(t)?t:String(t)}},6522:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n.d(t,{Z:function(){return r}})},7876:function(e,t,n){"use strict";n.d(t,{Fx:function(){return T},MT:function(){return d},QL:function(){return C},ex:function(){return s}});var r=n(3830),o=n(3017),i=n(1591),a=n(7346);function s(e){if("virtual"===(0,a.Jz)()){let t=document.activeElement;(0,i.QB)((()=>{document.activeElement===t&&document.contains(e)&&(0,i.Ao)(e)}))}else(0,i.Ao)(e)}function l(e,t){return"#comment"!==e.nodeName&&function(e){if(!(e instanceof HTMLElement)&&!(e instanceof SVGElement))return!1;let{display:t,visibility:n}=e.style,r="none"!==t&&"hidden"!==n&&"collapse"!==n;if(r){const{getComputedStyle:t}=e.ownerDocument.defaultView;let{display:n,visibility:o}=t(e);r="none"!==n&&"hidden"!==o&&"collapse"!==o}return r}(e)&&function(e,t){return!e.hasAttribute("hidden")&&("DETAILS"!==e.nodeName||!t||"SUMMARY"===t.nodeName||e.hasAttribute("open"))}(e,t)&&(!e.parentElement||l(e.parentElement,e))}const u=o.createContext(null);let c=null;function d(e){let{children:t,contain:n,restoreFocus:r,autoFocus:a}=e,s=(0,o.useRef)(),l=(0,o.useRef)(),d=(0,o.useRef)([]),{parentNode:f}=(0,o.useContext)(u)||{},h=(0,o.useMemo)((()=>new k({scopeRef:d})),[d]);(0,i.bt)((()=>{let e=f||E.root;if(E.getTreeNode(e.scopeRef)&&c&&!b(c,e.scopeRef)){let t=E.getTreeNode(c);t&&(e=t)}e.addChild(h),E.addNode(h)}),[h,f]),(0,i.bt)((()=>{E.getTreeNode(d).contain=n}),[n]),(0,i.bt)((()=>{let e=s.current.nextSibling,t=[];for(;e&&e!==l.current;)t.push(e),e=e.nextSibling;d.current=t}),[t]),function(e,t,n){(0,i.bt)((()=>{if(t||n)return;let r=e.current,o=t=>{let n=t.target;v(n,e.current)?c=e:y(n)||(c=null)};return document.addEventListener("focusin",o,!1),r.forEach((e=>e.addEventListener("focusin",o,!1))),()=>{document.removeEventListener("focusin",o,!1),r.forEach((e=>e.removeEventListener("focusin",o,!1)))}}),[e,t,n])}(d,r,n),function(e,t){let n=(0,o.useRef)(),r=(0,o.useRef)(null);(0,i.bt)((()=>{let o=e.current;if(!t)return void(r.current&&(cancelAnimationFrame(r.current),r.current=null));let i=t=>{if("Tab"!==t.key||t.altKey||t.ctrlKey||t.metaKey||!m(e))return;let n=document.activeElement,r=e.current;if(!v(n,r))return;let o=C(g(r),{tabbable:!0},r);o.currentNode=n;let i=t.shiftKey?o.previousNode():o.nextNode();i||(o.currentNode=t.shiftKey?r[r.length-1].nextElementSibling:r[0].previousElementSibling,i=t.shiftKey?o.previousNode():o.nextNode()),t.preventDefault(),i&&w(i,!0)},a=t=>{c&&!b(c,e)||!v(t.target,e.current)?m(e)&&!x(t.target,e)?n.current?n.current.focus():c&&S(c.current):m(e)&&(n.current=t.target):(c=e,n.current=t.target)},s=t=>{r.current&&cancelAnimationFrame(r.current),r.current=requestAnimationFrame((()=>{m(e)&&!x(document.activeElement,e)&&(c=e,document.body.contains(t.target)?(n.current=t.target,n.current.focus()):c&&S(c.current))}))};return document.addEventListener("keydown",i,!1),document.addEventListener("focusin",a,!1),o.forEach((e=>e.addEventListener("focusin",a,!1))),o.forEach((e=>e.addEventListener("focusout",s,!1))),()=>{document.removeEventListener("keydown",i,!1),document.removeEventListener("focusin",a,!1),o.forEach((e=>e.removeEventListener("focusin",a,!1))),o.forEach((e=>e.removeEventListener("focusout",s,!1)))}}),[e,t]),(0,o.useEffect)((()=>()=>{r.current&&cancelAnimationFrame(r.current)}),[r])}(d,n),function(e,t,n){const r=(0,o.useRef)("undefined"!==typeof document?document.activeElement:null);(0,i.bt)((()=>{let r=e.current;if(!t||n)return;let o=()=>{c&&!b(c,e)||(c=e)};return document.addEventListener("focusin",o,!1),r.forEach((e=>e.addEventListener("focusin",o,!1))),()=>{document.removeEventListener("focusin",o,!1),r.forEach((e=>e.removeEventListener("focusin",o,!1)))}}),[e,n]),(0,i.bt)((()=>{if(!t)return;E.getTreeNode(e).nodeToRestore=r.current;let o=t=>{if("Tab"!==t.key||t.altKey||t.ctrlKey||t.metaKey)return;let n=document.activeElement;if(!v(n,e.current))return;let r=E.getTreeNode(e).nodeToRestore,o=C(document.body,{tabbable:!0});o.currentNode=n;let i=t.shiftKey?o.previousNode():o.nextNode();if(document.body.contains(r)&&r!==document.body||(r=null,E.getTreeNode(e).nodeToRestore=null),(!i||!v(i,e.current))&&r){o.currentNode=r;do{i=t.shiftKey?o.previousNode():o.nextNode()}while(v(i,e.current));t.preventDefault(),t.stopPropagation(),i?w(i,!0):y(r)?w(r,!0):n.blur()}};return n||document.addEventListener("keydown",o,!0),()=>{n||document.removeEventListener("keydown",o,!0);let r=E.getTreeNode(e).nodeToRestore;if(t&&r&&(v(document.activeElement,e.current)||document.activeElement===document.body&&function(e){let t=E.getTreeNode(c);for(;t&&t.scopeRef!==e;){if(t.nodeToRestore)return!1;t=t.parent}return(null===t||void 0===t?void 0:t.scopeRef)===e}(e))){let t=E.clone();requestAnimationFrame((()=>{if(document.activeElement===document.body){let n=t.getTreeNode(e);for(;n;){if(n.nodeToRestore&&document.body.contains(n.nodeToRestore))return void w(n.nodeToRestore);n=n.parent}for(n=t.getTreeNode(e);n;){if(n.scopeRef&&E.getTreeNode(n.scopeRef))return void S(n.scopeRef.current,!0);n=n.parent}}}))}}}),[e,t,n])}(d,r,n),function(e,t){const n=o.useRef(t);(0,o.useEffect)((()=>{n.current&&(c=e,v(document.activeElement,c.current)||S(e.current)),n.current=!1}),[e])}(d,a),(0,o.useEffect)((()=>{if(d){let e=document.activeElement,t=null;if(v(e,d.current)){for(let n of E.traverse())v(e,n.scopeRef.current)&&(t=n);t===E.getTreeNode(d)&&(c=t.scopeRef)}return()=>{let e=E.getTreeNode(d).parent.scopeRef;d!==c&&!b(d,c)||e&&!E.getTreeNode(e)||(c=e),E.removeTreeNode(d)}}}),[d]);let p=(0,o.useMemo)((()=>function(e){return{focusNext(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.current,{from:r,tabbable:o,wrap:i,accept:a}=t,s=r||document.activeElement,l=n[0].previousElementSibling,u=C(g(n),{tabbable:o,accept:a},n);u.currentNode=v(s,n)?s:l;let c=u.nextNode();return!c&&i&&(u.currentNode=l,c=u.nextNode()),c&&w(c,!0),c},focusPrevious(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.current,{from:r,tabbable:o,wrap:i,accept:a}=t,s=r||document.activeElement,l=n[n.length-1].nextElementSibling,u=C(g(n),{tabbable:o,accept:a},n);u.currentNode=v(s,n)?s:l;let c=u.previousNode();return!c&&i&&(u.currentNode=l,c=u.previousNode()),c&&w(c,!0),c},focusFirst(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.current,{tabbable:r,accept:o}=t,i=C(g(n),{tabbable:r,accept:o},n);i.currentNode=n[0].previousElementSibling;let a=i.nextNode();return a&&w(a,!0),a},focusLast(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.current,{tabbable:r,accept:o}=t,i=C(g(n),{tabbable:r,accept:o},n);i.currentNode=n[n.length-1].nextElementSibling;let a=i.previousNode();return a&&w(a,!0),a}}}(d)),[]),j=(0,o.useMemo)((()=>({focusManager:p,parentNode:h})),[h,p]);return o.createElement(u.Provider,{value:j},o.createElement("span",{"data-focus-scope-start":!0,hidden:!0,ref:s}),t,o.createElement("span",{"data-focus-scope-end":!0,hidden:!0,ref:l}))}const f=["input:not([disabled]):not([type=hidden])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[contenteditable]"],h=f.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])";f.push('[tabindex]:not([tabindex="-1"]):not([disabled])');const p=f.join(':not([hidden]):not([tabindex="-1"]),');function g(e){return e[0].parentElement}function m(e){let t=E.getTreeNode(c);for(;t&&t.scopeRef!==e;){if(t.contain)return!1;t=t.parent}return!0}function y(e){return x(e)}function v(e,t){return t.some((t=>t.contains(e)))}function x(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(e instanceof Element&&e.closest("[data-react-aria-top-layer]"))return!0;for(let{scopeRef:n}of E.traverse(E.getTreeNode(t)))if(v(e,n.current))return!0;return!1}function b(e,t){var n;let r=null===(n=E.getTreeNode(t))||void 0===n?void 0:n.parent;for(;r;){if(r.scopeRef===e)return!0;r=r.parent}return!1}function w(e){if(null==e||arguments.length>1&&void 0!==arguments[1]&&arguments[1]){if(null!=e)try{e.focus()}catch(t){}}else try{s(e)}catch(n){}}function S(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=e[0].previousElementSibling,r=C(g(e),{tabbable:t},e);r.currentNode=n;let o=r.nextNode();t&&!o&&(r=C(g(e),{tabbable:!1},e),r.currentNode=n,o=r.nextNode()),w(o)}function C(e,t,n){let r=(null===t||void 0===t?void 0:t.tabbable)?p:h,o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(e){var o;return(null===t||void 0===t||null===(o=t.from)||void 0===o?void 0:o.contains(e))?NodeFilter.FILTER_REJECT:!e.matches(r)||!l(e)||n&&!v(e,n)||(null===t||void 0===t?void 0:t.accept)&&!t.accept(e)?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT}});return(null===t||void 0===t?void 0:t.from)&&(o.currentNode=t.from),o}class j{get size(){return this.fastMap.size}getTreeNode(e){return this.fastMap.get(e)}addTreeNode(e,t,n){let r=this.fastMap.get(null!==t&&void 0!==t?t:null),o=new k({scopeRef:e});r.addChild(o),o.parent=r,this.fastMap.set(e,o),n&&(o.nodeToRestore=n)}addNode(e){this.fastMap.set(e.scopeRef,e)}removeTreeNode(e){if(null===e)return;let t=this.fastMap.get(e),n=t.parent;for(let o of this.traverse())o!==t&&t.nodeToRestore&&o.nodeToRestore&&t.scopeRef.current&&v(o.nodeToRestore,t.scopeRef.current)&&(o.nodeToRestore=t.nodeToRestore);let r=t.children;n.removeChild(t),r.size>0&&r.forEach((e=>n.addChild(e))),this.fastMap.delete(t.scopeRef)}traverse(){var e=this;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.root;return function*(){if(null!=t.scopeRef&&(yield t),t.children.size>0)for(let n of t.children)yield*e.traverse(n)}()}clone(){let e=new j;for(let t of this.traverse())e.addTreeNode(t.scopeRef,t.parent.scopeRef,t.nodeToRestore);return e}constructor(){(0,r.Z)(this,"fastMap",new Map),this.root=new k({scopeRef:null}),this.fastMap.set(null,this.root)}}class k{addChild(e){this.children.add(e),e.parent=this}removeChild(e){this.children.delete(e),e.parent=void 0}constructor(e){(0,r.Z)(this,"children",new Set),(0,r.Z)(this,"contain",!1),this.scopeRef=e.scopeRef}}let E=new j;function T(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{autoFocus:t=!1,isTextInput:n,within:r}=e,i=(0,o.useRef)({isFocused:!1,isFocusVisible:t||(0,a.E)()}),[s,l]=(0,o.useState)(!1),[u,c]=(0,o.useState)((()=>i.current.isFocused&&i.current.isFocusVisible)),d=(0,o.useCallback)((()=>c(i.current.isFocused&&i.current.isFocusVisible)),[]),f=(0,o.useCallback)((e=>{i.current.isFocused=e,l(e),d()}),[d]);(0,a.mG)((e=>{i.current.isFocusVisible=e,d()}),[],{isTextInput:n});let{focusProps:h}=(0,a.KK)({isDisabled:r,onFocusChange:f}),{focusWithinProps:p}=(0,a.L_)({isDisabled:!r,onFocusWithinChange:f});return{isFocused:s,isFocusVisible:i.current.isFocused&&u,focusProps:r?p:h}}},7346:function(e,t,n){"use strict";n.d(t,{E:function(){return L},Jz:function(){return F},KK:function(){return C},L_:function(){return B},TA:function(){return q},XI:function(){return K},mG:function(){return W},r7:function(){return d}});var r=n(1591),o=n(3017);let i="default",a="",s=new WeakMap;function l(e){(0,r.gn)()?("default"===i&&(a=document.documentElement.style.webkitUserSelect,document.documentElement.style.webkitUserSelect="none"),i="disabled"):(e instanceof HTMLElement||e instanceof SVGElement)&&(s.set(e,e.style.userSelect),e.style.userSelect="none")}function u(e){if((0,r.gn)()){if("disabled"!==i)return;i="restoring",setTimeout((()=>{(0,r.QB)((()=>{"restoring"===i&&("none"===document.documentElement.style.webkitUserSelect&&(document.documentElement.style.webkitUserSelect=a||""),a="",i="default")}))}),300)}else if((e instanceof HTMLElement||e instanceof SVGElement)&&e&&s.has(e)){let t=s.get(e);"none"===e.style.userSelect&&(e.style.userSelect=t),""===e.getAttribute("style")&&e.removeAttribute("style"),s.delete(e)}}const c=o.createContext(null);function d(e){let{onPress:t,onPressChange:n,onPressStart:i,onPressEnd:a,onPressUp:s,isDisabled:d,isPressed:x,preventFocusOnPress:b,shouldCancelOnPointerExit:w,allowTextSelectionOnPress:S,ref:C,...j}=function(e){let t=(0,o.useContext)(c);if(t){let{register:n,...o}=t;e=(0,r.dG)(o,e),n()}return(0,r.lE)(t,e.ref),e}(e),k=(0,o.useRef)(null);k.current={onPress:t,onPressChange:n,onPressStart:i,onPressEnd:a,onPressUp:s,isDisabled:d,shouldCancelOnPointerExit:w};let[E,T]=(0,o.useState)(!1),O=(0,o.useRef)({isPressed:!1,ignoreEmulatedMouseEvents:!1,ignoreClickAfterPress:!1,didFirePressStart:!1,activePointerId:null,target:null,isOverTarget:!1,pointerType:null}),{addGlobalListener:I,removeAllGlobalListeners:D}=(0,r.xi)(),A=(0,o.useMemo)((()=>{let e=O.current,t=(t,n)=>{let{onPressStart:r,onPressChange:o,isDisabled:i}=k.current;i||e.didFirePressStart||(r&&r({type:"pressstart",pointerType:n,target:t.currentTarget,shiftKey:t.shiftKey,metaKey:t.metaKey,ctrlKey:t.ctrlKey,altKey:t.altKey}),o&&o(!0),e.didFirePressStart=!0,T(!0))},n=function(t,n){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],{onPressEnd:o,onPressChange:i,onPress:a,isDisabled:s}=k.current;e.didFirePressStart&&(e.ignoreClickAfterPress=!0,e.didFirePressStart=!1,o&&o({type:"pressend",pointerType:n,target:t.currentTarget,shiftKey:t.shiftKey,metaKey:t.metaKey,ctrlKey:t.ctrlKey,altKey:t.altKey}),i&&i(!1),T(!1),a&&r&&!s&&a({type:"press",pointerType:n,target:t.currentTarget,shiftKey:t.shiftKey,metaKey:t.metaKey,ctrlKey:t.ctrlKey,altKey:t.altKey}))},o=(e,t)=>{let{onPressUp:n,isDisabled:r}=k.current;r||n&&n({type:"pressup",pointerType:t,target:e.currentTarget,shiftKey:e.shiftKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey})},i=t=>{e.isPressed&&(e.isOverTarget&&n(g(e.target,t),e.pointerType,!1),e.isPressed=!1,e.isOverTarget=!1,e.activePointerId=null,e.pointerType=null,D(),S||u(e.target))},a={onKeyDown(n){h(n.nativeEvent,n.currentTarget)&&n.currentTarget.contains(n.target)?(v(n.target,n.key)&&n.preventDefault(),n.stopPropagation(),e.isPressed||n.repeat||(e.target=n.currentTarget,e.isPressed=!0,t(n,"keyboard"),I(document,"keyup",s,!1))):"Enter"===n.key&&f(n.currentTarget)&&n.stopPropagation()},onKeyUp(t){h(t.nativeEvent,t.currentTarget)&&!t.repeat&&t.currentTarget.contains(t.target)&&o(g(e.target,t),"keyboard")},onClick(i){i&&!i.currentTarget.contains(i.target)||i&&0===i.button&&(i.stopPropagation(),d&&i.preventDefault(),e.ignoreClickAfterPress||e.ignoreEmulatedMouseEvents||"virtual"!==e.pointerType&&!(0,r.Zj)(i.nativeEvent)||(d||b||(0,r.Ao)(i.currentTarget),t(i,"virtual"),o(i,"virtual"),n(i,"virtual")),e.ignoreEmulatedMouseEvents=!1,e.ignoreClickAfterPress=!1)}},s=t=>{if(e.isPressed&&h(t,e.target)){v(t.target,t.key)&&t.preventDefault(),t.stopPropagation(),e.isPressed=!1;let r=t.target;n(g(e.target,t),"keyboard",e.target.contains(r)),D(),e.target instanceof HTMLElement&&e.target.contains(r)&&(f(e.target)||"link"===e.target.getAttribute("role"))&&e.target.click()}};if("undefined"!==typeof PointerEvent){a.onPointerDown=n=>{0===n.button&&n.currentTarget.contains(n.target)&&((0,r.cr)(n.nativeEvent)?e.pointerType="virtual":(y(n.currentTarget)&&n.preventDefault(),e.pointerType=n.pointerType,n.stopPropagation(),e.isPressed||(e.isPressed=!0,e.isOverTarget=!0,e.activePointerId=n.pointerId,e.target=n.currentTarget,d||b||(0,r.Ao)(n.currentTarget),S||l(e.target),t(n,e.pointerType),I(document,"pointermove",s,!1),I(document,"pointerup",c,!1),I(document,"pointercancel",f,!1))))},a.onMouseDown=e=>{e.currentTarget.contains(e.target)&&0===e.button&&(y(e.currentTarget)&&e.preventDefault(),e.stopPropagation())},a.onPointerUp=t=>{t.currentTarget.contains(t.target)&&"virtual"!==e.pointerType&&0===t.button&&m(t,t.currentTarget)&&o(t,e.pointerType||t.pointerType)};let s=r=>{r.pointerId===e.activePointerId&&(m(r,e.target)?e.isOverTarget||(e.isOverTarget=!0,t(g(e.target,r),e.pointerType)):e.isOverTarget&&(e.isOverTarget=!1,n(g(e.target,r),e.pointerType,!1),k.current.shouldCancelOnPointerExit&&i(r)))},c=t=>{t.pointerId===e.activePointerId&&e.isPressed&&0===t.button&&(m(t,e.target)?n(g(e.target,t),e.pointerType):e.isOverTarget&&n(g(e.target,t),e.pointerType,!1),e.isPressed=!1,e.isOverTarget=!1,e.activePointerId=null,e.pointerType=null,D(),S||u(e.target))},f=e=>{i(e)};a.onDragStart=e=>{e.currentTarget.contains(e.target)&&i(e)}}else{a.onMouseDown=n=>{0===n.button&&n.currentTarget.contains(n.target)&&(y(n.currentTarget)&&n.preventDefault(),n.stopPropagation(),e.ignoreEmulatedMouseEvents||(e.isPressed=!0,e.isOverTarget=!0,e.target=n.currentTarget,e.pointerType=(0,r.Zj)(n.nativeEvent)?"virtual":"mouse",d||b||(0,r.Ao)(n.currentTarget),t(n,e.pointerType),I(document,"mouseup",s,!1)))},a.onMouseEnter=n=>{n.currentTarget.contains(n.target)&&(n.stopPropagation(),e.isPressed&&!e.ignoreEmulatedMouseEvents&&(e.isOverTarget=!0,t(n,e.pointerType)))},a.onMouseLeave=t=>{t.currentTarget.contains(t.target)&&(t.stopPropagation(),e.isPressed&&!e.ignoreEmulatedMouseEvents&&(e.isOverTarget=!1,n(t,e.pointerType,!1),k.current.shouldCancelOnPointerExit&&i(t)))},a.onMouseUp=t=>{t.currentTarget.contains(t.target)&&(e.ignoreEmulatedMouseEvents||0!==t.button||o(t,e.pointerType))};let s=t=>{0===t.button&&(e.isPressed=!1,D(),e.ignoreEmulatedMouseEvents?e.ignoreEmulatedMouseEvents=!1:(m(t,e.target)?n(g(e.target,t),e.pointerType):e.isOverTarget&&n(g(e.target,t),e.pointerType,!1),e.isOverTarget=!1))};a.onTouchStart=n=>{if(!n.currentTarget.contains(n.target))return;n.stopPropagation();let o=function(e){const{targetTouches:t}=e;return t.length>0?t[0]:null}(n.nativeEvent);o&&(e.activePointerId=o.identifier,e.ignoreEmulatedMouseEvents=!0,e.isOverTarget=!0,e.isPressed=!0,e.target=n.currentTarget,e.pointerType="touch",d||b||(0,r.Ao)(n.currentTarget),S||l(e.target),t(n,e.pointerType),I(window,"scroll",c,!0))},a.onTouchMove=r=>{if(!r.currentTarget.contains(r.target))return;if(r.stopPropagation(),!e.isPressed)return;let o=p(r.nativeEvent,e.activePointerId);o&&m(o,r.currentTarget)?e.isOverTarget||(e.isOverTarget=!0,t(r,e.pointerType)):e.isOverTarget&&(e.isOverTarget=!1,n(r,e.pointerType,!1),k.current.shouldCancelOnPointerExit&&i(r))},a.onTouchEnd=t=>{if(!t.currentTarget.contains(t.target))return;if(t.stopPropagation(),!e.isPressed)return;let r=p(t.nativeEvent,e.activePointerId);r&&m(r,t.currentTarget)?(o(t,e.pointerType),n(t,e.pointerType)):e.isOverTarget&&n(t,e.pointerType,!1),e.isPressed=!1,e.activePointerId=null,e.isOverTarget=!1,e.ignoreEmulatedMouseEvents=!0,S||u(e.target),D()},a.onTouchCancel=t=>{t.currentTarget.contains(t.target)&&(t.stopPropagation(),e.isPressed&&i(t))};let c=t=>{e.isPressed&&t.target.contains(e.target)&&i({currentTarget:e.target,shiftKey:!1,ctrlKey:!1,metaKey:!1,altKey:!1})};a.onDragStart=e=>{e.currentTarget.contains(e.target)&&i(e)}}return a}),[I,d,b,D,S]);return(0,o.useEffect)((()=>()=>{S||u(O.current.target)}),[S]),{isPressed:x||E,pressProps:(0,r.dG)(j,A)}}function f(e){return"A"===e.tagName&&e.hasAttribute("href")}function h(e,t){const{key:n,code:r}=e,o=t,i=o.getAttribute("role");return("Enter"===n||" "===n||"Spacebar"===n||"Space"===r)&&!(o instanceof HTMLInputElement&&!b(o,n)||o instanceof HTMLTextAreaElement||o.isContentEditable)&&(!f(o)||"button"===i&&"Enter"!==n)&&!("link"===i&&"Enter"!==n)}function p(e,t){const n=e.changedTouches;for(let r=0;r<n.length;r++){const e=n[r];if(e.identifier===t)return e}return null}function g(e,t){return{currentTarget:e,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,altKey:t.altKey}}function m(e,t){let n=t.getBoundingClientRect(),r=function(e){let t=e.width/2||e.radiusX||0,n=e.height/2||e.radiusY||0;return{top:e.clientY-n,right:e.clientX+t,bottom:e.clientY+n,left:e.clientX-t}}(e);return i=r,!((o=n).left>i.right||i.left>o.right)&&!(o.top>i.bottom||i.top>o.bottom);var o,i}function y(e){return!(e instanceof HTMLElement)||!e.draggable}function v(e,t){return e instanceof HTMLInputElement?!b(e,t):!(e instanceof HTMLButtonElement)||"submit"!==e.type}c.displayName="PressResponderContext";const x=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function b(e,t){return"checkbox"===e.type||"radio"===e.type?" "===t:x.has(e.type)}class w{isDefaultPrevented(){return this.nativeEvent.defaultPrevented}preventDefault(){this.defaultPrevented=!0,this.nativeEvent.preventDefault()}stopPropagation(){this.nativeEvent.stopPropagation(),this.isPropagationStopped=()=>!0}isPropagationStopped(){return!1}persist(){}constructor(e,t){this.nativeEvent=t,this.target=t.target,this.currentTarget=t.currentTarget,this.relatedTarget=t.relatedTarget,this.bubbles=t.bubbles,this.cancelable=t.cancelable,this.defaultPrevented=t.defaultPrevented,this.eventPhase=t.eventPhase,this.isTrusted=t.isTrusted,this.timeStamp=t.timeStamp,this.type=e}}function S(e){let t=(0,o.useRef)({isFocused:!1,onBlur:e,observer:null});return t.current.onBlur=e,(0,r.bt)((()=>{const e=t.current;return()=>{e.observer&&(e.observer.disconnect(),e.observer=null)}}),[]),(0,o.useCallback)((e=>{if(e.target instanceof HTMLButtonElement||e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement||e.target instanceof HTMLSelectElement){t.current.isFocused=!0;let n=e.target,r=e=>{var r,o;t.current.isFocused=!1,n.disabled&&(null===(o=(r=t.current).onBlur)||void 0===o||o.call(r,new w("blur",e))),t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};n.addEventListener("focusout",r,{once:!0}),t.current.observer=new MutationObserver((()=>{t.current.isFocused&&n.disabled&&(t.current.observer.disconnect(),n.dispatchEvent(new FocusEvent("blur")),n.dispatchEvent(new FocusEvent("focusout",{bubbles:!0})))})),t.current.observer.observe(n,{attributes:!0,attributeFilter:["disabled"]})}}),[])}function C(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:i}=e;const a=(0,o.useCallback)((e=>{if(e.target===e.currentTarget)return r&&r(e),i&&i(!1),!0}),[r,i]),s=S(a),l=(0,o.useCallback)((e=>{e.target===e.currentTarget&&document.activeElement===e.target&&(n&&n(e),i&&i(!0),s(e))}),[i,n,s]);return{focusProps:{onFocus:!t&&(n||i||r)?l:void 0,onBlur:t||!r&&!i?void 0:a}}}let j=null,k=new Set,E=!1,T=!1,O=!1;const I={Tab:!0,Escape:!0};function D(e,t){for(let n of k)n(e,t)}function A(e){T=!0,function(e){return!(e.metaKey||!(0,r.V5)()&&e.altKey||e.ctrlKey||"Control"===e.key||"Shift"===e.key||"Meta"===e.key)}(e)&&(j="keyboard",D("keyboard",e))}function _(e){j="pointer","mousedown"!==e.type&&"pointerdown"!==e.type||(T=!0,D("pointer",e))}function P(e){(0,r.Zj)(e)&&(T=!0,j="virtual")}function M(e){e.target!==window&&e.target!==document&&(T||O||(j="virtual",D("virtual",e)),T=!1,O=!1)}function R(){T=!1,O=!0}function N(){if("undefined"===typeof window||E)return;let e=HTMLElement.prototype.focus;HTMLElement.prototype.focus=function(){T=!0,e.apply(this,arguments)},document.addEventListener("keydown",A,!0),document.addEventListener("keyup",A,!0),document.addEventListener("click",P,!0),window.addEventListener("focus",M,!0),window.addEventListener("blur",R,!1),"undefined"!==typeof PointerEvent?(document.addEventListener("pointerdown",_,!0),document.addEventListener("pointermove",_,!0),document.addEventListener("pointerup",_,!0)):(document.addEventListener("mousedown",_,!0),document.addEventListener("mousemove",_,!0),document.addEventListener("mouseup",_,!0)),E=!0}function L(){return"pointer"!==j}function F(){return j}function W(e,t,n){N(),(0,o.useEffect)((()=>{let t=(t,r)=>{(function(e,t,n){return!(e&&"keyboard"===t&&n instanceof KeyboardEvent&&!I[n.key])})(null===n||void 0===n?void 0:n.isTextInput,t,r)&&e(L())};return k.add(t),()=>{k.delete(t)}}),t)}function B(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:i}=e,a=(0,o.useRef)({isFocusWithin:!1}),s=(0,o.useCallback)((e=>{a.current.isFocusWithin&&!e.currentTarget.contains(e.relatedTarget)&&(a.current.isFocusWithin=!1,n&&n(e),i&&i(!1))}),[n,i,a]),l=S(s),u=(0,o.useCallback)((e=>{a.current.isFocusWithin||document.activeElement!==e.target||(r&&r(e),i&&i(!0),a.current.isFocusWithin=!0,l(e))}),[r,i,l]);return t?{focusWithinProps:{onFocus:null,onBlur:null}}:{focusWithinProps:{onFocus:u,onBlur:s}}}"undefined"!==typeof document&&("loading"!==document.readyState?N():document.addEventListener("DOMContentLoaded",N));let z=!1,G=0;function Z(){z=!0,setTimeout((()=>{z=!1}),50)}function U(e){"touch"===e.pointerType&&Z()}function H(){if("undefined"!==typeof document)return"undefined"!==typeof PointerEvent?document.addEventListener("pointerup",U):document.addEventListener("touchend",Z),G++,()=>{G--,G>0||("undefined"!==typeof PointerEvent?document.removeEventListener("pointerup",U):document.removeEventListener("touchend",Z))}}function K(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:i}=e,[a,s]=(0,o.useState)(!1),l=(0,o.useRef)({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;(0,o.useEffect)(H,[]);let{hoverProps:u,triggerHoverEnd:c}=(0,o.useMemo)((()=>{let e=(e,r)=>{if(l.pointerType=r,i||"touch"===r||l.isHovered||!e.currentTarget.contains(e.target))return;l.isHovered=!0;let o=e.currentTarget;l.target=o,t&&t({type:"hoverstart",target:o,pointerType:r}),n&&n(!0),s(!0)},o=(e,t)=>{if(l.pointerType="",l.target=null,"touch"===t||!l.isHovered)return;l.isHovered=!1;let o=e.currentTarget;r&&r({type:"hoverend",target:o,pointerType:t}),n&&n(!1),s(!1)},a={};return"undefined"!==typeof PointerEvent?(a.onPointerEnter=t=>{z&&"mouse"===t.pointerType||e(t,t.pointerType)},a.onPointerLeave=e=>{!i&&e.currentTarget.contains(e.target)&&o(e,e.pointerType)}):(a.onTouchStart=()=>{l.ignoreEmulatedMouseEvents=!0},a.onMouseEnter=t=>{l.ignoreEmulatedMouseEvents||z||e(t,"mouse"),l.ignoreEmulatedMouseEvents=!1},a.onMouseLeave=e=>{!i&&e.currentTarget.contains(e.target)&&o(e,"mouse")}),{hoverProps:a,triggerHoverEnd:o}}),[t,n,r,i,l]);return(0,o.useEffect)((()=>{i&&c({currentTarget:l.target},l.pointerType)}),[i]),{hoverProps:u,isHovered:a}}const V=500;function q(e){let{isDisabled:t,onLongPressStart:n,onLongPressEnd:i,onLongPress:a,threshold:s=V,accessibilityDescription:l}=e;const u=(0,o.useRef)(null);let{addGlobalListener:c,removeGlobalListener:f}=(0,r.xi)(),{pressProps:h}=d({isDisabled:t,onPressStart(e){if(("mouse"===e.pointerType||"touch"===e.pointerType)&&(n&&n({...e,type:"longpressstart"}),u.current=setTimeout((()=>{e.target.dispatchEvent(new PointerEvent("pointercancel",{bubbles:!0})),a&&a({...e,type:"longpress"}),u.current=null}),s),"touch"===e.pointerType)){let t=e=>{e.preventDefault()};c(e.target,"contextmenu",t,{once:!0}),c(window,"pointerup",(()=>{setTimeout((()=>{f(e.target,"contextmenu",t)}),30)}),{once:!0})}},onPressEnd(e){u.current&&clearTimeout(u.current),!i||"mouse"!==e.pointerType&&"touch"!==e.pointerType||i({...e,type:"longpressend"})}}),p=(0,r.PK)(a&&!t?l:null);return{longPressProps:(0,r.dG)(h,p)}}},8879:function(e,t,n){"use strict";n.d(t,{Av:function(){return c},gP:function(){return u}});var r=n(3017);const o={prefix:String(Math.round(1e10*Math.random())),current:0,isSSR:!1},i=r.createContext(o);let a=Boolean("undefined"!==typeof window&&window.document&&window.document.createElement),s=new WeakMap;function l(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=(0,r.useContext)(i),n=(0,r.useRef)(null);if(null===n.current&&!e){var o,a;let e=null===(o=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)||void 0===o||null===(a=o.ReactCurrentOwner)||void 0===a?void 0:a.current;if(e){let n=s.get(e);null==n?s.set(e,{id:t.current,state:e.memoizedState}):e.memoizedState!==n.state&&(t.current=n.id,s.delete(e))}n.current=++t.current}return n.current}function u(e){let t=(0,r.useContext)(i);t!==o||a||console.warn("When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.");let n=l(!!e);return e||`react-aria${t.prefix}-${n}`}function c(){return(0,r.useContext)(i).isSSR}},1591:function(e,t,n){"use strict";n.d(t,{zL:function(){return v},Ao:function(){return x},ad:function(){return B},gn:function(){return W},V5:function(){return F},Zj:function(){return K},cr:function(){return V},Pf:function(){return z},dG:function(){return p},QB:function(){return j},zT:function(){return Z},Gt:function(){return H},PK:function(){return R},zX:function(){return G},xi:function(){return k},Me:function(){return c},bE:function(){return E},bt:function(){return s},mp:function(){return f},lE:function(){return T},nP:function(){return A}});var r=n(3017),o=n(8879);function i(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=i(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}var a=function(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=i(e))&&(r&&(r+=" "),r+=t);return r};const s="undefined"!==typeof window?r.useLayoutEffect:()=>{};function l(e){let[t,n]=(0,r.useState)(e),o=(0,r.useRef)(t),i=(0,r.useRef)(null);o.current=t;let a=(0,r.useRef)(null);a.current=()=>{let e=i.current.next();e.done?i.current=null:t===e.value?a.current():n(e.value)},s((()=>{i.current&&a.current()}));let l=(0,r.useCallback)((e=>{i.current=e(o.current),a.current()}),[i,a]);return[t,l]}let u=new Map;function c(e){let[t,n]=(0,r.useState)(e),i=(0,r.useRef)(null),a=(0,o.gP)(t),l=(0,r.useCallback)((e=>{i.current=e}),[]);return u.set(a,l),s((()=>{let e=a;return()=>{u.delete(e)}}),[a]),(0,r.useEffect)((()=>{let e=i.current;e&&(i.current=null,n(e))})),a}function d(e,t){if(e===t)return e;let n=u.get(e);if(n)return n(t),t;let r=u.get(t);return r?(r(e),e):t}function f(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=c(),[n,o]=l(t),i=(0,r.useCallback)((()=>{o((function*(){yield t,yield document.getElementById(t)?t:void 0}))}),[t,o]);return s(i,[t,i,...e]),n}function h(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(){for(let e of t)"function"===typeof e&&e(...arguments)}}function p(){let e={...arguments.length<=0?void 0:arguments[0]};for(let t=1;t<arguments.length;t++){let n=t<0||arguments.length<=t?void 0:arguments[t];for(let t in n){let r=e[t],o=n[t];"function"===typeof r&&"function"===typeof o&&"o"===t[0]&&"n"===t[1]&&t.charCodeAt(2)>=65&&t.charCodeAt(2)<=90?e[t]=h(r,o):"className"!==t&&"UNSAFE_className"!==t||"string"!==typeof r||"string"!==typeof o?"id"===t&&r&&o?e.id=d(r,o):e[t]=void 0!==o?o:r:e[t]=a(r,o)}}return e}const g=new Set(["id"]),m=new Set(["aria-label","aria-labelledby","aria-describedby","aria-details"]),y=/^(data-.*)$/;function v(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{labelable:n,propNames:r}=t,o={};for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&(g.has(i)||n&&m.has(i)||(null===r||void 0===r?void 0:r.has(i))||y.test(i))&&(o[i]=e[i]);return o}function x(e){if(function(){if(null==b){b=!1;try{document.createElement("div").focus({get preventScroll(){return b=!0,!0}})}catch(e){}}return b}())e.focus({preventScroll:!0});else{let t=function(e){var t=e.parentNode,n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft});return n}(e);e.focus(),function(e){for(let{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}(t)}}let b=null;let w=new Map,S=new Set;function C(){if("undefined"===typeof window)return;let e=t=>{let n=w.get(t.target);if(n&&(n.delete(t.propertyName),0===n.size&&(t.target.removeEventListener("transitioncancel",e),w.delete(t.target)),0===w.size)){for(let e of S)e();S.clear()}};document.body.addEventListener("transitionrun",(t=>{let n=w.get(t.target);n||(n=new Set,w.set(t.target,n),t.target.addEventListener("transitioncancel",e)),n.add(t.propertyName)})),document.body.addEventListener("transitionend",e)}function j(e){requestAnimationFrame((()=>{0===w.size?e():S.add(e)}))}"undefined"!==typeof document&&("loading"!==document.readyState?C():document.addEventListener("DOMContentLoaded",C));function k(){let e=(0,r.useRef)(new Map),t=(0,r.useCallback)(((t,n,r,o)=>{let i=(null===o||void 0===o?void 0:o.once)?function(){e.current.delete(r),r(...arguments)}:r;e.current.set(r,{type:n,eventTarget:t,fn:i,options:o}),t.addEventListener(n,r,o)}),[]),n=(0,r.useCallback)(((t,n,r,o)=>{var i;let a=(null===(i=e.current.get(r))||void 0===i?void 0:i.fn)||r;t.removeEventListener(n,a,o),e.current.delete(r)}),[]),o=(0,r.useCallback)((()=>{e.current.forEach(((e,t)=>{n(e.eventTarget,e.type,t,e.options)}))}),[n]);return(0,r.useEffect)((()=>o),[o]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:o}}function E(e,t){let{id:n,"aria-label":r,"aria-labelledby":o}=e;if(n=c(n),o&&r){let e=new Set([...o.trim().split(/\s+/),n]);o=[...e].join(" ")}else o&&(o=o.trim().split(/\s+/).join(" "));return r||o||!t||(r=t),{id:n,"aria-label":r,"aria-labelledby":o}}function T(e,t){s((()=>{if(e&&e.ref&&t)return e.ref.current=t.current,()=>{e.ref.current=null}}),[e,t])}function O(e){for(I(e)&&(e=e.parentElement);e&&!I(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}function I(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}let D="undefined"!==typeof window&&window.visualViewport;function A(){let[e,t]=(0,r.useState)((()=>_()));return(0,r.useEffect)((()=>{let e=()=>{t((e=>{let t=_();return t.width===e.width&&t.height===e.height?e:t}))};return D?D.addEventListener("resize",e):window.addEventListener("resize",e),()=>{D?D.removeEventListener("resize",e):window.removeEventListener("resize",e)}}),[]),e}function _(){return{width:(null===D||void 0===D?void 0:D.width)||window.innerWidth,height:(null===D||void 0===D?void 0:D.height)||window.innerHeight}}let P=0;const M=new Map;function R(e){let[t,n]=(0,r.useState)(void 0);return s((()=>{if(!e)return;let t=M.get(e);if(t)n(t.element.id);else{let r="react-aria-description-"+P++;n(r);let o=document.createElement("div");o.id=r,o.style.display="none",o.textContent=e,document.body.appendChild(o),t={refCount:0,element:o},M.set(e,t)}return t.refCount++,()=>{0===--t.refCount&&(t.element.remove(),M.delete(e))}}),[e]),{"aria-describedby":e?t:void 0}}function N(e){var t;return"undefined"!==typeof window&&null!=window.navigator&&((null===(t=window.navigator.userAgentData)||void 0===t?void 0:t.brands.some((t=>e.test(t.brand))))||e.test(window.navigator.userAgent))}function L(e){var t;return"undefined"!==typeof window&&null!=window.navigator&&e.test((null===(t=window.navigator.userAgentData)||void 0===t?void 0:t.platform)||window.navigator.platform)}function F(){return L(/^Mac/i)}function W(){return L(/^iPhone/i)||L(/^iPad/i)||F()&&navigator.maxTouchPoints>1}function B(){return F()||W()}function z(){return N(/AppleWebKit/i)&&!N(/Chrome/i)}function G(e,t,n,o){let i=(0,r.useRef)(n);i.current=n;let a=null==n;(0,r.useEffect)((()=>{if(a)return;let n=e.current,r=e=>i.current.call(this,e);return n.addEventListener(t,r,o),()=>{n.removeEventListener(t,r,o)}}),[e,t,o,a])}function Z(e,t){let n=U(e,t,"left"),r=U(e,t,"top"),o=t.offsetWidth,i=t.offsetHeight,a=e.scrollLeft,s=e.scrollTop,{borderTopWidth:l,borderLeftWidth:u}=getComputedStyle(e),c=e.scrollLeft+parseInt(u,10),d=e.scrollTop+parseInt(l,10),f=c+e.clientWidth,h=d+e.clientHeight;n<=a?a=n-parseInt(u,10):n+o>f&&(a+=n+o-f),r<=d?s=r-parseInt(l,10):r+i>h&&(s+=r+i-h),e.scrollLeft=a,e.scrollTop=s}function U(e,t,n){const r="left"===n?"offsetLeft":"offsetTop";let o=0;for(;t.offsetParent&&(o+=t[r],t.offsetParent!==e);){if(t.offsetParent.contains(e)){o-=e[r];break}t=t.offsetParent}return o}function H(e,t){if(document.contains(e)){let a=document.scrollingElement||document.documentElement;if("hidden"===window.getComputedStyle(a).overflow){let t=O(e);for(;e&&t&&e!==a&&t!==a;)Z(t,e),t=O(e=t)}else{var n;let{left:a,top:s}=e.getBoundingClientRect();null===e||void 0===e||null===(n=e.scrollIntoView)||void 0===n||n.call(e,{block:"nearest"});let{left:l,top:u}=e.getBoundingClientRect();var r,o,i;if(Math.abs(a-l)>1||Math.abs(s-u)>1)null===t||void 0===t||null===(r=t.containingElement)||void 0===r||null===(o=r.scrollIntoView)||void 0===o||o.call(r,{block:"center",inline:"center"}),null===(i=e.scrollIntoView)||void 0===i||i.call(e,{block:"nearest"})}}}function K(e){return!(0!==e.mozInputSource||!e.isTrusted)||(N(/Android/i)&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}function V(e){return 0===e.width&&0===e.height||1===e.width&&1===e.height&&0===e.pressure&&0===e.detail&&"mouse"===e.pointerType}},3830:function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,{Z:function(){return r}})}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}n.m=e,n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},function(){var e,t=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__};n.t=function(r,o){if(1&o&&(r=this(r)),8&o)return r;if("object"===typeof r&&r){if(4&o&&r.__esModule)return r;if(16&o&&"function"===typeof r.then)return r}var i=Object.create(null);n.r(i);var a={};e=e||[null,t({}),t([]),t(t)];for(var s=2&o&&r;"object"==typeof s&&!~e.indexOf(s);s=t(s))Object.getOwnPropertyNames(s).forEach((function(e){a[e]=function(){return r[e]}}));return a.default=function(){return r},n.d(i,a),i}}(),n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.f={},n.e=function(e){return Promise.all(Object.keys(n.f).reduce((function(t,r){return n.f[r](e,t),t}),[]))},n.u=function(e){return"static/js/"+({737:"resize-observer-polyfill",992:"reports"}[e]||e)+"."+{457:"e2e3c7b2",737:"a2fa22b1",969:"98ab5142",992:"c9bf4be9"}[e]+".chunk.js"},n.miniCssF=function(e){},n.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e={},t="@actual-app/web:";n.l=function(r,o,i,a){if(e[r])e[r].push(o);else{var s,l;if(void 0!==i)for(var u=document.getElementsByTagName("script"),c=0;c<u.length;c++){var d=u[c];if(d.getAttribute("src")==r||d.getAttribute("data-webpack")==t+i){s=d;break}}s||(l=!0,(s=document.createElement("script")).charset="utf-8",s.timeout=120,n.nc&&s.setAttribute("nonce",n.nc),s.setAttribute("data-webpack",t+i),s.src=r),e[r]=[o];var f=function(t,n){s.onerror=s.onload=null,clearTimeout(h);var o=e[r];if(delete e[r],s.parentNode&&s.parentNode.removeChild(s),o&&o.forEach((function(e){return e(n)})),t)return t(n)},h=setTimeout(f.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=f.bind(null,s.onerror),s.onload=f.bind(null,s.onload),l&&document.head.appendChild(s)}}}(),n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e},n.p="/",function(){n.b=document.baseURI||self.location.href;var e={179:0};n.f.j=function(t,r){var o=n.o(e,t)?e[t]:void 0;if(0!==o)if(o)r.push(o[2]);else{var i=new Promise((function(n,r){o=e[t]=[n,r]}));r.push(o[2]=i);var a=n.p+n.u(t),s=new Error;n.l(a,(function(r){if(n.o(e,t)&&(0!==(o=e[t])&&(e[t]=void 0),o)){var i=r&&("load"===r.type?"missing":r.type),a=r&&r.target&&r.target.src;s.message="Loading chunk "+t+" failed.\n("+i+": "+a+")",s.name="ChunkLoadError",s.type=i,s.request=a,o[1](s)}}),"chunk-"+t,t)}};var t=function(t,r){var o,i,a=r[0],s=r[1],l=r[2],u=0;if(a.some((function(t){return 0!==e[t]}))){for(o in s)n.o(s,o)&&(n.m[o]=s[o]);if(l)l(n)}for(t&&t(r);u<a.length;u++)i=a[u],n.o(e,i)&&e[i]&&e[i][0](),e[i]=0},r=self.webpackChunk_actual_app_web=self.webpackChunk_actual_app_web||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))}(),function(){"use strict";var e={};n.r(e),n.d(e,{FILE:function(){return pt},HTML:function(){return yt},TEXT:function(){return mt},URL:function(){return gt}});var t={};n.r(t),n.d(t,{BudgetSummary:function(){return uf},BudgetTotalsMonth:function(){return df},CategoryMonth:function(){return gf},ExpenseCategoryMonth:function(){return yf},ExpenseGroupMonth:function(){return mf},GroupMonth:function(){return hf},IncomeCategoryMonth:function(){return xf},IncomeGroupMonth:function(){return vf},IncomeHeaderMonth:function(){return ff}});var r={};function o(e){return(t,n,r)=>{if("undefined"!==typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope)throw new Error("`startWorkerFromMain` should only be called from the main thread");if("undefined"===typeof Worker)throw new Error("Web workers not available. sqlite3 requires web workers to work.");e().then((e=>{let{default:o}=e,i=new o;i.postMessage({type:"init",buffers:[t,n]}),i.addEventListener("message",(e=>{r.postMessage(e.data)}))}))}}n.r(r),n.d(r,{BudgetSummary:function(){return Ef},BudgetTotalsMonth:function(){return Df},ExpenseCategoryMonth:function(){return Pf},ExpenseGroupMonth:function(){return _f},IncomeCategoryMonth:function(){return Rf},IncomeGroupMonth:function(){return Mf},IncomeHeaderMonth:function(){return Af}});const i=function(e,t){const n=o(t);return t=>{t.addEventListener("message",(r=>{if(r.data.type===e)n(r.data.argBuffer,r.data.resultBuffer,t)}))}}("__absurd:spawn-idb-worker",(()=>n.e(969).then(n.bind(n,6969))));const a=new URL(n(6104),n.b);let s,l=!1,u="23.7.2";s=new Worker(a),i(s),window.SharedArrayBuffer&&localStorage.removeItem("SharedArrayBufferOverride"),s.postMessage({type:"init",version:u,isDev:l,publicUrl:"",hash:"7aebb51bfd02e5b1a78f",isSharedArrayBufferOverrideEnabled:localStorage.getItem("SharedArrayBufferOverride")}),n.g.Actual={IS_DEV:l,ACTUAL_VERSION:u,IS_FAKE_WEB:!0,logToTerminal:function(){console.log(...arguments)},relaunch:()=>{window.location.reload()},openFileDialog:async e=>{let{filters:t=[],properties:n}=e;return new Promise((e=>{let n=document.createElement("input");n.type="file";let r=t.find((e=>e.extensions));r&&(n.accept=r.extensions.map((e=>"."+e)).join(",")),n.style.position="absolute",n.style.top="0px",n.style.left="0px",n.dispatchEvent(new MouseEvent("click",{view:window,bubbles:!0,cancelable:!0})),n.addEventListener("change",(t=>{let n=t.target.files[0],r=n.name.replace(/.*(\.[^.]*)/,"file$1");if(n){var o=new FileReader;o.readAsArrayBuffer(n),o.onload=async function(t){let n=`/uploads/${r}`;window.__actionsForMenu.uploadFile(r,t.target.result).then((()=>e([n])))},o.onerror=function(e){alert("Error reading file")}}}))}))},saveFile:(e,t,n)=>{const r=document.createElement("a");r.style="display: none",r.download=t,r.rel="noopener";const o=new Blob([e]);r.href=URL.createObjectURL(o),r.dispatchEvent(new MouseEvent("click"))},openURLInBrowser:e=>{window.open(e,"_blank")},onEventFromMain:(e,t)=>{},applyAppUpdate:()=>{},updateAppMenu:e=>{},getServerSocket:async()=>s},document.addEventListener("keydown",(e=>{if(e.metaKey||e.ctrlKey)if("o"===e.key)e.preventDefault(),window.__actionsForMenu.closeBudget();else if("z"===e.key.toLowerCase()){if("INPUT"===e.target.tagName||"TEXTAREA"===e.target.tagName||e.target.isContentEditable)return;e.preventDefault(),e.shiftKey?window.__actionsForMenu.redo():window.__actionsForMenu.undo()}}));var c=n(3017),d=n(8989),f=n(7282),h=n(8753);function p(e){return function(t){var n=t.dispatch,r=t.getState;return function(t){return function(o){return"function"===typeof o?o(n,r,e):t(o)}}}}var g=p();g.withExtraArgument=p;var m=g,y=n(1025),v=n(5196),x=n(9121);const b={banks:[],failedAccounts:new Map,accountsSyncing:null};const w={loadingText:null,updateInfo:null,showUpdateNotification:!0,managerHasInitialized:!1,lastUndoState:{current:null},lastSplitState:{current:null}};function S(e,t){let n=new Set,r=e.map((e=>{if(e.cloudFileId){if(null==t)return{...e,state:"unknown"};let r=t.find((t=>e.cloudFileId===t.fileId));return r?(n.add(r.fileId),r.groupId===e.groupId?{...e,name:r.name,deleted:r.deleted,encryptKeyId:r.encryptKeyId,hasKey:r.hasKey,state:"synced"}:{...e,name:r.name,deleted:r.deleted,encryptKeyId:r.encryptKeyId,hasKey:r.hasKey,state:"detached"}):{...e,state:"broken"}}return{...e,state:"local"}})),o=(i=r.concat((t||[]).filter((e=>!n.has(e.fileId))).map((e=>({cloudFileId:e.fileId,groupId:e.groupId,name:e.name,deleted:e.deleted,encryptKeyId:e.encryptKeyId,hasKey:e.hasKey,state:"remote"})))).filter((e=>!e.deleted)),i.sort(((e,t)=>{let n=e.name.toLowerCase(),r=t.name.toLowerCase(),o=n<r?-1:n>r?1:0;return 0===o&&(o=e.id<t.id?-1:e.id>t.id?1:0),o})),i);var i;return o.filter((e=>"broken"!==e.state)).concat(o.filter((e=>"broken"===e.state)))}const C={budgets:[],availableImports:[],remoteFiles:null,allFiles:null};const j={selectedCell:null};var k=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:j,t=arguments.length>1?arguments[1]:void 0;return t.type===v.Uh?{...e,selectedCell:t.sheet?{sheet:t.sheet,name:t.name}:null}:e};const E={modalStack:[],isHidden:!1};var T=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:E,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case v.jw:return{...e,modalStack:[...e.modalStack,{name:t.name,options:t.options}]};case v.JA:return{...e,modalStack:[{name:t.name,options:t.options}]};case v.TZ:return{...e,modalStack:e.modalStack.slice(0,-1)};case v.et:return{...e,modalStack:[]};case v.uI:return{...e,isHidden:!0};case v.kJ:return{...e,isHidden:!1};case v.wH:if("loadingText"in t.state)return{...e,isHidden:null!=t.state.loadingText};break;case v.dp:return E}return e};const O={notifications:[]};var I=n(9585);const D={local:null,global:null};const A={};var _=n(5499);const P={data:null};const M={app:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:w,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case v.wH:return{...e,...t.state};case v.HT:return e.lastUndoState.current=t.undoState,e;case v.VM:return e.lastSplitState.current=t.splitState,e}return e},queries:_.ZP,account:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:b,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case v.YC:return{...e,banks:t.banks};case v._V:return{...e,accountsSyncing:t.name};case v.cV:{let n=new Map(e.failedAccounts);return t.failed?n.set(t.id,{type:t.errorType,code:t.errorCode}):n.delete(t.id),{...e,failedAccounts:n}}case v.Co:{let n=new Map;return t.syncErrors.forEach((e=>{n.set(e.id,{type:e.type,code:e.code})})),{...e,failedAccounts:n}}}return e},debug:k,profile:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:A,t=arguments.length>1?arguments[1]:void 0;return t.type===v.Kh?{...e,...t.profile}:e},prefs:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:D,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case v.px:return t.prefs&&(0,I.yC)({format:t.prefs.numberFormat||"comma-dot",hideFraction:t.prefs.hideFraction}),{local:t.prefs,global:t.globalPrefs};case v.uF:return(t.prefs.numberFormat||null!=t.prefs.hideFraction)&&(0,I.yC)({format:t.prefs.numberFormat||e.local.numberFormat,hideFraction:null!=t.prefs.hideFraction?t.prefs.hideFraction:e.local.hideFraction}),{...e,local:{...e.local,...t.prefs}};case v.CH:return{...e,global:{...e.global,...t.globalPrefs}}}return e},modals:T,notifications:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:O,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case v.Dv:return e.notifications.find((e=>e.id===t.notification.id))?e:{...e,notifications:[...e.notifications,t.notification]};case v.Kf:return{...e,notifications:e.notifications.filter((e=>e.id!==t.id))}}return e},budgets:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:C,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case v.Ud:return{...e,budgets:t.budgets,allFiles:S(t.budgets,e.remoteFiles)};case v.Oi:return{...e,remoteFiles:t.files,allFiles:S(e.budgets,t.files)};case v.GY:return{...e,budgets:t.budgetes,remoteFiles:t.remoteFiles,allFiles:S(t.budgets,t.remoteFiles)};case v.Yc:return{...e,availableImports:t.imports};case v.dp:return{...e,allFiles:null}}return e},user:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:P,t=arguments.length>1?arguments[1]:void 0;return t.type===v.q1?{...e,data:t.data}:e}};var R=M,N=n(7156),L=n(6634);async function F(){if("ResizeObserver"in window===!1){const e=await n.e(737).then(n.bind(n,9145));window.ResizeObserver=e.ResizeObserver}}var W=n(1591),B=n(5761),z=n(8993);const G=(0,c.createContext)(null);function Z(e){(0,W.nP)();const t=document.documentElement.clientHeight,n=document.documentElement.clientWidth,r={atLeastMediumWidth:n>=B.A.medium,isNarrowWidth:n<B.A.small,isSmallWidth:n>=B.A.small&&n<B.A.medium,isMediumWidth:n>=B.A.medium&&n<B.A.wide,isWideWidth:n>=B.A.wide,height:t,width:n};return(0,z.jsx)(G.Provider,{value:r,children:e.children})}function U(){return(0,c.useContext)(G)}var H=n(2085),K=n(9314);var V=n.p+"static/media/bg.42987350d58d04897ed83a3ce50df2d5.svg";var q=function(e){let{selected:t}=e;return(0,z.jsx)("div",{...(0,L.iv)({position:"absolute",top:0,bottom:0,left:0,right:0,background:`url(${V}) no-repeat center center fixed`,backgroundSize:"100% 100%"})})},$=n(5371);var Y=function(e){let{initializing:t,loadingText:n}=e;return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(q,{}),(null!=n||t)&&(0,z.jsxs)($.G7,{...(0,L.iv)({position:"absolute",top:0,left:0,right:0,padding:50,paddingTop:200,color:H.O9.n1,alignItems:"center"}),children:[(0,z.jsx)($.gO,{style:{marginBottom:20,fontSize:18},children:n}),(0,z.jsx)(K.Z,{width:25,color:H.O9.n1})]})]})},Q=n(1743);function X(){return(0,z.jsxs)(Q.Z,{style:[{padding:"6px 20px",display:"flex",flexDirection:"row",justifyContent:"space-between",color:H.O9.y2,backgroundColor:H.O9.y8,borderBottom:`1px solid ${H.O9.y6}`,zIndex:1}],children:[(0,z.jsx)(Q.Z,{children:"This is a demo build of Actual."}),(0,z.jsx)(Q.Z,{children:(0,z.jsxs)($.dL,{to:`https://github.com/actualbudget/actual/pull/${{NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_BACKEND_WORKER_HASH:"7aebb51bfd02e5b1a78f"}.REACT_APP_REVIEW_ID}`,children:["Open the PR: #",{NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_BACKEND_WORKER_HASH:"7aebb51bfd02e5b1a78f"}.REACT_APP_REVIEW_ID]})})]})}var J=n(6717);class ee extends c.Component{constructor(){super(...arguments),this.state={showError:!1}}renderSimple(e){let t;return t=e.IDBFailure?(0,z.jsx)($.xv,{children:"Your browser doesn\u2019t support IndexedDB in this environment, a feature that Actual requires to run. This might happen if you are in private browsing mode. Please try a different browser or turn off private browsing."}):e.SharedArrayBufferMissing?(0,z.jsxs)($.xv,{children:["Actual requires access to ",(0,z.jsx)("code",{children:"SharedArrayBuffer"})," in order to function properly. If you\u2019re seeing this error, either your browser does not support ",(0,z.jsx)("code",{children:"SharedArrayBuffer"}),", or your server is not sending the appropriate headers, or you are not using HTTPS. See"," ",(0,z.jsx)($.dL,{linkColor:"muted",to:"https://actualbudget.org/docs/troubleshooting/shared-array-buffer",children:"our troubleshooting documentation"})," ","to learn more. ",(0,z.jsx)(ne,{})]}):(0,z.jsxs)($.xv,{children:["There was a problem loading the app in this browser version. If this continues to be a problem, you can"," ",(0,z.jsx)($.dL,{linkColor:"muted",to:"https://github.com/actualbudget/releases",children:"download the desktop app"}),"."]}),(0,z.jsx)($.G7,{style:{alignItems:"center",justifyContent:"center",height:"100%"},children:(0,z.jsxs)($.Kq,{style:{paddingBottom:100,maxWidth:500,color:H.O9.r4,lineHeight:"1.5em",fontSize:15},children:[(0,z.jsx)($.xv,{children:t}),(0,z.jsxs)($.xv,{children:["Please get"," ",(0,z.jsx)($.dL,{linkColor:"muted",to:"https://actualbudget.org/contact",children:"in touch"})," ","for support"]})]})})}render(){const{buttonText:e,error:t}=this.props,{showError:n}=this.state;return"app-init-failure"===t.type?this.renderSimple(t):(0,z.jsx)($.u_,{isCurrent:!0,showClose:!1,title:"Fatal Error",children:()=>(0,z.jsxs)($.G7,{style:{maxWidth:500},children:[(0,z.jsx)($.P,{children:"There was an unrecoverable error in the UI. Sorry!"}),(0,z.jsxs)($.P,{children:["If this error persists, please get"," ",(0,z.jsx)($.dL,{to:"https://actualbudget.org/contact",children:"in touch"})," ","so it can be investigated."]}),(0,z.jsx)($.P,{children:(0,z.jsx)($.zx,{onClick:()=>window.Actual.relaunch(),children:e})}),(0,z.jsxs)($.P,{isLast:!0,style:{fontSize:11},children:[(0,z.jsx)($.Qj,{onClick:()=>this.setState({showError:!0}),style:{color:H.O9.p4},children:"Show Error"}),n&&(0,z.jsx)($.gO,{style:{marginTop:5,height:100,overflow:"auto"},children:t.stack})]})]})})}}var te=ee;function ne(){let[e,t]=(0,c.useState)(!1),[n,r]=(0,c.useState)(!1);return e?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)($.P,{style:{marginTop:10},children:["Actual uses ",(0,z.jsx)("code",{children:"SharedArrayBuffer"})," to allow usage from multiple tabs at once and to ensure correct behavior when switching files. While it can run without access to ",(0,z.jsx)("code",{children:"SharedArrayBuffer"}),", you may encounter data loss or notice multiple budget files being merged with each other."]}),(0,z.jsxs)("label",{style:{display:"flex",alignItems:"center",marginBottom:10},children:[(0,z.jsx)(J.XZ,{checked:n,onChange:r})," I understand the risks, run Actual in the unsupported fallback mode"]}),(0,z.jsx)($.zx,{disabled:!n,onClick:()=>{window.localStorage.setItem("SharedArrayBufferOverride","true"),window.location.reload()},children:"Open Actual"})]}):(0,z.jsx)($.Qj,{onClick:()=>t(!0),style:{color:"inherit !important",marginLeft:5,border:"none !important",background:"none !important",padding:"0 !important",textDecoration:"underline !important",boxShadow:"none !important",display:"inline !important",font:"inherit !important"},children:"Advanced options"})}function re(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];if("undefined"!==typeof process&&void 0===t)throw new Error("invariant requires an error message argument");if(!e){let e;if(void 0===t)e=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{let n=0;e=new Error(t.replace(/%s/g,(function(){return r[n++]}))),e.name="Invariant Violation"}throw e.framesToPop=1,e}}function oe(e){return"object"===typeof e}const ie="dnd-core/INIT_COORDS",ae="dnd-core/BEGIN_DRAG",se="dnd-core/PUBLISH_DRAG_SOURCE",le="dnd-core/HOVER",ue="dnd-core/DROP",ce="dnd-core/END_DRAG";function de(e,t){return{type:ie,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}const fe={type:ie,payload:{clientOffset:null,sourceClientOffset:null}};function he(e){return function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{publishSource:!0};const{publishSource:r=!0,clientOffset:o,getSourceClientOffset:i}=n,a=e.getMonitor(),s=e.getRegistry();e.dispatch(de(o)),function(e,t,n){re(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach((function(e){re(n.getSource(e),"Expected sourceIds to be registered.")}))}(t,a,s);const l=function(e,t){let n=null;for(let r=e.length-1;r>=0;r--)if(t.canDragSource(e[r])){n=e[r];break}return n}(t,a);if(null==l)return void e.dispatch(fe);let u=null;if(o){if(!i)throw new Error("getSourceClientOffset must be defined");!function(e){re("function"===typeof e,"When clientOffset is provided, getSourceClientOffset must be a function.")}(i),u=i(l)}e.dispatch(de(o,u));const c=s.getSource(l).beginDrag(a,l);if(null==c)return;!function(e){re(oe(e),"Item must be an object.")}(c),s.pinSource(l);const d=s.getSourceType(l);return{type:ae,payload:{itemType:d,item:c,sourceId:l,clientOffset:o||null,sourceClientOffset:u||null,isSourcePublic:!!r}}}}function pe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ge(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){pe(e,t,n[t])}))}return e}function me(e){return function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n=e.getMonitor(),r=e.getRegistry();!function(e){re(e.isDragging(),"Cannot call drop while not dragging."),re(!e.didDrop(),"Cannot call drop twice during one drag operation.")}(n);const o=function(e){const t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}(n);o.forEach(((o,i)=>{const a=function(e,t,n,r){const o=n.getTarget(e);let i=o?o.drop(r,e):void 0;(function(e){re("undefined"===typeof e||oe(e),"Drop result must either be an object or undefined.")})(i),"undefined"===typeof i&&(i=0===t?{}:r.getDropResult());return i}(o,i,r,n),s={type:ue,payload:{dropResult:ge({},t,a)}};e.dispatch(s)}))}}function ye(e){return function(){const t=e.getMonitor(),n=e.getRegistry();!function(e){re(e.isDragging(),"Cannot call endDrag while not dragging.")}(t);const r=t.getSourceId();if(null!=r){n.getSource(r,!0).endDrag(t,r),n.unpinSource()}return{type:ce}}}function ve(e,t){return null===t?null===e:Array.isArray(e)?e.some((e=>e===t)):e===t}function xe(e){return function(t){let{clientOffset:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(e){re(Array.isArray(e),"Expected targetIds to be an array.")}(t);const r=t.slice(0),o=e.getMonitor(),i=e.getRegistry();return function(e,t,n){for(let r=e.length-1;r>=0;r--){const o=e[r];ve(t.getTargetType(o),n)||e.splice(r,1)}}(r,i,o.getItemType()),function(e,t,n){re(t.isDragging(),"Cannot call hover while not dragging."),re(!t.didDrop(),"Cannot call hover after drop.");for(let r=0;r<e.length;r++){const t=e[r];re(e.lastIndexOf(t)===r,"Expected targetIds to be unique in the passed array.");re(n.getTarget(t),"Expected targetIds to be registered.")}}(r,o,i),function(e,t,n){e.forEach((function(e){n.getTarget(e).hover(t,e)}))}(r,o,i),{type:le,payload:{targetIds:r,clientOffset:n||null}}}}function be(e){return function(){if(e.getMonitor().isDragging())return{type:se}}}class we{receiveBackend(e){this.backend=e}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const e=this,{dispatch:t}=this.store;const n=function(e){return{beginDrag:he(e),publishDragSource:be(e),hover:xe(e),drop:me(e),endDrag:ye(e)}}(this);return Object.keys(n).reduce(((r,o)=>{const i=n[o];var a;return r[o]=(a=i,function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];const i=a.apply(e,r);"undefined"!==typeof i&&t(i)}),r}),{})}dispatch(e){this.store.dispatch(e)}constructor(e,t){this.isSetUp=!1,this.handleRefCountChange=()=>{const e=this.store.getState().refCount>0;this.backend&&(e&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!e&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=e,this.monitor=t,e.subscribe(this.handleRefCountChange)}}function Se(e,t){return{x:e.x-t.x,y:e.y-t.y}}const Ce=[],je=[];Ce.__IS_NONE__=!0,je.__IS_ALL__=!0;class ke{subscribeToStateChange(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{handlerIds:n}=t;re("function"===typeof e,"listener must be a function."),re("undefined"===typeof n||Array.isArray(n),"handlerIds, when specified, must be an array of strings.");let r=this.store.getState().stateId;return this.store.subscribe((()=>{const t=this.store.getState(),o=t.stateId;try{const i=o===r||o===r+1&&!function(e,t){return e!==Ce&&(e===je||"undefined"===typeof t||(n=e,t.filter((e=>n.indexOf(e)>-1))).length>0);var n}(t.dirtyHandlerIds,n);i||e()}finally{r=o}}))}subscribeToOffsetChange(e){re("function"===typeof e,"listener must be a function.");let t=this.store.getState().dragOffset;return this.store.subscribe((()=>{const n=this.store.getState().dragOffset;n!==t&&(t=n,e())}))}canDragSource(e){if(!e)return!1;const t=this.registry.getSource(e);return re(t,`Expected to find a valid source. sourceId=${e}`),!this.isDragging()&&t.canDrag(this,e)}canDropOnTarget(e){if(!e)return!1;const t=this.registry.getTarget(e);if(re(t,`Expected to find a valid target. targetId=${e}`),!this.isDragging()||this.didDrop())return!1;return ve(this.registry.getTargetType(e),this.getItemType())&&t.canDrop(this,e)}isDragging(){return Boolean(this.getItemType())}isDraggingSource(e){if(!e)return!1;const t=this.registry.getSource(e,!0);if(re(t,`Expected to find a valid source. sourceId=${e}`),!this.isDragging()||!this.isSourcePublic())return!1;return this.registry.getSourceType(e)===this.getItemType()&&t.isDragging(this,e)}isOverTarget(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{shallow:!1};if(!e)return!1;const{shallow:n}=t;if(!this.isDragging())return!1;const r=this.registry.getTargetType(e),o=this.getItemType();if(o&&!ve(r,o))return!1;const i=this.getTargetIds();if(!i.length)return!1;const a=i.indexOf(e);return n?a===i.length-1:a>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return Boolean(this.store.getState().dragOperation.isSourcePublic)}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return function(e){const{clientOffset:t,initialClientOffset:n,initialSourceClientOffset:r}=e;return t&&n&&r?Se(function(e,t){return{x:e.x+t.x,y:e.y+t.y}}(t,r),n):null}(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return function(e){const{clientOffset:t,initialClientOffset:n}=e;return t&&n?Se(t,n):null}(this.store.getState().dragOffset)}constructor(e,t){this.store=e,this.registry=t}}const Ee="undefined"!==typeof global?global:self,Te=Ee.MutationObserver||Ee.WebKitMutationObserver;function Oe(e){return function(){const t=setTimeout(r,0),n=setInterval(r,50);function r(){clearTimeout(t),clearInterval(n),e()}}}const Ie="function"===typeof Te?function(e){let t=1;const n=new Te(e),r=document.createTextNode("");return n.observe(r,{characterData:!0}),function(){t=-t,r.data=t}}:Oe;class De{call(){try{this.task&&this.task()}catch(e){this.onError(e)}finally{this.task=null,this.release(this)}}constructor(e,t){this.onError=e,this.release=t,this.task=null}}const Ae=new class{enqueueTask(e){const{queue:t,requestFlush:n}=this;t.length||(n(),this.flushing=!0),t[t.length]=e}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:e}=this;for(;this.index<e.length;){const t=this.index;if(this.index++,e[t].call(),this.index>this.capacity){for(let t=0,n=e.length-this.index;t<n;t++)e[t]=e[t+this.index];e.length-=this.index,this.index=0}}e.length=0,this.index=0,this.flushing=!1},this.registerPendingError=e=>{this.pendingErrors.push(e),this.requestErrorThrow()},this.requestFlush=Ie(this.flush),this.requestErrorThrow=Oe((()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()}))}},_e=new class{create(e){const t=this.freeTasks,n=t.length?t.pop():new De(this.onError,(e=>t[t.length]=e));return n.task=e,n}constructor(e){this.onError=e,this.freeTasks=[]}}(Ae.registerPendingError);const Pe="dnd-core/ADD_SOURCE",Me="dnd-core/ADD_TARGET",Re="dnd-core/REMOVE_SOURCE",Ne="dnd-core/REMOVE_TARGET";function Le(e,t){t&&Array.isArray(e)?e.forEach((e=>Le(e,!1))):re("string"===typeof e||"symbol"===typeof e,t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var Fe;!function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"}(Fe||(Fe={}));let We=0;function Be(e){const t=(We++).toString();switch(e){case Fe.SOURCE:return`S${t}`;case Fe.TARGET:return`T${t}`;default:throw new Error(`Unknown Handler Role: ${e}`)}}function ze(e){switch(e[0]){case"S":return Fe.SOURCE;case"T":return Fe.TARGET;default:throw new Error(`Cannot parse handler ID: ${e}`)}}function Ge(e,t){const n=e.entries();let r=!1;do{const{done:e,value:[,o]}=n.next();if(o===t)return!0;r=!!e}while(!r);return!1}class Ze{addSource(e,t){Le(e),function(e){re("function"===typeof e.canDrag,"Expected canDrag to be a function."),re("function"===typeof e.beginDrag,"Expected beginDrag to be a function."),re("function"===typeof e.endDrag,"Expected endDrag to be a function.")}(t);const n=this.addHandler(Fe.SOURCE,e,t);return this.store.dispatch(function(e){return{type:Pe,payload:{sourceId:e}}}(n)),n}addTarget(e,t){Le(e,!0),function(e){re("function"===typeof e.canDrop,"Expected canDrop to be a function."),re("function"===typeof e.hover,"Expected hover to be a function."),re("function"===typeof e.drop,"Expected beginDrag to be a function.")}(t);const n=this.addHandler(Fe.TARGET,e,t);return this.store.dispatch(function(e){return{type:Me,payload:{targetId:e}}}(n)),n}containsHandler(e){return Ge(this.dragSources,e)||Ge(this.dropTargets,e)}getSource(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];re(this.isSourceId(e),"Expected a valid source ID.");return t&&e===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(e)}getTarget(e){return re(this.isTargetId(e),"Expected a valid target ID."),this.dropTargets.get(e)}getSourceType(e){return re(this.isSourceId(e),"Expected a valid source ID."),this.types.get(e)}getTargetType(e){return re(this.isTargetId(e),"Expected a valid target ID."),this.types.get(e)}isSourceId(e){return ze(e)===Fe.SOURCE}isTargetId(e){return ze(e)===Fe.TARGET}removeSource(e){var t;re(this.getSource(e),"Expected an existing source."),this.store.dispatch(function(e){return{type:Re,payload:{sourceId:e}}}(e)),t=()=>{this.dragSources.delete(e),this.types.delete(e)},Ae.enqueueTask(_e.create(t))}removeTarget(e){re(this.getTarget(e),"Expected an existing target."),this.store.dispatch(function(e){return{type:Ne,payload:{targetId:e}}}(e)),this.dropTargets.delete(e),this.types.delete(e)}pinSource(e){const t=this.getSource(e);re(t,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=t}unpinSource(){re(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(e,t,n){const r=Be(e);return this.types.set(r,t),e===Fe.SOURCE?this.dragSources.set(r,n):e===Fe.TARGET&&this.dropTargets.set(r,n),r}constructor(e){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=e}}const Ue=(e,t)=>e===t;function He(){let e=arguments.length>1?arguments[1]:void 0;switch(e.type){case le:break;case Pe:case Me:case Ne:case Re:return Ce;default:return je}const{targetIds:t=[],prevTargetIds:n=[]}=e.payload,r=function(e,t){const n=new Map,r=e=>{n.set(e,n.has(e)?n.get(e)+1:1)};e.forEach(r),t.forEach(r);const o=[];return n.forEach(((e,t)=>{1===e&&o.push(t)})),o}(t,n),o=r.length>0||!function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Ue;if(e.length!==t.length)return!1;for(let r=0;r<e.length;++r)if(!n(e[r],t[r]))return!1;return!0}(t,n);if(!o)return Ce;const i=n[n.length-1],a=t[t.length-1];return i!==a&&(i&&r.push(i),a&&r.push(a)),r}function Ke(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ve={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function qe(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ve,t=arguments.length>1?arguments[1]:void 0;const{payload:n}=t;switch(t.type){case ie:case ae:return{initialSourceClientOffset:n.sourceClientOffset,initialClientOffset:n.clientOffset,clientOffset:n.clientOffset};case le:return r=e.clientOffset,o=n.clientOffset,!r&&!o||r&&o&&r.x===o.x&&r.y===o.y?e:function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Ke(e,t,n[t])}))}return e}({},e,{clientOffset:n.clientOffset});case ce:case ue:return Ve;default:return e}var r,o}function $e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ye(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){$e(e,t,n[t])}))}return e}const Qe={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function Xe(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Qe,t=arguments.length>1?arguments[1]:void 0;const{payload:n}=t;switch(t.type){case ae:return Ye({},e,{itemType:n.itemType,item:n.item,sourceId:n.sourceId,isSourcePublic:n.isSourcePublic,dropResult:null,didDrop:!1});case se:return Ye({},e,{isSourcePublic:!0});case le:return Ye({},e,{targetIds:n.targetIds});case Ne:return-1===e.targetIds.indexOf(n.targetId)?e:Ye({},e,{targetIds:(r=e.targetIds,o=n.targetId,r.filter((e=>e!==o)))});case ue:return Ye({},e,{dropResult:n.dropResult,didDrop:!0,targetIds:[]});case ce:return Ye({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}var r,o}function Je(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;switch((arguments.length>1?arguments[1]:void 0).type){case Pe:case Me:return e+1;case Re:case Ne:return e-1;default:return e}}function et(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0)+1}function tt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){tt(e,t,n[t])}))}return e}function rt(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return{dirtyHandlerIds:He(e.dirtyHandlerIds,{type:t.type,payload:nt({},t.payload,{prevTargetIds:(n=e,r="dragOperation.targetIds",o=[],r.split(".").reduce(((e,t)=>e&&e[t]?e[t]:o||null),n))})}),dragOffset:qe(e.dragOffset,t),refCount:Je(e.refCount,t),dragOperation:Xe(e.dragOperation,t),stateId:et(e.stateId)};var n,r,o}function ot(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=function(e){const t="undefined"!==typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__;return(0,h.MT)(rt,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}(arguments.length>3&&void 0!==arguments[3]&&arguments[3]),o=new ke(r,new Ze(r)),i=new we(r,o),a=e(i,t,n);return i.receiveBackend(a),i}const it=(0,c.createContext)({dragDropManager:void 0});function at(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}let st=0;const lt=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var ut=(0,c.memo)((function(e){var{children:t}=e,n=at(e,["children"]);const[r,o]=function(e){if("manager"in e){return[{dragDropManager:e.manager},!1]}const t=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ct(),n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;const o=t;o[lt]||(o[lt]={dragDropManager:ot(e,t,n,r)});return o[lt]}(e.backend,e.context,e.options,e.debugMode),n=!e.context;return[t,n]}(n);return(0,c.useEffect)((()=>{if(o){const e=ct();return++st,()=>{0===--st&&(e[lt]=null)}}}),[]),(0,z.jsx)(it.Provider,{value:r,children:t})}));function ct(){return"undefined"!==typeof global?global:window}function dt(e){let t=null;return()=>(null==t&&(t=e()),t)}class ft{enter(e){const t=this.entered.length;return this.entered=function(e,t){const n=new Set,r=e=>n.add(e);e.forEach(r),t.forEach(r);const o=[];return n.forEach((e=>o.push(e))),o}(this.entered.filter((t=>this.isNodeInDocument(t)&&(!t.contains||t.contains(e)))),[e]),0===t&&this.entered.length>0}leave(e){const t=this.entered.length;var n,r;return this.entered=(n=this.entered.filter(this.isNodeInDocument),r=e,n.filter((e=>e!==r))),t>0&&0===this.entered.length}reset(){this.entered=[]}constructor(e){this.entered=[],this.isNodeInDocument=e}}class ht{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach((e=>{Object.defineProperty(this.item,e,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${e}" until the drop event.`),null}})}))}loadDataTransfer(e){if(e){const t={};Object.keys(this.config.exposeProperties).forEach((n=>{const r=this.config.exposeProperties[n];null!=r&&(t[n]={value:r(e,this.config.matchesTypes),configurable:!0,enumerable:!0})})),Object.defineProperties(this.item,t)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(e,t){return t===e.getSourceId()}endDrag(){}constructor(e){this.config=e,this.item={},this.initializeExposedProperties()}}const pt="__NATIVE_FILE__",gt="__NATIVE_URL__",mt="__NATIVE_TEXT__",yt="__NATIVE_HTML__";function vt(e,t,n){const r=t.reduce(((t,n)=>t||e.getData(n)),"");return null!=r?r:n}const xt={[pt]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:["Files"]},[yt]:{exposeProperties:{html:(e,t)=>vt(e,t,""),dataTransfer:e=>e},matchesTypes:["Html","text/html"]},[gt]:{exposeProperties:{urls:(e,t)=>vt(e,t,"").split("\n"),dataTransfer:e=>e},matchesTypes:["Url","text/uri-list"]},[mt]:{exposeProperties:{text:(e,t)=>vt(e,t,""),dataTransfer:e=>e},matchesTypes:["Text","text/plain"]}};function bt(e){if(!e)return null;const t=Array.prototype.slice.call(e.types||[]);return Object.keys(xt).filter((e=>{const n=xt[e];return!!(null===n||void 0===n?void 0:n.matchesTypes)&&n.matchesTypes.some((e=>t.indexOf(e)>-1))}))[0]||null}const wt=dt((()=>/firefox/i.test(navigator.userAgent))),St=dt((()=>Boolean(window.safari)));class Ct{interpolate(e){const{xs:t,ys:n,c1s:r,c2s:o,c3s:i}=this;let a=t.length-1;if(e===t[a])return n[a];let s,l=0,u=i.length-1;for(;l<=u;){s=Math.floor(.5*(l+u));const r=t[s];if(r<e)l=s+1;else{if(!(r>e))return n[s];u=s-1}}a=Math.max(0,u);const c=e-t[a],d=c*c;return n[a]+r[a]*c+o[a]*d+i[a]*c*d}constructor(e,t){const{length:n}=e,r=[];for(let h=0;h<n;h++)r.push(h);r.sort(((t,n)=>e[t]<e[n]?-1:1));const o=[],i=[],a=[];let s,l;for(let h=0;h<n-1;h++)s=e[h+1]-e[h],l=t[h+1]-t[h],i.push(s),o.push(l),a.push(l/s);const u=[a[0]];for(let h=0;h<i.length-1;h++){const e=a[h],t=a[h+1];if(e*t<=0)u.push(0);else{s=i[h];const n=i[h+1],r=s+n;u.push(3*r/((r+n)/e+(r+s)/t))}}u.push(a[a.length-1]);const c=[],d=[];let f;for(let h=0;h<u.length-1;h++){f=a[h];const e=u[h],t=1/i[h],n=e+u[h+1]-f-f;c.push((f-e-n)*t),d.push(n*t*t)}this.xs=e,this.ys=t,this.c1s=u,this.c2s=c,this.c3s=d}}const jt=1;function kt(e){const t=e.nodeType===jt?e:e.parentElement;if(!t)return null;const{top:n,left:r}=t.getBoundingClientRect();return{x:r,y:n}}function Et(e){return{x:e.clientX,y:e.clientY}}function Tt(e,t,n,r,o){const i=function(e){var t;return"IMG"===e.nodeName&&(wt()||!(null===(t=document.documentElement)||void 0===t?void 0:t.contains(e)))}(t),a=kt(i?e:t),s={x:n.x-a.x,y:n.y-a.y},{offsetWidth:l,offsetHeight:u}=e,{anchorX:c,anchorY:d}=r,{dragPreviewWidth:f,dragPreviewHeight:h}=function(e,t,n,r){let o=e?t.width:n,i=e?t.height:r;return St()&&e&&(i/=window.devicePixelRatio,o/=window.devicePixelRatio),{dragPreviewWidth:o,dragPreviewHeight:i}}(i,t,l,u),{offsetX:p,offsetY:g}=o,m=0===g||g;return{x:0===p||p?p:new Ct([0,.5,1],[s.x,s.x/l*f,s.x+f-l]).interpolate(c),y:m?g:(()=>{let e=new Ct([0,.5,1],[s.y,s.y/u*h,s.y+h-u]).interpolate(d);return St()&&i&&(e+=(window.devicePixelRatio-1)*h),e})()}}class Ot{get window(){return this.globalContext?this.globalContext:"undefined"!==typeof window?window:void 0}get document(){var e;return(null===(e=this.globalContext)||void 0===e?void 0:e.document)?this.globalContext.document:this.window?this.window.document:void 0}get rootElement(){var e;return(null===(e=this.optionsArgs)||void 0===e?void 0:e.rootElement)||this.window}constructor(e,t){this.ownerDocument=null,this.globalContext=e,this.optionsArgs=t}}function It(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){It(e,t,n[t])}))}return e}class At{profile(){var e,t;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:(null===(e=this.dragStartSourceIds)||void 0===e?void 0:e.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:(null===(t=this.dragOverTargetIds)||void 0===t?void 0:t.length)||0}}get window(){return this.options.window}get document(){return this.options.document}get rootElement(){return this.options.rootElement}setup(){const e=this.rootElement;if(void 0!==e){if(e.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");e.__isReactDndBackendSetUp=!0,this.addEventListeners(e)}}teardown(){const e=this.rootElement;var t;void 0!==e&&(e.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId&&(null===(t=this.window)||void 0===t||t.cancelAnimationFrame(this.asyncEndDragFrameId)))}connectDragPreview(e,t,n){return this.sourcePreviewNodeOptions.set(e,n),this.sourcePreviewNodes.set(e,t),()=>{this.sourcePreviewNodes.delete(e),this.sourcePreviewNodeOptions.delete(e)}}connectDragSource(e,t,n){this.sourceNodes.set(e,t),this.sourceNodeOptions.set(e,n);const r=t=>this.handleDragStart(t,e),o=e=>this.handleSelectStart(e);return t.setAttribute("draggable","true"),t.addEventListener("dragstart",r),t.addEventListener("selectstart",o),()=>{this.sourceNodes.delete(e),this.sourceNodeOptions.delete(e),t.removeEventListener("dragstart",r),t.removeEventListener("selectstart",o),t.setAttribute("draggable","false")}}connectDropTarget(e,t){const n=t=>this.handleDragEnter(t,e),r=t=>this.handleDragOver(t,e),o=t=>this.handleDrop(t,e);return t.addEventListener("dragenter",n),t.addEventListener("dragover",r),t.addEventListener("drop",o),()=>{t.removeEventListener("dragenter",n),t.removeEventListener("dragover",r),t.removeEventListener("drop",o)}}addEventListeners(e){e.addEventListener&&(e.addEventListener("dragstart",this.handleTopDragStart),e.addEventListener("dragstart",this.handleTopDragStartCapture,!0),e.addEventListener("dragend",this.handleTopDragEndCapture,!0),e.addEventListener("dragenter",this.handleTopDragEnter),e.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.addEventListener("dragover",this.handleTopDragOver),e.addEventListener("dragover",this.handleTopDragOverCapture,!0),e.addEventListener("drop",this.handleTopDrop),e.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(e){e.removeEventListener&&(e.removeEventListener("dragstart",this.handleTopDragStart),e.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),e.removeEventListener("dragend",this.handleTopDragEndCapture,!0),e.removeEventListener("dragenter",this.handleTopDragEnter),e.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.removeEventListener("dragover",this.handleTopDragOver),e.removeEventListener("dragover",this.handleTopDragOverCapture,!0),e.removeEventListener("drop",this.handleTopDrop),e.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const e=this.monitor.getSourceId(),t=this.sourceNodeOptions.get(e);return Dt({dropEffect:this.altKeyPressed?"copy":"move"},t||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const e=this.monitor.getSourceId();return Dt({anchorX:.5,anchorY:.5,captureDraggingState:!1},this.sourcePreviewNodeOptions.get(e)||{})}isDraggingNativeItem(){const t=this.monitor.getItemType();return Object.keys(e).some((n=>e[n]===t))}beginDragNativeItem(e,t){this.clearCurrentDragSourceNode(),this.currentNativeSource=function(e,t){const n=xt[e];if(!n)throw new Error(`native type ${e} has no configuration`);const r=new ht(n);return r.loadDataTransfer(t),r}(e,t),this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(e){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e;this.mouseMoveTimeoutTimer=setTimeout((()=>{var e;return null===(e=this.rootElement)||void 0===e?void 0:e.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}),1e3)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){var e;if(this.currentDragSourceNode=null,this.rootElement)null===(e=this.window)||void 0===e||e.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0);return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(e,t){e.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(t))}handleDragEnter(e,t){this.dragEnterTargetIds.unshift(t)}handleDragOver(e,t){null===this.dragOverTargetIds&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(t)}handleDrop(e,t){this.dropTargetIds.unshift(t)}constructor(e,t,n){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=e=>{const t=this.sourceNodes.get(e);return t&&kt(t)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=e=>Boolean(e&&this.document&&this.document.body&&this.document.body.contains(e)),this.endDragIfSourceWasRemovedFromDOM=()=>{const e=this.currentDragSourceNode;null==e||this.isNodeInDocument(e)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=e=>{null===this.hoverRafId&&"undefined"!==typeof requestAnimationFrame&&(this.hoverRafId=requestAnimationFrame((()=>{this.monitor.isDragging()&&this.actions.hover(e||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null})))},this.cancelHover=()=>{null!==this.hoverRafId&&"undefined"!==typeof cancelAnimationFrame&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=e=>{if(e.defaultPrevented)return;const{dragStartSourceIds:t}=this;this.dragStartSourceIds=null;const n=Et(e);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(t||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:n});const{dataTransfer:r}=e,o=bt(r);if(this.monitor.isDragging()){if(r&&"function"===typeof r.setDragImage){const e=this.monitor.getSourceId(),t=this.sourceNodes.get(e),o=this.sourcePreviewNodes.get(e)||t;if(o){const{anchorX:e,anchorY:i,offsetX:a,offsetY:s}=this.getCurrentSourcePreviewNodeOptions(),l=Tt(t,o,n,{anchorX:e,anchorY:i},{offsetX:a,offsetY:s});r.setDragImage(o,l.x,l.y)}}try{null===r||void 0===r||r.setData("application/json",{})}catch(i){}this.setCurrentDragSourceNode(e.target);const{captureDraggingState:t}=this.getCurrentSourcePreviewNodeOptions();t?this.actions.publishDragSource():setTimeout((()=>this.actions.publishDragSource()),0)}else if(o)this.beginDragNativeItem(o);else{if(r&&!r.types&&(e.target&&!e.target.hasAttribute||!e.target.hasAttribute("draggable")))return;e.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=e=>{var t;(this.dragEnterTargetIds=[],this.isDraggingNativeItem())&&(null===(t=this.currentNativeSource)||void 0===t||t.loadDataTransfer(e.dataTransfer));if(!this.enterLeaveCounter.enter(e.target)||this.monitor.isDragging())return;const{dataTransfer:n}=e,r=bt(n);r&&this.beginDragNativeItem(r,n)},this.handleTopDragEnter=e=>{const{dragEnterTargetIds:t}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=e.altKey,t.length>0&&this.actions.hover(t,{clientOffset:Et(e)});t.some((e=>this.monitor.canDropOnTarget(e)))&&(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=e=>{var t;(this.dragOverTargetIds=[],this.isDraggingNativeItem())&&(null===(t=this.currentNativeSource)||void 0===t||t.loadDataTransfer(e.dataTransfer))},this.handleTopDragOver=e=>{const{dragOverTargetIds:t}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging())return e.preventDefault(),void(e.dataTransfer&&(e.dataTransfer.dropEffect="none"));this.altKeyPressed=e.altKey,this.lastClientOffset=Et(e),this.scheduleHover(t);(t||[]).some((e=>this.monitor.canDropOnTarget(e)))?(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?e.preventDefault():(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=e=>{this.isDraggingNativeItem()&&e.preventDefault();this.enterLeaveCounter.leave(e.target)&&(this.isDraggingNativeItem()&&setTimeout((()=>this.endDragNativeItem()),0),this.cancelHover())},this.handleTopDropCapture=e=>{var t;(this.dropTargetIds=[],this.isDraggingNativeItem())?(e.preventDefault(),null===(t=this.currentNativeSource)||void 0===t||t.loadDataTransfer(e.dataTransfer)):bt(e.dataTransfer)&&e.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=e=>{const{dropTargetIds:t}=this;this.dropTargetIds=[],this.actions.hover(t,{clientOffset:Et(e)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=e=>{const t=e.target;"function"===typeof t.dragDrop&&("INPUT"===t.tagName||"SELECT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable||(e.preventDefault(),t.dragDrop()))},this.options=new Ot(t,n),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new ft(this.isNodeInDocument)}}const _t=function(e,t,n){return new At(e,t,n)};var Pt=n(9274),Mt=n(7745),Rt=n(702),Nt=n(5068),Lt=n(9476),Ft=n(2914);var Wt=n(1936);var Bt=e=>(0,z.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"#242134",...e.style},children:(0,z.jsx)("path",{d:"M3.94 6.5 2.22 3.64l1.42-1.42L6.5 3.94c.52-.3 1.1-.54 1.7-.7L9 0h2l.8 3.24c.6.16 1.18.4 1.7.7l2.86-1.72 1.42 1.42-1.72 2.86c.3.52.54 1.1.7 1.7L20 9v2l-3.24.8c-.16.6-.4 1.18-.7 1.7l1.72 2.86-1.42 1.42-2.86-1.72c-.52.3-1.1.54-1.7.7L11 20H9l-.8-3.24c-.6-.16-1.18-.4-1.7-.7l-2.86 1.72-1.42-1.42 1.72-2.86c-.3-.52-.54-1.1-.7-1.7L0 11V9l3.24-.8c.16-.6.4-1.18.7-1.7zM10 13a3 3 0 1 0 0-6 3 3 0 0 0 0 6z",fill:"currentColor"})});var zt=e=>(0,z.jsxs)("svg",{...e,viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",style:{color:"#242134",...e.style},children:[(0,z.jsx)("g",{clipPath:"url(#a)",children:(0,z.jsx)("path",{d:"M1.857 7.612H.98a.98.98 0 0 0-.98.98v2.224c0 .449.184.857.51 1.163.612.551 1.816 1.49 3.735 2.368a.571.571 0 0 1 .306.346l.939 3.286a.484.484 0 0 0 .469.347h1.47a.479.479 0 0 0 .469-.367l.47-1.817a.262.262 0 0 1 .326-.183c.571.122 1.183.163 1.795.163.613 0 1.225-.061 1.796-.163.143-.02.286.06.327.183l.47 1.817a.502.502 0 0 0 .468.367h1.47a.484.484 0 0 0 .47-.347l1.224-4.245a.487.487 0 0 1 .122-.224c.919-.98 1.53-2.163 1.735-3.47h.49c.53 0 .959-.448.938-.979-.02-.51-.47-.918-.98-.918h-.448C18.06 4.673 14.632 2 10.489 2c-1.775 0-3.428.49-4.755 1.326-.591-.408-1.469-.734-2.693-.632-.49.04-.715.612-.388.959.408.429.796 1 .877 1.735L1.857 7.612Zm3.122.98a.862.862 0 0 1-.857-.858c0-.469.388-.857.857-.857.47 0 .858.388.858.857 0 .47-.388.858-.858.858Z",fill:"currentColor"})}),(0,z.jsx)("defs",{children:(0,z.jsx)("clipPath",{id:"a",children:(0,z.jsx)("path",{fill:"currentColor",d:"M0 0h20v20H0z"})})})]});var Gt=e=>(0,z.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"#242134",...e.style},children:(0,z.jsx)("path",{d:"M0 4c0-1.1.9-2 2-2h15a1 1 0 0 1 1 1v1H2v1h17a1 1 0 0 1 1 1v10a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V4zm16.5 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z",fill:"currentColor"})});let Zt=(0,c.createContext)(null);function Ut(e){let{location:t,children:n}=e;return(0,z.jsx)(Zt.Provider,{value:t,children:n})}let Ht=(0,c.createContext)({type:"page"});function Kt(e){let{type:t,current:n,children:r}=e;return(0,z.jsx)(Ht.Provider,{value:{type:t,current:n},children:r})}function Vt(){return(0,c.useContext)(Ht)}function qt(e){let{name:t,style:n}=e;const{isNarrowWidth:r}=U();return r?(0,z.jsx)($.G7,{style:[{alignItems:"center",backgroundColor:H.O9.b2,color:"white",flexDirection:"row",flex:"1 0 auto",fontSize:18,fontWeight:500,height:50,justifyContent:"center",overflowY:"auto"},n],children:t}):(0,z.jsx)($.xv,{style:[{fontSize:25,fontWeight:500,marginBottom:15},n],children:t})}function $t(e){let{title:t,modalSize:n,children:r,titleStyle:o}=e,{type:i,current:a}=Vt(),s=(0,Pt.s0)(),{isNarrowWidth:l}=U(),u=l?10:20;if("modal"===i){let e=n;return"string"===typeof n&&(e="medium"===n?{width:750,height:600}:{width:600}),(0,z.jsx)($.u_,{title:t,isCurrent:a,size:e,onClose:()=>s(-1),children:r})}return(0,z.jsxs)($.G7,{style:l?void 0:H.W2.page,children:[(0,z.jsx)(qt,{name:t,style:{...o,paddingInline:u}}),(0,z.jsx)($.G7,{style:l?{overflowY:"auto",padding:u}:{paddingLeft:u,paddingRight:u,flex:1},children:r})]})}let Yt=Date.now();function Qt(){let e=(0,Pt.s0)(),t=Xt();return(0,c.useLayoutEffect)((()=>{window.__navigate=e,window.__pushModal=t}),[e,t]),null}function Xt(){let e=(0,Pt.s0)(),t=(0,Pt.TH)();return(0,c.useCallback)((function(n){return e(n,{state:{parent:t,_version:Yt,...arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}}})}),[e,t])}function Jt(e){var t,n;return(null===(t=e.state)||void 0===t?void 0:t._version)!==Yt?null:(null===(n=e.state)||void 0===n?void 0:n.parent)||null}function en(e){let{render:t}=e,n=(0,Pt.TH)(),r=Jt(n),o=[n];for(;r;)o.unshift(r),r=Jt(r);let i=o[0],a=o.slice(1);return(0,z.jsxs)(Ut,{location:o[o.length-1],children:[t(i),a.map(((e,n)=>(0,z.jsx)(Kt,{type:"modal",current:n===a.length-1,children:t(e)},e.key)))]})}function tn(e){return e.replace("v","").split(".").map((e=>parseInt(e)))}function nn(e,t){let n=tn(e),r=tn(t);return n[0]-r[0]||n[1]-r[1]||n[2]-r[2]}async function rn(){let e=await fetch("https://api.github.com/repos/actualbudget/actual/tags"),t=(await e.json()).map((e=>e.name)).concat([`v${window.Actual.ACTUAL_VERSION}`]);return t.sort(nn),t[t.length-1]}async function on(e){return nn(window.Actual.ACTUAL_VERSION,e)<0}var an=n(4881),sn=n.n(an),ln=n(6018),un=n(3865),cn=n(3189),dn=n(8664),fn=n(4917),hn=n(7968);function pn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"account";return e?"budgeted"===e?{[`${t}.offbudget`]:!1,[`${t}.closed`]:!1}:"offbudget"===e?{[`${t}.offbudget`]:!0,[`${t}.closed`]:!1}:"uncategorized"===e?{[`${t}.offbudget`]:!1,category:null,is_parent:!1,$or:[{"payee.transfer_acct.offbudget":!0,"payee.transfer_acct":null}]}:{[t]:e}:null}function gn(e){let t=(0,hn.ZP)("transactions").options({splits:"grouped"}),n=pn(e);return n&&(t=t.filter(n)),t}function mn(e,t,n){let r,o=(0,I.Dz)(t);return r=(0,fn.Ze)(n).test(t)?(0,cn.Z)(t,(0,fn.D1)(n),new Date):(0,fn._y)(n).test(t)?(0,cn.Z)(t,(0,fn.JC)(n),new Date):(0,cn.Z)(t,n,new Date),e.filter({$or:{"payee.name":{$like:`%${t}%`},notes:{$like:`%${t}%`},"category.name":{$like:`%${t}%`},"account.name":{$like:`%${t}%`},$or:[(0,dn.Z)(r)&&{date:(0,fn.is)(r)},null!=o&&{amount:{$transform:"$abs",$eq:(0,I.l9)(o)}},null!=o&&Number.isInteger(o)&&{amount:{$transform:{$abs:{$idiv:["$",100]}},$eq:o}}].filter(Boolean)}})}function yn(e){return{name:`balance-${e.id}`,query:(0,hn.ZP)("transactions").filter({account:e.id}).options({splits:"none"}).calculate({$sum:"$amount"})}}function vn(){return{query:(0,hn.ZP)("transactions").filter({"account.closed":!1}).calculate({$sum:"$amount"}),name:"accounts-balance"}}function xn(){return{name:"budgeted-accounts-balance",query:(0,hn.ZP)("transactions").filter({"account.offbudget":!1,"account.closed":!1}).calculate({$sum:"$amount"})}}function bn(){return{name:"offbudget-accounts-balance",query:(0,hn.ZP)("transactions").filter({"account.offbudget":!0,"account.closed":!1}).calculate({$sum:"$amount"})}}let wn=(0,hn.ZP)("transactions").filter({"account.offbudget":!1,category:null,$or:[{"payee.transfer_acct.offbudget":!0,"payee.transfer_acct":null}]});const Sn={incomeAvailable:"available-funds",lastMonthOverspent:"last-month-overspent",forNextMonth:"buffered",totalBudgeted:"total-budgeted",toBudget:"to-budget",fromLastMonth:"from-last-month",totalIncome:"total-income",totalSpent:"total-spent",totalBalance:"total-leftover",groupSumAmount:e=>`group-sum-amount-${e}`,groupIncomeReceived:"total-income",groupBudgeted:e=>`group-budget-${e}`,groupBalance:e=>`group-leftover-${e}`,catBudgeted:e=>`budget-${e}`,catSumAmount:e=>`sum-amount-${e}`,catBalance:e=>`leftover-${e}`,catCarryover:e=>`carryover-${e}`},Cn={totalBudgetedExpense:"total-budgeted",totalBudgetedIncome:"total-budget-income",totalBudgetedSaved:"total-saved",totalIncome:"total-income",totalSpent:"total-spent",totalSaved:"real-saved",totalLeftover:"total-leftover",groupSumAmount:e=>`group-sum-amount-${e}`,groupIncomeReceived:"total-income",groupBudgeted:e=>`group-budget-${e}`,groupBalance:e=>`group-leftover-${e}`,catBudgeted:e=>`budget-${e}`,catSumAmount:e=>`sum-amount-${e}`,catBalance:e=>`leftover-${e}`,catCarryover:e=>`carryover-${e}`};var jn=n(5284);function kn(e){return"number"===typeof e?e:0}function En(e,t){return{type:"SplitTransactionError",version:1,difference:kn(t.amount)-e}}function Tn(e,t){let n="temp"===e.id?"temp":"";return{amount:0,...t,payee:t.payee||e.payee,id:t.id?t.id:n+(0,jn.Z)(),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 On(e){const t=e.subtransactions.reduce(((e,t)=>e+kn(t.amount)),0);return{...e,error:t===kn(e.amount)?null:En(t,e)}}function In(e,t){let n=[e[t]],r=t+1;for(;r<e.length&&e[r].is_child;)n.push(e[r]),r++;return n}function Dn(e){let t=e.reduce(((e,t)=>{let{subtransactions:n,...r}=t;n=n||[],e.push(r);for(let o=0;o<n.length;o++)e.push(n[o]);return e}),[]);return t}function An(e){return{...e[0],subtransactions:e.slice(1)}}function _n(e){return null==e?null:Dn([e])}function Pn(e,t,n){let r=e.findIndex((e=>e.id===t)),o=e[r],i=[...e];if(-1===r)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,r);if(null==t)return console.log("Cannot find parent index"),{diff:{deleted:[],updated:[]}};let o,a=In(e,t),s=n(An(a)),l=_n(s);return null==l?(o={deleted:[{id:a[0].id}],updated:[]},s={id:a[0].id,_deleted:!0},i.splice(t,a.length)):(o=(0,I.Th)(a,l),i.splice(t,a.length,...l)),{data:i,newTransaction:s,diff:o}}{let e=n(o),t=_n(e)||[];return e&&(e.subtransactions=e.subtransactions||[]),i.splice(r,1,...t),{data:i,newTransaction:e||{id:o.id,_deleted:!0},diff:(0,I.Th)([o],t)}}}function Mn(e,t){return Pn(e,t,(e=>{if(!e.is_parent)return e;let t=(0,I.Z$)(e.subtransactions);return e.subtransactions.push(Tn(e,{amount:0,sort_order:kn(t&&t.sort_order)-1})),e}))}function Rn(e,t){return Pn(e,t.id,(e=>{if(e.is_parent){let n=e.id===t.id?t:e,r=e.subtransactions.map((r=>{let o=r;return e.id===t.id?o={...r,payee:r.payee===e.payee?t.payee:r.payee}:r.id===t.id&&(o=t),Tn(n,o)}));return On({...n,subtransactions:r})}return t}))}function Nn(e,t){return Pn(e,t,(e=>{if(e.is_parent){if(e.id===t)return null;if(1===e.subtransactions.length)return{...e,subtransactions:null,is_parent:!1,error:null};{let n=e.subtransactions.filter((e=>e.id!==t));return On({...e,subtransactions:n})}}return null}))}function Ln(e,t){return Pn(e,t,(e=>e.is_parent||e.is_child?e:{...e,is_parent:!0,error:0===kn(e.amount)?null:En(0,e),subtransactions:[Tn(e,{amount:0,sort_order:-1})]}))}function Fn(e){let t=e.find((e=>!e.is_child));t={...t,id:(0,jn.Z)()};let n=e.filter((e=>e.is_child));return[t,...n.map((e=>({...e,id:(0,jn.Z)(),parent_id:t.id})))]}var Wn=n(5058);async function Bn(e){let{upgradingAccountId:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(e,t,n){let{onSuccess:r,onClose:o}=n;e("nordigen-external-msg",{onMoveExternal:async e=>{let{institutionId:n}=e;const r=await(0,N.lW)("nordigen-create-web-token",{upgradingAccountId:t,institutionId:n,accessValidForDays:30});if(r.error)return r;const{link:o,requisitionId:i}=r;window.Actual.openURLInBrowser(o);let{error:a,data:s}=await(0,N.lW)("nordigen-poll-web-token",{upgradingAccountId:t,requisitionId:i});return{error:a,data:s}},onClose:o,onSuccess:r})}(e,t,{onSuccess:async n=>{e("select-linked-accounts",{accounts:n.accounts,requisitionId:n.id,upgradingAccountId:t})}})}var zn=n(1785),Gn=n(5249);function Zn(e,t){throw new Error(t+": "+JSON.stringify(e.str.slice(e.index,10)))}function Un(e){return e.str[e.index]}function Hn(e){if(e.index>=e.str.length)return null;let t=Un(e);return e.index++,t}function Kn(e,t){return Un(e)===t&&(Hn(e),!0)}function Vn(e){if("("===Un(e)){Hn(e);let t=qn(e);return")"!==Un(e)&&Zn(e,"Unbalanced parentheses"),Hn(e),t}return function(e){let t="-"===Un(e);t&&Hn(e),/\p{Sc}/u.test(Un(e))&&Hn(e);let n="";for(;Un(e)&&Un(e).match(/[0-9,.]/);){let t=","===(0,I.ff)().separator?".":",";Un(e)===t?Hn(e):n+=Hn(e)}""===n&&Zn(e,"Unexpected character");let r=parseFloat(n.replace((0,I.ff)().separator,"."));return t?-r:r}(e)}let qn=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.reduce(((e,t)=>n=>{let r=e(n);for(;Kn(n,t);)r={op:t,left:r,right:e(n)};return r}),Vn)}("^","/","*","-","+");function $n(e){if("number"===typeof e)return e;let{left:t,right:n,op:r}=e;switch(r){case"+":return $n(t)+$n(n);case"-":return $n(t)-$n(n);case"*":return $n(t)*$n(n);case"/":return $n(t)/$n(n);case"^":return Math.pow($n(t),$n(n));default:throw new Error("Unknown operator: "+r)}}function Yn(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(""===e)return n;try{t=$n(function(e){let t={str:e.replace(/\s/g,""),index:0};return qn(t)}(e))}catch(cu){return n}return isNaN(t)?n:t}var Qn=n(8370);var Xn=e=>(0,z.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 91 51",style:{color:"#242134",...e.style},children:(0,z.jsx)("path",{fill:"currentColor",d:"M30.256 48.614a3.14 3.14 0 0 0-.989-2.153L10.803 29.063h76.915a3.2 3.2 0 0 0 .315 0c1.584-.084 2.95-1.64 2.867-3.266-.082-1.625-1.598-3.028-3.182-2.943H10.803L29.267 5.49c1.284-1.099 1.456-3.057.385-4.373a2.972 2.972 0 0 0-4.48-.187L.971 23.695a3.163 3.163 0 0 0 0 4.56l24.2 22.766a2.98 2.98 0 0 0 2.205.84c1.669-.08 2.958-1.534 2.88-3.247Z"})}),Jn=n(7888);var er=e=>(0,z.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"#242134",...e.style},children:(0,z.jsx)("path",{d:"m9.293 12.95.707.707L15.657 8l-1.414-1.414L10 10.828 5.757 6.586 4.343 8z",fill:"currentColor"})}),tr=n(6288),nr=n(2873);var rr=e=>(0,z.jsxs)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:[(0,z.jsx)("path",{d:"M12.406 14.905a1 1 0 0 0-.543 1.307 1 1 0 0 1-.217 1.09l-2.828 2.829a2 2 0 0 1-2.828 0L3.868 18.01a2 2 0 0 1 0-2.829L6.7 12.353a1.013 1.013 0 0 1 1.091-.217 1 1 0 0 0 .763-1.849 3.034 3.034 0 0 0-3.268.652l-2.832 2.828a4.006 4.006 0 0 0 0 5.657l2.122 2.121a4 4 0 0 0 5.656 0l2.829-2.828a3.008 3.008 0 0 0 .651-3.27 1 1 0 0 0-1.306-.542Z",fill:"currentColor"}),(0,z.jsx)("path",{d:"M7.757 16.241a1.011 1.011 0 0 0 1.414 0l7.779-7.778a1 1 0 0 0-1.414-1.414l-7.779 7.778a1 1 0 0 0 0 1.414Z",fill:"currentColor"}),(0,z.jsx)("path",{d:"m21.546 4.574-2.121-2.121a4.006 4.006 0 0 0-5.657 0l-2.829 2.828a3.006 3.006 0 0 0-.651 3.269 1 1 0 1 0 1.849-.764 1 1 0 0 1 .217-1.086l2.828-2.828a2 2 0 0 1 2.829 0l2.121 2.121a2 2 0 0 1 0 2.829L17.3 11.645a1.015 1.015 0 0 1-1.091.217 1 1 0 0 0-.765 1.849 3.026 3.026 0 0 0 3.27-.651l2.828-2.828a4.007 4.007 0 0 0 .004-5.658Z",fill:"currentColor"})]}),or=n(5432),ir=n(7740),ar=n(5946),sr=n(1912),lr=n(5547),ur=n(9234);function cr(e,t){let{amount:n,date:r}=e;Cr(e.id)&&(n=(e._inverse?-1:1)*(0,Qn.lP)(n));let o=n<0?-n:null,i=n>0?n:null;return 0===n&&(t?i=0:o=0),(0,dn.Z)((0,zn.Z)(r))||(r=null),{...e,date:r,debit:null!=o?(0,I.zA)(o):"",credit:null!=i?(0,I.zA)(i):""}}function dr(e,t){let n=e[t];return n&&n.is_child&&(null==e[t+1]||e[t+1].parent_id!==n.parent_id)}let fr=(0,c.createContext)(null);function hr(){let e=(0,c.useContext)(fr);return(0,c.useMemo)((()=>({...e,expanded:t=>"collapse"===e.state.mode?!e.state.ids.has(t):e.state.ids.has(t)})),[e])}function pr(e){let{children:t,initialMode:n="expand"}=e,r=(0,d.v9)((e=>e.app.lastSplitState)),o=(0,d.I0)(),[i,a]=(0,c.useReducer)(((e,t)=>{switch(t.type){case"toggle-split":{let n=new Set([...e.ids]),{id:r}=t;return n.has(r)?n.delete(r):n.add(r),{...e,ids:n}}case"open-split":{let n=new Set([...e.ids]),{id:r}=t;return"collapse"===e.mode?n.delete(r):n.add(r),{...e,ids:n}}case"set-mode":return{...e,mode:t.mode,ids:new Set,transitionId:null};case"switch-mode":return null!=e.transitionId?e:{...e,mode:"expand"===e.mode?"collapse":"expand",transitionId:t.id,ids:new Set};case"finish-switch-mode":return{...e,transitionId:null};default:throw new Error("Unknown action type: "+t.type)}}),r.current||{ids:new Set,mode:n});(0,c.useEffect)((()=>{null!=i.transitionId&&setTimeout((()=>{a({type:"finish-switch-mode"})}),250)}),[i.transitionId]),(0,c.useEffect)((()=>{null==i.transitionId&&o({type:"SET_LAST_SPLIT_STATE",splitState:i})}),[i]);let s=(0,c.useMemo)((()=>({state:i,dispatch:a})),[i,a]);return(0,z.jsx)(fr.Provider,{value:s,children:t})}const gr=(0,c.memo)((e=>{let{hasSelected:t,showAccount:n,showCategory:r,showBalance:o,showCleared:i}=e,a=(0,Wn.YP)();return(0,z.jsxs)(ur.X2,{borderColor:H.O9.n9,backgroundColor:"white",style:{color:H.O9.n4,fontWeight:300,zIndex:200},children:[(0,z.jsx)(ur._7,{exposed:!0,focused:!1,selected:t,width:20,onSelect:e=>a({type:"select-all",event:e})}),(0,z.jsx)(ur.bL,{value:"Date",width:110}),n&&(0,z.jsx)(ur.bL,{value:"Account",width:"flex"}),(0,z.jsx)(ur.bL,{value:"Payee",width:"flex"}),(0,z.jsx)(ur.bL,{value:"Notes",width:"flex"}),r&&(0,z.jsx)(ur.bL,{value:"Category",width:"flex"}),(0,z.jsx)(ur.bL,{value:"Payment",width:80,textAlign:"right"}),(0,z.jsx)(ur.bL,{value:"Deposit",width:80,textAlign:"right"}),o&&(0,z.jsx)(ur.bL,{value:"Balance",width:88,textAlign:"right"}),i&&(0,z.jsx)(ur.gN,{width:21,truncate:!1}),(0,z.jsx)(ur.bL,{value:"",width:15+H.W2.scrollbarWidth})]})}));function mr(e){let{id:t,focused:n,selected:r,status:o,isChild:i,onEdit:a,onUpdate:s}=e,l="cleared"===o||null==o,u=(0,sr.V)(o),d={color:"cleared"===o?H.O9.g5:"missed"===o?H.O9.r6:"due"===o?H.O9.y5:r?H.O9.b7:H.O9.n7};return(0,z.jsx)(ur.bL,{name:"cleared",width:"auto",focused:n,style:{padding:1},plain:!0,children:(0,z.jsx)(ur.Sx,{style:[{padding:3,border:"1px solid transparent",borderRadius:50,":focus":{border:"1px solid "+d.color,boxShadow:`0 1px 2px ${d.color}`},cursor:l?"pointer":"default"},i&&{visibility:"hidden"}],onEdit:()=>a(t,"cleared"),onSelect:function(){l&&s("cleared",!("cleared"===o))},children:(0,c.createElement)(u.Icon,{style:{width:13,height:13,color:d.color,marginTop:"due"===o?-1:0}})})})}function yr(e){let{id:t,payeeId:n,accountId:r,focused:o,inherited:i,payees:a,accounts:s,valueStyle:l,transaction:u,payee:d,transferAcct:f,isPreview:h,onEdit:p,onUpdate:g,onCreatePayee:m,onManagePayees:y,onNavigateToTransferAccount:v,onNavigateToSchedule:x}=e,b=(0,c.useRef)(!1);return s=s.filter((e=>e.id!==r)),a=a.filter((e=>e.transfer_acct!==r)),(0,z.jsx)(ur.wh,{width:"flex",name:"payee",value:n,valueStyle:[l,i&&{color:H.O9.n8}],exposed:o,onExpose:!h&&(e=>p(t,e)),onUpdate:async e=>{if(g("payee",e),e&&e.startsWith("new:")&&!b.current){b.current=!0;let t=await m(e.slice(4));g("payee",t),b.current=!1}},unexposedContent:(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(vr,{transaction:u,transferAccount:f,onNavigateToTransferAccount:v,onNavigateToSchedule:x}),(0,z.jsx)(ur.rt,{value:n,formatter:()=>function(e,t,n){let{payee:r}=e;return n?(0,z.jsx)($.G7,{style:{flexDirection:"row",alignItems:"center"},children:(0,z.jsx)("div",{style:{overflow:"hidden",textOverflow:"ellipsis"},children:n.name})}):t&&!t.transfer_acct?t.name:r&&r.startsWith("new:")?r.slice(4):""}(u,d,f)})]}),children:e=>{let{onBlur:t,onKeyDown:r,onUpdate:o,onSave:i,shouldSaveFromKey:l,inputStyle:c}=e;return(0,z.jsx)(ar.Z,{payees:a,accounts:s,value:n,shouldSaveFromKey:l,inputProps:{onBlur:t,onKeyDown:r,style:c},showManagePayees:!0,tableBehavior:!0,defaultFocusTransferPayees:u.is_child,focused:!0,onUpdate:o,onSelect:i,onManagePayees:()=>y(n),isCreatable:!0,menuPortalTarget:void 0})}})}function vr(e){let{transaction:t,transferAccount:n,onNavigateToTransferAccount:r,onNavigateToSchedule:o,children:i}=e,a=t.schedule,s=(0,un.oF)(),l=s?s.schedules.find((e=>e.id===a)):null;if(null==l&&null==n)return i;let u={marginLeft:-5,marginRight:2,width:23,height:23,color:"inherit"},c={width:13,height:13,color:"inherit"},d={width:10,height:10,color:"inherit"},f=l&&l._date&&!!l._date.frequency;return l?(0,z.jsx)($.zx,{bare:!0,style:u,onClick:e=>{e.stopPropagation(),o(a)},children:f?(0,z.jsx)(tr.Z,{style:c}):(0,z.jsx)(nr.Z,{style:c})}):n?(0,z.jsx)($.zx,{bare:!0,style:u,onClick:e=>{e.stopPropagation(),Sr(t.id)||r(n.id)},children:(t._inverse?-1:1)*t.amount>0?(0,z.jsx)(Xn,{style:d}):(0,z.jsx)(Jn.Z,{style:d})}):null}const xr=(0,c.memo)((function(e){let{transaction:t,editing:n,backgroundColor:r="white",showAccount:o,showBalance:i,showCleared:a,showZeroInDeposit:s,style:l,hovered:u,selected:d,highlighted:f,added:h,matched:p,expanded:g,inheritedFields:m,focusedField:y,categoryGroups:v,payees:x,accounts:b,balance:w,dateFormat:S="MM/dd/yyyy",hideFraction:C,onSave:j,onEdit:k,onHover:E,onDelete:T,onSplit:O,onManagePayees:D,onCreatePayee:A,onToggleSplit:P,onNavigateToTransferAccount:M,onNavigateToSchedule:R}=e,N=(0,Wn.YP)(),[L,F]=(0,c.useState)(s),[W,B]=(0,c.useState)(t),[G,Z]=(0,c.useState)((()=>cr(t,s))),U=Cr(G.id);function K(e,n){if(G[e]!==n){let r={...G,[e]:n};if("note"===e&&""===n&&null==G.note)return;if("account"===e&&n&&(0,_.gI)(b)[n].offbudget&&(r.category=null),"credit"===e?r.debit="":"debit"===e&&(r.credit=""),"payee"===e&&n&&n.startsWith("new:"))Z(r);else{let e=function(e,t){let n,{debit:r,credit:o,date:i,...a}=e;if(""!==r){let e=Yn(r,null);n=null!=e?-e:null}else n=Yn(o,null);return n=null!=n?(0,I.l9)(n):t.amount,null==i&&(i=t.date||(0,fn.PR)()),{...a,date:i,amount:n}}(r,t);Z(cr(e,s)),j(e)}}}t===W&&s===L||(Z(cr(t,s)),B(t),F(s));let V,{id:q,debit:Y,credit:Q,payee:X,imported_payee:J,notes:ee,date:te,account:ne,category:re,cleared:oe,is_parent:ie,_unmatched:ae=!1,_inverse:se=!1}=G,le=x&&X&&(0,_.yG)(x)[X],ue=b&&ne&&(0,_.gI)(b)[ne];V=se?b&&ne&&(0,_.gI)(b)[ne]:le&&le.transfer_acct&&(0,_.gI)(b)[le.transfer_acct];let ce=G.is_child,de=d?H.O9.b8:H.O9.border,fe=V&&0===V.offbudget,he=ue&&1===ue.offbudget,pe=h?{fontWeight:600}:null,ge=u||"select"===y,me=C?{letterSpacing:-.5}:null;return(0,z.jsxs)(ur.X2,{borderColor:de,backgroundColor:d?H.O9.selected:ge?H.O9.hover:U?"#fcfcfc":r,highlighted:f,style:[l,U&&{color:H.O9.n5,fontStyle:"italic"},ae&&{opacity:.5}],onMouseEnter:()=>E&&E(G.id),children:[ce&&(0,z.jsx)(ur.gN,{borderColor:"transparent",width:110,style:{width:110,backgroundColor:H.O9.n11,borderBottomWidth:0}}),ce&&o&&(0,z.jsx)(ur.gN,{borderColor:"transparent",style:{flex:1,backgroundColor:H.O9.n11,opacity:0}}),Sr(G.id)?ce?(0,z.jsx)(ur.nu,{onDelete:()=>T&&T(G.id),exposed:u||n,style:[ce&&{borderLeftWidth:1},{lineHeight:0}]}):(0,z.jsx)(ur.bL,{width:20}):(0,z.jsx)(ur._7,{exposed:u||d||n,focused:"select"===y,onSelect:e=>{N({type:"select",id:G.id,event:e})},onEdit:()=>k(q,"select"),selected:d,style:[ce&&{borderLeftWidth:1}],value:p&&(0,z.jsx)(rr,{style:{width:13,height:13,color:H.O9.n7}})}),!ce&&(0,z.jsx)(ur.wh,{name:"date",width:110,exposed:"date"===y,value:te,valueStyle:pe,formatter:e=>e?(0,Gn.Z)((0,zn.Z)(e),S):"",onExpose:!U&&(e=>k(q,e)),onUpdate:e=>{K("date",e)},children:e=>{let{onBlur:t,onKeyDown:n,onUpdate:r,onSave:o,shouldSaveFromKey:i,inputStyle:a}=e;return(0,z.jsx)(lr.Z,{value:te||"",dateFormat:S,inputProps:{onBlur:t,onKeyDown:n,style:a},shouldSaveFromKey:i,tableBehavior:!0,onUpdate:r,onSelect:o})}}),!ce&&o&&(0,z.jsx)(ur.wh,{name:"account",width:"flex",value:ne,formatter:e=>{let t=e&&(0,_.gI)(b)[e];return t?t.name:""},valueStyle:pe,exposed:"account"===y,onExpose:!U&&(e=>k(q,e)),onUpdate:async e=>{e&&K("account",e)},children:e=>{let{onBlur:t,onKeyDown:n,onUpdate:r,onSave:o,shouldSaveFromKey:i,inputStyle:a}=e;return(0,z.jsx)(or.Z,{includeClosedAccounts:!1,value:ne,accounts:b,shouldSaveFromKey:i,tableBehavior:!0,focused:!0,inputProps:{onBlur:t,onKeyDown:n,style:a},onUpdate:r,onSelect:o,menuPortalTarget:void 0})}}),(0,z.jsx)(yr,{id:q,payeeId:X,accountId:ne,focused:"payee"===y,inherited:m&&m.has("payee"),payees:x,accounts:b,valueStyle:pe,transaction:G,payee:le,transferAcct:V,importedPayee:J,isPreview:U,onEdit:k,onUpdate:K,onCreatePayee:A,onManagePayees:D,onNavigateToTransferAccount:M,onNavigateToSchedule:R}),U?(0,z.jsx)(ur.bL,{name:"notes",width:"flex"}):(0,z.jsx)(ur.F3,{width:"flex",name:"notes",exposed:"notes"===y,focused:"notes"===y,value:ee||"",valueStyle:pe,onExpose:!U&&(e=>k(q,e)),inputProps:{value:ee||"",onUpdate:K.bind(null,"notes")}}),U?(0,z.jsx)(ur.bL,{width:"flex",style:{alignItems:"flex-start"},exposed:!0,children:()=>(0,z.jsx)($.G7,{style:{color:"missed"===ee?H.O9.r6:"due"===ee?H.O9.y4:d?H.O9.b5:H.O9.n6,backgroundColor:"missed"===ee?H.O9.r10:"due"===ee?H.O9.y9:d?H.O9.b8:H.O9.n10,margin:"0 5px",padding:"3px 7px",borderRadius:4},children:(0,I.VL)(ee)})}):ie?(0,z.jsx)(ur.bL,{name:"category",width:"flex",focused:"category"===y,style:{padding:0},plain:!0,children:(0,z.jsx)(ur.Sx,{style:{alignSelf:"flex-start",color:H.O9.n6,borderRadius:4,transition:"none","&:hover":{backgroundColor:"rgba(100, 100, 100, .15)",color:H.O9.n5}},disabled:Sr(G.id),onEdit:()=>k(q,"category"),onSelect:()=>P(q),children:(0,z.jsxs)($.G7,{style:{flexDirection:"row",alignItems:"center",alignSelf:"stretch",borderRadius:4,flex:1,padding:4},children:[ie&&(0,z.jsx)(er,{style:{width:14,height:14,color:"currentColor",transition:"transform .08s",transform:g?"rotateZ(0)":"rotateZ(-90deg)"}}),(0,z.jsx)($.xv,{style:{fontStyle:"italic",userSelect:"none"},children:"Split"})]})})}):fe||he||U?(0,z.jsx)(ur.F3,{name:"category",width:"flex",exposed:"category"===y,focused:"category"===y,onExpose:!U&&(e=>k(q,e)),value:ie?"Split":he?"Off Budget":fe?"Transfer":"",valueStyle:pe,style:{fontStyle:"italic",color:"#c0c0c0",fontWeight:300},inputProps:{readOnly:!0,style:{fontStyle:"italic"}}}):(0,z.jsx)(ur.wh,{name:"category",width:"flex",value:re,formatter:e=>{return e?(t=(0,_.ch)(v)[e],n="name",t?t[n]:""):G.id?"Categorize":"";var t,n},exposed:"category"===y,onExpose:e=>k(q,e),valueStyle:re?pe:{fontStyle:"italic",fontWeight:300,color:H.O9.p8},onUpdate:async e=>{"split"===e?O(G.id):K("category",e)},children:e=>{let{onBlur:t,onKeyDown:n,onUpdate:r,onSave:o,shouldSaveFromKey:i,inputStyle:a}=e;return(0,z.jsx)(ir.Z,{categoryGroups:v,value:re,focused:!0,tableBehavior:!0,showSplitOption:!ce&&!ie,shouldSaveFromKey:i,inputProps:{onBlur:t,onKeyDown:n,style:a},onUpdate:r,onSelect:o,menuPortalTarget:void 0})}}),(0,z.jsx)(ur.F3,{type:"input",width:80,name:"debit",exposed:"debit"===y,focused:"debit"===y,value:""===Y&&""===Q?"0.00":Y,valueStyle:pe,textAlign:"right",title:Y,onExpose:!U&&(e=>k(q,e)),style:[ie&&{fontStyle:"italic"},H.W2.tnum,me],inputProps:{value:""===Y&&""===Q?"0.00":Y,onUpdate:K.bind(null,"debit")}}),(0,z.jsx)(ur.F3,{type:"input",width:80,name:"credit",exposed:"credit"===y,focused:"credit"===y,value:Q,valueStyle:pe,textAlign:"right",title:Q,onExpose:!U&&(e=>k(q,e)),style:[ie&&{fontStyle:"italic"},H.W2.tnum,me],inputProps:{value:Q,onUpdate:K.bind(null,"credit")}}),i&&(0,z.jsx)(ur.bL,{name:"balance",value:null==w||ce||U?"":(0,I.zA)(w),valueStyle:{color:w<0?H.O9.r4:H.O9.g4},style:[H.W2.tnum,me],width:88,textAlign:"right"}),a&&(0,z.jsx)(mr,{id:q,focused:"cleared"===y,selected:d,isPreview:U,status:U?ee:oe?"cleared":null,isChild:ce,onEdit:k,onUpdate:K}),(0,z.jsx)(ur.bL,{width:15})]})}));function br(e){let{error:t,isDeposit:n,onAddSplit:r,style:o}=e;return"SplitTransactionError"!==t.type?null:1===t.version?(0,z.jsxs)($.G7,{style:[{flexDirection:"row",alignItems:"center",padding:"0 5px"},o],"data-testid":"transaction-error",children:[(0,z.jsxs)($.xv,{children:["Amount left:"," ",(0,z.jsx)($.xv,{style:{fontWeight:500},children:(0,I.zA)(n?t.difference:-t.difference)})]}),(0,z.jsx)($.G7,{style:{flex:1}}),(0,z.jsx)($.zx,{style:{marginLeft:15,padding:"4px 10px"},primary:!0,onClick:r,children:"Add Split"})]}):void 0}function wr(e,t,n){return[{id:"temp",date:n||(0,fn.PR)(),account:e||null,category:t||null,cleared:!1,amount:null}]}function Sr(e){return-1!==e.indexOf("temp")}function Cr(e){return-1!==e.indexOf("preview/")}function jr(e){let{transactions:t,accounts:n,categoryGroups:r,payees:o,editingTransaction:i,hoveredTransaction:a,focusedField:s,showAccount:l,showCategory:u,showBalance:c,showCleared:d,dateFormat:f,hideFraction:h,onHover:p,onClose:g,onSplit:m,onEdit:y,onDelete:v,onSave:x,onAdd:b,onAddSplit:w,onManagePayees:S,onCreatePayee:C,onNavigateToTransferAccount:j,onNavigateToSchedule:k}=e;const E=t[0].error,T=t[0].amount>0;return(0,z.jsxs)($.G7,{style:{borderBottom:"1px solid #ebebeb",paddingBottom:6,backgroundColor:"white"},"data-testid":"new-transaction",onKeyDown:e=>{"Escape"===e.key&&g()},onMouseLeave:()=>p(null),children:[t.map(((e,t)=>(0,z.jsx)(xr,{editing:i===e.id,hovered:a===e.id,transaction:e,showAccount:l,showCategory:u,showBalance:c,showCleared:d,focusedField:i===e.id&&s,showZeroInDeposit:T,accounts:n,categoryGroups:r,payees:o,dateFormat:f,hideFraction:h,expanded:!0,onHover:p,onEdit:y,onSave:x,onSplit:m,onDelete:v,onAdd:b,onManagePayees:S,onCreatePayee:C,style:{marginTop:-1},onNavigateToTransferAccount:j,onNavigateToSchedule:k},e.id))),(0,z.jsxs)($.G7,{style:{flexDirection:"row",alignItems:"center",justifyContent:"flex-end",marginTop:6,marginRight:20},children:[(0,z.jsx)($.zx,{style:{marginRight:10,padding:"4px 10px"},onClick:()=>g(),"data-testid":"cancel-button",children:"Cancel"}),E?(0,z.jsx)(br,{error:E,isDeposit:T,onAddSplit:()=>w(t[0].id)}):(0,z.jsx)($.zx,{style:{padding:"4px 10px"},primary:!0,onClick:b,"data-testid":"add-button",children:"Add"})]})]})}function kr(e){let{tableNavigator:t,tableRef:n,dateFormat:r="MM/dd/yyyy",newNavigator:o,renderEmpty:i,onHover:a,onScroll:s,...l}=e;const u=(0,c.createRef)(),d=function(e){const t=(0,c.useRef)();return(0,c.useEffect)((()=>{t.current=e}),[e]),t.current}(l.isAdding);let f=(0,c.useCallback)((e=>{l.onCloseAddTransaction(),l.onNavigateToTransferAccount(e)}),[l.onCloseAddTransaction,l.onNavigateToTransferAccount]),h=(0,c.useCallback)((e=>{l.onCloseAddTransaction(),l.onNavigateToSchedule(e)}),[l.onCloseAddTransaction,l.onNavigateToSchedule]);(0,c.useEffect)((()=>{!d&&l.isAdding&&o.onEdit("temp","date")}),[d,l.isAdding,o]);return(0,z.jsxs)($.G7,{innerRef:u,style:[{flex:1,cursor:"default"},l.style],children:[(0,z.jsxs)($.G7,{children:[(0,z.jsx)(gr,{hasSelected:l.selectedItems.size>0,showAccount:l.showAccount,showCategory:l.showCategory,showBalance:!!l.balances,showCleared:l.showCleared}),l.isAdding&&(0,z.jsx)($.G7,{...o.getNavigatorProps({onKeyDown:e=>l.onCheckNewEnter(e)}),children:(0,z.jsx)(jr,{transactions:l.newTransactions,editingTransaction:o.editingId,hoveredTransaction:l.hoveredTransaction,focusedField:o.focusedField,accounts:l.accounts,categoryGroups:l.categoryGroups,payees:l.payees||[],showAccount:l.showAccount,showCategory:l.showCategory,showBalance:!!l.balances,showCleared:l.showCleared,dateFormat:r,hideFraction:l.hideFraction,onClose:l.onCloseAddTransaction,onAdd:l.onAddTemporary,onAddSplit:l.onAddSplit,onSplit:l.onSplit,onEdit:o.onEdit,onSave:l.onSave,onDelete:l.onDelete,onHover:a,onManagePayees:l.onManagePayees,onCreatePayee:l.onCreatePayee,onNavigateToTransferAccount:f,onNavigateToSchedule:f})})]}),(0,z.jsxs)($.G7,{style:[{flex:1,overflow:"hidden"}],"data-testid":"transaction-table",onMouseLeave:()=>a(null),children:[(0,z.jsx)(ur.iA,{navigator:t,ref:n,items:l.transactions,renderItem:e=>{let{item:n,index:o,position:i,editing:s}=e;const{transactions:u,selectedItems:c,hoveredTransaction:d,accounts:p,categoryGroups:g,payees:m,showCleared:y,showAccount:v,showCategory:x,balances:b,hideFraction:w,isNew:S,isMatched:C,isExpanded:j}=l;let k=n,E=d===k.id,T=c.has(k.id),O=l.transactionMap.get(k.parent_id),I=O&&O.amount>0,D=j&&j((O||k).id),A=D&&O&&O.error||k.error;return(0,z.jsxs)(z.Fragment,{children:[(!D||dr(u,o))&&A&&"SplitTransactionError"===A.type&&(0,z.jsx)($.u,{position:"bottom-right",width:250,forceTop:i,forceLayout:!0,style:{transform:"translate(-5px, 2px)"},children:(0,z.jsx)(br,{error:A,isDeposit:I,onAddSplit:()=>l.onAddSplit(k.id)})}),(0,z.jsx)(xr,{editing:s,transaction:k,showAccount:v,showCategory:x,showBalance:!!b,showCleared:y,hovered:E,selected:T,highlighted:!1,added:S&&S(k.id),expanded:j&&j(k.id),matched:C&&C(k.id),showZeroInDeposit:I,balance:b&&b[k.id]&&b[k.id].balance,focusedField:s&&t.focusedField,accounts:p,categoryGroups:g,payees:m,inheritedFields:O&&O.payee===k.payee?new Set(["payee"]):new Set,dateFormat:r,hideFraction:w,onHover:a,onEdit:t.onEdit,onSave:l.onSave,onDelete:l.onDelete,onSplit:l.onSplit,onManagePayees:l.onManagePayees,onCreatePayee:l.onCreatePayee,onToggleSplit:l.onToggleSplit,onNavigateToTransferAccount:f,onNavigateToSchedule:h})]})},renderEmpty:i,loadMore:l.loadMoreTransactions,isSelected:e=>l.selectedItems.has(e),onKeyDown:e=>l.onCheckEnter(e),onScroll:s}),l.isAdding&&(0,z.jsx)("div",{style:{position:"absolute",top:-20,left:0,right:0,height:20,backgroundColor:"red",boxShadow:"0 0 6px rgba(0, 0, 0, .20)"}},"shadow")]})]})}let Er=(0,c.forwardRef)(((e,t)=>{let[n,r]=(0,c.useState)(null),[o,i]=(0,c.useState)(e.hoveredTransaction),[a,s]=(0,c.useState)(!1),l=hr(),u=(0,c.useRef)(null),d=(0,c.useRef)(null),f=(h=d,p=t,(0,c.useMemo)((()=>function(e){[h,p].forEach((t=>{"function"===typeof t?t(e):null!=t&&(t.current=e)}))}),[h,p]));var h,p;let g=(0,c.useMemo)((()=>{let t;if(null!=l.state.transitionId){let n=e.transactions.findIndex((e=>e.id===l.state.transitionId));t=e.transactions.filter(((e,t)=>{if(e.parent_id){if(t>=n)return l.expanded(e.parent_id);if(u.current)return u.current.expanded(e.parent_id)}return!0}))}else u.current&&null!=u.current.state.transitionId&&(d.current.anchor(),d.current.setRowAnimation(!1)),u.current=l,t=e.transactions.filter((e=>!e.parent_id||l.expanded(e.parent_id)));return u.current=l,t}),[e.transactions,l]);const m=(0,c.useMemo)((()=>new Map(g.map((e=>[e.id,e])))),[g]);(0,c.useEffect)((()=>{d.current.isAnchored()&&(d.current.unanchor(),d.current.setRowAnimation(!0))}),[u.current]);let y=(0,ur.wz)(n,E),v=(0,ur.wz)(g,E),x=(0,c.useRef)(!1),b=(0,c.useRef)({newTransactions:n,newNavigator:y,tableNavigator:v}),w=(0,c.useRef)(!1),S=(0,c.useRef)(!1),[C,j]=(0,c.useState)({}),k=(0,Wn.D9)();function E(t){let n=["select","date","account","payee","notes","category","debit","credit","cleared"];return n=t.is_child?["select","payee","notes","category","debit","credit"]:n.filter((t=>(e.showAccount||"account"!==t)&&(e.showCategory||"category"!==t))),Cr(t.id)&&(n=["select","cleared"]),Sr(t.id)&&(n=n.slice(1)),n}function T(t){w.current?S.current=t:t(e)}(0,c.useLayoutEffect)((()=>{b.current={newTransactions:n,newNavigator:y,tableNavigator:v,transactions:e.transactions}})),a!==e.isAdding&&(!a&&e.isAdding&&r(wr(e.currentAccountId,e.currentCategoryId)),s(e.isAdding)),(0,c.useEffect)((()=>{if(x.current){if(null==n[0].account)e.addNotification({type:"error",message:"Account is a required field"}),y.onEdit("temp","account");else{let t=b.current.newTransactions,n=t.length>0?t[0].date:null;r(wr(e.currentAccountId,e.currentCategoryId,n)),y.onEdit("temp","date"),e.onAdd(t)}x.current=!1}})),(0,c.useEffect)((()=>{w.current&&S.current&&(S.current(e),S.current=null),w.current=!1}),[n,e.transactions]);let O=(0,c.useCallback)((()=>{x.current=!0,j({})}),[e.onAdd,y.onEdit]),I=(0,c.useCallback)((async t=>{if(w.current=!0,Sr(t.id)){e.onApplyRules&&(t=await e.onApplyRules(t));let n=b.current.newTransactions;r(Rn(n,t).data)}else e.onSave(t)}),[e.onSave]),D=(0,c.useCallback)((e=>{i(e)}),[]),A=(0,c.useCallback)((e=>{if(Sr(e)){let t=b.current.newTransactions;if(e===t[0].id)return;r(Nn(t,e).data)}}),[]),_=(0,c.useMemo)((()=>t=>{if(Sr(t)){let{newNavigator:e}=b.current,n=b.current.newTransactions,{data:o,diff:i}=Ln(n,t);r(o),null===n[0].amount?e.onEdit(n[0].id,"debit"):e.onEdit(i.added[0].id,b.current.newNavigator.focusedField)}else{let n=b.current.transactions.find((e=>e.id===t)),r=e.onSplit(t);l.dispatch({type:"open-split",id:n.id});let{tableNavigator:o}=b.current;null===n.amount?o.onEdit(n.id,"debit"):o.onEdit(r,o.focusedField)}}),[e.onSplit,l.dispatch]),P=(0,c.useCallback)((t=>{if(Sr(t)){let e=b.current.newTransactions,{data:n,diff:o}=Mn(e,t);r(n),y.onEdit(o.added[0].id,b.current.newNavigator.focusedField)}else{let n=e.onAddSplit(t);v.onEdit(n,b.current.tableNavigator.focusedField)}}),[e.onAddSplit]);let M=(0,c.useCallback)((e=>l.dispatch({type:"toggle-split",id:e})),[l.dispatch]);return(0,z.jsx)(kr,{tableRef:f,...e,transactions:g,transactionMap:m,selectedItems:k,hoveredTransaction:o,isExpanded:l.expanded,onHover:D,onSave:I,onDelete:A,onSplit:_,onCheckNewEnter:function(e){if("Enter"===e.key)if(e.metaKey)e.stopPropagation(),O();else if(!e.shiftKey){function t(e){let{newTransactions:t}=e.current;return t[t.length-1]}y.editingId===t(b).id&&e.stopPropagation(),T((()=>{let e=t(b),n=e.parent_id||e.is_parent;b.current.newTransactions[0].error&&y.editingId===e.id?P(e.id):y.editingId!==e.id||n&&e.error||O()}))}},onCheckEnter:function(e){if("Enter"===e.key&&!e.shiftKey){let{editingId:t,focusedField:n}=v;T((()=>{var r;let o=b.current.transactions,i=o.findIndex((e=>e.id===t)),a=m.get(null===(r=o[i])||void 0===r?void 0:r.parent_id);dr(o,i)&&a&&a.error&&"select"!==n&&(e.stopPropagation(),P(t))}))}},onAddTemporary:O,onAddSplit:P,onCloseAddTransaction:function(){r(wr(e.currentAccountId,e.currentCategoryId)),e.onCloseAddTransaction()},onToggleSplit:M,newTransactions:n,tableNavigator:v,newNavigator:y})}));async function Tr(e){let t=await(0,N.lW)("transactions-batch-update",{...e,learnCategories:!0});return t.length>0?{updates:t}:{}}async function Or(e,t,n){let r=await Tr(e);n(function(e,t){return An((0,I.zb)(t,_n(e)))}(t.newTransaction,r),(0,I.zb)(r,t.data))}function Ir(e){let{tableRef:t,transactions:n,allTransactions:r,loadMoreTransactions:o,account:i,accounts:a,category:s,categoryGroups:l,payees:u,balances:d,showCleared:f,showAccount:h,headerContent:p,animated:g,isAdding:m,isNew:y,isMatched:v,isFiltered:x,dateFormat:b,hideFraction:w,addNotification:S,renderEmpty:C,onChange:j,onRefetch:k,onCloseAddTransaction:E,onCreatePayee:T}=e,O=(0,c.useRef)(),D=(0,Pt.s0)(),A=Xt();(0,c.useLayoutEffect)((()=>{O.current=n}),[n]);let _=(0,c.useCallback)((async e=>{e=Fn(e),await Tr({added:e}),k()}),[]),P=(0,c.useCallback)((async e=>{let t=Rn(O.current,e);if(t.diff.updated.length>0){!!t.diff.updated[0].date?(t.diff.updated[0].sort_order=Date.now(),await Tr(t.diff),k()):(j(t.newTransaction,t.data),Or(t.diff,t,j))}}),[]),M=(0,c.useCallback)((e=>{const t=Mn(O.current,e);return j(t.newTransaction,t.data),Or(t.diff,t,j),t.diff.added[0].id}),[]),R=(0,c.useCallback)((e=>{const t=Ln(O.current,e);return j(t.newTransaction,t.data),Or(t.diff,t,j),t.diff.added[0].id}),[]),L=(0,c.useCallback)((async e=>{let t=await(0,N.lW)("rules-run",{transaction:e}),n=(0,I.k4)(e,t),r={...e};return n&&Object.keys(n).forEach((e=>{null!=r[e]&&""!==r[e]&&0!==r[e]&&!1!==r[e]||(r[e]=n[e])})),r}),[]),F=(0,c.useCallback)((e=>{D("/payees",{selectedPayee:e})})),W=(0,c.useCallback)((e=>{D(`/accounts/${e}`)})),B=(0,c.useCallback)((e=>{A(`/schedule/edit/${e}`)}));return(0,z.jsx)(Er,{ref:t,transactions:r,loadMoreTransactions:o,accounts:a,categoryGroups:l,payees:u,balances:d,showCleared:f,showAccount:h,showCategory:!0,animated:g,currentAccountId:i&&i.id,currentCategoryId:s&&s.id,isAdding:m,isNew:y,isMatched:v,isFiltered:x,dateFormat:b,hideFraction:w,addNotification:S,headerContent:p,renderEmpty:C,onSave:P,onApplyRules:L,onSplit:R,onCloseAddTransaction:E,onAdd:_,onAddSplit:M,onManagePayees:F,onCreatePayee:T,style:{backgroundColor:"white"},onNavigateToTransferAccount:W,onNavigateToSchedule:B})}const Dr=(0,c.createContext)({}),Ar=()=>(0,c.useContext)(Dr).url,_r=()=>(0,c.useContext)(Dr).version,Pr=()=>(0,c.useContext)(Dr).setURL;async function Mr(){let{error:e,version:t}=await(0,N.lW)("get-server-version");return e?"":t}function Rr(e){let{children:t}=e,[n,r]=(0,c.useState)(""),[o,i]=(0,c.useState)("");(0,c.useEffect)((()=>{!async function(){r(await(0,N.lW)("get-server-url")),i(await Mr())}()}),[]);let a=(0,c.useCallback)((async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{error:n}=await(0,N.lW)("set-server-url",{...t,url:e});return n||(r(await(0,N.lW)("get-server-url")),i(await Mr())),{error:n}}),[r]);return(0,z.jsx)(Dr.Provider,{value:{url:n,setURL:a,version:o?`v${o}`:"N/A"},children:t})}function Nr(){const e=Ar(),t=(0,d.v9)((e=>e.user.data));return e?!t||t.offline?"offline":"online":"no-server"}var Lr=n(1576);var Fr=e=>(0,z.jsx)("svg",{...e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{color:"#242134",...e.style},children:(0,z.jsx)("path",{d:"M19.611 2.571h-3.754a1.286 1.286 0 1 1 0-2.571h6.857A1.286 1.286 0 0 1 24 1.286v6.857a1.286 1.286 0 0 1-2.571 0V4.39L15.48 10.34a1.286 1.286 0 0 1-1.817-1.817l5.948-5.95ZM1.286 14.571a1.286 1.286 0 0 1 1.285 1.286v3.754l5.949-5.946a1.286 1.286 0 0 1 1.817 1.817L4.39 21.429h3.753a1.285 1.285 0 1 1 0 2.571H1.286A1.286 1.286 0 0 1 0 22.714v-6.857a1.286 1.286 0 0 1 1.286-1.286Z",fill:"currentColor"})});var Wr=e=>(0,z.jsx)("svg",{...e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{color:"#242134",...e.style},children:(0,z.jsx)("path",{d:"M14.143 1.714A1.286 1.286 0 0 1 15.429 3v3.753L21.806.377a1.286 1.286 0 0 1 1.817 1.817l-6.376 6.377H21a1.286 1.286 0 1 1 0 2.572h-6.857a1.286 1.286 0 0 1-1.286-1.286V3a1.286 1.286 0 0 1 1.286-1.286ZM9.857 22.286A1.285 1.285 0 0 1 8.571 21v-3.753l-6.377 6.376a1.286 1.286 0 0 1-1.817-1.817l6.376-6.377H3a1.286 1.286 0 0 1 0-2.572h6.857a1.286 1.286 0 0 1 1.286 1.286V21a1.286 1.286 0 0 1-1.286 1.286Z",fill:"currentColor"})});var Br=e=>(0,z.jsxs)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:[(0,z.jsx)("path",{d:"M8.616 1.741A1.455 1.455 0 0 1 10.07.287h3.392a1.455 1.455 0 0 1 1.453 1.454v8.228a.25.25 0 0 0 .25.25h2.9a1.138 1.138 0 0 1 .827 2l-6.1 6.1a1.489 1.489 0 0 1-2.056 0l-6.1-6.1a1.137 1.137 0 0 1 .827-2h2.9a.249.249 0 0 0 .25-.25Z",fill:"currentColor"}),(0,z.jsx)("path",{d:"M0 19.677a4.039 4.039 0 0 0 4.035 4.035h15.93A4.039 4.039 0 0 0 24 19.677V17.8a1.225 1.225 0 0 0-2.449 0v1.874a1.588 1.588 0 0 1-1.586 1.586H4.035a1.588 1.588 0 0 1-1.586-1.586V17.8A1.225 1.225 0 0 0 0 17.8Z",fill:"currentColor"})]});var zr=e=>(0,z.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:(0,z.jsx)("path",{d:"M15.067 3.986a.5.5 0 0 0-.354-.148.5.5 0 0 0-.354.147L3.437 14.91a.5.5 0 0 0 0 .707l4.948 4.948a.5.5 0 0 0 .707 0L20.009 9.648a.5.5 0 0 0 0-.706ZM2.43 16.8a.5.5 0 0 0-.489-.127.5.5 0 0 0-.351.364L.084 23.314a.5.5 0 0 0 .133.47.507.507 0 0 0 .47.132l6.272-1.5a.5.5 0 0 0 .237-.84ZM23.2 2.924 21.077.8a2.5 2.5 0 0 0-3.532 0l-1.418 1.417a.5.5 0 0 0 0 .707l4.95 4.949a.5.5 0 0 0 .707 0L23.2 6.454a2.5 2.5 0 0 0 0-3.53Z",fill:"currentColor"})}),Gr=n(2141);var Zr=e=>(0,z.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:(0,z.jsx)("path",{d:"m23.384 21.619-6.529-6.529a9.284 9.284 0 1 0-1.768 1.768l6.529 6.529a1.266 1.266 0 0 0 1.768 0 1.251 1.251 0 0 0 0-1.768ZM2.75 9.5a6.75 6.75 0 1 1 6.75 6.75A6.758 6.758 0 0 1 2.75 9.5Z",fill:"currentColor"})});var Ur=e=>(0,z.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"#242134",...e.style},children:(0,z.jsx)("path",{d:"M10 3v2a5 5 0 0 0-3.54 8.54l-1.41 1.41A7 7 0 0 1 10 3zm4.95 2.05A7 7 0 0 1 10 17v-2a5 5 0 0 0 3.54-8.54l1.41-1.41zM10 20l-4-4 4-4v8zm0-12V0l4 4-4 4z",fill:"currentColor"})});let Hr=L.iv.keyframes({"0%":{transform:"rotateZ(0deg)"},"100%":{transform:"rotateZ(360deg)"}});function Kr(e){let{animating:t,iconStyle:n}=e;return(0,z.jsx)(Q.Z,{style:[{animation:t?`${Hr} 1s infinite linear`:null}],children:(0,z.jsx)(Ur,{width:14,height:14,style:{color:"currentColor",...n}})})}var Vr=n(8030),qr=n(8130),$r=n(2677),Yr=n(2328);var Qr=e=>(0,z.jsx)("svg",{...e,viewBox:"0 0 19 24",xmlns:"http://www.w3.org/2000/svg",style:{color:"#242134",...e.style},children:(0,z.jsx)("path",{d:"M17 24H2a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2h9a1 1 0 0 1 .707.293l7 7A1 1 0 0 1 19 8v14a2 2 0 0 1-2 2ZM2 21.5a.5.5 0 0 0 .5.5h14a.5.5 0 0 0 .5-.5V9a.5.5 0 0 0-.5-.5h-4a2 2 0 0 1-2-2v-4A.5.5 0 0 0 10 2H2.5a.5.5 0 0 0-.5.5v19Z",fill:"currentColor"})});function Xr(e){let{editable:t,defaultNotes:n,position:r="bottom-left",onClose:o}=e,[i,a]=(0,c.useState)(n),s=(0,c.createRef)();return(0,c.useEffect)((()=>{t&&s.current.focus()}),[s,t]),(0,z.jsx)($.u,{position:r,onClose:()=>o(i),children:t?(0,z.jsx)("textarea",{ref:s,...(0,L.iv)({border:"1px solid "+H.O9.border,padding:7,minWidth:300,minHeight:120,outline:"none"}),value:i||"",onChange:e=>a(e.target.value)}):(0,z.jsx)($.xv,{...(0,L.iv)({display:"block",maxWidth:225,padding:8,whiteSpace:"pre-wrap",overflowWrap:"break-word"}),children:i})})}function Jr(e){let{id:t,width:n=12,height:r=12,defaultColor:o=H.O9.n8,tooltipPosition:i,style:a}=e,[s,l]=(0,c.useState)(!1),u=(0,$.lL)(),d=(0,Yr.y)((()=>(0,x.ZP)("notes").filter({id:t}).select("*")),[t]),f=d&&d.length>0?d[0].note:null,h=f&&""!==f;const[p,g]=(0,c.useState)(null),m=u.isOpen||h&&s;return(0,z.jsxs)($.G7,{style:[{flexShrink:0}],onMouseEnter:()=>{g(setTimeout((()=>{l(!0)}),300))},onMouseLeave:()=>{clearTimeout(p),l(!1)},children:[(0,z.jsx)($.zx,{bare:!0,className:h||m?"":"hover-visible",style:[{color:o},a,h&&{display:"flex !important"},m&&{color:H.O9.n1}],...u.getOpenEvents(),children:(0,z.jsx)(Qr,{style:{width:n,height:r,color:"currentColor"}})}),m&&(0,z.jsx)(Xr,{editable:u.isOpen,defaultNotes:f,position:i,onClose:function(e){(0,N.lW)("notes-save",{id:t,note:e}),u.close()}})]})}function eo(e){let{getTransaction:t,onShow:n,onDuplicate:r,onDelete:o,onEdit:i,onUnlink:a,onCreateRule:s,onScheduleAction:l}=e,u=Xt(),d=(0,Wn.D9)(),f=(0,c.useMemo)((()=>{let e=[...d];return{preview:!!e.find((e=>Cr(e))),trans:!!e.find((e=>!Cr(e)))}}),[d]),h=(0,c.useMemo)((()=>[...d].map((e=>t(e))).some((e=>e&&e.is_child))),[d]),p=(0,c.useMemo)((()=>!f.preview&&[...d].every((e=>{let n=t(e);return n&&n.schedule}))),[f.preview,d,t]);return(0,z.jsx)(ur.Vg,{name:"transactions",keyHandlers:f.trans&&{f:()=>n([...d]),d:()=>o([...d]),a:()=>i("account",[...d]),p:()=>i("payee",[...d]),n:()=>i("notes",[...d]),c:()=>i("category",[...d]),l:()=>i("cleared",[...d])},items:[...f.trans?[{name:"show",text:"Show",key:"F"},{name:"duplicate",text:"Duplicate",disabled:h},{name:"delete",text:"Delete",key:"D"},...p?[{name:"view-schedule",text:"View schedule",disabled:d.size>1},{name:"unlink-schedule",text:"Unlink schedule"}]:[{name:"link-schedule",text:"Link schedule"},{name:"create-rule",text:"Create rule"}],$.v2.line,{type:$.v2.label,name:"Edit field"},{name:"date",text:"Date"},{name:"account",text:"Account",key:"A"},{name:"payee",text:"Payee",key:"P"},{name:"notes",text:"Notes",key:"N"},{name:"category",text:"Category",key:"C"},{name:"amount",text:"Amount"},{name:"cleared",text:"Cleared",key:"L"}]:[{name:"view-schedule",text:"View schedule"},{name:"post-transaction",text:"Post transaction"},{name:"skip",text:"Skip scheduled date"}]],onSelect:e=>{switch(e){case"show":n([...d]);break;case"duplicate":r([...d]);break;case"delete":o([...d]);break;case"post-transaction":case"skip":l(e,d);break;case"view-schedule":let c,f=[...d][0];if(Cr(f)){c=f.split("/")[1]}else{let e=t(f);c=e&&e.schedule}c&&u(`/schedule/edit/${c}`);break;case"link-schedule":u("/schedule/link",{transactionIds:[...d]});break;case"unlink-schedule":a([...d]);break;case"create-rule":s([...d]);break;default:i(e,[...d])}}})}var to=e=>(0,z.jsxs)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:[(0,z.jsx)("path",{d:"M13.584 12a2.643 2.643 0 0 1-.775 1.875l-9.541 9.541a1.768 1.768 0 0 1-2.5-2.5l8.739-8.739a.25.25 0 0 0 0-.354L.768 3.084a1.768 1.768 0 0 1 2.5-2.5l9.541 9.541A2.643 2.643 0 0 1 13.584 12Z",fill:"currentColor"}),(0,z.jsx)("path",{d:"M23.75 12a2.643 2.643 0 0 1-.775 1.875l-9.541 9.541a1.768 1.768 0 0 1-2.5-2.5l8.739-8.739a.25.25 0 0 0 0-.354l-8.739-8.739a1.768 1.768 0 0 1 2.5-2.5l9.541 9.541A2.643 2.643 0 0 1 23.75 12Z",fill:"currentColor"})]}),no=n(666),ro=n(1685),oo=n(5901);var io=function(e){let{binding:t,type:n,formatter:r,style:o,getStyle:i}=e;return(0,z.jsx)(oo.Z,{binding:t,children:e=>{let{name:t,value:a}=e;return(0,z.jsx)(no.Z,{style:["financial"===n&&H.W2.tnum,o,i&&i(a)],"data-testid":t,"data-cellname":t,children:r?r(a):(0,ro.Z)(a,n)})}})},ao=n(1388);function so(e,t){if(!e)throw new Error("SheetValue binding is required");if(n.g.IS_TESTING&&"string"!==typeof e&&!e.name&&(e={...e,name:e.value.toString()}),null==(e="string"===typeof e?{name:e,value:null}:e).name)throw new Error("Binding name is now required");let r=(0,c.useContext)(ao.Z)||"__global",o=function(e){let t=e.indexOf("!");return-1!==t?{sheet:e.slice(0,t),name:e.slice(t+1)}:{sheet:null,name:e}}(e.name);o.sheet&&(r=o.sheet,e={...e,name:o.name});let i=(0,Ft.M)(),[a,s]=(0,c.useState)({name:r+"!"+e.name,value:void 0===e.value?null:e.value,query:e.query}),l=(0,c.useRef)(t),u=(0,c.useRef)(a.value);return(0,c.useLayoutEffect)((()=>{l.current=t,u.current=a.value})),(0,c.useLayoutEffect)((()=>(e.query&&i.createQuery(r,e.name,e.query),i.bind(r,e,null,(e=>{l.current&&l.current(e),e.value!==u.current&&s(e)})))),[r,e.name]),a.value}function lo(e){let{name:t,balance:n}=e;return(0,z.jsxs)($.xv,{style:{marginLeft:15,backgroundColor:H.O9.n9,borderRadius:4,padding:"4px 6px",color:H.O9.n5},children:[t," ",(0,z.jsx)($.xv,{style:{fontWeight:600},children:(0,ro.Z)(n,"financial")})]})}function uo(e){let{selectedItems:t,account:n}=e,r=`selected-balance-${[...t].join("-")}`,o=so({name:r,query:(0,x.ZP)("transactions").filter({id:{$oneof:[...t]},parent_id:{$oneof:[...t]}}).select("id")}),i=new Set((o||[]).map((e=>e.id))),a=[...t].filter((e=>!i.has(e))),s=so({name:r+"-sum",query:(0,x.ZP)("transactions").filter({id:{$oneof:a}}).options({splits:"all"}).calculate({$sum:"$amount"})}),l=null,u=(0,un.oF)(),c=u?u.schedules:[],d=[...t].filter((e=>Cr(e))).map((e=>e.slice(8)));for(let f of c)d.includes(f.id)&&(n&&n.id!==f._account?l-=f._amount:l+=f._amount);if(null==s){if(null==l)return null;s=l}else null!=l&&(s+=l);return(0,z.jsx)(lo,{name:"Selected balance:",balance:s})}function co(e){let{balanceQuery:t}=e,n=so({name:t.name+"-cleared",query:t.query.filter({cleared:!0})}),r=so({name:t.name+"-uncleared",query:t.query.filter({cleared:!1})});return(0,z.jsxs)($.G7,{style:{flexDirection:"row"},children:[(0,z.jsx)(lo,{name:"Cleared total:",balance:n}),(0,z.jsx)(lo,{name:"Uncleared total:",balance:r})]})}function fo(e){let{balanceQuery:t,showExtraBalances:n,onToggleExtraBalances:r,account:o}=e,i=(0,Wn.D9)();return(0,z.jsxs)($.G7,{style:{flexDirection:"row",alignItems:"center",marginTop:-5,marginLeft:-5},children:[(0,z.jsxs)($.zx,{"data-testid":"account-balance",bare:!0,onClick:r,style:{"& svg":{opacity:i.size>0||n?1:0},"&:hover svg":{opacity:1}},children:[(0,z.jsx)(io,{binding:{...t,value:0},type:"financial",style:{fontSize:22,fontWeight:400},getStyle:e=>({color:e<0?H.O9.r5:e>0?H.O9.g5:H.O9.n8})}),(0,z.jsx)(to,{style:{width:10,height:10,marginLeft:10,color:H.O9.n5,transform:n?"rotateZ(180deg)":"rotateZ(0)"}})]}),n&&(0,z.jsx)(co,{balanceQuery:t}),i.size>0&&(0,z.jsx)(uo,{selectedItems:i,account:o})]})}var ho=n(6854);function po(e){let{balanceQuery:t,targetBalance:n,onDone:r,onCreateTransaction:o}=e,i=so({name:t.name+"-cleared",value:0,query:t.query.filter({cleared:!0})}),a=n-i;return(0,z.jsx)($.G7,{style:{flexDirection:"row",alignSelf:"center",backgroundColor:"white",...H.W2.shadow,borderRadius:4,marginTop:5,marginBottom:15,padding:10},children:(0,z.jsxs)($.G7,{style:{flexDirection:"row",alignItems:"center"},children:[0===a?(0,z.jsxs)($.G7,{style:{color:H.O9.g4,flex:1,flexDirection:"row",alignItems:"center",justifyContent:"center"},children:[(0,z.jsx)(ho.Z,{style:{width:13,height:13,color:H.O9.g5,marginRight:3}}),"All reconciled!"]}):(0,z.jsx)($.G7,{style:{color:H.O9.n3},children:(0,z.jsxs)($.xv,{style:{fontStyle:"italic",textAlign:"center"},children:["Your cleared balance"," ",(0,z.jsx)("strong",{children:(0,ro.Z)(i,"financial")})," needs"," ",(0,z.jsx)("strong",{children:(a>0?"+":"")+(0,ro.Z)(a,"financial")})," ","to match",(0,z.jsx)("br",{})," your bank\u2019s balance of"," ",(0,z.jsx)($.xv,{style:{fontWeight:700},children:(0,ro.Z)(n,"financial")})]})}),(0,z.jsx)($.G7,{style:{marginLeft:15},children:(0,z.jsx)($.zx,{primary:!0,onClick:r,children:"Done Reconciling"})}),0!==a&&(0,z.jsx)($.G7,{style:{marginLeft:15},children:(0,z.jsx)($.zx,{onClick:()=>o(a),children:"Create Reconciliation Transaction"})})]})})}function go(e){let{account:t,onReconcile:n,onClose:r}=e,o=so(yn(t));return(0,z.jsx)($.u,{position:"bottom-right",width:275,onClose:r,children:(0,z.jsxs)($.G7,{style:{padding:"5px 8px"},children:[(0,z.jsx)($.xv,{children:"Enter the current balance of your bank account that you want to reconcile with:"}),(0,z.jsxs)("form",{onSubmit:function(e){e.preventDefault();let t=e.target.elements[0],i=(0,I.qT)(t.value);null!=i?(n(null==i?o:i),r()):t.select()},children:[null!=o&&(0,z.jsx)($.$Y,{children:(0,z.jsx)($.II,{defaultValue:(0,ro.Z)(o,"financial"),style:{margin:"7px 0"}})}),(0,z.jsx)($.zx,{primary:!0,children:"Reconcile"})]})]})})}function mo(e){let{tableRef:t,editingName:n,isNameEditable:r,workingHard:o,accountName:i,account:a,filterId:s,filtersList:l,accountsSyncing:u,accounts:d,transactions:f,showBalances:h,showExtraBalances:p,showCleared:g,showEmptyMessage:m,balanceQuery:y,reconcileAmount:v,canCalculateBalance:x,search:b,filters:w,conditionsOp:S,savePrefs:C,onSearch:j,onAddTransaction:k,onShowTransactions:E,onDoneReconciling:T,onCreateReconciliationTransaction:O,onToggleExtraBalances:I,onSaveName:D,onExposeName:A,onSync:_,onImport:P,onMenuSelect:M,onReconcile:R,onBatchDelete:N,onBatchDuplicate:L,onBatchEdit:F,onBatchUnlink:W,onCreateRule:B,onApplyFilter:G,onUpdateFilter:Z,onClearFilters:U,onReloadSavedFilter:V,onCondOpChange:q,onDeleteFilter:Y,onScheduleAction:Q}=e,[X,J]=(0,c.useState)(!1),ee=(0,c.useRef)(null),te=hr(),ne=a&&a.account_id;return a||(ne=!!d.find((e=>!!e.account_id))),(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)($r.U,{keys:{"ctrl+f, cmd+f":()=>{ee.current&&ee.current.focus()}}}),(0,z.jsxs)($.G7,{style:[H.W2.pageContent,{paddingBottom:10,flexShrink:0}],children:[(0,z.jsx)($.G7,{style:{marginTop:2,alignItems:"flex-start"},children:(0,z.jsx)($.G7,{children:n?(0,z.jsx)($.$Y,{children:(0,z.jsx)($.II,{defaultValue:i,onEnter:e=>D(e.target.value),onBlur:()=>A(!1),style:{fontSize:25,fontWeight:500,marginTop:-5,marginBottom:-2,marginLeft:-5}})}):r?(0,z.jsxs)($.G7,{style:{flexDirection:"row",alignItems:"center",gap:3,"& .hover-visible":{opacity:0,transition:"opacity .25s"},"&:hover .hover-visible":{opacity:1}},children:[(0,z.jsx)($.G7,{style:{fontSize:25,fontWeight:500,marginRight:5,marginBottom:5},"data-testid":"account-name",children:a&&a.closed?"Closed: "+i:i}),a&&(0,z.jsx)(Jr,{id:`account-${a.id}`}),(0,z.jsx)($.zx,{bare:!0,className:"hover-visible",onClick:()=>A(!0),children:(0,z.jsx)(zr,{style:{width:11,height:11,color:H.O9.n8}})})]}):(0,z.jsx)($.G7,{style:{fontSize:25,fontWeight:500,marginBottom:5},"data-testid":"account-name",children:a&&a.closed?"Closed: "+i:i})})}),(0,z.jsx)(fo,{balanceQuery:y,showExtraBalances:p,onToggleExtraBalances:I,account:a}),(0,z.jsxs)($.Kq,{spacing:2,direction:"row",align:"center",style:{marginTop:12},children:[(a&&!a.closed||ne)&&(0,z.jsx)($.zx,{bare:!0,onClick:ne?_:P,children:ne?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(Kr,{width:13,height:13,animating:a&&u===a.name||"__all"===u,style:{color:"currentColor",marginRight:4}})," ","Sync"]}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(Br,{width:13,height:13,style:{color:"currentColor",marginRight:4}})," ","Import"]})}),!m&&(0,z.jsxs)($.zx,{bare:!0,onClick:k,children:[(0,z.jsx)(Lr.Z,{width:10,height:10,style:{color:"inherit",marginRight:3}})," ","Add New"]}),(0,z.jsx)($.G7,{children:(0,z.jsx)(Vr.L,{onApply:G})}),(0,z.jsx)($.F5,{leftContent:(0,z.jsx)(Zr,{style:{width:13,height:13,flexShrink:0,color:b?H.O9.p7:"inherit",margin:5,marginRight:0}}),rightContent:b&&(0,z.jsx)($.zx,{bare:!0,style:{padding:8},onClick:()=>j(""),title:"Clear search term",children:(0,z.jsx)(Gr.Z,{style:{width:8,height:8,color:"inherit"}})}),inputRef:ee,value:b,placeholder:"Search",onKeyDown:e=>{"Escape"===e.key&&j("")},getStyle:e=>[{backgroundColor:"transparent",borderWidth:0,boxShadow:"none",transition:"color .15s","& input::placeholder":{color:H.O9.n1,transition:"color .25s"}},e&&{boxShadow:"0 0 0 2px "+H.O9.b5},!e&&""!==b&&{color:H.O9.p4}],onChange:e=>j(e.target.value)}),o?(0,z.jsx)($.G7,{children:(0,z.jsx)(K.Z,{color:H.O9.n1,style:{width:16,height:16}})}):(0,z.jsx)(eo,{getTransaction:e=>f.find((t=>t.id===e)),onShow:E,onDuplicate:L,onDelete:N,onEdit:F,onUnlink:W,onCreateRule:B,onScheduleAction:Q}),(0,z.jsx)($.zx,{bare:!0,disabled:""!==b||w.length>0,style:{padding:6},onClick:function(){t.current&&(te.dispatch({type:"switch-mode",id:t.current.getScrolledItem()}),C({"expand-splits":!("expand"===te.state.mode)}))},title:"collapse"===te.state.mode?"Collapse split transactions":"Expand split transactions",children:"collapse"===te.state.mode?(0,z.jsx)(Wr,{style:{width:14,height:14,color:"inherit"}}):(0,z.jsx)(Fr,{style:{width:14,height:14,color:"inherit"}})}),a?(0,z.jsxs)($.G7,{children:[(0,z.jsx)($.j2,{onClick:()=>J(!0)}),X&&(0,z.jsx)(yo,{account:a,canSync:ne,canShowBalances:x(),showBalances:h,showCleared:g,onMenuSelect:e=>{J(!1),M(e)},onReconcile:R,onClose:()=>J(!1)})]}):(0,z.jsxs)($.G7,{children:[(0,z.jsx)($.j2,{onClick:()=>J(!0)}),X&&(0,z.jsx)(vo,{onMenuSelect:e=>{J(!1),M(e)},onClose:()=>J(!1)})]})]}),w&&w.length>0&&(0,z.jsx)(qr.O,{filters:w,conditionsOp:S,onUpdateFilter:Z,onDeleteFilter:Y,onClearFilters:U,onReloadSavedFilter:V,filterId:s,filtersList:l,onCondOpChange:q})]}),null!=v&&(0,z.jsx)(po,{targetBalance:v,balanceQuery:y,onDone:T,onCreateTransaction:O})]})}function yo(e){let{account:t,canSync:n,showBalances:r,canShowBalances:o,showCleared:i,onClose:a,onReconcile:s,onMenuSelect:l}=e,[u,d]=(0,c.useState)("default");const f=Nr();return"reconcile"===u?(0,z.jsx)(go,{account:t,onClose:a,onReconcile:s}):(0,z.jsx)($.zR,{width:200,onClose:a,children:(0,z.jsx)($.v2,{onMenuSelect:e=>{"reconcile"===e?d("reconcile"):l(e)},items:[o&&{name:"toggle-balance",text:(r?"Hide":"Show")+" Running Balance"},{name:"toggle-cleared",text:(i?"Hide":"Show")+" \u201cCleared\u201d Checkboxes"},{name:"export",text:"Export"},{name:"reconcile",text:"Reconcile"},t&&!t.closed&&(n?{name:"unlink",text:"Unlink Account"}:"online"===f&&{name:"link",text:"Link Account"}),t.closed?{name:"reopen",text:"Reopen Account"}:{name:"close",text:"Close Account"}].filter((e=>e))})})}function vo(e){let{onClose:t,onMenuSelect:n}=e;return(0,z.jsx)($.zR,{width:200,onClose:t,children:(0,z.jsx)($.v2,{onMenuSelect:e=>{n(e)},items:[{name:"export",text:"Export"}]})})}function xo(e){let{onAdd:t}=e;return(0,z.jsx)($.G7,{style:{backgroundColor:"white",flex:1,alignItems:"center",borderTopWidth:1,borderColor:H.O9.n9},children:(0,z.jsxs)($.G7,{style:{width:550,marginTop:75,fontSize:15,alignItems:"center"},children:[(0,z.jsxs)($.xv,{style:{textAlign:"center",lineHeight:"1.4em"},children:["For Actual to be useful, you need to ",(0,z.jsx)("strong",{children:"add an account"}),". You can link an account to automatically download transactions, or manage it locally yourself."]}),(0,z.jsx)($.zx,{primary:!0,style:{marginTop:20},onClick:t,children:"Add account"}),(0,z.jsx)($.G7,{style:{marginTop:20,fontSize:13,color:H.O9.n5},children:"In the future, you can add accounts from the sidebar."})]})})}function bo(e){let{account:t={},transactions:n,filtered:r,children:o}=e;const{id:i}=t;let a=(0,un.oF)(),s=(0,c.useMemo)((()=>a?a.schedules.filter((e=>!e.completed&&["due","upcoming","missed"].includes(a.statuses.get(e.id)))):[]),[a]),l=(0,c.useMemo)((()=>s.map((e=>({id:"preview/"+e.id,payee:e._payee,account:e._account,amount:e._amount,date:e.next_date,notes:a.statuses.get(e.id),schedule:e.id,_inverse:i!==e._account})))),[s,i]),u=(0,c.useMemo)((()=>!r&&l.length>0?l.concat(n):n),[r,l,n]);return o(null==a?null:u)}class wo extends c.PureComponent{constructor(e){super(e),this.fetchAllIds=async()=>{let{data:e}=await(0,x.Vn)(this.paged.getQuery().select("id"));return e.reduce(((e,t)=>(e.push(t.id),t.subtransactions.forEach((t=>e.push(t.id))),e)),[])},this.refetchTransactions=async()=>{this.paged&&this.paged.run()},this.fetchTransactions=()=>{let e=this.makeRootQuery();this.rootQuery=this.currentQuery=e,this.updateQuery(e),this.props.accountId&&this.props.markAccountRead(this.props.accountId)},this.makeRootQuery=()=>{let e=this.props.location.state,t=this.props.accountId;return e&&e.filter?(0,x.ZP)("transactions").options({splits:"grouped"}).filter({"account.offbudget":!1,...e.filter}):gn(t)},this.onSearch=e=>{this.paged.unsubscribe(),this.setState({search:e},this.onSearchDone)},this.onSearchDone=(0,an.debounce)((()=>{""===this.state.search?this.updateQuery(this.currentQuery,this.state.filters.length>0):this.updateQuery(mn(this.currentQuery,this.state.search,this.props.dateFormat),!0)}),150),this.onSync=async()=>{const e=this.props.accountId,t=this.props.accounts.find((t=>t.id===e));await this.props.syncAndDownload(t?t.id:null)},this.onImport=async()=>{const e=this.props.accountId;if(this.props.accounts.find((t=>t.id===e))){const t=await window.Actual.openFileDialog({filters:[{name:"Financial Files",extensions:["qif","ofx","qfx","csv"]}]});t&&this.props.pushModal("import-transactions",{accountId:e,filename:t[0],onImported:e=>{e&&this.fetchTransactions()}})}},this.onExport=async e=>{let t=await(0,N.lW)("transactions-export-query",{query:this.currentQuery.serialize()}),n=`${e&&e.replace(/[()]/g,"").replace(/\s+/g,"-")||"transactions"}.csv`;window.Actual.saveFile(t,n,"Export Transactions")},this.onTransactionsChange=(e,t)=>{this.paged.optimisticUpdate((t=>e._deleted?t.filter((t=>t.id!==e.id)):t.map((t=>t.id===e.id?e:t))),(e=>t)),this.props.updateNewTransactions(e.id)},this.canCalculateBalance=()=>{let e=this.props.accountId;return this.props.accounts.find((t=>t.id===e))&&""===this.state.search&&0===this.state.filters.length},this.onAddTransaction=()=>{this.setState({isAdding:!0})},this.onExposeName=e=>{this.setState({editingName:e})},this.onSaveName=e=>{if(e.trim().length){const t=this.props.accountId,n=this.props.accounts.find((e=>e.id===t));this.props.updateAccount({...n,name:e}),this.setState({editingName:!1})}},this.onToggleExtraBalances=()=>{let{accountId:e,showExtraBalances:t}=this.props,n="show-extra-balances-"+e||0;this.props.savePrefs({[n]:!t})},this.onMenuSelect=async e=>{const t=this.props.accountId,n=this.props.accounts.find((e=>e.id===t));switch(e){case"link":Bn(this.props.pushModal,{upgradingAccountId:t});break;case"unlink":this.props.unlinkAccount(t);break;case"close":this.props.openAccountCloseModal(t);break;case"reopen":this.props.reopenAccount(t);break;case"export":const e=this.getAccountTitle(n,t);this.onExport(e);break;case"toggle-balance":this.state.showBalances?(this.props.savePrefs({["show-balances-"+t]:!1}),this.setState({showBalances:!1,balances:[]})):(this.props.savePrefs({["show-balances-"+t]:!0}),this.setState({showBalances:!0}),this.calculateBalances());break;case"toggle-cleared":this.state.showCleared?(this.props.savePrefs({["hide-cleared-"+t]:!0}),this.setState({showCleared:!1})):(this.props.savePrefs({["hide-cleared-"+t]:!1}),this.setState({showCleared:!0}))}},this.isNew=e=>this.props.newTransactions.includes(e),this.isMatched=e=>this.props.matchedTransactions.includes(e),this.onCreatePayee=e=>""!==e.trim()?this.props.createPayee(e):null,this.onReconcile=e=>{this.setState({reconcileAmount:e})},this.onDoneReconciling=()=>{this.setState({reconcileAmount:null})},this.onCreateReconciliationTransaction=async e=>{const t=Fn([{id:"temp",account:this.props.accountId,cleared:!0,amount:e,date:(0,fn.PR)(),notes:"Reconciliation balance adjustment"}]);this.setState({transactions:[...this.state.transactions,...t]}),await(0,N.lW)("transactions-batch-update",{added:t}),await this.refetchTransactions()},this.onShowTransactions=async e=>{this.onApplyFilter({customName:"Selected transactions",filter:{id:{$oneof:e}}})},this.onBatchEdit=async(e,t)=>{let n=async(e,n)=>{this.setState({workingHard:!0});let{data:r}=await(0,x.Vn)((0,x.ZP)("transactions").filter({id:{$oneof:t}}).select("*").options({splits:"grouped"})),o=Dn(r),i={deleted:[],updated:[]};"cleared"===e&&(n=!!o.find((e=>!e.cleared)));const a=new Set(t);o.forEach((t=>{if(!a.has(t.id))return;let{diff:r}=Rn(o,{...t,[e]:n});o=(0,I.zb)(r,o),i.deleted=i.deleted?i.deleted.concat(r.deleted):r.deleted,i.updated=i.updated?i.updated.concat(r.updated):r.updated,i.added=i.added?i.added.concat(r.added):r.added})),await(0,N.lW)("transactions-batch-update",i),await this.refetchTransactions(),this.table.current&&this.table.current.edit(o[0].id,"select",!1)};"cleared"===e?n("cleared",null):this.props.pushModal("edit-field",{name:e,onSubmit:n})},this.onBatchDuplicate=async e=>{this.setState({workingHard:!0});let{data:t}=await(0,x.Vn)((0,x.ZP)("transactions").filter({id:{$oneof:e}}).select("*").options({splits:"grouped"})),n={added:t.reduce(((e,t)=>e.concat(Fn(_n(t)))),[]).map((e=>{let{sort_order:t,...n}=e;return{...n}}))};await(0,N.lW)("transactions-batch-update",n),await this.refetchTransactions()},this.onBatchDelete=async e=>{this.setState({workingHard:!0});let{data:t}=await(0,x.Vn)((0,x.ZP)("transactions").filter({id:{$oneof:e}}).select("*").options({splits:"grouped"})),n=Dn(t),r=new Set(e),o={deleted:[],updated:[]};n.forEach((e=>{let t=e.parent_id;if(!r.has(e.id)||t&&r.has(t))return;let{diff:i}=Nn(n,e.id);n=(0,I.zb)(i,n),o.deleted=i.deleted?o.deleted.concat(i.deleted):i.deleted,o.updated=i.updated?o.updated.concat(i.updated):i.updated})),await(0,N.lW)("transactions-batch-update",o),await this.refetchTransactions()},this.onBatchUnlink=async e=>{await(0,N.lW)("transactions-batch-update",{updated:e.map((e=>({id:e,schedule:null})))}),await this.refetchTransactions()},this.onCreateRule=async e=>{let{data:t}=await(0,x.Vn)((0,x.ZP)("transactions").filter({id:{$oneof:e}}).select("*").options({splits:"grouped"})),n=Dn(t),r={stage:null,conditionsOp:"and",conditions:[n[0].imported_payee?{field:"imported_payee",op:"is",value:n[0].imported_payee,type:"string"}:{field:"payee",op:"is",value:n[0].payee,type:"id"}],actions:[{op:"set",field:"category",value:n[0].category,type:"id"}]};this.props.pushModal("edit-rule",{rule:r})},this.onCondOpChange=(e,t)=>{this.setState({conditionsOp:e}),this.setState({filterId:{...this.state.filterId,status:"changed"}}),this.applyFilters([...t])},this.onReloadSavedFilter=(e,t)=>{if("reload"===t){let[e]=this.props.filtersList.filter((e=>e.id===this.state.filterId.id));this.setState({conditionsOp:e.conditionsOp}),this.applyFilters([...e.conditions])}else e.status&&this.setState({conditionsOp:e.conditionsOp})&&this.applyFilters([...e.conditions]);this.setState({filterId:{...this.state.filterId,...e}})},this.onClearFilters=()=>{this.setState({conditionsOp:"and"}),this.setState({filterId:[]}),this.applyFilters([])},this.onUpdateFilter=(e,t)=>{this.applyFilters(this.state.filters.map((n=>n===e?t:n))),this.setState({filterId:{...this.state.filterId,status:this.state.filterId&&"changed"}})},this.onDeleteFilter=e=>{this.applyFilters(this.state.filters.filter((t=>t!==e))),1===this.state.filters.length?this.setState({filterId:[]})&&this.setState({conditionsOp:"and"}):this.setState({filterId:{...this.state.filterId,status:this.state.filterId&&"changed"}})},this.onApplyFilter=async e=>{let t=this.state.filters;e.customName&&(t=t.filter((t=>t.customName!==e.customName))),e.conditions?(this.setState({filterId:{...e,status:"saved"}}),this.setState({conditionsOp:e.conditionsOp}),this.applyFilters([...e.conditions])):(this.setState({filterId:{...this.state.filterId,status:this.state.filterId&&"changed"}}),this.applyFilters([...t,e]))},this.onScheduleAction=async(e,t)=>{switch(e){case"post-transaction":for(let e of t){let t=e.split("/");await(0,N.lW)("schedule/post-transaction",{id:t[1]})}this.refetchTransactions();break;case"skip":for(let e of t){let t=e.split("/");await(0,N.lW)("schedule/skip-next-date",{id:t[1]})}}},this.applyFilters=async e=>{if(e.length>0){let t=e.filter((e=>!!e.customName)).map((e=>e.filter)),{filters:n}=await(0,N.lW)("make-filters-from-conditions",{conditions:e.filter((e=>!e.customName))});const r="or"===this.state.conditionsOp?"$or":"$and";this.currentQuery=this.rootQuery.filter({[r]:[...n,...t]}),this.updateQuery(this.currentQuery,!0),this.setState({filters:e,search:""})}else this.setState({transactions:[],transactionCount:0}),this.fetchTransactions(),this.setState({filters:e,search:""})},this.paged=null,this.table=(0,c.createRef)(),this.animated=!0,this.state={search:"",filters:[],loading:!0,workingHard:!1,reconcileAmount:null,transactions:[],transactionsCount:0,showBalances:e.showBalances,balances:[],showCleared:e.showCleared,editingName:!1,isAdding:!1,latestDate:null,filterId:[],conditionsOp:"and"}}async componentDidMount(){let e=e=>{if(e.includes("transactions")||e.includes("category_mapping")||e.includes("payee_mapping"))return this.refetchTransactions()},t=async t=>{let n,{tables:r,messages:o,undoTag:i}=t;if(await e(r),o.every((e=>"transactions"===e.dataset))&&!o.find((e=>"tombstone"===e.column))){let e=o.filter((e=>"transactions"===e.dataset&&!("tombstone"===e.column)));n=1===e.length?e[0].row:null}this.table.current&&(this.table.current.edit(null),n&&this.table.current.scrollTo(n)),this.props.setLastUndoState(null)},n=[(0,N.oL)("undo-event",t)];this.unlisten=()=>{n.forEach((e=>e()))},0===this.props.categoryGroups.length&&await this.props.getCategories(),await this.props.initiallyLoadPayees(),await this.fetchTransactions(),this.props.lastUndoState&&this.props.lastUndoState.current&&t(this.props.lastUndoState.current)}componentDidUpdate(e){this.state.isAdding&&this.props.accountId!==e.accountId&&this.setState({isAdding:!1}),e.modalShowing&&!this.props.modalShowing&&setTimeout((()=>{this.refetchTransactions()}),100)}componentWillUnmount(){this.unlisten&&this.unlisten(),this.paged&&this.paged.unsubscribe()}updateQuery(e,t){this.paged&&this.paged.unsubscribe(),this.paged=(0,x.Fr)(e.select("*"),(async(e,n)=>{const r=null==n;r&&(this.table.current&&this.table.current.setRowAnimation(!1),t?this.props.splitsExpandedDispatch({type:"set-mode",mode:"collapse"}):this.props.splitsExpandedDispatch({type:"set-mode",mode:this.props.expandSplits?"expand":"collapse"})),this.setState({transactions:e,transactionCount:this.paged.getTotalCount(),transactionsFiltered:t,loading:!1,workingHard:!1},(()=>{this.state.showBalances&&this.calculateBalances(),r&&this.table.current&&this.table.current.scrollToTop(),setTimeout((()=>{this.table.current&&this.table.current.setRowAnimation(!0)}),0)}))}),{pageCount:150,onlySync:!0,mapper:Dn})}componentWillReceiveProps(e){this.props.accountId!==e.accountId&&this.setState({editingName:!1,loading:!0,search:"",showBalances:e.showBalances,balances:[],showCleared:e.showCleared},(()=>{this.fetchTransactions()}))}async calculateBalances(){if(!this.canCalculateBalance())return;let{data:e}=await(0,x.Vn)(this.paged.getQuery().options({splits:"none"}).select([{balance:{$sumOver:"$amount"}}]));this.setState({balances:(0,I.ZZ)(e)})}getAccountTitle(e,t){let{filterName:n}=this.props.location.state||{};return n||(e?e.name:"budgeted"===t?"Budgeted Accounts":"offbudget"===t?"Off Budget Accounts":"uncategorized"===t?"Uncategorized":t?null:"All Accounts")}getBalanceQuery(e,t){return{name:`balance-query-${t}`,query:this.makeRootQuery().calculate({$sum:"$amount"})}}render(){let{accounts:e,categoryGroups:t,payees:n,dateFormat:r,hideFraction:o,addNotification:i,accountsSyncing:a,replaceModal:s,showExtraBalances:l,accountId:u,categoryId:c}=this.props,{transactions:d,loading:f,workingHard:h,filterId:p,reconcileAmount:g,transactionsFiltered:m,editingName:y,showBalances:v,balances:x,showCleared:b}=this.state,w=e.find((e=>e.id===u));const S=this.getAccountTitle(w,u);if(!S&&!f)return(0,z.jsx)(Pt.Fg,{to:"/accounts",replace:!0});let C=t.flatMap((e=>e.categories)).find((e=>e.id===c)),j=!f&&!u&&0===e.length,k=u&&"budgeted"!==u&&"offbudget"!==u&&"uncategorized"!==u,E=this.getBalanceQuery(w,u);return(0,z.jsx)(bo,{account:w,transactions:d,filtered:m,children:c=>null==c?null:(0,z.jsx)(Wn.mL,{name:"transactions",items:c,fetchAllIds:this.fetchAllIds,registerDispatch:e=>this.dispatchSelected=e,children:(0,z.jsxs)($.G7,{style:[H.W2.page],children:[(0,z.jsx)(mo,{tableRef:this.table,editingName:y,isNameEditable:k,workingHard:h,account:w,filterId:p,filtersList:this.props.filtersList,location:this.props.location,accountName:S,accountsSyncing:a,accounts:e,transactions:d,showBalances:v,showExtraBalances:l,showCleared:b,showEmptyMessage:j,balanceQuery:E,canCalculateBalance:this.canCalculateBalance,reconcileAmount:g,search:this.state.search,filters:this.state.filters,conditionsOp:this.state.conditionsOp,savePrefs:this.props.savePrefs,onSearch:this.onSearch,onShowTransactions:this.onShowTransactions,onMenuSelect:this.onMenuSelect,onAddTransaction:this.onAddTransaction,onToggleExtraBalances:this.onToggleExtraBalances,onSaveName:this.onSaveName,onExposeName:this.onExposeName,onReconcile:this.onReconcile,onDoneReconciling:this.onDoneReconciling,onCreateReconciliationTransaction:this.onCreateReconciliationTransaction,onSync:this.onSync,onImport:this.onImport,onBatchDelete:this.onBatchDelete,onBatchDuplicate:this.onBatchDuplicate,onBatchEdit:this.onBatchEdit,onBatchUnlink:this.onBatchUnlink,onCreateRule:this.onCreateRule,onUpdateFilter:this.onUpdateFilter,onClearFilters:this.onClearFilters,onReloadSavedFilter:this.onReloadSavedFilter,onCondOpChange:this.onCondOpChange,onDeleteFilter:this.onDeleteFilter,onApplyFilter:this.onApplyFilter,onScheduleAction:this.onScheduleAction}),(0,z.jsx)($.G7,{style:{flex:1},children:(0,z.jsx)(Ir,{tableRef:this.table,account:w,transactions:d,allTransactions:c,animated:this.animated,loadMoreTransactions:()=>this.paged&&this.paged.fetchNext(),accounts:e,category:C,categoryGroups:t,payees:n,balances:v&&this.canCalculateBalance()?x:null,showCleared:b,showAccount:!u||"offbudget"===u||"budgeted"===u||"uncategorized"===u,isAdding:this.state.isAdding,isNew:this.isNew,isMatched:this.isMatched,isFiltered:""!==this.state.search||this.state.filters.length>0,dateFormat:r,hideFraction:o,addNotification:i,renderEmpty:()=>j?(0,z.jsx)(xo,{onAdd:()=>s("add-account")}):f?null:(0,z.jsx)($.G7,{style:{marginTop:20,textAlign:"center",fontStyle:"italic"},children:"No transactions"}),onChange:this.onTransactionsChange,onRefetch:this.refetchTransactions,onRefetchUpToRow:e=>this.paged.refetchUpToRow(e,{field:"date",order:"desc"}),onCloseAddTransaction:()=>this.setState({isAdding:!1}),onCreatePayee:this.onCreatePayee})})]})})})}}function So(e){let{dispatch:t}=hr(),n=(0,Pt.bS)(e.location.pathname);return(0,z.jsx)(wo,{...e,match:n,splitsExpandedDispatch:t})}function Co(){var e,t;let n=(0,Pt.UO)(),r=(0,Pt.TH)(),o=(0,c.useContext)(Zt),i=(0,d.v9)((e=>({newTransactions:e.queries.newTransactions,matchedTransactions:e.queries.matchedTransactions,accounts:e.queries.accounts,failedAccounts:e.account.failedAccounts,categoryGroups:e.queries.categories.grouped,dateFormat:e.prefs.local.dateFormat||"MM/dd/yyyy",hideFraction:e.prefs.local.hideFraction||!1,expandSplits:e.prefs.local["expand-splits"],showBalances:n.id&&e.prefs.local["show-balances-"+n.id],showCleared:n.id&&!e.prefs.local["hide-cleared-"+n.id],showExtraBalances:e.prefs.local["show-extra-balances-"+n.id||0],payees:e.queries.payees,modalShowing:e.modals.modalStack.length>0,accountsSyncing:e.account.accountsSyncing,lastUndoState:e.app.lastUndoState}))),a=(0,d.I0)(),s=(0,ln.m)(),l=(0,c.useMemo)((()=>(0,h.DE)(y,a)),[a]),u=(0,c.useMemo)((()=>{let e=pn(n.id,"_account"),t=pn(n.id,"_payee.transfer_acct");return(r.state&&r.state.filter||"uncategorized"===n.id)&&(e={id:null},t={id:null}),n=>(n=n.filter({$and:[{"_account.closed":!1}],$or:[e,t]})).orderBy({next_date:"desc"})}),[n.id]);return(0,z.jsx)(un.up,{transform:u,children:(0,z.jsx)(pr,{initialMode:i.expandSplits?"collapse":"expand",children:(0,z.jsx)(So,{...i,...l,modalShowing:i.modalShowing||!(!o.state||!o.state.parent),accountId:n.id,categoryId:null===o||void 0===o||null===(e=o.state)||void 0===e||null===(t=e.filter)||void 0===t?void 0:t.category,location:r,filtersList:s})})})}var jo=n(1678);const ko=e=>t=>{class n extends c.Component{componentDidMount(){Eo(e)}componentDidUpdate(){Eo(e)}render(){return(0,z.jsx)(t,{...this.props})}}return n};function Eo(e){[...document.getElementsByTagName("meta")].find((e=>"theme-color"===e.name)).setAttribute("content",e)}function To(e){let{onSync:t,children:n}=e,[r,o]=(0,c.useState)(!1);return n({refreshing:r,onRefresh:async function(){o(!0),await t(),o(!1)}})}var Oo=e=>(0,z.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"#242134",...e.style},children:(0,z.jsx)("path",{d:"M7.05 9.293 6.343 10 12 15.657l1.414-1.414L9.172 10l4.242-4.243L12 4.343z",fill:"currentColor"})}),Io=n(7876),Do=n(7346);function Ao(e){let{id:t,label:n,"aria-labelledby":r,"aria-label":o,labelElementType:i="label"}=e;t=(0,W.Me)(t);let a=(0,W.Me)(),s={};return n?(r=r?`${r} ${a}`:a,s={id:a,htmlFor:"label"===i?t:void 0}):r||o||console.warn("If you do not provide a visible label, you must specify an aria-label or aria-labelledby attribute for accessibility"),{labelProps:s,fieldProps:(0,W.bE)({id:t,"aria-label":o,"aria-labelledby":r})}}var _o=n(8879);const Po=new Set(["Arab","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),Mo=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function Ro(e){if(Intl.Locale){let t=new Intl.Locale(e).maximize().script;return Po.has(t)}let t=e.split("-")[0];return Mo.has(t)}function No(){let e="undefined"!==typeof navigator&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch(t){e="en-US"}return{locale:e,direction:Ro(e)?"rtl":"ltr"}}let Lo=No(),Fo=new Set;function Wo(){Lo=No();for(let e of Fo)e(Lo)}function Bo(){let e=(0,_o.Av)(),[t,n]=(0,c.useState)(Lo);return(0,c.useEffect)((()=>(0===Fo.size&&window.addEventListener("languagechange",Wo),Fo.add(n),()=>{Fo.delete(n),0===Fo.size&&window.removeEventListener("languagechange",Wo)})),[]),e?{locale:"en-US",direction:"ltr"}:t}const zo=c.createContext(null);function Go(){let e=Bo();return(0,c.useContext)(zo)||e}new WeakMap;let Zo=new Map;function Uo(e){let{locale:t}=Go(),n=t+(e?Object.entries(e).sort(((e,t)=>e[0]<t[0]?-1:1)).join():"");if(Zo.has(n))return Zo.get(n);let r=new Intl.Collator(t,e);return Zo.set(n,r),r}function Ho(e){return(0,W.ad)()?e.altKey:e.ctrlKey}function Ko(e){return(0,W.V5)()?e.metaKey:e.ctrlKey}const Vo=1e3;function qo(e){let{keyboardDelegate:t,selectionManager:n,onTypeSelect:r}=e,o=(0,c.useRef)({search:"",timeout:null}).current;return{typeSelectProps:{onKeyDownCapture:t.getKeyForSearch?e=>{let i=function(e){return 1!==e.length&&/^[A-Z]/i.test(e)?"":e}(e.key);if(!i||e.ctrlKey||e.metaKey)return;" "===i&&o.search.trim().length>0&&(e.preventDefault(),"continuePropagation"in e||e.stopPropagation()),o.search+=i;let a=t.getKeyForSearch(o.search,n.focusedKey);null==a&&(a=t.getKeyForSearch(o.search)),null!=a&&(n.setFocusedKey(a),r&&r(a)),clearTimeout(o.timeout),o.timeout=setTimeout((()=>{o.search=""}),Vo)}:null}}}function $o(e){let{selectionManager:t,keyboardDelegate:n,ref:r,autoFocus:o=!1,shouldFocusWrap:i=!1,disallowEmptySelection:a=!1,disallowSelectAll:s=!1,selectOnFocus:l="replace"===t.selectionBehavior,disallowTypeAhead:u=!1,shouldUseVirtualFocus:d,allowsTabNavigation:f=!1,isVirtualized:h,scrollRef:p=r}=e,{direction:g}=Go(),m=(0,c.useRef)({top:0,left:0});(0,W.zX)(p,"scroll",h?null:()=>{m.current={top:p.current.scrollTop,left:p.current.scrollLeft}});const y=(0,c.useRef)(o);(0,c.useEffect)((()=>{if(y.current){let e=null;"first"===o&&(e=n.getFirstKey()),"last"===o&&(e=n.getLastKey());let i=t.selectedKeys;i.size&&(e=i.values().next().value),t.setFocused(!0),t.setFocusedKey(e),null!=e||d||(0,Io.ex)(r.current)}y.current=!1}),[]),(0,c.useEffect)((()=>{let e=(0,Do.Jz)();if(!h&&t.isFocused&&null!=t.focusedKey&&(null===p||void 0===p?void 0:p.current)){let n=p.current.querySelector(`[data-key="${t.focusedKey}"]`);n&&((0,W.zT)(p.current,n),"keyboard"===e&&(0,W.Gt)(n,{containingElement:r.current}))}}),[h,p,t.focusedKey,t.isFocused,r]);let v,x={onKeyDown:e=>{if(e.altKey&&"Tab"===e.key&&e.preventDefault(),!r.current.contains(e.target))return;const o=(n,r)=>{null!=n&&(t.setFocusedKey(n,r),e.shiftKey&&"multiple"===t.selectionMode?t.extendSelection(n):l&&!Ho(e)&&t.replaceSelection(n))};switch(e.key){case"ArrowDown":if(n.getKeyBelow){var u,c;e.preventDefault();let r=null!=t.focusedKey?n.getKeyBelow(t.focusedKey):null===(u=n.getFirstKey)||void 0===u?void 0:u.call(n);null==r&&i&&(r=null===(c=n.getFirstKey)||void 0===c?void 0:c.call(n,t.focusedKey)),o(r)}break;case"ArrowUp":if(n.getKeyAbove){var d,h;e.preventDefault();let r=null!=t.focusedKey?n.getKeyAbove(t.focusedKey):null===(d=n.getLastKey)||void 0===d?void 0:d.call(n);null==r&&i&&(r=null===(h=n.getLastKey)||void 0===h?void 0:h.call(n,t.focusedKey)),o(r)}break;case"ArrowLeft":if(n.getKeyLeftOf){e.preventDefault(),o(n.getKeyLeftOf(t.focusedKey),"rtl"===g?"first":"last")}break;case"ArrowRight":if(n.getKeyRightOf){e.preventDefault(),o(n.getKeyRightOf(t.focusedKey),"rtl"===g?"last":"first")}break;case"Home":if(n.getFirstKey){e.preventDefault();let r=n.getFirstKey(t.focusedKey,Ko(e));t.setFocusedKey(r),Ko(e)&&e.shiftKey&&"multiple"===t.selectionMode?t.extendSelection(r):l&&t.replaceSelection(r)}break;case"End":if(n.getLastKey){e.preventDefault();let r=n.getLastKey(t.focusedKey,Ko(e));t.setFocusedKey(r),Ko(e)&&e.shiftKey&&"multiple"===t.selectionMode?t.extendSelection(r):l&&t.replaceSelection(r)}break;case"PageDown":if(n.getKeyPageBelow){e.preventDefault(),o(n.getKeyPageBelow(t.focusedKey))}break;case"PageUp":if(n.getKeyPageAbove){e.preventDefault(),o(n.getKeyPageAbove(t.focusedKey))}break;case"a":Ko(e)&&"multiple"===t.selectionMode&&!0!==s&&(e.preventDefault(),t.selectAll());break;case"Escape":e.preventDefault(),a||t.clearSelection();break;case"Tab":if(!f){if(e.shiftKey)r.current.focus();else{let e,t,n=(0,Io.QL)(r.current,{tabbable:!0});do{t=n.lastChild(),t&&(e=t)}while(t);e&&!e.contains(document.activeElement)&&(0,W.Ao)(e)}break}}},onFocus:e=>{if(t.isFocused)e.currentTarget.contains(e.target)||t.setFocused(!1);else if(e.currentTarget.contains(e.target)){if(t.setFocused(!0),null==t.focusedKey){let i=e=>{null!=e&&(t.setFocusedKey(e),l&&t.replaceSelection(e))},a=e.relatedTarget;var r,o;a&&e.currentTarget.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_FOLLOWING?i(null!==(r=t.lastSelectedKey)&&void 0!==r?r:n.getLastKey()):i(null!==(o=t.firstSelectedKey)&&void 0!==o?o:n.getFirstKey())}else h||(p.current.scrollTop=m.current.top,p.current.scrollLeft=m.current.left);if(!h&&null!=t.focusedKey){let e=p.current.querySelector(`[data-key="${t.focusedKey}"]`);e&&((0,W.Ao)(e),(0,W.zT)(p.current,e))}}},onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||t.setFocused(!1)},onMouseDown(e){p.current===e.target&&e.preventDefault()}},{typeSelectProps:b}=qo({keyboardDelegate:n,selectionManager:t});return u||(x=(0,W.dG)(b,x)),d||(v=null==t.focusedKey?0:-1),{collectionProps:{...x,tabIndex:v}}}function Yo(e){let{selectionManager:t,key:n,ref:r,shouldSelectOnPressUp:o,isVirtualized:i,shouldUseVirtualFocus:a,focus:s,isDisabled:l,onAction:u,allowsDifferentPressOrigin:d}=e,f=e=>{if("keyboard"===e.pointerType&&Ho(e))t.toggleSelection(n);else{if("none"===t.selectionMode)return;"single"===t.selectionMode?t.isSelected(n)&&!t.disallowEmptySelection?t.toggleSelection(n):t.replaceSelection(n):e&&e.shiftKey?t.extendSelection(n):"toggle"===t.selectionBehavior||e&&(Ko(e)||"touch"===e.pointerType||"virtual"===e.pointerType)?t.toggleSelection(n):t.replaceSelection(n)}};(0,c.useEffect)((()=>{n===t.focusedKey&&t.isFocused&&!a&&(s?s():document.activeElement!==r.current&&(0,Io.ex)(r.current))}),[r,n,t.focusedKey,t.childFocusStrategy,t.isFocused,a]),l=l||t.isDisabled(n);let h={};a||l?l&&(h.onMouseDown=e=>{e.preventDefault()}):h={tabIndex:n===t.focusedKey?0:-1,onFocus(e){e.target===r.current&&t.setFocusedKey(n)}};let p=!l&&t.canSelectItem(n),g=u&&!l,m=g&&("replace"===t.selectionBehavior?!p:t.isEmpty),y=g&&p&&"replace"===t.selectionBehavior,v=m||y,x=(0,c.useRef)(null),b=v&&p,w=(0,c.useRef)(!1),S=(0,c.useRef)(!1),C={};o?(C.onPressStart=e=>{x.current=e.pointerType,w.current=b,"keyboard"!==e.pointerType||v&&!Xo()||f(e)},d?(C.onPressUp=e=>{"keyboard"!==e.pointerType&&f(e)},C.onPress=m?()=>u():null):C.onPress=e=>{if(m||y&&"mouse"!==e.pointerType){if("keyboard"===e.pointerType&&!Qo())return;u()}else"keyboard"!==e.pointerType&&f(e)}):(C.onPressStart=e=>{x.current=e.pointerType,w.current=b,S.current=m,("mouse"===e.pointerType&&!m||"keyboard"===e.pointerType&&(!u||Xo()))&&f(e)},C.onPress=e=>{("touch"===e.pointerType||"pen"===e.pointerType||"virtual"===e.pointerType||"keyboard"===e.pointerType&&v&&Qo()||"mouse"===e.pointerType&&S.current)&&(v?u():f(e))}),i||(h["data-key"]=n),C.preventFocusOnPress=a;let{pressProps:j,isPressed:k}=(0,Do.r7)(C),E=y?e=>{"mouse"===x.current&&(e.stopPropagation(),e.preventDefault(),u())}:void 0,{longPressProps:T}=(0,Do.TA)({isDisabled:!b,onLongPress(e){"touch"===e.pointerType&&(f(e),t.setSelectionBehavior("toggle"))}});return{itemProps:(0,W.dG)(h,p||m?j:{},b?T:{},{onDoubleClick:E,onDragStartCapture:e=>{"touch"===x.current&&w.current&&e.preventDefault()}}),isPressed:k,isSelected:t.isSelected(n),isFocused:t.isFocused&&t.focusedKey===n,isDisabled:l,allowsSelection:p,hasAction:v}}function Qo(){let e=window.event;return"Enter"===(null===e||void 0===e?void 0:e.key)}function Xo(){let e=window.event;return" "===(null===e||void 0===e?void 0:e.key)||"Space"===(null===e||void 0===e?void 0:e.code)}class Jo{getKeyBelow(e){for(e=this.collection.getKeyAfter(e);null!=e;){if("item"===this.collection.getItem(e).type&&!this.disabledKeys.has(e))return e;e=this.collection.getKeyAfter(e)}return null}getKeyAbove(e){for(e=this.collection.getKeyBefore(e);null!=e;){if("item"===this.collection.getItem(e).type&&!this.disabledKeys.has(e))return e;e=this.collection.getKeyBefore(e)}return null}getFirstKey(){let e=this.collection.getFirstKey();for(;null!=e;){if("item"===this.collection.getItem(e).type&&!this.disabledKeys.has(e))return e;e=this.collection.getKeyAfter(e)}return null}getLastKey(){let e=this.collection.getLastKey();for(;null!=e;){if("item"===this.collection.getItem(e).type&&!this.disabledKeys.has(e))return e;e=this.collection.getKeyBefore(e)}return null}getItem(e){return this.ref.current.querySelector(`[data-key="${e}"]`)}getKeyPageAbove(e){let t=this.ref.current,n=this.getItem(e);if(!n)return null;let r=Math.max(0,n.offsetTop+n.offsetHeight-t.offsetHeight);for(;n&&n.offsetTop>r;)n=null==(e=this.getKeyAbove(e))?null:this.getItem(e);return e}getKeyPageBelow(e){let t=this.ref.current,n=this.getItem(e);if(!n)return null;let r=Math.min(t.scrollHeight,n.offsetTop-n.offsetHeight+t.offsetHeight);for(;n&&n.offsetTop<r;)n=null==(e=this.getKeyBelow(e))?null:this.getItem(e);return e}getKeyForSearch(e,t){if(!this.collator)return null;let n=this.collection,r=t||this.getFirstKey();for(;null!=r;){let t=n.getItem(r),o=t.textValue.slice(0,e.length);if(t.textValue&&0===this.collator.compare(o,e))return r;r=this.getKeyBelow(r)}return null}constructor(e,t,n,r){this.collection=e,this.disabledKeys=t,this.ref=n,this.collator=r}}function ei(e){let{selectionManager:t,collection:n,disabledKeys:r,ref:o,keyboardDelegate:i,autoFocus:a,shouldFocusWrap:s,isVirtualized:l,disallowEmptySelection:u,selectOnFocus:d="replace"===t.selectionBehavior,disallowTypeAhead:f,shouldUseVirtualFocus:h,allowsTabNavigation:p}=e,g=Uo({usage:"search",sensitivity:"base"}),m=t.disabledBehavior,y=(0,c.useMemo)((()=>i||new Jo(n,"selection"===m?new Set:r,o,g)),[i,n,r,o,g,m]),{collectionProps:v}=$o({ref:o,selectionManager:t,keyboardDelegate:y,autoFocus:a,shouldFocusWrap:s,disallowEmptySelection:u,selectOnFocus:d,disallowTypeAhead:f,shouldUseVirtualFocus:h,allowsTabNavigation:p,isVirtualized:l,scrollRef:o});return{listProps:v}}var ti=n(3830);function ni(e){return null}function ri(e){return null!=e.hasChildItems?e.hasChildItems:!!e.childItems||!!(e.title&&c.Children.count(e.children)>0)}ni.getCollectionNode=function*(e,t){let{childItems:n,title:r,children:o}=e,i=e.title||e.children,a=e.textValue||("string"===typeof i?i:"")||e["aria-label"]||"";a||(null===t||void 0===t?void 0:t.suppressTextValueWarning)||console.warn("<Item> with non-plain text contents is unsupported by type to select for accessibility. Please add a `textValue` prop."),yield{type:"item",props:e,rendered:i,textValue:a,"aria-label":e["aria-label"],hasChildNodes:ri(e),*childNodes(){if(n)for(let e of n)yield{type:"item",value:e};else if(r){let e=[];c.Children.forEach(o,(t=>{e.push({type:"item",element:t})})),yield*e}}}};let oi=ni;function ii(e){return null}ii.getCollectionNode=function*(e){let{children:t,title:n,items:r}=e;yield{type:"section",props:e,hasChildNodes:!0,rendered:n,"aria-label":e["aria-label"],*childNodes(){if("function"===typeof t){if(!r)throw new Error("props.children was a function but props.items is missing");for(let e of r)yield{type:"item",value:e,renderer:t}}else{let e=[];c.Children.forEach(t,(t=>{e.push({type:"item",element:t})})),yield*e}}}};let ai=ii;class si{build(e,t){return this.context=t,li((()=>this.iterateCollection(e)))}*iterateCollection(e){let{children:t,items:n}=e;if("function"===typeof t){if(!n)throw new Error("props.children was a function but props.items is missing");for(let n of e.items)yield*this.getFullNode({value:n},{renderer:t})}else{let e=[];c.Children.forEach(t,(t=>{e.push(t)}));let n=0;for(let t of e){let e=this.getFullNode({element:t,index:n},{});for(let t of e)n++,yield t}}}getKey(e,t,n,r){if(null!=e.key)return e.key;if("cell"===t.type&&null!=t.key)return`${r}${t.key}`;let o=t.value;if(null!=o){var i;let e=null!==(i=o.key)&&void 0!==i?i:o.id;if(null==e)throw new Error("No key found for item");return e}return r?`${r}.${t.index}`:`$.${t.index}`}getChildState(e,t){return{renderer:t.renderer||e.renderer}}*getFullNode(e,t,n,r){let o=e.element;if(!o&&e.value&&t&&t.renderer){let n=this.cache.get(e.value);if(n&&(!n.shouldInvalidate||!n.shouldInvalidate(this.context)))return n.index=e.index,n.parentKey=r?r.key:null,void(yield n);o=t.renderer(e.value)}if(c.isValidElement(o)){let i=o.type;if("function"!==typeof i&&"function"!==typeof i.getCollectionNode){let e="function"===typeof o.type?o.type.name:o.type;throw new Error(`Unknown element <${e}> in collection.`)}let a=i.getCollectionNode(o.props,this.context),s=e.index,l=a.next();for(;!l.done&&l.value;){let i=l.value;e.index=s;let u=i.key;u||(u=i.element?null:this.getKey(o,e,t,n));let c=[...this.getFullNode({...i,key:u,index:s,wrapper:ui(e.wrapper,i.wrapper)},this.getChildState(t,i),n?`${n}${o.key}`:o.key,r)];for(let t of c){if(t.value=i.value||e.value,t.value&&this.cache.set(t.value,t),e.type&&t.type!==e.type)throw new Error(`Unsupported type <${ci(t.type)}> in <${ci(r.type)}>. Only <${ci(e.type)}> is supported.`);s++,yield t}l=a.next(c)}return}if(null==e.key)return;let i=this,a={type:e.type,props:e.props,key:e.key,parentKey:r?r.key:null,value:e.value,level:r?r.level+1:0,index:e.index,rendered:e.rendered,textValue:e.textValue,"aria-label":e["aria-label"],wrapper:e.wrapper,shouldInvalidate:e.shouldInvalidate,hasChildNodes:e.hasChildNodes,childNodes:li((function*(){if(!e.hasChildNodes)return;let n=0;for(let r of e.childNodes()){null!=r.key&&(r.key=`${a.key}${r.key}`),r.index=n;let e=i.getFullNode(r,i.getChildState(t,r),a.key,a);for(let t of e)n++,yield t}}))};yield a}constructor(){(0,ti.Z)(this,"cache",new WeakMap)}}function li(e){let t=[],n=null;return{*[Symbol.iterator](){for(let e of t)yield e;n||(n=e());for(let e of n)t.push(e),yield e}}}function ui(e,t){return e&&t?n=>e(t(n)):e||(t||void 0)}function ci(e){return e[0].toUpperCase()+e.slice(1)}function di(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=(0,c.useMemo)((()=>new si),[]),i=(0,c.useRef)(null);return(0,c.useMemo)((()=>{if(e.collection)return e.collection;let r=o.build(e,n);return i.current=t(r,i.current),i.current}),[o,e.children,e.items,e.collection,n,...r])}function fi(e,t){return"function"===typeof t.getChildren?t.getChildren(e.key):e.childNodes}function hi(e){return function(e,t){if(t<0)return;let n=0;for(let r of e){if(n===t)return r;n++}}(e,0)}function pi(e,t,n){if(t.parentKey===n.parentKey)return t.index-n.index;let r=gi(e,t),o=gi(e,n),i=r.slice(0,o.length).findIndex(((e,t)=>e!==o[t]));return-1!==i?(t=r[i],n=o[i],t.index-n.index):-1}function gi(e,t){let n=[];for(;null!=(null===t||void 0===t?void 0:t.parentKey);)t=e.getItem(t.parentKey),n.unshift(t);return n}const mi=new WeakMap;function yi(e){let t=mi.get(e);if(null!=t)return t;t=0;let n=r=>{for(let o of r)"section"===o.type?n(fi(o,e)):t++};return n(e),mi.set(e,t),t}const vi=new WeakMap;function xi(e,t){let n=vi.get(e);if(!n)throw new Error("Unknown list");return`${n.id}-option-${r=t,"string"===typeof r?r.replace(/\s*/g,""):""+r}`;var r}function bi(e,t,n){let r=(0,W.zL)(e,{labelable:!0}),{listProps:o}=ei({...e,ref:n,selectionManager:t.selectionManager,collection:t.collection,disabledKeys:t.disabledKeys}),{focusWithinProps:i}=(0,Do.L_)({onFocusWithin:e.onFocus,onBlurWithin:e.onBlur,onFocusWithinChange:e.onFocusChange}),a=(0,W.Me)(e.id);vi.set(t,{id:a,shouldUseVirtualFocus:e.shouldUseVirtualFocus,shouldSelectOnPressUp:e.shouldSelectOnPressUp,shouldFocusOnHover:e.shouldFocusOnHover,isVirtualized:e.isVirtualized,onAction:e.onAction});let{labelProps:s,fieldProps:l}=Ao({...e,id:a,labelElementType:"span"});return{labelProps:s,listBoxProps:(0,W.dG)(r,i,"multiple"===t.selectionManager.selectionMode?{"aria-multiselectable":"true"}:{},{role:"listbox",...(0,W.dG)(l,o)})}}function wi(e,t,n){let{key:r}=e,o=vi.get(t);var i;let a=null!==(i=e.isDisabled)&&void 0!==i?i:t.disabledKeys.has(r);var s;let l=null!==(s=e.isSelected)&&void 0!==s?s:t.selectionManager.isSelected(r);var u;let c=null!==(u=e.shouldSelectOnPressUp)&&void 0!==u?u:null===o||void 0===o?void 0:o.shouldSelectOnPressUp;var d;let f=null!==(d=e.shouldFocusOnHover)&&void 0!==d?d:null===o||void 0===o?void 0:o.shouldFocusOnHover;var h;let p=null!==(h=e.shouldUseVirtualFocus)&&void 0!==h?h:null===o||void 0===o?void 0:o.shouldUseVirtualFocus;var g;let m=null!==(g=e.isVirtualized)&&void 0!==g?g:null===o||void 0===o?void 0:o.isVirtualized,y=(0,W.mp)(),v=(0,W.mp)(),x={role:"option","aria-disabled":a||void 0,"aria-selected":"none"!==t.selectionManager.selectionMode?l:void 0};if((0,W.V5)()&&(0,W.Pf)()||(x["aria-label"]=e["aria-label"],x["aria-labelledby"]=y,x["aria-describedby"]=v),m){var b;let e=Number(null===(b=t.collection.getItem(r))||void 0===b?void 0:b.index);x["aria-posinset"]=Number.isNaN(e)?void 0:e+1,x["aria-setsize"]=yi(t.collection)}let{itemProps:w,isPressed:S,isFocused:C,hasAction:j,allowsSelection:k}=Yo({selectionManager:t.selectionManager,key:r,ref:n,shouldSelectOnPressUp:c,allowsDifferentPressOrigin:c&&f,isVirtualized:m,shouldUseVirtualFocus:p,isDisabled:a,onAction:(null===o||void 0===o?void 0:o.onAction)?()=>{var e;return null===o||void 0===o||null===(e=o.onAction)||void 0===e?void 0:e.call(o,r)}:void 0}),{hoverProps:E}=(0,Do.XI)({isDisabled:a||!f,onHoverStart(){(0,Do.E)()||(t.selectionManager.setFocused(!0),t.selectionManager.setFocusedKey(r))}});return{optionProps:{...x,...(0,W.dG)(w,E),id:xi(t,r)},labelProps:{id:y},descriptionProps:{id:v},isFocused:C,isFocusVisible:C&&(0,Do.E)(),isSelected:l,isDisabled:a,isPressed:S,allowsSelection:k,hasAction:j}}function Si(e,t,n){let[r,o]=(0,c.useState)(e||t),i=(0,c.useRef)(void 0!==e),a=i.current,s=void 0!==e,l=(0,c.useRef)(r);a!==s&&console.warn(`WARN: A component changed from ${a?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}.`),i.current=s;let u=(0,c.useCallback)((function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];let a=function(e){if(n){for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];Object.is(l.current,e)||n(e,...r)}s||(l.current=e)};if("function"===typeof e){console.warn("We can not support a function callback. See Github Issues for details https://github.com/adobe/react-spectrum/issues/2320");let t=function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];let u=e(s?l.current:t,...o);return a(u,...r),s?t:u};o(t)}else s||o(e),a(e,...r)}),[s,n]);return s?l.current=e:e=r,[e,u]}class Ci extends Set{constructor(e,t,n){super(e),e instanceof Ci?(this.anchorKey=t||e.anchorKey,this.currentKey=n||e.currentKey):(this.anchorKey=t,this.currentKey=n)}}function ji(e){let{selectionMode:t="none",disallowEmptySelection:n,allowDuplicateSelectionEvents:r,selectionBehavior:o="toggle",disabledBehavior:i="all"}=e,a=(0,c.useRef)(!1),[,s]=(0,c.useState)(!1),l=(0,c.useRef)(null),u=(0,c.useRef)(null),[,d]=(0,c.useState)(null),f=(0,c.useMemo)((()=>ki(e.selectedKeys)),[e.selectedKeys]),h=(0,c.useMemo)((()=>ki(e.defaultSelectedKeys,new Ci)),[e.defaultSelectedKeys]),[p,g]=Si(f,h,e.onSelectionChange),m=(0,c.useMemo)((()=>e.disabledKeys?new Set(e.disabledKeys):new Set),[e.disabledKeys]),[y,v]=(0,c.useState)(o);"replace"===o&&"toggle"===y&&"object"===typeof p&&0===p.size&&v("replace");let x=(0,c.useRef)(o);return(0,c.useEffect)((()=>{o!==x.current&&(v(o),x.current=o)}),[o]),{selectionMode:t,disallowEmptySelection:n,selectionBehavior:y,setSelectionBehavior:v,get isFocused(){return a.current},setFocused(e){a.current=e,s(e)},get focusedKey(){return l.current},get childFocusStrategy(){return u.current},setFocusedKey(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"first";l.current=e,u.current=t,d(e)},selectedKeys:p,setSelectedKeys(e){!r&&function(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}(e,p)||g(e)},disabledKeys:m,disabledBehavior:i}}function ki(e,t){return e?"all"===e?"all":new Ci(e):t}class Ei{get selectionMode(){return this.state.selectionMode}get disallowEmptySelection(){return this.state.disallowEmptySelection}get selectionBehavior(){return this.state.selectionBehavior}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}get isFocused(){return this.state.isFocused}setFocused(e){this.state.setFocused(e)}get focusedKey(){return this.state.focusedKey}get childFocusStrategy(){return this.state.childFocusStrategy}setFocusedKey(e,t){(null==e||this.collection.getItem(e))&&this.state.setFocusedKey(e,t)}get selectedKeys(){return"all"===this.state.selectedKeys?new Set(this.getSelectAllKeys()):this.state.selectedKeys}get rawSelection(){return this.state.selectedKeys}isSelected(e){return"none"!==this.state.selectionMode&&(e=this.getKey(e),"all"===this.state.selectedKeys?this.canSelectItem(e):this.state.selectedKeys.has(e))}get isEmpty(){return"all"!==this.state.selectedKeys&&0===this.state.selectedKeys.size}get isSelectAll(){if(this.isEmpty)return!1;if("all"===this.state.selectedKeys)return!0;if(null!=this._isSelectAll)return this._isSelectAll;let e=this.getSelectAllKeys(),t=this.state.selectedKeys;return this._isSelectAll=e.every((e=>t.has(e))),this._isSelectAll}get firstSelectedKey(){let e=null;for(let t of this.state.selectedKeys){let n=this.collection.getItem(t);(!e||n&&pi(this.collection,n,e)<0)&&(e=n)}return null===e||void 0===e?void 0:e.key}get lastSelectedKey(){let e=null;for(let t of this.state.selectedKeys){let n=this.collection.getItem(t);(!e||n&&pi(this.collection,n,e)>0)&&(e=n)}return null===e||void 0===e?void 0:e.key}get disabledKeys(){return this.state.disabledKeys}get disabledBehavior(){return this.state.disabledBehavior}extendSelection(e){if("none"===this.selectionMode)return;if("single"===this.selectionMode)return void this.replaceSelection(e);let t;if(e=this.getKey(e),"all"===this.state.selectedKeys)t=new Ci([e],e,e);else{let n=this.state.selectedKeys,r=n.anchorKey||e;t=new Ci(n,r,e);for(let o of this.getKeyRange(r,n.currentKey||e))t.delete(o);for(let o of this.getKeyRange(e,r))this.canSelectItem(o)&&t.add(o)}this.state.setSelectedKeys(t)}getKeyRange(e,t){let n=this.collection.getItem(e),r=this.collection.getItem(t);return n&&r?pi(this.collection,n,r)<=0?this.getKeyRangeInternal(e,t):this.getKeyRangeInternal(t,e):[]}getKeyRangeInternal(e,t){let n=[],r=e;for(;r;){let e=this.collection.getItem(r);if((e&&"item"===e.type||"cell"===e.type&&this.allowsCellSelection)&&n.push(r),r===t)return n;r=this.collection.getKeyAfter(r)}return[]}getKey(e){let t=this.collection.getItem(e);if(!t)return e;if("cell"===t.type&&this.allowsCellSelection)return e;for(;"item"!==t.type&&null!=t.parentKey;)t=this.collection.getItem(t.parentKey);return t&&"item"===t.type?t.key:null}toggleSelection(e){if("none"===this.selectionMode)return;if("single"===this.selectionMode&&!this.isSelected(e))return void this.replaceSelection(e);if(null==(e=this.getKey(e)))return;let t=new Ci("all"===this.state.selectedKeys?this.getSelectAllKeys():this.state.selectedKeys);t.has(e)?t.delete(e):this.canSelectItem(e)&&(t.add(e),t.anchorKey=e,t.currentKey=e),this.disallowEmptySelection&&0===t.size||this.state.setSelectedKeys(t)}replaceSelection(e){if("none"===this.selectionMode)return;if(null==(e=this.getKey(e)))return;let t=this.canSelectItem(e)?new Ci([e],e,e):new Ci;this.state.setSelectedKeys(t)}setSelectedKeys(e){if("none"===this.selectionMode)return;let t=new Ci;for(let n of e)if(n=this.getKey(n),null!=n&&(t.add(n),"single"===this.selectionMode))break;this.state.setSelectedKeys(t)}getSelectAllKeys(){let e=[],t=n=>{for(;n;){if(this.canSelectItem(n)){let r=this.collection.getItem(n);"item"===r.type&&e.push(n),r.hasChildNodes&&(this.allowsCellSelection||"item"!==r.type)&&t(hi(fi(r,this.collection)).key)}n=this.collection.getKeyAfter(n)}};return t(this.collection.getFirstKey()),e}selectAll(){"multiple"===this.selectionMode&&this.state.setSelectedKeys("all")}clearSelection(){!this.disallowEmptySelection&&("all"===this.state.selectedKeys||this.state.selectedKeys.size>0)&&this.state.setSelectedKeys(new Ci)}toggleSelectAll(){this.isSelectAll?this.clearSelection():this.selectAll()}select(e,t){"none"!==this.selectionMode&&("single"===this.selectionMode?this.isSelected(e)&&!this.disallowEmptySelection?this.toggleSelection(e):this.replaceSelection(e):"toggle"===this.selectionBehavior||t&&("touch"===t.pointerType||"virtual"===t.pointerType)?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys)return!0;let t=this.selectedKeys;if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;for(let n of t)if(!e.has(n))return!1;return!0}canSelectItem(e){if("none"===this.state.selectionMode||this.state.disabledKeys.has(e))return!1;let t=this.collection.getItem(e);return!(!t||"cell"===t.type&&!this.allowsCellSelection)}isDisabled(e){return this.state.disabledKeys.has(e)&&"all"===this.state.disabledBehavior}constructor(e,t,n){var r;this.collection=e,this.state=t,this.allowsCellSelection=null!==(r=null===n||void 0===n?void 0:n.allowsCellSelection)&&void 0!==r&&r,this._isSelectAll=null}}let Ti=Symbol.iterator;class Oi{*[Ti](){yield*this.iterable}get size(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){let t=this.keyMap.get(e);return t?t.prevKey:null}getKeyAfter(e){let t=this.keyMap.get(e);return t?t.nextKey:null}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(e){return this.keyMap.get(e)}at(e){const t=[...this.getKeys()];return this.getItem(t[e])}getChildren(e){let t=this.keyMap.get(e);return(null===t||void 0===t?void 0:t.childNodes)||[]}constructor(e){(0,ti.Z)(this,"keyMap",new Map),this.iterable=e;let t,n=e=>{if(this.keyMap.set(e.key,e),e.childNodes&&"section"===e.type)for(let t of e.childNodes)n(t)};for(let o of e)n(o);let r=0;for(let[o,i]of this.keyMap)t?(t.nextKey=o,i.prevKey=t.key):(this.firstKey=o,i.prevKey=void 0),"item"===i.type&&(i.index=r++),t=i,t.nextKey=void 0;this.lastKey=null===t||void 0===t?void 0:t.key}}function Ii(e){let{filter:t}=e,n=ji(e),r=(0,c.useMemo)((()=>e.disabledKeys?new Set(e.disabledKeys):new Set),[e.disabledKeys]),o=(0,c.useMemo)((()=>({suppressTextValueWarning:e.suppressTextValueWarning})),[e.suppressTextValueWarning]),i=di(e,(e=>new Oi(t?t(e):e)),o,[t]),a=(0,c.useMemo)((()=>new Ei(i,n)),[i,n]);const s=(0,c.useRef)(null);return(0,c.useEffect)((()=>{if(null!=n.focusedKey&&!i.getItem(n.focusedKey)){const e=s.current.getItem(n.focusedKey),t=[...s.current.getKeys()].map((e=>{const t=s.current.getItem(e);return"item"===t.type?t:null})).filter((e=>null!==e)),r=[...i.getKeys()].map((e=>{const t=i.getItem(e);return"item"===t.type?t:null})).filter((e=>null!==e)),o=t.length-r.length;let l,u=Math.min(o>1?Math.max(e.index-o+1,0):e.index,r.length-1);for(;u>=0;){if(!a.isDisabled(r[u].key)){l=r[u];break}u<r.length-1?u++:(u>e.index&&(u=e.index),u--)}n.setFocusedKey(l?l.key:null)}s.current=i}),[i,a,n,n.focusedKey]),{collection:i,disabledKeys:r,selectionManager:a}}const Di={SECTION_HEADING:10};let Ai=(0,jo.Z)((e=>(0,I.ZZ)(e))),_i=(0,jo.Z)((e=>(0,I.ZZ)(e)));function Pi(e){return-1!==e.indexOf("preview/")}function Mi(e){let t,{status:n}=e;switch(n){case"missed":t=H.O9.r3;break;case"due":t=H.O9.y3;break;case"upcoming":t=H.O9.n4}return(0,z.jsx)($.xv,{style:{fontSize:11,color:t,fontStyle:"italic"},children:(0,I.VL)(n)})}class Ri extends c.PureComponent{render(){const{transaction:e,accounts:t,categories:n,payees:r,showCategory:o,added:i,style:a}=this.props;let{id:s,payee:l,amount:u,category:c,cleared:d,is_parent:f,notes:h,schedule:p}=e;Pi(s)&&(u=(0,Qn.lP)(u));let g=c?function(e,t){return e.find((e=>e.id===t)).name}(n,c):null,m=r&&l&&Ai(r)[l],y=m&&m.transfer_acct&&_i(t)[m.transfer_acct],v=function(e,t,n){let{amount:r}=e;return n?`Transfer ${r>0?"from":"to"} ${n.name}`:t?t.name:""}(e,m,y),x=y?"Transfer":f?"Split":g,b=Pi(s),w=b&&{fontStyle:"italic",color:H.O9.n5};return(0,z.jsxs)(Bi,{style:[{flex:1,height:60,padding:"5px 10px"},b&&{backgroundColor:H.O9.n11},a],children:[(0,z.jsxs)($.G7,{style:[{flex:1}],children:[(0,z.jsxs)($.G7,{style:{flexDirection:"row",alignItems:"center"},children:[p&&(0,z.jsx)(tr.Z,{style:{width:12,height:12,marginRight:5,color:w.color||H.O9.n1}}),(0,z.jsx)($.oR,{style:[H.W2.text,w,{fontSize:14,fontWeight:i?"600":"400"},""===v&&{color:H.O9.n6,fontStyle:"italic"}],children:v||"Empty"})]}),b?(0,z.jsx)(Mi,{status:h}):(0,z.jsxs)($.G7,{style:{flexDirection:"row",alignItems:"center",marginTop:3},children:[(0,z.jsx)(ho.Z,{style:{width:11,height:11,color:d?H.O9.g6:H.O9.n8,marginRight:5}}),o&&(0,z.jsx)($.oR,{style:{fontSize:11,marginTop:1,fontWeight:"400",color:x?H.O9.n3:H.O9.p7,fontStyle:x?null:"italic",textAlign:"left"},children:x||"Uncategorized"})]})]}),(0,z.jsx)($.xv,{style:[H.W2.text,w,{marginLeft:25,marginRight:5,fontSize:14}],children:(0,I.zA)(u)})]})}}class Ni extends c.Component{constructor(){super(...arguments),this.makeData=(0,jo.Z)((e=>{const t=[];return e.forEach((e=>{if(0===t.length||e.date!==t[t.length-1].date){let n=t[t.length-1];if(n&&n.data.length>0){let e=n.data;e[e.length-1].isLast=!0}t.push({id:e.date,date:e.date,data:[]})}e.is_child||t[t.length-1].data.push(e)})),t}))}render(){const{transactions:e,scrollProps:t={},onLoadMore:n}=this.props,r=this.makeData(e);return(0,z.jsxs)(z.Fragment,{children:[t.ListHeaderComponent,(0,z.jsxs)(Li,{...t,"aria-label":"transaction list",label:"",loadMore:n,selectionMode:"none",style:{flex:"1 auto",height:"100%",overflowY:"auto"},children:[0===r.length?(0,z.jsx)(ai,{children:(0,z.jsx)(oi,{children:(0,z.jsx)("div",{style:{display:"flex",justifyContent:"center",width:"100%"},children:(0,z.jsx)($.xv,{style:{fontSize:15},children:"No transactions"})})})}):null,r.map((e=>(0,z.jsx)(ai,{title:fn.WU(e.date,"MMMM dd, yyyy"),children:e.data.map(((e,t,n)=>(0,z.jsx)(oi,{style:{fontSize:t===n.length-1?98:"inherit"},textValue:e.id,children:(0,z.jsx)(Ri,{transaction:e,categories:this.props.categories,accounts:this.props.accounts,payees:this.props.payees,showCategory:this.props.showCategory,added:this.props.isNew(e.id),onSelect:()=>{}})},e.id)))},e.id)))]})]})}}function Li(e){let t=Ii(e),n=(0,c.useRef)(),{listBoxProps:r,labelProps:o}=bi(e,t,n);return(0,c.useEffect)((()=>{function t(){Math.abs(n.current.scrollHeight-n.current.clientHeight-n.current.scrollTop)<n.current.clientHeight&&e.loadMore()}return n.current.addEventListener("scroll",t),()=>{n.current&&n.current.removeEventListener("scroll",t)}}),[t.collection]),(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)("div",{...o,children:e.label}),(0,z.jsx)("ul",{...r,ref:n,style:{padding:0,listStyle:"none",margin:0,overflowY:"auto",width:"100%"},children:[...t.collection].map((e=>(0,z.jsx)(Fi,{section:e,state:t},e.key)))})]})}function Fi(e){let{section:t,state:n}=e,{itemProps:r,headingProps:o,groupProps:i}=function(e){let{heading:t,"aria-label":n}=e,r=(0,W.Me)();return{itemProps:{role:"presentation"},headingProps:t?{id:r,"aria-hidden":!0}:{},groupProps:{role:"group","aria-label":n,"aria-labelledby":t?r:void 0}}}({heading:t.rendered,"aria-label":t["aria-label"]});return(0,z.jsxs)("li",{...r,style:{width:"100%"},children:[t.rendered&&(0,z.jsx)("div",{...o,style:{...H.W2.smallText,backgroundColor:H.O9.n10,borderBottom:`1px solid ${H.O9.n9}`,borderTop:`1px solid ${H.O9.n9}`,color:H.O9.n4,display:"flex",justifyContent:"center",paddingBottom:4,paddingTop:4,position:"sticky",top:"0",width:"100%",zIndex:Di.SECTION_HEADING},children:t.rendered}),(0,z.jsx)("ul",{...i,style:{padding:0,listStyle:"none"},children:[...t.childNodes].map(((e,t,r)=>(0,z.jsx)(Wi,{item:e,state:n,isLast:t===r.length-1},e.key)))})]})}function Wi(e){let{isLast:t,item:n,state:r}=e,o=(0,c.useRef)(),{optionProps:i,isSelected:a}=wi({key:n.key},r,o),{isFocusVisible:s,focusProps:l}=(0,Io.Fx)();return(0,z.jsx)("li",{...(0,W.dG)(i,l),ref:o,style:{background:a?"blueviolet":"transparent",color:a?"white":null,outline:s?"2px solid orange":"none",...!t&&{borderBottom:`1px solid ${H.O9.border}`}},children:n.rendered})}const Bi=(0,c.forwardRef)(((e,t)=>{let{children:n,style:r,...o}=e;return(0,z.jsx)($.G7,{style:[{height:50,flexDirection:"row",alignItems:"center",paddingLeft:10,paddingRight:10},r],ref:t,...o,children:n})}));function zi(e){let{accountName:t,onSearch:n}=e;const[r,o]=(0,c.useState)("");return(0,z.jsx)($.G7,{style:{flexDirection:"row",alignItems:"center",backgroundColor:H.O9.n11,margin:"11px auto 4px",borderRadius:4,padding:10,width:"100%"},children:(0,z.jsx)($.F5,{leftContent:(0,z.jsx)(Zr,{style:{width:13,height:13,flexShrink:0,color:r?H.O9.p7:"inherit",margin:5,marginRight:0}}),value:r,onUpdate:e=>{o(e),n(e)},placeholder:`Search ${t}`,style:{backgroundColor:H.O9.n11,border:`1px solid ${H.O9.n9}`,fontSize:15,flex:1,height:32,marginLeft:4,padding:8}})})}const Gi=70;function Zi(e){let{account:t,prependTransactions:n,transactions:r,accounts:o,categories:i,payees:a,balance:s,isNewTransaction:l,onLoadMore:u,onSearch:d,onSelectTransaction:f}=e,h=(0,c.useMemo)((()=>n.concat(r)),[n,r]);return(0,z.jsxs)($.G7,{style:{flex:1,backgroundColor:H.O9.n11,overflowY:"hidden",width:"100%"},children:[(0,z.jsxs)($.G7,{style:{alignItems:"center",backgroundColor:H.O9.n11,flexShrink:0,overflowY:"hidden",paddingTop:20,top:0,width:"100%"},children:[(0,z.jsxs)($.G7,{style:{alignItems:"center",flexDirection:"row",justifyContent:"space-between",width:"100%"},children:[(0,z.jsxs)(Mt.rU,{to:"/accounts",style:{alignItems:"center",display:"flex",textDecoration:"none",width:Gi},children:[(0,z.jsx)(Oo,{style:{color:H.O9.b5,width:32,height:32}}),(0,z.jsx)(no.Z,{style:{...H.W2.text,color:H.O9.b5,fontWeight:500},children:"Back"})]}),(0,z.jsx)($.G7,{style:{fontSize:16,fontWeight:500},children:t.name}),(0,z.jsx)(Mt.rU,{to:"transaction/new",style:{visibility:"hidden"},children:(0,z.jsx)($.zx,{bare:!0,style:{justifyContent:"center",width:Gi},children:(0,z.jsx)(Lr.Z,{width:20,height:20})})})]}),(0,z.jsx)($.__,{title:"BALANCE",style:{marginTop:10}}),(0,z.jsx)(io,{binding:s,type:"financial",debug:!0,style:{fontSize:18,fontWeight:"500"},getStyle:e=>({color:e<0?H.O9.r4:H.O9.p5})}),(0,z.jsx)(zi,{accountName:t.name,onSearch:d})]}),(0,z.jsx)(Ni,{transactions:h,categories:i,accounts:o,payees:a,showCategory:!t.offbudget,isNew:l,onLoadMore:u,onSelect:f})]})}const Ui=(0,jo.Z)(((e,t)=>{let n=pn(e,"_account");return t&&(n={id:null}),e=>(e=e.filter({$and:[n,{"_account.closed":!1}]})).orderBy({next_date:"desc"})}));function Hi(e){let{accountId:t,children:n}=e,r=(0,un.oF)();return n(null==r?null:r.schedules.filter((e=>!e.completed&&["due","upcoming","missed"].includes(r.statuses.get(e.id)))).map((e=>({id:"preview/"+e.id,payee:e._payee,account:e._account,amount:e._amount,date:e.next_date,notes:r.statuses.get(e.id),schedule:e.id}))))}let Ki;var Vi=(0,d.$j)((e=>({accounts:e.queries.accounts,newTransactions:e.queries.newTransactions,updatedAccounts:e.queries.updatedAccounts,categories:e.queries.categories.list,prefs:e.prefs.local})),y)(ko(H.O9.n11)((function(e){(0,Pt.s0)();const[t,n]=(0,c.useState)([]),[r,o]=(0,c.useState)(""),[i,a]=(0,c.useState)();let s=(0,d.v9)((e=>({payees:e.queries.payees,newTransactions:e.queries.newTransactions,categories:e.queries.categories.list,prefs:e.prefs.local,dateFormat:e.prefs.local.dateFormat||"MM/dd/yyyy"}))),l=(0,d.I0)(),u=(0,c.useMemo)((()=>(0,h.DE)(y,l)),[l]);const{id:f}=(0,Pt.UO)(),p=e=>{Ki&&Ki.unsubscribe(),Ki=(0,x.Fr)(e.options({splits:"grouped"}).select("*"),(e=>n(e)),{pageCount:150,mapper:Dn})},g=async()=>{let e=gn(f);a(e),p(e)};(0,c.useEffect)((()=>{let t;return async function(){t=(0,N.oL)("sync-event",(e=>{let{type:t,tables:n}=e;"applied"===t&&((n.includes("transactions")||n.includes("category_mapping")||n.includes("payee_mapping"))&&Ki&&Ki.run(),(n.includes("payees")||n.includes("payee_mapping"))&&u.getPayees())})),0===s.categories.length&&await u.getCategories(),0===e.accounts.length&&await u.getAccounts(),await u.initiallyLoadPayees(),await g(),u.markAccountRead(f)}(),()=>t()}),[]);const m=sn()((()=>{""===r&&i?p(i):r&&i&&p(mn(i,r,s.dateFormat))}),150);if((0,c.useEffect)(m,[r,i,s.dateFormat]),!e.accounts||!e.accounts.length)return null;const v=e.accounts.find((e=>e.id===f)),b=e=>s.newTransactions.includes(e),w=async e=>{Ki.unsubscribe(),o(e)};let S=yn(v),C=s.prefs.numberFormat||"comma-dot",j=s.prefs.hideFraction||!1;return(0,z.jsx)(To,{onSync:async()=>{await e.syncAndDownload()},children:n=>{let{refreshing:o,onRefresh:i}=n;return(0,z.jsx)(un.up,{transform:Ui(f,""!==r),children:(0,z.jsx)(Hi,{accountId:e.accountId,children:n=>null==n?null:(0,c.createElement)(Zi,{...s,...u,key:C+j,account:v,accounts:e.accounts,categories:s.categories,payees:s.payees,transactions:t,prependTransactions:n||[],balance:S,isNewTransaction:b,onLoadMore:()=>{Ki&&Ki.fetchNext()},onSearch:w,onSelectTransaction:()=>{}})})})}})})));function qi(e){let{name:t,amount:n}=e;return(0,z.jsxs)($.G7,{style:{flexDirection:"row",marginTop:28,marginBottom:10},children:[(0,z.jsx)($.G7,{style:{flex:1},children:(0,z.jsx)($.xv,{style:[H.W2.text,{textTransform:"uppercase",color:H.O9.n5,fontSize:13}],"data-testid":"name",children:t})}),(0,z.jsx)(io,{binding:n,style:[H.W2.text,{color:H.O9.n5,fontSize:13}],type:"financial"})]})}function $i(e){let{account:t,updated:n,getBalanceQuery:r,onSelect:o}=e;return(0,z.jsx)($.G7,{style:{flex:"1 0 auto",flexDirection:"row",backgroundColor:"white",boxShadow:`0 1px 1px ${H.O9.n7}`,borderRadius:6,marginTop:10},children:(0,z.jsxs)($.zx,{onMouseDown:()=>o(t.id),style:{flexDirection:"row",flex:1,alignItems:"center",borderRadius:6,"&:active":{opacity:.1}},children:[(0,z.jsx)($.G7,{style:{flex:"1 auto",margin:"10px 0"},children:(0,z.jsxs)($.G7,{style:{flexDirection:"row",alignItems:"center"},children:[(0,z.jsx)($.oR,{style:[H.W2.text,{fontSize:17,fontWeight:600,color:n?H.O9.b2:H.O9.n2,paddingRight:30}],children:t.name}),t.bankId&&(0,z.jsx)($.G7,{style:{backgroundColor:H.O9.g5,marginLeft:"-23px",width:8,height:8,borderRadius:8}})]})}),(0,z.jsx)(io,{binding:r(t),type:"financial",style:{fontSize:16,color:H.O9.n3},getStyle:e=>e<0&&{color:H.O9.r4}})]})})}function Yi(e){let{onAdd:t}=e;return(0,z.jsxs)($.G7,{style:{flex:1,padding:30},children:[(0,z.jsx)($.xv,{style:H.W2.text,children:"For Actual to be useful, you need to add an account. You can link an account to automatically download transactions, or manage it locally yourself."}),(0,z.jsx)($.zx,{primary:!0,style:{marginTop:20,alignSelf:"center"},onClick:()=>alert("Account creation is not supported on mobile on the self-hosted service yet"),children:"Add Account"}),(0,z.jsx)($.xv,{style:{marginTop:20,color:H.O9.n5},children:"In the future, you can add accounts using the add button in the header."})]})}class Qi extends c.Component{constructor(){super(...arguments),this.isNewTransaction=e=>this.props.newTransactions.includes(e)}render(){const{accounts:e,updatedAccounts:t,getBalanceQuery:n,getOnBudgetBalance:r,getOffBudgetBalance:o,onAddAccount:i,onSelectAccount:a}=this.props,s=e.filter((e=>0===e.offbudget)),l=e.filter((e=>1===e.offbudget));if(0===e.length)return(0,z.jsx)(Yi,{onAdd:i});const u=(0,z.jsxs)($t,{title:"Accounts",children:[(0,z.jsx)(qi,{name:"Budgeted",amount:r()}),s.map(((e,r)=>(0,z.jsx)($i,{account:e,updated:t.includes(e.id),getBalanceQuery:n,onSelect:a},e.id))),(0,z.jsx)(qi,{name:"Off budget",amount:o()}),l.map(((e,r)=>(0,z.jsx)($i,{account:e,updated:t.includes(e.id),getBalanceQuery:n,onSelect:a},e.id)))]});return(0,z.jsx)($.G7,{style:{flex:1},children:u})}}var Xi=(0,d.$j)((e=>({accounts:e.queries.accounts,newTransactions:e.queries.newTransactions,updatedAccounts:e.queries.updatedAccounts,categories:e.queries.categories.list,prefs:e.prefs.local})),y)(ko(H.O9.b2)((function(e){const t=(0,c.useState)({}),n=(0,Pt.s0)();(0,c.useEffect)((()=>{(async()=>{0===e.categories.length&&await e.getCategories(),e.getAccounts()})()}),[]);let{accounts:r,categories:o,newTransactions:i,updatedAccounts:a,prefs:s}=e,l=s.numberFormat||"comma-dot",u=s.hideFraction||!1;return(0,z.jsx)($.G7,{style:{flex:1},children:(0,z.jsx)(Qi,{accounts:r.filter((e=>!e.closed)),categories:o,transactions:t||[],updatedAccounts:a,newTransactions:i,getBalanceQuery:yn,getOnBudgetBalance:xn,getOffBudgetBalance:bn,onAddAccount:()=>{},onSelectAccount:e=>{n(`/accounts/${e}`)},onSelectTransaction:e=>{n(`/transaction/${e}`)}},l+u)})}))),Ji=ga(),ea=e=>da(e,Ji),ta=ga();ea.write=e=>da(e,ta);var na=ga();ea.onStart=e=>da(e,na);var ra=ga();ea.onFrame=e=>da(e,ra);var oa=ga();ea.onFinish=e=>da(e,oa);var ia=[];ea.setTimeout=(e,t)=>{let n=ea.now()+t,r=()=>{let e=ia.findIndex((e=>e.cancel==r));~e&&ia.splice(e,1),ua-=~e?1:0},o={time:n,handler:e,cancel:r};return ia.splice(aa(n),0,o),ua+=1,fa(),o};var aa=e=>~(~ia.findIndex((t=>t.time>e))||~ia.length);ea.cancel=e=>{na.delete(e),ra.delete(e),oa.delete(e),Ji.delete(e),ta.delete(e)},ea.sync=e=>{ca=!0,ea.batchedUpdates(e),ca=!1},ea.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function r(){for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];t=r,ea.onStart(n)}return r.handler=e,r.cancel=()=>{na.delete(n),t=null},r};var sa=typeof window<"u"?window.requestAnimationFrame:()=>{};ea.use=e=>sa=e,ea.now=typeof performance<"u"?()=>performance.now():Date.now,ea.batchedUpdates=e=>e(),ea.catch=console.error,ea.frameLoop="always",ea.advance=()=>{"demand"!==ea.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):pa()};var la=-1,ua=0,ca=!1;function da(e,t){ca?(t.delete(e),e(0)):(t.add(e),fa())}function fa(){la<0&&(la=0,"demand"!==ea.frameLoop&&sa(ha))}function ha(){~la&&(sa(ha),ea.batchedUpdates(pa))}function pa(){let e=la;la=ea.now();let t=aa(la);t&&(ma(ia.splice(0,t),(e=>e.handler())),ua-=t),ua?(na.flush(),Ji.flush(e?Math.min(64,la-e):16.667),ra.flush(),ta.flush(),oa.flush()):la=-1}function ga(){let e=new Set,t=e;return{add(n){ua+=t!=e||e.has(n)?0:1,e.add(n)},delete(n){return ua-=t==e&&e.has(n)?1:0,e.delete(n)},flush(n){t.size&&(e=new Set,ua-=t.size,ma(t,(t=>t(n)&&e.add(t))),ua+=e.size,t=e)}}}function ma(e,t){e.forEach((e=>{try{t(e)}catch(n){ea.catch(n)}}))}var ya=Object.defineProperty,va={};function xa(){}((e,t)=>{for(var n in t)ya(e,n,{get:t[n],enumerable:!0})})(va,{assign:()=>Pa,colors:()=>Da,createStringInterpolator:()=>Ea,skipAnimation:()=>Aa,to:()=>Ta,willAdvance:()=>_a});var ba={arr:Array.isArray,obj:e=>!!e&&"Object"===e.constructor.name,fun:e=>"function"==typeof e,str:e=>"string"==typeof e,num:e=>"number"==typeof e,und:e=>void 0===e};function wa(e,t){if(ba.arr(e)){if(!ba.arr(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return e===t}var Sa=(e,t)=>e.forEach(t);function Ca(e,t,n){if(ba.arr(e))for(let r=0;r<e.length;r++)t.call(n,e[r],`${r}`);else for(let r in e)e.hasOwnProperty(r)&&t.call(n,e[r],r)}var ja=e=>ba.und(e)?[]:ba.arr(e)?e:[e];function ka(e,t){if(e.size){let n=Array.from(e);e.clear(),Sa(n,t)}}var Ea,Ta,Oa=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return ka(e,(e=>e(...n)))},Ia=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),Da=null,Aa=!1,_a=xa,Pa=e=>{e.to&&(Ta=e.to),e.now&&(ea.now=e.now),void 0!==e.colors&&(Da=e.colors),null!=e.skipAnimation&&(Aa=e.skipAnimation),e.createStringInterpolator&&(Ea=e.createStringInterpolator),e.requestAnimationFrame&&ea.use(e.requestAnimationFrame),e.batchedUpdates&&(ea.batchedUpdates=e.batchedUpdates),e.willAdvance&&(_a=e.willAdvance),e.frameLoop&&(ea.frameLoop=e.frameLoop)},Ma=new Set,Ra=[],Na=[],La=0,Fa={get idle(){return!Ma.size&&!Ra.length},start(e){La>e.priority?(Ma.add(e),ea.onStart(Wa)):(Ba(e),ea(Ga))},advance:Ga,sort(e){if(La)ea.onFrame((()=>Fa.sort(e)));else{let t=Ra.indexOf(e);~t&&(Ra.splice(t,1),za(e))}},clear(){Ra=[],Ma.clear()}};function Wa(){Ma.forEach(Ba),Ma.clear(),ea(Ga)}function Ba(e){Ra.includes(e)||za(e)}function za(e){Ra.splice(function(e,t){let n=e.findIndex(t);return n<0?e.length:n}(Ra,(t=>t.priority>e.priority)),0,e)}function Ga(e){let t=Na;for(let n=0;n<Ra.length;n++){let r=Ra[n];La=r.priority,r.idle||(_a(r),r.advance(e),r.idle||t.push(r))}return La=0,(Na=Ra).length=0,(Ra=t).length>0}var Za="[-+]?\\d*\\.?\\d+",Ua=Za+"%";function Ha(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return"\\(\\s*("+t.join(")\\s*,\\s*(")+")\\s*\\)"}var Ka=new RegExp("rgb"+Ha(Za,Za,Za)),Va=new RegExp("rgba"+Ha(Za,Za,Za,Za)),qa=new RegExp("hsl"+Ha(Za,Ua,Ua)),$a=new RegExp("hsla"+Ha(Za,Ua,Ua,Za)),Ya=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Qa=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Xa=/^#([0-9a-fA-F]{6})$/,Ja=/^#([0-9a-fA-F]{8})$/;function es(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function ts(e,t,n){let r=n<.5?n*(1+t):n+t-n*t,o=2*n-r,i=es(o,r,e+1/3),a=es(o,r,e),s=es(o,r,e-1/3);return Math.round(255*i)<<24|Math.round(255*a)<<16|Math.round(255*s)<<8}function ns(e){let t=parseInt(e,10);return t<0?0:t>255?255:t}function rs(e){return(parseFloat(e)%360+360)%360/360}function os(e){let t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function is(e){let t=parseFloat(e);return t<0?0:t>100?1:t/100}function as(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=Xa.exec(e))?parseInt(t[1]+"ff",16)>>>0:Da&&void 0!==Da[e]?Da[e]:(t=Ka.exec(e))?(ns(t[1])<<24|ns(t[2])<<16|ns(t[3])<<8|255)>>>0:(t=Va.exec(e))?(ns(t[1])<<24|ns(t[2])<<16|ns(t[3])<<8|os(t[4]))>>>0:(t=Ya.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=Ja.exec(e))?parseInt(t[1],16)>>>0:(t=Qa.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=qa.exec(e))?(255|ts(rs(t[1]),is(t[2]),is(t[3])))>>>0:(t=$a.exec(e))?(ts(rs(t[1]),is(t[2]),is(t[3]))|os(t[4]))>>>0:null}(e);return null===t?e:(t=t||0,`rgba(${(4278190080&t)>>>24}, ${(16711680&t)>>>16}, ${(65280&t)>>>8}, ${(255&t)/255})`)}var ss=(e,t,n)=>{if(ba.fun(e))return e;if(ba.arr(e))return ss({range:e,output:t,extrapolate:n});if(ba.str(e.output[0]))return Ea(e);let r=e,o=r.output,i=r.range||[0,1],a=r.extrapolateLeft||r.extrapolate||"extend",s=r.extrapolateRight||r.extrapolate||"extend",l=r.easing||(e=>e);return e=>{let t=function(e,t){for(var n=1;n<t.length-1&&!(t[n]>=e);++n);return n-1}(e,i);return function(e,t,n,r,o,i,a,s,l){let u=l?l(e):e;if(u<t){if("identity"===a)return u;"clamp"===a&&(u=t)}if(u>n){if("identity"===s)return u;"clamp"===s&&(u=n)}return r===o?r:t===n?e<=t?r:o:(t===-1/0?u=-u:n===1/0?u-=t:u=(u-t)/(n-t),u=i(u),r===-1/0?u=-u:o===1/0?u+=r:u=u*(o-r)+r,u)}(e,i[t],i[t+1],o[t],o[t+1],l,a,s,r.map)}};var ls=1.70158,us=1.525*ls,cs=ls+1,ds=2*Math.PI/3,fs=2*Math.PI/4.5,hs=e=>e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375,ps={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>1-(1-e)*(1-e),easeInOutQuad:e=>e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2,easeInCubic:e=>e*e*e,easeOutCubic:e=>1-Math.pow(1-e,3),easeInOutCubic:e=>e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2,easeInQuart:e=>e*e*e*e,easeOutQuart:e=>1-Math.pow(1-e,4),easeInOutQuart:e=>e<.5?8*e*e*e*e:1-Math.pow(-2*e+2,4)/2,easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>1-Math.pow(1-e,5),easeInOutQuint:e=>e<.5?16*e*e*e*e*e:1-Math.pow(-2*e+2,5)/2,easeInSine:e=>1-Math.cos(e*Math.PI/2),easeOutSine:e=>Math.sin(e*Math.PI/2),easeInOutSine:e=>-(Math.cos(Math.PI*e)-1)/2,easeInExpo:e=>0===e?0:Math.pow(2,10*e-10),easeOutExpo:e=>1===e?1:1-Math.pow(2,-10*e),easeInOutExpo:e=>0===e?0:1===e?1:e<.5?Math.pow(2,20*e-10)/2:(2-Math.pow(2,-20*e+10))/2,easeInCirc:e=>1-Math.sqrt(1-Math.pow(e,2)),easeOutCirc:e=>Math.sqrt(1-Math.pow(e-1,2)),easeInOutCirc:e=>e<.5?(1-Math.sqrt(1-Math.pow(2*e,2)))/2:(Math.sqrt(1-Math.pow(-2*e+2,2))+1)/2,easeInBack:e=>cs*e*e*e-ls*e*e,easeOutBack:e=>1+cs*Math.pow(e-1,3)+ls*Math.pow(e-1,2),easeInOutBack:e=>e<.5?Math.pow(2*e,2)*(2*(us+1)*e-us)/2:(Math.pow(2*e-2,2)*((us+1)*(2*e-2)+us)+2)/2,easeInElastic:e=>0===e?0:1===e?1:-Math.pow(2,10*e-10)*Math.sin((10*e-10.75)*ds),easeOutElastic:e=>0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin((10*e-.75)*ds)+1,easeInOutElastic:e=>0===e?0:1===e?1:e<.5?-Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*fs)/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*fs)/2+1,easeInBounce:e=>1-hs(1-e),easeOutBounce:hs,easeInOutBounce:e=>e<.5?(1-hs(1-2*e))/2:(1+hs(2*e-1))/2,steps:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"end";return n=>{let r=(n="end"===t?Math.min(n,.999):Math.max(n,.001))*e;return((e,t,n)=>Math.min(Math.max(n,e),t))(0,1,("end"===t?Math.floor(r):Math.ceil(r))/e)}}},gs=Symbol.for("FluidValue.get"),ms=Symbol.for("FluidValue.observers"),ys=e=>!(!e||!e[gs]),vs=e=>e&&e[gs]?e[gs]():e,xs=e=>e[ms]||null;function bs(e,t){let n=e[ms];n&&n.forEach((e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)}))}var ws=class{[gs];[ms];constructor(e){if(!e&&!(e=this.get))throw Error("Unknown getter");Ss(this,e)}},Ss=(e,t)=>Es(e,gs,t);function Cs(e,t){if(e[gs]){let n=e[ms];n||Es(e,ms,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function js(e,t){let n=e[ms];if(n&&n.has(t)){let r=n.size-1;r?n.delete(t):e[ms]=null,e.observerRemoved&&e.observerRemoved(r,t)}}var ks,Es=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),Ts=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,Os=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,Is=new RegExp(`(${Ts.source})(%|[a-z]+)`,"i"),Ds=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,As=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,_s=e=>{let[t,n]=Ps(e);if(!t||Ia())return e;let r=window.getComputedStyle(document.documentElement).getPropertyValue(t);if(r)return r.trim();if(n&&n.startsWith("--")){return window.getComputedStyle(document.documentElement).getPropertyValue(n)||e}return n&&As.test(n)?_s(n):n||e},Ps=e=>{let t=As.exec(e);if(!t)return[,];let[,n,r]=t;return[n,r]},Ms=(e,t,n,r,o)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(r)}, ${o})`,Rs=e=>{ks||(ks=Da?new RegExp(`(${Object.keys(Da).join("|")})(?!\\w)`,"g"):/^\b$/);let t=e.output.map((e=>vs(e).replace(As,_s).replace(Os,as).replace(ks,as))),n=t.map((e=>e.match(Ts).map(Number))),r=n[0].map(((e,t)=>n.map((e=>{if(!(t in e))throw Error('The arity of each "output" value must be equal');return e[t]})))).map((t=>ss({...e,output:t})));return e=>{let n=!Is.test(t[0])&&t.find((e=>Is.test(e)))?.replace(Ts,""),o=0;return t[0].replace(Ts,(()=>`${r[o++](e)}${n||""}`)).replace(Ds,Ms)}},Ns="react-spring: ",Ls=e=>{let t=e,n=!1;if("function"!=typeof t)throw new TypeError(`${Ns}once requires a function parameter`);return function(){n||(t(...arguments),n=!0)}},Fs=Ls(console.warn);var Ws=Ls(console.warn);function Bs(e){return ba.str(e)&&("#"==e[0]||/\d/.test(e)||!Ia()&&As.test(e)||e in(Da||{}))}new WeakMap;new Set,new WeakMap,new WeakMap,new WeakMap;var zs=Ia()?c.useEffect:c.useLayoutEffect,Gs=()=>{let e=(0,c.useRef)(!1);return zs((()=>(e.current=!0,()=>{e.current=!1})),[]),e};function Zs(){let e=(0,c.useState)()[1],t=Gs();return()=>{t.current&&e(Math.random())}}var Us=e=>(0,c.useEffect)(e,Hs),Hs=[];function Ks(e){let t=(0,c.useRef)();return(0,c.useEffect)((()=>{t.current=e})),t.current}var Vs=Symbol.for("Animated:node"),qs=e=>e&&e[Vs],$s=(e,t)=>((e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}))(e,Vs,t),Ys=e=>e&&e[Vs]&&e[Vs].getPayload(),Qs=class{payload;constructor(){$s(this,this)}getPayload(){return this.payload||[]}},Xs=class extends Qs{constructor(e){super(),this._value=e,ba.num(this._value)&&(this.lastPosition=this._value)}done=!0;elapsedTime;lastPosition;lastVelocity;v0;durationProgress=0;static create(e){return new Xs(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return ba.num(e)&&(this.lastPosition=e,t&&(e=Math.round(e/t)*t,this.done&&(this.lastPosition=e))),this._value!==e&&(this._value=e,!0)}reset(){let{done:e}=this;this.done=!1,ba.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}},Js=class extends Xs{_string=null;_toString;constructor(e){super(0),this._toString=ss({output:[e,e]})}static create(e){return new Js(e)}getValue(){return this._string??(this._string=this._toString(this._value))}setValue(e){if(ba.str(e)){if(e==this._string)return!1;this._string=e,this._value=1}else{if(!super.setValue(e))return!1;this._string=null}return!0}reset(e){e&&(this._toString=ss({output:[this.getValue(),e]})),this._value=0,super.reset()}},el={dependencies:null},tl=class extends Qs{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){let t={};return Ca(this.source,((n,r)=>{var o;(o=n)&&o[Vs]===o?t[r]=n.getValue(e):ys(n)?t[r]=vs(n):e||(t[r]=n)})),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&Sa(this.payload,(e=>e.reset()))}_makePayload(e){if(e){let t=new Set;return Ca(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){el.dependencies&&ys(e)&&el.dependencies.add(e);let t=Ys(e);t&&Sa(t,(e=>this.add(e)))}},nl=class extends tl{constructor(e){super(e)}static create(e){return new nl(e)}getValue(){return this.source.map((e=>e.getValue()))}setValue(e){let t=this.getPayload();return e.length==t.length?t.map(((t,n)=>t.setValue(e[n]))).some(Boolean):(super.setValue(e.map(rl)),!0)}};function rl(e){return(Bs(e)?Js:Xs).create(e)}function ol(e){let t=qs(e);return t?t.constructor:ba.arr(e)?nl:Bs(e)?Js:Xs}var il=(e,t)=>{let n=!ba.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,c.forwardRef)(((r,o)=>{let i=(0,c.useRef)(null),a=n&&(0,c.useCallback)((e=>{i.current=function(e,t){return e&&(ba.fun(e)?e(t):e.current=t),t}(o,e)}),[o]),[s,l]=function(e,t){let n=new Set;return el.dependencies=n,e.style&&(e={...e,style:t.createAnimatedStyle(e.style)}),e=new tl(e),el.dependencies=null,[e,n]}(r,t),u=Zs(),d=()=>{let e=i.current;n&&!e||!1===(!!e&&t.applyAnimatedValues(e,s.getValue(!0)))&&u()},f=new al(d,l),h=(0,c.useRef)();zs((()=>(h.current=f,Sa(l,(e=>Cs(e,f))),()=>{h.current&&(Sa(h.current.deps,(e=>js(e,h.current))),ea.cancel(h.current.update))}))),(0,c.useEffect)(d,[]),Us((()=>()=>{let e=h.current;Sa(e.deps,(t=>js(t,e)))}));let p=t.getComponentProps(s.getValue());return c.createElement(e,{...p,ref:a})}))},al=class{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&ea.write(this.update)}};var sl=Symbol.for("AnimatedComponent"),ll=e=>ba.str(e)?e:e&&ba.str(e.displayName)?e.displayName:ba.fun(e)&&e.name||null;function ul(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return ba.fun(e)?e(...n):e}var cl=(e,t)=>!0===e||!!(t&&e&&(ba.fun(e)?e(t):ja(e).includes(t))),dl=(e,t)=>ba.obj(e)?t&&e[t]:e,fl=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,hl=e=>e,pl=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:hl,n=gl;e.default&&!0!==e.default&&(e=e.default,n=Object.keys(e));let r={};for(let o of n){let n=t(e[o],o);ba.und(n)||(r[o]=n)}return r},gl=["config","onProps","onStart","onChange","onPause","onResume","onRest"],ml={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function yl(e){let t=function(e){let t={},n=0;if(Ca(e,((e,r)=>{ml[r]||(t[r]=e,n++)})),n)return t}(e);if(t){let n={to:t};return Ca(e,((e,r)=>r in t||(n[r]=e))),n}return{...e}}function vl(e){return e=vs(e),ba.arr(e)?e.map(vl):Bs(e)?va.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function xl(e){for(let t in e)return!0;return!1}function bl(e){return ba.fun(e)||ba.arr(e)&&ba.obj(e[0])}function wl(e,t){e.ref?.delete(e),t?.delete(e)}function Sl(e,t){t&&e.ref!==t&&(e.ref?.delete(e),t.add(e),e.ref=t)}var Cl={tension:170,friction:26,mass:1,damping:1,easing:ps.linear,clamp:!1};function jl(e,t){if(ba.und(t.decay)){let n=!ba.und(t.tension)||!ba.und(t.friction);(n||!ba.und(t.frequency)||!ba.und(t.damping)||!ba.und(t.mass))&&(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}var kl=[];function El(e,t){let{key:n,props:r,defaultProps:o,state:i,actions:a}=t;return new Promise(((t,s)=>{let l,u,c=cl(r.cancel??o?.cancel,n);if(c)h();else{ba.und(r.pause)||(i.paused=cl(r.pause,n));let e=o?.pause;!0!==e&&(e=i.paused||cl(e,n)),l=ul(r.delay||0,n),e?(i.resumeQueue.add(f),a.pause()):(a.resume(),f())}function d(){i.resumeQueue.add(f),i.timeouts.delete(u),u.cancel(),l=u.time-ea.now()}function f(){l>0&&!va.skipAnimation?(i.delayed=!0,u=ea.setTimeout(h,l),i.pauseQueue.add(d),i.timeouts.add(u)):h()}function h(){i.delayed&&(i.delayed=!1),i.pauseQueue.delete(d),i.timeouts.delete(u),e<=(i.cancelId||0)&&(c=!0);try{a.start({...r,callId:e,cancel:c},t)}catch(da){s(da)}}}))}var Tl=(e,t)=>1==t.length?t[0]:t.some((e=>e.cancelled))?Dl(e.get()):t.every((e=>e.noop))?Ol(e.get()):Il(e.get(),t.every((e=>e.finished))),Ol=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),Il=function(e,t){return{value:e,finished:t,cancelled:arguments.length>2&&void 0!==arguments[2]&&arguments[2]}},Dl=e=>({value:e,cancelled:!0,finished:!1});function Al(e,t,n,r){let{callId:o,parentId:i,onRest:a}=t,{asyncTo:s,promise:l}=n;return i||e!==s||t.reset?n.promise=(async()=>{n.asyncId=o,n.asyncTo=e;let u,c,d,f=pl(t,((e,t)=>"onRest"===t?void 0:e)),h=new Promise(((e,t)=>(u=e,c=t))),p=e=>{let t=o<=(n.cancelId||0)&&Dl(r)||o!==n.asyncId&&Il(r,!1);if(t)throw e.result=t,c(e),e},g=(e,t)=>{let i=new Pl,a=new Ml;return(async()=>{if(va.skipAnimation)throw _l(n),a.result=Il(r,!1),c(a),a;p(i);let s=ba.obj(e)?{...e}:{...t,to:e};s.parentId=o,Ca(f,((e,t)=>{ba.und(s[t])&&(s[t]=e)}));let l=await r.start(s);return p(i),n.paused&&await new Promise((e=>{n.resumeQueue.add(e)})),l})()};if(va.skipAnimation)return _l(n),Il(r,!1);try{let t;t=ba.arr(e)?(async e=>{for(let t of e)await g(t)})(e):Promise.resolve(e(g,r.stop.bind(r))),await Promise.all([t.then(u),h]),d=Il(r.get(),!0,!1)}catch(la){if(la instanceof Pl)d=la.result;else{if(!(la instanceof Ml))throw la;d=la.result}}finally{o==n.asyncId&&(n.asyncId=i,n.asyncTo=i?s:void 0,n.promise=i?l:void 0)}return ba.fun(a)&&ea.batchedUpdates((()=>{a(d,r,r.item)})),d})():l}function _l(e,t){ka(e.timeouts,(e=>e.cancel())),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}var Pl=class extends Error{result;constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},Ml=class extends Error{result;constructor(){super("SkipAnimationSignal")}},Rl=e=>e instanceof Ll,Nl=1,Ll=class extends ws{id=Nl++;_priority=0;get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){let e=qs(this);return e&&e.getValue()}to(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return va.to(this,t)}interpolate(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Fs(`${Ns}The "interpolate" function is deprecated in v9 (use "to" instead)`),va.to(this,t)}toJSON(){return this.get()}observerAdded(e){1==e&&this._attach()}observerRemoved(e){0==e&&this._detach()}_attach(){}_detach(){}_onChange(e){bs(this,{type:"change",parent:this,value:e,idle:arguments.length>1&&void 0!==arguments[1]&&arguments[1]})}_onPriorityChange(e){this.idle||Fa.sort(this),bs(this,{type:"priority",parent:this,priority:e})}},Fl=Symbol.for("SpringPhase"),Wl=e=>(1&e[Fl])>0,Bl=e=>(2&e[Fl])>0,zl=e=>(4&e[Fl])>0,Gl=(e,t)=>t?e[Fl]|=3:e[Fl]&=-3,Zl=(e,t)=>t?e[Fl]|=4:e[Fl]&=-5,Ul=class extends Ll{key;animation=new class{changed=!1;values=kl;toValues=null;fromValues=kl;to;from;config=new class{tension;friction;frequency;damping;mass;velocity=0;restVelocity;precision;progress;duration;easing;clamp;bounce;decay;round;constructor(){Object.assign(this,Cl)}};immediate=!1};queue;defaultProps={};_state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set};_pendingCalls=new Set;_lastCallId=0;_lastToId=0;_memoizedDuration=0;constructor(e,t){if(super(),!ba.und(e)||!ba.und(t)){let n=ba.obj(e)?{...e}:{...t,from:e};ba.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(Bl(this)||this._state.asyncTo)||zl(this)}get goal(){return vs(this.animation.to)}get velocity(){let e=qs(this);return e instanceof Xs?e.lastVelocity||0:e.getPayload().map((e=>e.lastVelocity||0))}get hasAnimated(){return Wl(this)}get isAnimating(){return Bl(this)}get isPaused(){return zl(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,n=!1,r=this.animation,{toValues:o}=r,{config:i}=r,a=Ys(r.to);!a&&ys(r.to)&&(o=ja(vs(r.to))),r.values.forEach(((s,l)=>{if(s.done)return;let u=s.constructor==Js?1:a?a[l].lastPosition:o[l],c=r.immediate,d=u;if(!c){if(d=s.lastPosition,i.tension<=0)return void(s.done=!0);let t,n=s.elapsedTime+=e,o=r.fromValues[l],a=null!=s.v0?s.v0:s.v0=ba.arr(i.velocity)?i.velocity[l]:i.velocity,f=i.precision||(o==u?.005:Math.min(1,.001*Math.abs(u-o)));if(ba.und(i.duration))if(i.decay){let e=!0===i.decay?.998:i.decay,r=Math.exp(-(1-e)*n);d=o+a/(1-e)*(1-r),c=Math.abs(s.lastPosition-d)<=f,t=a*r}else{t=null==s.lastVelocity?a:s.lastVelocity;let n,r=i.restVelocity||f/10,l=i.clamp?0:i.bounce,h=!ba.und(l),p=o==u?s.v0>0:o<u,g=!1,m=1,y=Math.ceil(e/m);for(let e=0;e<y&&(n=Math.abs(t)>r,n||(c=Math.abs(u-d)<=f,!c));++e){h&&(g=d==u||d>u==p,g&&(t=-t*l,d=u)),t+=(1e-6*-i.tension*(d-u)+.001*-i.friction*t)/i.mass*m,d+=t*m}}else{let r=1;i.duration>0&&(this._memoizedDuration!==i.duration&&(this._memoizedDuration=i.duration,s.durationProgress>0&&(s.elapsedTime=i.duration*s.durationProgress,n=s.elapsedTime+=e)),r=(i.progress||0)+n/this._memoizedDuration,r=r>1?1:r<0?0:r,s.durationProgress=r),d=o+i.easing(r)*(u-o),t=(d-s.lastPosition)/e,c=1==r}s.lastVelocity=t,Number.isNaN(d)&&(console.warn("Got NaN while animating:",this),c=!0)}a&&!a[l].done&&(c=!1),c?s.done=!0:t=!1,s.setValue(d,i.round)&&(n=!0)}));let s=qs(this),l=s.getValue();if(t){let e=vs(r.to);l===e&&!n||i.decay?n&&i.decay&&this._onChange(l):(s.setValue(e),this._onChange(e)),this._stop()}else n&&this._onChange(l)}set(e){return ea.batchedUpdates((()=>{this._stop(),this._focus(e),this._set(e)})),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(Bl(this)){let{to:e,config:t}=this.animation;ea.batchedUpdates((()=>{this._onStart(),t.decay||this._set(e,!1),this._stop()}))}return this}update(e){return(this.queue||(this.queue=[])).push(e),this}start(e,t){let n;return ba.und(e)?(n=this.queue||[],this.queue=[]):n=[ba.obj(e)?e:{...t,to:e}],Promise.all(n.map((e=>this._update(e)))).then((e=>Tl(this,e)))}stop(e){let{to:t}=this.animation;return this._focus(this.get()),_l(this._state,e&&this._lastCallId),ea.batchedUpdates((()=>this._stop(t,e))),this}reset(){this._update({reset:!0})}eventObserved(e){"change"==e.type?this._start():"priority"==e.type&&(this.priority=e.priority+1)}_prepareNode(e){let t=this.key||"",{to:n,from:r}=e;n=ba.obj(n)?n[t]:n,(null==n||bl(n))&&(n=void 0),r=ba.obj(r)?r[t]:r,null==r&&(r=void 0);let o={to:n,from:r};return Wl(this)||(e.reverse&&([n,r]=[r,n]),r=vs(r),ba.und(r)?qs(this)||this._set(n):this._set(r)),o}_update(e,t){let{...n}=e,{key:r,defaultProps:o}=this;n.default&&Object.assign(o,pl(n,((e,t)=>/^on/.test(t)?dl(e,r):e))),Ql(this,n,"onProps"),Xl(this,"onProps",n,this);let i=this._prepareNode(n);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");let a=this._state;return El(++this._lastCallId,{key:r,props:n,defaultProps:o,state:a,actions:{pause:()=>{zl(this)||(Zl(this,!0),Oa(a.pauseQueue),Xl(this,"onPause",Il(this,Hl(this,this.animation.to)),this))},resume:()=>{zl(this)&&(Zl(this,!1),Bl(this)&&this._resume(),Oa(a.resumeQueue),Xl(this,"onResume",Il(this,Hl(this,this.animation.to)),this))},start:this._merge.bind(this,i)}}).then((e=>{if(n.loop&&e.finished&&(!t||!e.noop)){let e=Kl(n);if(e)return this._update(e,!0)}return e}))}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(Dl(this));let r=!ba.und(e.to),o=!ba.und(e.from);if(r||o){if(!(t.callId>this._lastToId))return n(Dl(this));this._lastToId=t.callId}let{key:i,defaultProps:a,animation:s}=this,{to:l,from:u}=s,{to:c=l,from:d=u}=e;o&&!r&&(!t.default||ba.und(c))&&(c=d),t.reverse&&([c,d]=[d,c]);let f=!wa(d,u);f&&(s.from=d),d=vs(d);let h=!wa(c,l);h&&this._focus(c);let p=bl(t.to),{config:g}=s,{decay:m,velocity:y}=g;(r||o)&&(g.velocity=0),t.config&&!p&&function(e,t,n){n&&(jl(n={...n},t),t={...n,...t}),jl(e,t),Object.assign(e,t);for(let a in Cl)null==e[a]&&(e[a]=Cl[a]);let{frequency:r,damping:o}=e,{mass:i}=e;ba.und(r)||(r<.01&&(r=.01),o<0&&(o=0),e.tension=Math.pow(2*Math.PI/r,2)*i,e.friction=4*Math.PI*o*i/r)}(g,ul(t.config,i),t.config!==a.config?ul(a.config,i):void 0);let v=qs(this);if(!v||ba.und(c))return n(Il(this,!0));let x=ba.und(t.reset)?o&&!t.default:!ba.und(d)&&cl(t.reset,i),b=x?d:this.get(),w=vl(c),S=ba.num(w)||ba.arr(w)||Bs(w),C=!p&&(!S||cl(a.immediate||t.immediate,i));if(h){let e=ol(c);if(e!==v.constructor){if(!C)throw Error(`Cannot animate between ${v.constructor.name} and ${e.name}, as the "to" prop suggests`);v=this._set(w)}}let j=v.constructor,k=ys(c),E=!1;if(!k){let e=x||!Wl(this)&&f;(h||e)&&(E=wa(vl(b),w),k=!E),(!wa(s.immediate,C)&&!C||!wa(g.decay,m)||!wa(g.velocity,y))&&(k=!0)}if(E&&Bl(this)&&(s.changed&&!x?k=!0:k||this._stop(l)),!p&&((k||ys(l))&&(s.values=v.getPayload(),s.toValues=ys(c)?null:j==Js?[1]:ja(w)),s.immediate!=C&&(s.immediate=C,!C&&!x&&this._set(l)),k)){let{onRest:e}=s;Sa(Yl,(e=>Ql(this,t,e)));let r=Il(this,Hl(this,l));Oa(this._pendingCalls,r),this._pendingCalls.add(n),s.changed&&ea.batchedUpdates((()=>{s.changed=!x,e?.(r,this),x?ul(a.onRest,r):s.onStart?.(r,this)}))}x&&this._set(b),p?n(Al(t.to,t,this._state,this)):k?this._start():Bl(this)&&!h?this._pendingCalls.add(n):n(Ol(b))}_focus(e){let t=this.animation;e!==t.to&&(xs(this)&&this._detach(),t.to=e,xs(this)&&this._attach())}_attach(){let e=0,{to:t}=this.animation;ys(t)&&(Cs(t,this),Rl(t)&&(e=t.priority+1)),this.priority=e}_detach(){let{to:e}=this.animation;ys(e)&&js(e,this)}_set(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=vs(e);if(!ba.und(n)){let e=qs(this);if(!e||!wa(n,e.getValue())){let r=ol(n);e&&e.constructor==r?e.setValue(n):$s(this,r.create(n)),e&&ea.batchedUpdates((()=>{this._onChange(n,t)}))}}return qs(this)}_onStart(){let e=this.animation;e.changed||(e.changed=!0,Xl(this,"onStart",Il(this,Hl(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),ul(this.animation.onChange,e,this)),ul(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){let e=this.animation;qs(this).reset(vs(e.to)),e.immediate||(e.fromValues=e.values.map((e=>e.lastPosition))),Bl(this)||(Gl(this,!0),zl(this)||this._resume())}_resume(){va.skipAnimation?this.finish():Fa.start(this)}_stop(e,t){if(Bl(this)){Gl(this,!1);let n=this.animation;Sa(n.values,(e=>{e.done=!0})),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),bs(this,{type:"idle",parent:this});let r=t?Dl(this.get()):Il(this.get(),Hl(this,e??n.to));Oa(this._pendingCalls,r),n.changed&&(n.changed=!1,Xl(this,"onRest",r,this))}}};function Hl(e,t){let n=vl(t);return wa(vl(e.get()),n)}function Kl(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.loop,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.to,r=ul(t);if(r){let o=!0!==r&&yl(r),i=(o||e).reverse,a=!o||o.reset;return Vl({...e,loop:t,default:!1,pause:void 0,to:!i||bl(n)?n:void 0,from:a?e.from:void 0,reset:a,...o})}}function Vl(e){let{to:t,from:n}=e=yl(e),r=new Set;return ba.obj(t)&&$l(t,r),ba.obj(n)&&$l(n,r),e.keys=r.size?Array.from(r):null,e}function ql(e){let t=Vl(e);return ba.und(t.default)&&(t.default=pl(t)),t}function $l(e,t){Ca(e,((e,n)=>null!=e&&t.add(n)))}var Yl=["onStart","onRest","onChange","onPause","onResume"];function Ql(e,t,n){e.animation[n]=t[n]!==fl(t,n)?dl(t[n],e.key):void 0}function Xl(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];e.animation[t]?.(...r),e.defaultProps[t]?.(...r)}var Jl=["onStart","onChange","onRest"],eu=1,tu=class{id=eu++;springs={};queue=[];ref;_flush;_initialProps;_lastAsyncId=0;_active=new Set;_changed=new Set;_started=!1;_item;_state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set};_events={onStart:new Map,onChange:new Map,onRest:new Map};constructor(e,t){this._onFrame=this._onFrame.bind(this),t&&(this._flush=t),e&&this.start({default:!0,...e})}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every((e=>e.idle&&!e.isDelayed&&!e.isPaused))}get item(){return this._item}set item(e){this._item=e}get(){let e={};return this.each(((t,n)=>e[n]=t.get())),e}set(e){for(let t in e){let n=e[t];ba.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(Vl(e)),this}start(e){let{queue:t}=this;return e?t=ja(e).map(Vl):this.queue=[],this._flush?this._flush(this,t):(lu(this,t),nu(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){let n=this.springs;Sa(ja(t),(t=>n[t].stop(!!e)))}else _l(this._state,this._lastAsyncId),this.each((t=>t.stop(!!e)));return this}pause(e){if(ba.und(e))this.start({pause:!0});else{let t=this.springs;Sa(ja(e),(e=>t[e].pause()))}return this}resume(e){if(ba.und(e))this.start({pause:!1});else{let t=this.springs;Sa(ja(e),(e=>t[e].resume()))}return this}each(e){Ca(this.springs,e)}_onFrame(){let{onStart:e,onChange:t,onRest:n}=this._events,r=this._active.size>0,o=this._changed.size>0;(r&&!this._started||o&&!this._started)&&(this._started=!0,ka(e,(e=>{let[t,n]=e;n.value=this.get(),t(n,this,this._item)})));let i=!r&&this._started,a=o||i&&n.size?this.get():null;o&&t.size&&ka(t,(e=>{let[t,n]=e;n.value=a,t(n,this,this._item)})),i&&(this._started=!1,ka(n,(e=>{let[t,n]=e;n.value=a,t(n,this,this._item)})))}eventObserved(e){if("change"==e.type)this._changed.add(e.parent),e.idle||this._active.add(e.parent);else{if("idle"!=e.type)return;this._active.delete(e.parent)}ea.onFrame(this._onFrame)}};function nu(e,t){return Promise.all(t.map((t=>ru(e,t)))).then((t=>Tl(e,t)))}async function ru(e,t,n){let{keys:r,to:o,from:i,loop:a,onRest:s,onResolve:l}=t,u=ba.obj(t.default)&&t.default;a&&(t.loop=!1),!1===o&&(t.to=null),!1===i&&(t.from=null);let c=ba.arr(o)||ba.fun(o)?o:void 0;c?(t.to=void 0,t.onRest=void 0,u&&(u.onRest=void 0)):Sa(Jl,(n=>{let r=t[n];if(ba.fun(r)){let o=e._events[n];t[n]=e=>{let{finished:t,cancelled:n}=e,i=o.get(r);i?(t||(i.finished=!1),n&&(i.cancelled=!0)):o.set(r,{value:null,finished:t||!1,cancelled:n||!1})},u&&(u[n]=t[n])}}));let d=e._state;t.pause===!d.paused?(d.paused=t.pause,Oa(t.pause?d.pauseQueue:d.resumeQueue)):d.paused&&(t.pause=!0);let f=(r||Object.keys(e.springs)).map((n=>e.springs[n].start(t))),h=!0===t.cancel||!0===fl(t,"cancel");(c||h&&d.asyncId)&&f.push(El(++e._lastAsyncId,{props:t,state:d,actions:{pause:xa,resume:xa,start(t,n){h?(_l(d,e._lastAsyncId),n(Dl(e))):(t.onRest=s,n(Al(c,t,d,e)))}}})),d.paused&&await new Promise((e=>{d.resumeQueue.add(e)}));let p=Tl(e,await Promise.all(f));if(a&&p.finished&&(!n||!p.noop)){let n=Kl(t,a,o);if(n)return lu(e,[n]),ru(e,n,!0)}return l&&ea.batchedUpdates((()=>l(p,e,e.item))),p}function ou(e,t){let n={...e.springs};return t&&Sa(ja(t),(e=>{ba.und(e.keys)&&(e=Vl(e)),ba.obj(e.to)||(e={...e,to:void 0}),su(n,e,(e=>au(e)))})),iu(e,n),n}function iu(e,t){Ca(t,((t,n)=>{e.springs[n]||(e.springs[n]=t,Cs(t,e))}))}function au(e,t){let n=new Ul;return n.key=e,t&&Cs(n,t),n}function su(e,t,n){t.keys&&Sa(t.keys,(r=>{(e[r]||(e[r]=n(r)))._prepareNode(t)}))}function lu(e,t){Sa(t,(t=>{su(e.springs,t,(t=>au(t,e)))}))}var uu,cu,du=e=>{let{children:t,...n}=e,r=(0,c.useContext)(fu),o=n.pause||!!r.pause,i=n.immediate||!!r.immediate;n=function(e,t){let[n]=(0,c.useState)((()=>({inputs:t,result:e()}))),r=(0,c.useRef)(),o=r.current,i=o;return i?t&&i.inputs&&function(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(t,i.inputs)||(i={inputs:t,result:e()}):i=n,(0,c.useEffect)((()=>{r.current=i,o==n&&(n.inputs=n.result=void 0)}),[i]),i.result}((()=>({pause:o,immediate:i})),[o,i]);let{Provider:a}=fu;return c.createElement(a,{value:n},t)},fu=(uu=du,cu={},Object.assign(uu,c.createContext(cu)),uu.Provider._context=uu,uu.Consumer._context=uu,uu);du.Provider=fu.Provider,du.Consumer=fu.Consumer;var hu=()=>{let e=[],t=function(t){Ws(`${Ns}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`);let r=[];return Sa(e,((e,o)=>{if(ba.und(t))r.push(e.start());else{let i=n(t,e,o);i&&r.push(e.start(i))}})),r};t.current=e,t.add=function(t){e.includes(t)||e.push(t)},t.delete=function(t){let n=e.indexOf(t);~n&&e.splice(n,1)},t.pause=function(){return Sa(e,(e=>e.pause(...arguments))),this},t.resume=function(){return Sa(e,(e=>e.resume(...arguments))),this},t.set=function(t){Sa(e,((e,n)=>{let r=ba.fun(t)?t(n,e):t;r&&e.set(r)}))},t.start=function(t){let n=[];return Sa(e,((e,r)=>{if(ba.und(t))n.push(e.start());else{let o=this._getProps(t,e,r);o&&n.push(e.start(o))}})),n},t.stop=function(){return Sa(e,(e=>e.stop(...arguments))),this},t.update=function(t){return Sa(e,((e,n)=>e.update(this._getProps(t,e,n)))),this};let n=function(e,t,n){return ba.fun(e)?e(n,t):e};return t._getProps=n,t};function pu(e,t,n){let r=ba.fun(t)&&t;r&&!n&&(n=[]);let o=(0,c.useMemo)((()=>r||3==arguments.length?hu():void 0),[]),i=(0,c.useRef)(0),a=Zs(),s=(0,c.useMemo)((()=>({ctrls:[],queue:[],flush(e,t){let n=ou(e,t);return i.current>0&&!s.queue.length&&!Object.keys(n).some((t=>!e.springs[t]))?nu(e,t):new Promise((r=>{iu(e,n),s.queue.push((()=>{r(nu(e,t))})),a()}))}})),[]),l=(0,c.useRef)([...s.ctrls]),u=[],d=Ks(e)||0;function f(e,n){for(let o=e;o<n;o++){let e=l.current[o]||(l.current[o]=new tu(null,s.flush)),n=r?r(o,e):t[o];n&&(u[o]=ql(n))}}(0,c.useMemo)((()=>{Sa(l.current.slice(e,d),(e=>{wl(e,o),e.stop(!0)})),l.current.length=e,f(d,e)}),[e]),(0,c.useMemo)((()=>{f(0,Math.min(d,e))}),n);let h=l.current.map(((e,t)=>ou(e,u[t]))),p=(0,c.useContext)(du),g=Ks(p),m=p!==g&&xl(p);zs((()=>{i.current++,s.ctrls=l.current;let{queue:e}=s;e.length&&(s.queue=[],Sa(e,(e=>e()))),Sa(l.current,((e,t)=>{o?.add(e),m&&e.start({default:p});let n=u[t];n&&(Sl(e,n.ref),e.ref?e.queue.push(n):e.start(n))}))})),Us((()=>()=>{Sa(s.ctrls,(e=>e.stop(!0)))}));let y=h.map((e=>({...e})));return o?[y,o]:y}function gu(e,t){let n=ba.fun(e),[[r],o]=pu(1,n?e:[e],n?t||[]:t);return n||2==arguments.length?[r,o]:r}function mu(e,t,n){let r=ba.fun(t)&&t,{reset:o,sort:i,trail:a=0,expires:s=!0,exitBeforeEnter:l=!1,onDestroyed:u,ref:d,config:f}=r?r():t,h=(0,c.useMemo)((()=>r||3==arguments.length?hu():void 0),[]),p=ja(e),g=[],m=(0,c.useRef)(null),y=o?null:m.current;zs((()=>{m.current=g})),Us((()=>(Sa(g,(e=>{h?.add(e.ctrl),e.ctrl.ref=h})),()=>{Sa(m.current,(e=>{e.expired&&clearTimeout(e.expirationId),wl(e.ctrl,h),e.ctrl.stop(!0)}))})));let v=function(e,t,n){let{key:r,keys:o=r}=t;if(null===o){let t=new Set;return e.map((e=>{let r=n&&n.find((n=>n.item===e&&"leave"!==n.phase&&!t.has(n)));return r?(t.add(r),r.key):yu++}))}return ba.und(o)?e:ba.fun(o)?e.map(o):ja(o)}(p,r?r():t,y),x=o&&m.current||[];zs((()=>Sa(x,(e=>{let{ctrl:t,item:n,key:r}=e;wl(t,h),ul(u,n,r)}))));let b=[];if(y&&Sa(y,((e,t)=>{e.expired?(clearTimeout(e.expirationId),x.push(e)):~(t=b[t]=v.indexOf(e.key))&&(g[t]=e)})),Sa(p,((e,t)=>{g[t]||(g[t]={key:v[t],item:e,phase:"mount",ctrl:new tu},g[t].ctrl.item=e)})),b.length){let e=-1,{leave:n}=r?r():t;Sa(b,((t,r)=>{let o=y[r];~t?(e=g.indexOf(o),g[e]={...o,item:p[t]}):n&&g.splice(++e,0,o)}))}ba.fun(i)&&g.sort(((e,t)=>i(e.item,t.item)));let w=-a,S=Zs(),C=pl(t),j=new Map,k=(0,c.useRef)(new Map),E=(0,c.useRef)(!1);Sa(g,((e,n)=>{let o,i,u=e.key,c=e.phase,h=r?r():t,p=ul(h.delay||0,u);if("mount"==c)o=h.enter,i="enter";else{let e=v.indexOf(u)<0;if("leave"!=c)if(e)o=h.leave,i="leave";else{if(!(o=h.update))return;i="update"}else{if(e)return;o=h.enter,i="enter"}}if(o=ul(o,e.item,n),o=ba.obj(o)?yl(o):{to:o},!o.config){let t=f||C.config;o.config=ul(t,e.item,n,i)}w+=a;let g={...C,delay:p+w,ref:d,immediate:h.immediate,reset:!1,...o};if("enter"==i&&ba.und(g.from)){let o=r?r():t,i=ba.und(o.initial)||y?o.from:o.initial;g.from=ul(i,e.item,n)}let{onResolve:x}=g;g.onResolve=e=>{ul(x,e);let t=m.current,n=t.find((e=>e.key===u));if(n&&(!e.cancelled||"update"==n.phase)&&n.ctrl.idle){let e=t.every((e=>e.ctrl.idle));if("leave"==n.phase){let t=ul(s,n.item);if(!1!==t){let r=!0===t?0:t;if(n.expired=!0,!e&&r>0)return void(r<=2147483647&&(n.expirationId=setTimeout(S,r)))}}e&&t.some((e=>e.expired))&&(k.current.delete(n),l&&(E.current=!0),S())}};let b=ou(e.ctrl,g);"leave"===i&&l?k.current.set(e,{phase:i,springs:b,payload:g}):j.set(e,{phase:i,springs:b,payload:g})}));let T=(0,c.useContext)(du),O=Ks(T),I=T!==O&&xl(T);zs((()=>{I&&Sa(g,(e=>{e.ctrl.start({default:T})}))}),[T]),Sa(j,((e,t)=>{if(k.current.size){let e=g.findIndex((e=>e.key===t.key));g.splice(e,1)}})),zs((()=>{Sa(k.current.size?k.current:j,((e,t)=>{let{phase:n,payload:r}=e,{ctrl:o}=t;t.phase=n,h?.add(o),I&&"enter"==n&&o.start({default:T}),r&&(Sl(o,r.ref),!o.ref&&!h||E.current?(o.start(r),E.current&&(E.current=!1)):o.update(r))}))}),o?void 0:n);let D=e=>c.createElement(c.Fragment,null,g.map(((t,n)=>{let{springs:r}=j.get(t)||t.ctrl,o=e({...r},t.item,t,n);return o&&o.type?c.createElement(o.type,{...o.props,key:ba.str(t.key)||ba.num(t.key)?t.key:t.ctrl.id,ref:o.ref}):o})));return h?[D,h]:D}var yu=1;var vu=class extends Ll{constructor(e,t){super(),this.source=e,this.calc=ss(...t);let n=this._get(),r=ol(n);$s(this,r.create(n))}key;idle=!0;calc;_active=new Set;advance(e){let t=this._get();wa(t,this.get())||(qs(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&bu(this._active)&&wu(this)}_get(){let e=ba.arr(this.source)?this.source.map(vs):ja(vs(this.source));return this.calc(...e)}_start(){this.idle&&!bu(this._active)&&(this.idle=!1,Sa(Ys(this),(e=>{e.done=!1})),va.skipAnimation?(ea.batchedUpdates((()=>this.advance())),wu(this)):Fa.start(this))}_attach(){let e=1;Sa(ja(this.source),(t=>{ys(t)&&Cs(t,this),Rl(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))})),this.priority=e,this._start()}_detach(){Sa(ja(this.source),(e=>{ys(e)&&js(e,this)})),this._active.clear(),wu(this)}eventObserved(e){"change"==e.type?e.idle?this.advance():(this._active.add(e.parent),this._start()):"idle"==e.type?this._active.delete(e.parent):"priority"==e.type&&(this.priority=ja(this.source).reduce(((e,t)=>Math.max(e,(Rl(t)?t.priority:0)+1)),0))}};function xu(e){return!1!==e.idle}function bu(e){return!e.size||Array.from(e).every(xu)}function wu(e){e.idle||(e.idle=!0,Sa(Ys(e),(e=>{e.done=!0})),bs(e,{type:"idle",parent:e}))}va.assign({createStringInterpolator:Rs,to:(e,t)=>new vu(e,t)});Fa.advance;var Su=n(6214),Cu=/^--/;function ju(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||Cu.test(e)||Eu.hasOwnProperty(e)&&Eu[e]?(""+t).trim():t+"px"}var ku={};var Eu={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Tu=["Webkit","Ms","Moz","O"];Eu=Object.keys(Eu).reduce(((e,t)=>(Tu.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),Eu);var Ou=/^(matrix|translate|scale|rotate|skew)/,Iu=/^(translate)/,Du=/^(rotate|skew)/,Au=(e,t)=>ba.num(e)&&0!==e?e+t:e,_u=(e,t)=>ba.arr(e)?e.every((e=>_u(e,t))):ba.num(e)?e===t:parseFloat(e)===t,Pu=class extends tl{constructor(e){let{x:t,y:n,z:r,...o}=e,i=[],a=[];(t||n||r)&&(i.push([t||0,n||0,r||0]),a.push((e=>[`translate3d(${e.map((e=>Au(e,"px"))).join(",")})`,_u(e,0)]))),Ca(o,((e,t)=>{if("transform"===t)i.push([e||""]),a.push((e=>[e,""===e]));else if(Ou.test(t)){if(delete o[t],ba.und(e))return;let n=Iu.test(t)?"px":Du.test(t)?"deg":"";i.push(ja(e)),a.push("rotate3d"===t?e=>{let[t,r,o,i]=e;return[`rotate3d(${t},${r},${o},${Au(i,n)})`,_u(i,0)]}:e=>[`${t}(${e.map((e=>Au(e,n))).join(",")})`,_u(e,t.startsWith("scale")?1:0)])}})),i.length&&(o.transform=new Mu(i,a)),super(o)}},Mu=class extends ws{constructor(e,t){super(),this.inputs=e,this.transforms=t}_value=null;get(){return this._value||(this._value=this._get())}_get(){let e="",t=!0;return Sa(this.inputs,((n,r)=>{let o=vs(n[0]),[i,a]=this.transforms[r](ba.arr(o)?o:n.map(vs));e+=" "+i,t=t&&a})),t?"none":e}observerAdded(e){1==e&&Sa(this.inputs,(e=>Sa(e,(e=>ys(e)&&Cs(e,this)))))}observerRemoved(e){0==e&&Sa(this.inputs,(e=>Sa(e,(e=>ys(e)&&js(e,this)))))}eventObserved(e){"change"==e.type&&(this._value=null),bs(this,e)}};va.assign({batchedUpdates:Su.unstable_batchedUpdates,createStringInterpolator:Rs,colors:{transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199}});var Ru=function(e){let{applyAnimatedValues:t=(()=>!1),createAnimatedStyle:n=(e=>new tl(e)),getComponentProps:r=(e=>e)}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:r},i=e=>{let t=ll(e)||"Anonymous";return(e=ba.str(e)?i[e]||(i[e]=il(e,o)):e[sl]||(e[sl]=il(e,o))).displayName=`Animated(${t})`,e};return Ca(e,((t,n)=>{ba.arr(e)&&(n=ll(t)),i[n]=i(t)})),{animated:i}}(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],{applyAnimatedValues:function(e,t){if(!e.nodeType||!e.setAttribute)return!1;let n="filter"===e.nodeName||e.parentNode&&"filter"===e.parentNode.nodeName,{style:r,children:o,scrollTop:i,scrollLeft:a,viewBox:s,...l}=t,u=Object.values(l),c=Object.keys(l).map((t=>n||e.hasAttribute(t)?t:ku[t]||(ku[t]=t.replace(/([A-Z])/g,(e=>"-"+e.toLowerCase())))));void 0!==o&&(e.textContent=o);for(let d in r)if(r.hasOwnProperty(d)){let t=ju(d,r[d]);Cu.test(d)?e.style.setProperty(d,t):e.style[d]=t}c.forEach(((t,n)=>{e.setAttribute(t,u[n])})),void 0!==i&&(e.scrollTop=i),void 0!==a&&(e.scrollLeft=a),void 0!==s&&e.setAttribute("viewBox",s)},createAnimatedStyle:e=>new Pu(e),getComponentProps:e=>{let{scrollTop:t,scrollLeft:n,...r}=e;return r}}),Nu=Ru.animated;var Lu=(0,d.$j)((e=>({accountsSyncing:e.account.accountsSyncing})),y)((function(e){let{accountsSyncing:t}=e;const n=mu(t?"__all"===t?"accounts":t:null,{from:{opacity:0,transform:"translateY(-100px)"},enter:{opacity:1,transform:"translateY(0)"},leave:{opacity:0,transform:"translateY(-100px)"},unique:!0});return(0,z.jsx)($.G7,{style:{position:"absolute",top:0,left:0,right:0,marginTop:5,alignItems:"center",zIndex:501},children:n(((e,t)=>t&&(0,z.jsx)(Nu.div,{style:e,children:(0,z.jsxs)($.G7,{style:{borderRadius:4,backgroundColor:H.O9.b9,color:H.O9.b1,padding:"5px 13px",flexDirection:"row",alignItems:"center",...H.W2.shadow},children:[(0,z.jsx)(Kr,{animating:!0,iconStyle:{color:H.O9.b1}}),(0,z.jsxs)($.xv,{children:["Syncing ",t]})]})},t)))})}));function Fu(e,t){return e.map((e=>(e.id===t.cat_group&&(e.categories=[t,...e.categories]),{...e})))}function Wu(e,t){return e.map((e=>(e.id===t.cat_group&&(e.categories=e.categories.map((e=>e.id===t.id?{...e,...t}:e))),e)))}function Bu(e,t,n,r){if(t===r)return e;let o=e.reduce(((e,n)=>e||n.categories.find((e=>e.id===t))),null);return o={...o,cat_group:n},e.map((e=>(e.id===n?(e.categories=e.categories.reduce(((e,n)=>(n.id===r?(e.push(o),e.push(n)):n.id!==t&&e.push(n),e)),[]),r||e.categories.push(o)):e.categories=e.categories.filter((e=>e.id!==t)),{...e})))}function zu(e,t,n){if(t===n)return e;let r=e.find((e=>e.id===t));return e=e.reduce(((e,o)=>(o.id===n?(e.push(r),e.push(o)):o.id!==t&&e.push(o),e)),[]),n||e.push(r),e}function Gu(e,t){return e.map((e=>(e.categories=e.categories.filter((e=>e.id!==t)),e)))}function Zu(e,t){return[...e,t]}function Uu(e,t){return e.map((e=>e.id===t.id?{...e,...t}:e))}function Hu(e,t){return e.filter((e=>e.id!==t))}const Ku={reportBudget:!1,goalTemplatesEnabled:!1};function Vu(e){return(0,d.v9)((t=>{const n=t.prefs.local[`flags.${e}`];return void 0===n?Ku[e]||!1:n}))}var qu=n(9515),$u=n(2177),Yu=n(2756);var Qu=e=>(0,z.jsxs)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:[(0,z.jsx)("rect",{x:.5,y:2.5,width:23,height:3,rx:1,ry:1,fill:"currentColor"}),(0,z.jsx)("rect",{x:.5,y:10.5,width:23,height:3,rx:1,ry:1,fill:"currentColor"}),(0,z.jsx)("rect",{x:.5,y:18.5,width:23,height:3,rx:1,ry:1,fill:"currentColor"})]});var Xu=e=>(0,z.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"#242134",...e.style},children:(0,z.jsx)("path",{d:"M2.93 17.07A10 10 0 1 1 17.07 2.93 10 10 0 0 1 2.93 17.07zm12.73-1.41A8 8 0 1 0 4.34 4.34a8 8 0 0 0 11.32 11.32zM9 5h2v6H9V5zm0 8h2v2H9v-2z",fill:"currentColor"})});function Ju(e,t){switch(e.toUpperCase()){case"ITEM_ERROR":switch(t.toUpperCase()){case"NO_ACCOUNTS":return"No open accounts could be found. Did you close the account? If so, unlink the account.";case"ITEM_LOGIN_REQUIRED":return"Your password or something else has changed with your bank and you need to login again."}break;case"INVALID_INPUT":if("INVALID_ACCESS_TOKEN"===t.toUpperCase())return"Item is no longer authorized. You need to login again.";break;case"RATE_LIMIT_EXCEEDED":return"Rate limit exceeded for this item. Please try again later."}return(0,z.jsxs)(z.Fragment,{children:["An internal error occurred. Try to login again, or get"," ",(0,z.jsx)($.dL,{to:"https://actualbudget.org/contact/",children:"in touch"})," ","for support."]})}var ec=(0,d.$j)((e=>({accounts:e.queries.accounts,failedAccounts:e.account.failedAccounts})),y)((function(e){let{accounts:t,failedAccounts:n,unlinkAccount:r,pushModal:o}=e,{id:i}=(0,Pt.UO)(),[a,s]=(0,c.useState)(!1);if(!n)return null;let l=n.get(i);if(!l)return null;let u=t.find((e=>e.id===i)),{type:d,code:f}=l,h="ITEM_ERROR"===d&&"ITEM_LOGIN_REQUIRED"===f||"INVALID_INPUT"===d&&"INVALID_ACCESS_TOKEN"===f;async function p(){r(u.id),s(!1)}return(0,z.jsxs)($.G7,{children:[(0,z.jsxs)($.zx,{bare:!0,style:{flexDirection:"row",alignItems:"center",color:H.O9.r5,backgroundColor:H.O9.r10,padding:"4px 8px",borderRadius:4},onClick:()=>s(!0),children:[(0,z.jsx)(Xu,{style:{width:14,height:14,marginRight:5,color:"currentColor"}})," ","This account is experiencing connection problems. Let\u2019s fix it."]}),a&&(0,z.jsxs)($.u,{position:"bottom-left",onClose:()=>s(!1),style:{fontSize:14,padding:15,maxWidth:400},children:[(0,z.jsx)("div",{style:{marginBottom:"1.15em"},children:"The server returned the following error:"}),(0,z.jsx)("div",{style:{marginBottom:"1.25em",color:H.O9.r5},children:Ju(l.type,l.code)}),(0,z.jsx)($.G7,{style:{justifyContent:"flex-end",flexDirection:"row"},children:h?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)($.zx,{onClick:p,children:"Unlink"}),(0,z.jsx)($.zx,{primary:!0,onClick:function(){s(!1),Bn(o,{upgradingAccountId:u.account_id})},style:{marginLeft:5},children:"Reauthorize"})]}):(0,z.jsx)($.zx,{onClick:p,children:"Unlink account"})})]})]})}));let tc=(0,c.createContext)();function nc(e){let{children:t}=e,[n,r]=(0,c.useState)(1);return(0,z.jsx)(tc.Provider,{value:{displayMax:n,setDisplayMax:r},children:t})}function rc(){return(0,c.useContext)(tc)}function oc(e){let{color:t,onClick:n}=e;return(0,z.jsx)(nr.Z,{style:{width:13,height:13,color:t,marginRight:5},onClick:n})}function ic(e){let{maxMonths:t,onChange:n}=e,{displayMax:r}=rc();if(r<=1)return null;let o=[];for(let i=1;i<=r;i++)o.push((0,z.jsx)(oc,{color:t>=i?H.O9.n5:H.O9.n8,onClick:()=>n(i)},i));return(0,z.jsx)($.G7,{style:{flexDirection:"row",marginRight:20,marginTop:-1,WebkitAppRegion:"no-drag","& svg":{transition:"transform .15s"},"& svg:hover":{transform:"scale(1.2)"}},title:"Choose the number of months shown at a time",children:o})}var ac=e=>(0,z.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"#242134",...e.style},children:(0,z.jsx)("path",{d:"m12.95 10.707.707-.707L8 4.343 6.586 5.757 10.828 10l-4.242 4.243L8 15.657l4.95-4.95z",fill:"currentColor"})});var sc=e=>(0,z.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"#242134",...e.style},children:(0,z.jsx)("path",{d:"M11 12h6v-1l-3-1V2l3-1V0H3v1l3 1v8l-3 1v1h6v7l1 1 1-1v-7z",fill:"currentColor"})});var lc=e=>(0,z.jsx)("svg",{...e,viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",style:{color:"#242134",...e.style},children:(0,z.jsx)("path",{d:"M19 18h-1v-8c0-.6-.4-1-1-1s-1 .4-1 1v8h-3V1c0-.6-.4-1-1-1s-1 .4-1 1v17H8V7c0-.6-.4-1-1-1s-1 .4-1 1v11H3V3c0-.6-.4-1-1-1s-1 .4-1 1v15c-.6 0-1 .4-1 1s.4 1 1 1h18c.6 0 1-.4 1-1s-.4-1-1-1z",fill:"currentColor"})});var uc=e=>(0,z.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"#242134",...e.style},children:(0,z.jsx)("path",{d:"M18 9.87V20H2V9.87a4.25 4.25 0 0 0 3-.38V14h10V9.5a4.26 4.26 0 0 0 3 .37zM3 0h4l-.67 6.03A3.43 3.43 0 0 1 3 9C1.34 9 .42 7.73.95 6.15L3 0zm5 0h4l.7 6.3c.17 1.5-.91 2.7-2.42 2.7h-.56A2.38 2.38 0 0 1 7.3 6.3L8 0zm5 0h4l2.05 6.15C19.58 7.73 18.65 9 17 9a3.42 3.42 0 0 1-3.33-2.97L13 0z",fill:"currentColor"})});var cc=e=>(0,z.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"#242134",...e.style},children:(0,z.jsx)("path",{d:"M17 16v4h-2v-4h-2v-3h6v3h-2zM1 9h6v3H1V9zm6-4h6v3H7V5zM3 0h2v8H3V0zm12 0h2v12h-2V0zM9 0h2v4H9V0zM3 12h2v8H3v-8zm6-4h2v12H9V8z",fill:"currentColor"})});var dc=e=>(0,z.jsxs)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:[(0,z.jsx)("path",{d:"M10.416 12a2.643 2.643 0 0 1 .775-1.875L20.732.584a1.768 1.768 0 0 1 2.5 2.5l-8.739 8.739a.25.25 0 0 0 0 .354l8.739 8.739a1.768 1.768 0 0 1-2.5 2.5l-9.541-9.541A2.643 2.643 0 0 1 10.416 12Z",fill:"currentColor"}),(0,z.jsx)("path",{d:"M.25 12a2.643 2.643 0 0 1 .775-1.875L10.566.584a1.768 1.768 0 0 1 2.5 2.5l-8.739 8.739a.25.25 0 0 0 0 .354l8.739 8.739a1.768 1.768 0 0 1-2.5 2.5l-9.541-9.541A2.643 2.643 0 0 1 .25 12Z",fill:"currentColor"})]}),fc=n(1231);const hc="undefined"!==typeof window?c.useLayoutEffect:c.useEffect;function pc(e,t,n){const[r,o]=function(e,t,n){const[r,o]=(0,c.useState)((()=>t(e))),i=(0,c.useCallback)((()=>{const i=t(e);fc(r,i)||(o(i),n&&n())}),[r,e,n]);return hc(i),[r,i]}(e,t,n);return hc((function(){const t=e.getHandlerId();if(null!=t)return e.subscribeToStateChange(o,{handlerIds:[t]})}),[e,o]),r}function gc(e,t,n){return pc(t,e||(()=>({})),(()=>n.reconnect()))}function mc(e,t){const n=[...t||[]];return null==t&&"function"!==typeof e&&n.push(e),(0,c.useMemo)((()=>"function"===typeof e?e():e),n)}function yc(e){return(0,c.useMemo)((()=>e.hooks.dragSource()),[e])}function vc(e){return(0,c.useMemo)((()=>e.hooks.dragPreview()),[e])}function xc(e,t,n,r){let o=n?n.call(r,e,t):void 0;if(void 0!==o)return!!o;if(e===t)return!0;if("object"!==typeof e||!e||"object"!==typeof t||!t)return!1;const i=Object.keys(e),a=Object.keys(t);if(i.length!==a.length)return!1;const s=Object.prototype.hasOwnProperty.bind(t);for(let l=0;l<i.length;l++){const a=i[l];if(!s(a))return!1;const u=e[a],c=t[a];if(o=n?n.call(r,u,c,a):void 0,!1===o||void 0===o&&u!==c)return!1}return!0}function bc(e){return null!==e&&"object"===typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function wc(e){return function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!(0,c.isValidElement)(t)){const r=t;return e(r,n),r}const r=t;!function(e){if("string"===typeof e.type)return;const t=e.type.displayName||e.type.name||"the component";throw new Error(`Only native element nodes can now be passed to React DnD connectors.You can either wrap ${t} into a <div>, or turn it into a drag source or a drop target itself.`)}(r);return function(e,t){const n=e.ref;return re("string"!==typeof n,"Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),n?(0,c.cloneElement)(e,{ref:e=>{Cc(n,e),Cc(t,e)}}):(0,c.cloneElement)(e,{ref:t})}(r,n?t=>e(t,n):e)}}function Sc(e){const t={};return Object.keys(e).forEach((n=>{const r=e[n];if(n.endsWith("Ref"))t[n]=e[n];else{const e=wc(r);t[n]=()=>e}})),t}function Cc(e,t){"function"===typeof e?e(t):e.current=t}class jc{receiveHandlerId(e){this.handlerId!==e&&(this.handlerId=e,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(e){this.dragSourceOptionsInternal=e}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(e){this.dragPreviewOptionsInternal=e}reconnect(){const e=this.reconnectDragSource();this.reconnectDragPreview(e)}reconnectDragSource(){const e=this.dragSource,t=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return t&&this.disconnectDragSource(),this.handlerId?e?(t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=e,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,e,this.dragSourceOptions)),t):(this.lastConnectedDragSource=e,t):t}reconnectDragPreview(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=this.dragPreview,n=e||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();n&&this.disconnectDragPreview(),this.handlerId&&(t?n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=t,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,t,this.dragPreviewOptions)):this.lastConnectedDragPreview=t)}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!xc(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!xc(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(e){this.hooks=Sc({dragSource:(e,t)=>{this.clearDragSource(),this.dragSourceOptions=t||null,bc(e)?this.dragSourceRef=e:this.dragSourceNode=e,this.reconnectDragSource()},dragPreview:(e,t)=>{this.clearDragPreview(),this.dragPreviewOptions=t||null,bc(e)?this.dragPreviewRef=e:this.dragPreviewNode=e,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=e}}function kc(){const{dragDropManager:e}=(0,c.useContext)(it);return re(null!=e,"Expected drag drop context"),e}let Ec=!1,Tc=!1;class Oc{receiveHandlerId(e){this.sourceId=e}getHandlerId(){return this.sourceId}canDrag(){re(!Ec,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Ec=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{Ec=!1}}isDragging(){if(!this.sourceId)return!1;re(!Tc,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Tc=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{Tc=!1}}subscribeToStateChange(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}isDraggingSource(e){return this.internalMonitor.isDraggingSource(e)}isOverTarget(e,t){return this.internalMonitor.isOverTarget(e,t)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(e){return this.internalMonitor.subscribeToOffsetChange(e)}canDragSource(e){return this.internalMonitor.canDragSource(e)}canDropOnTarget(e){return this.internalMonitor.canDropOnTarget(e)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.sourceId=null,this.internalMonitor=e.getMonitor()}}class Ic{beginDrag(){const e=this.spec,t=this.monitor;let n=null;return n="object"===typeof e.item?e.item:"function"===typeof e.item?e.item(t):{},null!==n&&void 0!==n?n:null}canDrag(){const e=this.spec,t=this.monitor;return"boolean"===typeof e.canDrag?e.canDrag:"function"!==typeof e.canDrag||e.canDrag(t)}isDragging(e,t){const n=this.spec,r=this.monitor,{isDragging:o}=n;return o?o(r):t===e.getSourceId()}endDrag(){const e=this.spec,t=this.monitor,n=this.connector,{end:r}=e;r&&r(t.getItem(),t),n.reconnect()}constructor(e,t,n){this.spec=e,this.monitor=t,this.connector=n}}function Dc(e,t,n){const r=kc(),o=function(e,t,n){const r=(0,c.useMemo)((()=>new Ic(e,t,n)),[t,n]);return(0,c.useEffect)((()=>{r.spec=e}),[e]),r}(e,t,n),i=function(e){return(0,c.useMemo)((()=>{const t=e.type;return re(null!=t,"spec.type must be defined"),t}),[e])}(e);hc((function(){if(null!=i){const[e,a]=function(e,t,n){const r=n.getRegistry(),o=r.addSource(e,t);return[o,()=>r.removeSource(o)]}(i,o,r);return t.receiveHandlerId(e),n.receiveHandlerId(e),a}}),[r,t,n,o,i])}function Ac(e,t){const n=mc(e,t);re(!n.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const r=function(){const e=kc();return(0,c.useMemo)((()=>new Oc(e)),[e])}(),o=function(e,t){const n=kc(),r=(0,c.useMemo)((()=>new jc(n.getBackend())),[n]);return hc((()=>(r.dragSourceOptions=e||null,r.reconnect(),()=>r.disconnectDragSource())),[r,e]),hc((()=>(r.dragPreviewOptions=t||null,r.reconnect(),()=>r.disconnectDragPreview())),[r,t]),r}(n.options,n.previewOptions);return Dc(n,r,o),[gc(n.collect,r,o),yc(o),vc(o)]}function _c(e){return(0,c.useMemo)((()=>e.hooks.dropTarget()),[e])}class Pc{get connectTarget(){return this.dropTarget}reconnect(){const e=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();e&&this.disconnectDropTarget();const t=this.dropTarget;this.handlerId&&(t?e&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=t,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,t,this.dropTargetOptions)):this.lastConnectedDropTarget=t)}receiveHandlerId(e){e!==this.handlerId&&(this.handlerId=e,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(e){this.dropTargetOptionsInternal=e}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!xc(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(e){this.hooks=Sc({dropTarget:(e,t)=>{this.clearDropTarget(),this.dropTargetOptions=t,bc(e)?this.dropTargetRef=e:this.dropTargetNode=e,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=e}}let Mc=!1;class Rc{receiveHandlerId(e){this.targetId=e}getHandlerId(){return this.targetId}subscribeToStateChange(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}canDrop(){if(!this.targetId)return!1;re(!Mc,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return Mc=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Mc=!1}}isOver(e){return!!this.targetId&&this.internalMonitor.isOverTarget(this.targetId,e)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.targetId=null,this.internalMonitor=e.getMonitor()}}class Nc{canDrop(){const e=this.spec,t=this.monitor;return!e.canDrop||e.canDrop(t.getItem(),t)}hover(){const e=this.spec,t=this.monitor;e.hover&&e.hover(t.getItem(),t)}drop(){const e=this.spec,t=this.monitor;if(e.drop)return e.drop(t.getItem(),t)}constructor(e,t){this.spec=e,this.monitor=t}}function Lc(e,t,n){const r=kc(),o=function(e,t){const n=(0,c.useMemo)((()=>new Nc(e,t)),[t]);return(0,c.useEffect)((()=>{n.spec=e}),[e]),n}(e,t),i=function(e){const{accept:t}=e;return(0,c.useMemo)((()=>(re(null!=e.accept,"accept must be defined"),Array.isArray(t)?t:[t])),[t])}(e);hc((function(){const[e,a]=function(e,t,n){const r=n.getRegistry(),o=r.addTarget(e,t);return[o,()=>r.removeTarget(o)]}(i,o,r);return t.receiveHandlerId(e),n.receiveHandlerId(e),a}),[r,t,o,n,i.map((e=>e.toString())).join("|")])}function Fc(e,t){const n=mc(e,t),r=function(){const e=kc();return(0,c.useMemo)((()=>new Rc(e)),[e])}(),o=function(e){const t=kc(),n=(0,c.useMemo)((()=>new Pc(t.getBackend())),[t]);return hc((()=>(n.dropTargetOptions=e||null,n.reconnect(),()=>n.disconnectDropTarget())),[e]),n}(n.options);return Lc(n,r,o),[gc(n.collect,r,o),_c(o)]}function Wc(e){let{item:t,type:n,canDrag:r,onDragChange:o}=e,i=(0,c.useRef)(o);const[,a]=Ac({type:n,item:()=>(i.current({state:"start-preview",type:n,item:t}),setTimeout((()=>{i.current({state:"start"})}),0),{type:n,item:t}),collect:e=>({isDragging:e.isDragging()}),end(e){i.current({state:"end",type:n,item:e})},canDrag(){return r}});return(0,c.useLayoutEffect)((()=>{i.current=o})),{dragRef:a}}function Bc(e){let{types:t,id:n,onDrop:r,onLongHover:o}=e,i=(0,c.useRef)(null),[a,s]=(0,c.useState)(null),[{isOver:l},u]=Fc({accept:t,drop(e){let{item:t}=e;r(t.id,a,n)},hover(e,t){let n=i.current.getBoundingClientRect(),r=(n.bottom-n.top)/2,o=t.getClientOffset().y-n.top;s(o<r?"top":"bottom")},collect(e){return{isOver:e.isOver()}}});return(0,c.useEffect)((()=>{let e;return o&&l&&(e=setTimeout(o,700)),()=>e&&clearTimeout(e)}),[l]),{dropRef:(d=u,f=i,(0,c.useMemo)((()=>function(e){[d,f].forEach((t=>{"function"===typeof t?t(e):null!=t&&(t.current=e)}))}),[d,f])),dropPos:l?a:null};var d,f}const zc=(0,c.createContext)(null);function Gc(e){let{pos:t,offset:n={}}=e,r=(0,c.useContext)(zc);if(null==t)return null;let o=("first"===r?2:0)+(n.top||0),i=("last"===r?2:0)+(n.bottom||0),a="top"===t?{top:-2+o}:{bottom:-1+i};return(0,z.jsx)($.G7,{style:[{position:"absolute",left:2,right:2,borderRadius:3,height:3,background:`linear-gradient(90deg, ${H.O9.b4} 0%, ${H.O9.b5} 100%)`,zIndex:1e4,pointerEvents:"none"},a]})}const Zc=240,Uc=600;function Hc(e){let{style:t,to:n,onClick:r,activeStyle:o,forceActive:i,children:a}=e;return r?(0,z.jsx)($.G7,{role:"button",tabIndex:0,style:[t,{touchAction:"auto",userSelect:"none",userDrag:"none",cursor:"pointer",...i?o:{}}],onClick:r,children:a}):(0,z.jsx)($.PN,{to:n,style:t,activeStyle:o,forceActive:i,children:a})}function Kc(e){let{children:t,Icon:n,title:r,style:o,indent:i=0,to:a,onClick:s,button:l,forceHover:u=!1,forceActive:c=!1}=e;const d={backgroundColor:H.O9.n2},f={borderLeft:"4px solid "+H.O9.p8,paddingLeft:19+i-4,color:H.O9.p8},h=[{...H.W2.mediumText,paddingTop:9,paddingBottom:9,paddingLeft:19+i,paddingRight:10,textDecoration:"none",color:H.O9.n9,...u?d:{}},{":hover":d}],p=(0,z.jsxs)($.G7,{style:{flexDirection:"row",alignItems:"center",height:20},children:[(0,z.jsx)(n,{width:15,height:15,style:{color:"inherit"}}),(0,z.jsx)($.gO,{style:{marginLeft:8},children:r}),(0,z.jsx)($.G7,{style:{flex:1}}),l]});return(0,z.jsxs)($.G7,{style:[{flexShrink:0},o],children:[(0,z.jsx)(Hc,{style:h,to:a,onClick:s,activeStyle:f,forceActive:c,children:p}),t?(0,z.jsx)($.G7,{style:{marginTop:5},children:t}):null]})}function Vc(e){let{Icon:t,title:n,style:r,to:o,onClick:i,bold:a,indent:s=0}=e;const l={backgroundColor:H.O9.n2},u={borderLeft:"4px solid "+H.O9.p8,paddingLeft:10+s,color:H.O9.p8,fontWeight:a?Uc:null},c=[qc,{color:H.O9.n9,paddingLeft:14+s,fontWeight:a?Uc:null},{":hover":l}],d=(0,z.jsxs)($.G7,{style:{flexDirection:"row",alignItems:"center",height:16},children:[t&&(0,z.jsx)(t,{width:12,height:12,style:{color:"inherit"}}),(0,z.jsx)($.gO,{style:{marginLeft:t?8:0,color:"inherit"},children:n})]});return(0,z.jsx)($.G7,{style:[{flexShrink:0},r],children:(0,z.jsx)(Hc,{style:c,to:o,onClick:i,activeStyle:u,children:d})})}let qc=[{marginTop:-2,marginBottom:2,paddingTop:4,paddingBottom:4,paddingRight:15,paddingLeft:10,textDecoration:"none",color:H.O9.n9},{":hover":{backgroundColor:H.O9.n2}},H.W2.smallText];function $c(e){let{name:t,account:n,connected:r,failed:o,updated:i,to:a,query:s,style:l,outerStyle:u,onDragChange:c,onDrop:d}=e,f=n?n.closed?"account-closed":n.offbudget?"account-offbudget":"account-onbudget":"title",{dragRef:h}=Wc({type:f,onDragChange:c,item:{id:n&&n.id},canDrag:null!=n}),{dropRef:p,dropPos:g}=Bc({types:n?[f]:[],id:n&&n.id,onDrop:d});return(0,z.jsx)($.G7,{innerRef:p,style:[{flexShrink:0},u],children:(0,z.jsxs)($.G7,{children:[(0,z.jsx)(Gc,{pos:g}),(0,z.jsx)($.G7,{innerRef:h,children:(0,z.jsxs)($.PN,{to:a,style:[qc,l,{position:"relative",borderLeft:"4px solid transparent"},i&&{fontWeight:700}],activeStyle:{borderColor:H.O9.p8,color:H.O9.p8,fontWeight:l&&l.fontWeight||"normal","& .dot":{backgroundColor:H.O9.p8,transform:"translateX(-4.5px)"}},children:[(0,z.jsx)($.G7,{style:{position:"absolute",left:0,top:0,bottom:0,flexDirection:"row",alignItems:"center"},children:(0,z.jsx)("div",{className:"dot",...(0,L.iv)({marginRight:3,width:5,height:5,borderRadius:5,backgroundColor:o?H.O9.r7:H.O9.g5,marginLeft:2,transition:"transform .3s",opacity:r?1:0})})}),(0,z.jsx)($.OI,{left:t,right:(0,z.jsx)(io,{debug:!0,binding:s,type:"financial"})})]})})]})})}function Yc(e){let{accounts:t,failedAccounts:n,updatedAccounts:r,getAccountPath:o,allAccountsPath:i,budgetedAccountPath:a,offBudgetAccountPath:s,getBalanceQuery:l,getAllAccountBalance:u,getOnBudgetBalance:d,getOffBudgetBalance:f,showClosedAccounts:h,onAddAccount:p,onToggleClosedAccounts:g,onReorder:m}=e,[y,v]=(0,c.useState)(!1),x=(0,c.useMemo)((()=>t.filter((e=>0===e.closed&&1===e.offbudget))),[t]),b=(0,c.useMemo)((()=>t.filter((e=>0===e.closed&&0===e.offbudget))),[t]),w=(0,c.useMemo)((()=>t.filter((e=>1===e.closed))),[t]);function S(e){v("start"===e.state)}let C=(e,t)=>0===e?{paddingTop:y?15:0,marginTop:y?-15:0}:null;return(0,z.jsxs)($.G7,{children:[(0,z.jsx)($c,{name:"All accounts",to:i,query:u(),style:{fontWeight:Uc,marginTop:15}}),b.length>0&&(0,z.jsx)($c,{name:"For budget",to:a,query:d(),style:{fontWeight:Uc,marginTop:13}}),b.map(((e,t)=>(0,z.jsx)($c,{name:e.name,account:e,connected:!!e.bankId,failed:n&&n.has(e.id),updated:r&&r.includes(e.id),to:o(e),query:l(e),onDragChange:S,onDrop:m,outerStyle:C(t,b.length)},e.id))),x.length>0&&(0,z.jsx)($c,{name:"Off budget",to:s,query:f(),style:{fontWeight:Uc,marginTop:13}}),x.map(((e,t)=>(0,z.jsx)($c,{name:e.name,account:e,connected:!!e.bankId,failed:n&&n.has(e.id),updated:r&&r.includes(e.id),to:o(e),query:l(e),onDragChange:S,onDrop:m,outerStyle:C(t,x.length)},e.id))),w.length>0&&(0,z.jsx)(Vc,{style:{marginTop:15},title:"Closed accounts"+(h?"":"..."),onClick:g,bold:!0}),h&&w.map(((e,t)=>(0,z.jsx)($c,{name:e.name,account:e,to:o(e),query:l(e),onDragChange:S,onDrop:m},e.id))),(0,z.jsx)(Vc,{style:{marginTop:15,marginBottom:9},onClick:p,Icon:Lr.Z,title:"Add account"})]})}function Qc(e){let{style:t,isFloating:n,onFloat:r}=e;return(0,z.jsx)($.G7,{className:"float",style:[t,{flexShrink:0}],children:(0,z.jsx)($.zx,{bare:!0,onClick:r,children:n?(0,z.jsx)(sc,{style:{margin:-2,width:15,height:15,color:H.O9.n5,transform:"rotate(45deg)"}}):(0,z.jsx)(dc,{style:{width:13,height:13,color:H.O9.n5}})})})}function Xc(){let[e,t]=(0,c.useState)(!1),n=(0,c.useCallback)((()=>t((e=>!e))),[]),r=(0,Pt.TH)();const o=["/payees","/rules","/settings","/tools"].some((e=>r.pathname.startsWith(e)));return(0,c.useEffect)((()=>{o&&t(!0)}),[r.pathname]),(0,z.jsxs)($.G7,{style:{flexShrink:0},children:[(0,z.jsx)(Kc,{title:"More",Icon:e?er:ac,onClick:n,style:{marginBottom:e?8:0},forceActive:!e&&o}),e&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(Vc,{title:"Payees",Icon:uc,to:"/payees",indent:15}),(0,z.jsx)(Vc,{title:"Rules",Icon:cc,to:"/rules",indent:15}),(0,z.jsx)(Vc,{title:"Settings",Icon:Bt,to:"/settings",indent:15})]})]})}function Jc(e){let{style:t,budgetName:n,accounts:r,failedAccounts:o,updatedAccounts:i,getBalanceQuery:a,getAllAccountBalance:s,getOnBudgetBalance:l,getOffBudgetBalance:u,showClosedAccounts:c,isFloating:d,onFloat:f,onAddAccount:h,onToggleClosedAccounts:p,onReorder:g}=e,m=!qu.jU&&"mac"===qu.OS;const y=ad();return(0,z.jsxs)($.G7,{style:[{width:Zc,color:H.O9.n9,backgroundColor:H.O9.n1,"& .float":{opacity:d?1:0,transition:"opacity .25s, width .25s",width:m||d?null:0},"&:hover .float":{opacity:1,width:m?null:"auto"}},t],children:[(0,z.jsxs)($.G7,{style:[{paddingTop:35,height:30,flexDirection:"row",alignItems:"center",margin:"0 8px 23px 20px",transition:"padding .4s"},m&&{paddingTop:20,justifyContent:"flex-start"}],children:[n,(0,z.jsx)($.G7,{style:{flex:1,flexDirection:"row"}}),!y.alwaysFloats&&(0,z.jsx)(Qc,{isFloating:d,onFloat:f})]}),(0,z.jsxs)($.G7,{style:{overflow:"auto"},children:[(0,z.jsx)(Kc,{title:"Budget",Icon:Gt,to:"/budget"}),(0,z.jsx)(Kc,{title:"Reports",Icon:lc,to:"/reports"}),(0,z.jsx)(Kc,{title:"Schedules",Icon:nr.Z,to:"/schedules"}),(0,z.jsx)(Xc,{}),(0,z.jsx)($.G7,{style:{height:1,backgroundColor:H.O9.n3,marginTop:15,flexShrink:0}}),(0,z.jsx)(Yc,{accounts:r,failedAccounts:o,updatedAccounts:i,getAccountPath:e=>`/accounts/${e.id}`,allAccountsPath:"/accounts",budgetedAccountPath:"/accounts/budgeted",offBudgetAccountPath:"/accounts/offbudget",getBalanceQuery:a,getAllAccountBalance:s,getOnBudgetBalance:l,getOffBudgetBalance:u,showClosedAccounts:c,onAddAccount:h,onToggleClosedAccounts:p,onReorder:g})]})]})}var ed=n(6740),td=n(9220);function nd(e){let{prefs:t,savePrefs:n}=e,r=(0,d.I0)(),o=(0,Pt.s0)();const[i,a]=(0,c.useState)(!1),[s,l]=(0,c.useState)(!1);let u=[{name:"rename",text:"Rename budget"},{name:"settings",text:"Settings"},...qu.jU?[{name:"help",text:"Help"}]:[],{name:"close",text:"Close file"}];return i?(0,z.jsx)($.$Y,{children:(0,z.jsx)($.II,{style:{width:160,fontSize:16,fontWeight:500},defaultValue:t.budgetName,onEnter:async e=>{""!==e.target.value.trim()&&(await n({budgetName:e.target.value}),a(!1))},onBlur:()=>a(!1)})}):(0,z.jsxs)($.zx,{bare:!0,style:{color:H.O9.n9,fontSize:16,fontWeight:500,marginLeft:-5,flex:"0 auto"},onClick:()=>l(!0),children:[(0,z.jsx)($.xv,{style:{whiteSpace:"nowrap",overflow:"hidden"},children:t.budgetName||"A budget has no name"}),(0,z.jsx)(td.Z,{width:7,height:7,style:{color:"inherit",marginLeft:5}}),s&&(0,z.jsx)($.u,{position:"bottom-left",style:{padding:0},onClose:()=>l(!1),children:(0,z.jsx)($.v2,{onMenuSelect:function(e){switch(l(!1),e){case"rename":a(!0);break;case"settings":o("/settings");break;case"help":window.open("https://actualbudget.org/docs/","_blank");break;case"close":r((0,ed.ej)())}},items:u})})]})}var rd=(0,d.$j)((e=>({accounts:e.queries.accounts,failedAccounts:e.account.failedAccounts,updatedAccounts:e.queries.updatedAccounts,prefs:e.prefs.local,floatingSidebar:e.prefs.global.floatingSidebar})),(e=>(0,h.DE)(y,e)))((function(e){let{accounts:t,failedAccounts:n,updatedAccounts:r,replaceModal:o,prefs:i,floatingSidebar:a,savePrefs:s,saveGlobalPrefs:l,getAccounts:u}=e;return(0,c.useEffect)((()=>{u()}),[u]),(0,z.jsx)(Jc,{isFloating:a,budgetName:(0,z.jsx)(nd,{prefs:i,savePrefs:s}),accounts:t,failedAccounts:n,updatedAccounts:r,getBalanceQuery:yn,getAllAccountBalance:vn,getOnBudgetBalance:xn,getOffBudgetBalance:bn,onFloat:()=>l({floatingSidebar:!a}),onReorder:async function(e,n,r){if("bottom"===n){let e=t.findIndex((e=>e.id===r))+1;r=e<t.length?t[e].id:null}await(0,N.lW)("account-move",{id:e,targetId:r}),await u()},onAddAccount:()=>o("add-account"),showClosedAccounts:i["ui.showClosedAccounts"],onToggleClosedAccounts:()=>s({"ui.showClosedAccounts":!i["ui.showClosedAccounts"]}),style:[{flex:1},H.W2.darkScrollbar]})}));const od=(0,c.createContext)(null);function id(e){let{children:t}=e,n=(0,d.v9)((e=>e.prefs.global.floatingSidebar)),[r,o]=(0,c.useState)(!0),{width:i}=U(),a=i<668,s=n||a;return(0,z.jsx)(od.Provider,{value:{hidden:r,setHidden:o,floating:s,alwaysFloats:a},children:t})}function ad(){let{hidden:e,setHidden:t,floating:n,alwaysFloats:r}=(0,c.useContext)(od);return(0,c.useMemo)((()=>({hidden:e,setHidden:t,floating:n,alwaysFloats:r})),[e,t,n,r])}var sd=(0,d.$j)((e=>({floatingSidebar:e.prefs.global.floatingSidebar})),y)((function(e){let{floatingSidebar:t}=e,n=ad(),{isNarrowWidth:r}=U(),o=t||n.alwaysFloats;return r?null:(0,z.jsx)($.G7,{onMouseOver:o?e=>{e.stopPropagation(),n.setHidden(!1)}:null,onMouseLeave:o?()=>n.setHidden(!0):null,style:{position:o?"absolute":null,top:12,bottom:o?12:-50,zIndex:1001,borderRadius:o?"0 6px 6px 0":0,overflow:"hidden",boxShadow:!o||n.hidden?"none":"0 15px 30px 0 rgba(0,0,0,0.25), 0 3px 15px 0 rgba(0,0,0,.5)",transform:`translateY(${o?0:-12}px)\n translateX(${o&&n.hidden?-Zc:0}px)`,transition:"transform .5s, box-shadow .5s, border-radius .5s, bottom .5s"},children:(0,z.jsx)(rd,{})})}));var ld=(0,d.$j)((e=>({userData:e.user.data})),y)((function(e){let{hideIfNoServer:t,userData:n,getUserData:r,signOut:o,closeBudget:i,style:a,color:s}=e,[l,u]=(0,c.useState)(!0),[d,f]=(0,c.useState)(!1);const h=Ar();return(0,c.useEffect)((()=>{r().then((()=>u(!1)))}),[]),t&&!h?null:l&&h?(0,z.jsx)($.xv,{style:[{color:H.O9.n5,fontStyle:"italic"},H.W2.delayedFadeIn,a],children:"Connecting..."}):(0,z.jsxs)($.G7,{style:[{flexDirection:"row",alignItems:"center"},a],children:[(0,z.jsx)($.zx,{bare:!0,onClick:()=>f(!0),style:{color:s},children:h?null!==n&&void 0!==n&&n.offline?"Server offline":"Server online":"No server"}),d&&(0,z.jsx)($.u,{position:"bottom-right",style:{padding:0},onClose:()=>f(!1),children:(0,z.jsx)($.v2,{onMenuSelect:async function(e){switch(f(!1),e){case"change-password":!async function(){await i(),window.__navigate("/change-password")}();break;case"sign-in":await i(),window.__navigate("/login");break;case"sign-out":o();break;case"config-server":await i(),window.__navigate("/config-server")}},items:[h&&!(null!==n&&void 0!==n&&n.offline)&&{name:"change-password",text:"Change password"},h&&{name:"sign-out",text:"Sign out"},{name:"config-server",text:h?"Change server URL":"Start using a server"}]})})]})}));let ud=(0,c.createContext)();function cd(e){let{children:t}=e,n=(0,c.useRef)([]);return(0,z.jsx)(ud.Provider,{value:{sendEvent:function(e){n.current.forEach((t=>t(e)))},subscribe:function(e){return n.current.push(e),()=>n.current=n.current.filter((t=>t!==e))}},children:t})}function dd(){return(0,z.jsx)(oo.Z,{binding:{name:"uncategorized-amount",query:wn.calculate({$count:"$id"})},children:e=>{const t=e.value;return 0!==t&&(0,z.jsxs)($.ZP,{bare:!0,to:"/accounts/uncategorized",style:{color:H.O9.r5},children:[t," uncategorized ",1===t?"transaction":"transactions"]})}})}function fd(e){let{localPrefs:t,style:n,onSync:r}=e,[o,i]=(0,c.useState)(!1),[a,s]=(0,c.useState)(null);return(0,c.useEffect)((()=>(0,N.oL)("sync-event",(e=>{let{type:n,subtype:r,syncDisabled:o}=e;"start"===n?(i(!0),s(null)):setTimeout((()=>{i(!1)}),200),"error"===n?"network"===r?s("offline"):t.cloudFileId?s("error"):s("local"):"success"===n&&s(o?"disabled":null)}))),[]),(0,z.jsxs)($.zx,{bare:!0,style:(0,L.iv)(n,{WebkitAppRegion:"none",color:"error"===a?H.O9.r7:"disabled"===a||"offline"===a||"local"===a?H.O9.n9:null},(0,L.BC)(`(min-width: ${B.Z.breakpoint_small})`,{color:"error"===a?H.O9.r4:"disabled"===a||"offline"===a||"local"===a?H.O9.n6:null})),onClick:r,children:["error"===a?(0,z.jsx)(Yu.Z,{width:13,style:{color:"currentColor"}}):(0,z.jsx)(Kr,{animating:o}),(0,z.jsx)($.xv,{style:{marginLeft:3},children:"disabled"===a?"Disabled":"offline"===a?"Offline":"Sync"})]})}function hd(e){let{globalPrefs:t,saveGlobalPrefs:n,localPrefs:r}=e,{sendEvent:o}=(0,c.useContext)(ud),[i,a]=(0,c.useState)(!1),[s,l]=(0,c.useState)(!1);const u=Vu("reportBudget");(0,c.useEffect)((()=>{a(!1)}),[r.budgetType]);let{budgetType:d}=r;return(0,z.jsxs)($.G7,{style:{flexDirection:"row",alignItems:"center"},children:[(0,z.jsx)(ic,{maxMonths:t.maxMonths||1,onChange:e=>n({maxMonths:e})}),u&&(0,z.jsxs)($.G7,{style:{marginLeft:-5},children:[(0,z.jsx)($.yp,{bare:!0,loading:i,style:{alignSelf:"flex-start",padding:"4px 7px"},title:"Learn more about budgeting",onClick:()=>l(!0),children:"report"===d?"Report budget":"Rollover budget"}),s&&(0,z.jsxs)($.u,{position:"bottom-left",onClose:()=>l(!1),style:{padding:10,maxWidth:400},children:[(0,z.jsxs)($.P,{children:["You are currently using a"," ",(0,z.jsxs)($.xv,{style:{fontWeight:600},children:["report"===d?"Report budget":"Rollover budget","."]})," ","Switching will not lose any data and you can always switch back."]}),(0,z.jsx)($.P,{children:(0,z.jsxs)($.yp,{primary:!0,loading:i,onClick:function(){a(!0),i||o("budget/switch-type")},children:["Switch to a"," ","report"===d?"Rollover budget":"Report budget"]})}),(0,z.jsx)($.P,{isLast:!0,children:(0,z.jsx)($.dL,{to:"https://actualbudget.org/docs/experimental/report-budget",linkColor:"muted",children:"How do these types of budgeting work?"})})]})]})]})}var pd=(0,d.$j)((e=>({globalPrefs:e.prefs.global,localPrefs:e.prefs.local,userData:e.user.data,floatingSidebar:e.prefs.global.floatingSidebar})),y)((function(e){var t;let{globalPrefs:n,saveGlobalPrefs:r,localPrefs:o,userData:i,floatingSidebar:a,syncError:s,setAppState:l,style:u,sync:c}=e,d=(0,Pt.s0)(),f=(0,Pt.TH)(),h=ad(),{isNarrowWidth:p}=U();const g=Ar();return p?null:(0,z.jsxs)($.G7,{style:[{flexDirection:"row",alignItems:"center",padding:"0 15px",height:36,pointerEvents:"none","& *":{pointerEvents:"auto"}},!qu.jU&&"mac"===qu.OS&&a&&{paddingLeft:80},u],children:[(a||h.alwaysFloats)&&(0,z.jsx)($.zx,{bare:!0,style:{marginRight:8},onPointerEnter:e=>{"mouse"===e.pointerType&&h.setHidden(!1)},onPointerLeave:e=>{"mouse"===e.pointerType&&h.setHidden(!0)},onPointerUp:e=>{"mouse"!==e.pointerType&&h.setHidden(!h.hidden)},children:(0,z.jsx)(Qu,{className:"menu",style:{width:15,height:15,color:H.O9.n5,left:0}})}),(0,z.jsxs)(Pt.Z5,{children:[(0,z.jsx)(Pt.AW,{path:"/accounts",element:null!==(t=f.state)&&void 0!==t&&t.goBack?(0,z.jsxs)($.zx,{onClick:()=>d(-1),bare:!0,children:[(0,z.jsx)($u.Z,{width:10,height:10,style:{marginRight:5,color:"currentColor"}})," ","Back"]}):null}),(0,z.jsx)(Pt.AW,{path:"/accounts/:id",element:(0,z.jsx)(ec,{})}),(0,z.jsx)(Pt.AW,{path:"/budget",element:(0,z.jsx)(hd,{globalPrefs:n,saveGlobalPrefs:r,localPrefs:o})}),(0,z.jsx)(Pt.AW,{path:"*",element:null})]}),(0,z.jsx)($.G7,{style:{flex:1}}),(0,z.jsx)(dd,{}),g?(0,z.jsx)(fd,{style:{marginLeft:10},localPrefs:o,onSync:c}):null,(0,z.jsx)(ld,{style:{marginLeft:10}})]})})),gd=n(2644),md=n(9227);var yd=e=>(0,z.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"#242134",...e.style},children:(0,z.jsx)("path",{d:"m3.828 9 6.071-6.071-1.414-1.414L0 10l.707.707 7.778 7.778 1.414-1.414L3.828 11H20V9H3.828z",fill:"currentColor"})});var vd=e=>(0,z.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"#242134",...e.style},children:(0,z.jsx)("path",{d:"m16.172 9-6.071-6.071 1.414-1.414L20 10l-.707.707-7.778 7.778-1.414-1.414L16.172 11H0V9z",fill:"currentColor"})}),xd=n(7800);function bd(e,t,n){return{start:t<e.start?e.start:t,end:n>e.end?e.end:n}}let wd=(0,c.createContext)();function Sd(e){let{startMonth:t,numMonths:n,monthBounds:r,type:o,children:i}=e,a=bd(r,t,fn.zI(t,n-1)),s=fn.Do(a.start,a.end);return(0,z.jsx)(wd.Provider,{value:{months:s,type:o},children:i})}function Cd(e){let{SummaryComponent:t}=e,{months:n}=(0,c.useContext)(wd),[r,o]=(0,c.useState)(0),[i,a]=gu((()=>({x:0,config:{mass:3,tension:600,friction:80}}))),s=(0,md.Z)((0,c.useCallback)((e=>{o(e.width)}),[])),l=(0,c.useRef)(n[0]),u=[...n];u.unshift(fn.W9(n[0],1)),u.push(fn.zI(n[n.length-1],1));let d=r/n.length;return(0,c.useLayoutEffect)((()=>{let e=l.current,t=e>n[0],r=d,o=t?2*-r:0;e!==u[0]&&e!==u[2]&&(o=-r);let i=-r;a.start({from:{x:o},x:i})}),[n[0]]),(0,c.useLayoutEffect)((()=>{l.current=n[0]}),[n[0]]),(0,c.useLayoutEffect)((()=>{a.start({from:{x:-d},to:{x:-d}})}),[d]),(0,z.jsx)("div",{...(0,L.iv)([{flex:1,overflow:"hidden"},1===n.length&&{marginLeft:-4,marginRight:-4}]),ref:s,children:(0,z.jsx)(Nu.div,{className:"view",style:{flexDirection:"row",width:r,willChange:"transform",transform:i.x.to((e=>`translateX(${e}px)`))},children:u.map((e=>(0,z.jsx)($.G7,{style:[{flex:`0 0 ${d}px`},{paddingLeft:4,paddingRight:4}],children:(0,z.jsx)(t,{month:e})},e)))})})}const jd="0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24)",kd=5;let Ed=(0,c.createContext)([]);function Td(e){return[{id:"to-be-budgeted",name:"To Be Budgeted",categories:[{id:"to-be-budgeted",name:"To Be Budgeted"}]},...e]}function Od(e){return 0===e||"0"===e||""===e?{color:H.O9.n10}:null}function Id(e){const t=Od(e);return t||(e<0?{color:H.O9.r4}:void 0)}function Dd(e){return{color:e<0?H.O9.r4:0===e?H.O9.n10:H.O9.g4}}function Ad(e,t,n){if("top"===t)return{targetId:n};{let t=e.findIndex((e=>e.id===n));if(-1===t)throw new Error("findSort: item not found: "+n);let r=t+1;return r<e.length-1?{targetId:e[r].id}:{targetId:null}}}function _d(){return Math.max(H.W2.scrollbarWidth-2,0)}class Pd extends c.Component{constructor(e){var t;super(e),this.onEditMonth=(e,t)=>{this.setState({editing:e?{id:e,cell:t}:null})},this.onEditName=e=>{this.setState({editing:e?{id:e,cell:"name"}:null})},this.onReorderCategory=(e,t,n)=>{let{categoryGroups:r}=this.props,o=!!r.find((e=>e.id===n));if(o){let{targetId:o}=function(e,t,n){if("bottom"===t)return{targetId:n};{let t=e.findIndex((e=>e.id===n));if(-1===t)throw new Error("findSort: item not found: "+n);let r=t-1;return r>=0?{targetId:e[r].id}:{targetId:null}}}(r,t,n),i=r.find((e=>e.id===o));if(i){let{categories:n}=i;this.props.onReorderCategory({id:e,groupId:i.id,targetId:0===n.length||"top"===t?null:n[0].id})}}else{let o;for(let e of r)if(e.categories.find((e=>e.id===n))){o=e;break}this.props.onReorderCategory({id:e,groupId:o.id,...Ad(o.categories,t,n)})}},this.onReorderGroup=(e,t,n)=>{let{categoryGroups:r}=this.props;this.props.onReorderGroup({id:e,...Ad(r,t,n)})},this.moveVertically=e=>{let{editing:t}=this.state,{type:n,categoryGroups:r,collapsed:o}=this.props;const i=r.reduce(((e,t)=>o.includes(t.id)?e.concat({id:t.id,isGroup:!0}):e.concat([{id:t.id,isGroup:!0},...t.categories])),[]);if(t){let r=i.findIndex((e=>e.id===t.id))+e;for(;r>=0&&r<i.length;){const o=i[r];if(!o.isGroup){if("report"!==n&&o.is_income)break;return void this.onEditMonth(o.id,t.cell)}r+=e}}},this.onKeyDown=e=>{if(!this.state.editing)return null;"Enter"!==e.key&&"Tab"!==e.key||(e.preventDefault(),this.moveVertically(e.shiftKey?-1:1))},this.onShowActivity=(e,t,n)=>{this.props.onShowActivity(e,t,this.resolveMonth(n))},this.onBudgetAction=(e,t,n)=>{this.props.onBudgetAction(this.resolveMonth(e),t,n)},this.resolveMonth=e=>fn.zI(this.props.startMonth,e),this.toggleHiddenCategories=()=>{this.setState((e=>({showHiddenCategories:!e.showHiddenCategories}))),this.props.savePrefs({"budget.showHiddenCategories":!this.state.showHiddenCategories})},this.expandAllCategories=()=>{this.props.setCollapsed([])},this.collapseAllCategories=()=>{let{setCollapsed:e,categoryGroups:t}=this.props;e(t.map((e=>e.id)))},this.budgetCategoriesRef=(0,c.createRef)(),this.state={editing:null,draggingState:null,showHiddenCategories:null!==(t=e.prefs["budget.showHiddenCategories"])&&void 0!==t&&t}}clearEditing(){this.setState({editing:null})}render(){let{type:e,categoryGroups:t,prewarmStartMonth:n,startMonth:r,numMonths:o,monthBounds:i,collapsed:a,setCollapsed:s,newCategoryForGroup:l,dataComponents:u,isAddingGroup:c,onSaveCategory:d,onSaveGroup:f,onDeleteCategory:h,onDeleteGroup:p,onShowNewCategory:g,onHideNewCategory:m,onShowNewGroup:y,onHideNewGroup:v}=this.props,{editing:x,draggingState:b,showHiddenCategories:w}=this.state;return(0,z.jsxs)($.G7,{"data-testid":"budget-table",style:[{flex:1},H.W2.lightScrollbar&&{"& ::-webkit-scrollbar":{backgroundColor:"transparent"},"& ::-webkit-scrollbar-thumb:vertical":{backgroundColor:"white"}}],children:[(0,z.jsxs)($.G7,{style:{flexDirection:"row",overflow:"hidden",flexShrink:0,paddingLeft:5,paddingRight:5+_d()},children:[(0,z.jsx)($.G7,{style:{width:200}}),(0,z.jsx)(Sd,{startMonth:n,numMonths:o,monthBounds:i,type:e,children:(0,z.jsx)(Cd,{SummaryComponent:u.SummaryComponent})})]}),(0,z.jsxs)(Sd,{startMonth:r,numMonths:o,monthBounds:i,type:e,children:[(0,z.jsx)(Fd,{MonthComponent:u.BudgetTotalsComponent,toggleHiddenCategories:this.toggleHiddenCategories,expandAllCategories:this.expandAllCategories,collapseAllCategories:this.collapseAllCategories}),(0,z.jsx)($.Hp.Provider,{value:this.budgetCategoriesRef,children:(0,z.jsx)($.G7,{style:{overflowY:"scroll",overflowAnchor:"none",flex:1,paddingLeft:5,paddingRight:5},innerRef:this.budgetCategoriesRef,children:(0,z.jsx)($.G7,{style:{opacity:b?.5:1,flexShrink:0},onKeyDown:this.onKeyDown,innerRef:e=>this.budgetDataNode=e,children:(0,z.jsx)(Zd,{showHiddenCategories:w,categoryGroups:t,newCategoryForGroup:l,isAddingGroup:c,editingCell:x,collapsed:a,setCollapsed:s,dataComponents:u,onEditMonth:this.onEditMonth,onEditName:this.onEditName,onSaveCategory:d,onSaveGroup:f,onDeleteCategory:h,onDeleteGroup:p,onReorderCategory:this.onReorderCategory,onReorderGroup:this.onReorderGroup,onShowNewCategory:g,onHideNewCategory:m,onShowNewGroup:y,onHideNewGroup:v,onBudgetAction:this.onBudgetAction,onShowActivity:this.onShowActivity})})})})]})]})}}const Md=(0,d.$j)((e=>({prefs:e.prefs.local})),(e=>(0,h.DE)(y,e)),null,{forwardRef:!0})(Pd);function Rd(e){let{innerRef:t,category:n,dragPreview:r,dragging:o,editing:i,style:a,borderColor:s=H.O9.border,isLast:l,onDragChange:u,onEditMonth:d,onEditName:f,onSave:h,onDelete:p,onHideNewCategory:g}=e;const m="new"===n.id,[y,v]=(0,c.useState)(!1),x=(0,z.jsxs)($.G7,{style:{flexDirection:"row",alignItems:"center",userSelect:"none",WebkitUserSelect:"none",opacity:n.hidden?.33:void 0},children:[(0,z.jsx)("div",{"data-testid":"category-name",style:{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",minWidth:0},children:n.name}),(0,z.jsxs)($.G7,{style:{flexShrink:0,marginLeft:5},children:[(0,z.jsx)($.zx,{bare:!0,onClick:e=>{e.stopPropagation(),v(!0)},style:{color:"currentColor",padding:3},children:(0,z.jsx)(er,{width:14,height:14,style:{color:"currentColor"}})}),y&&(0,z.jsx)($.u,{position:"bottom-left",width:200,style:{padding:0},onClose:()=>v(!1),children:(0,z.jsx)($.v2,{onMenuSelect:e=>{"rename"===e?f(n.id):"delete"===e?p(n.id):"toggleVisibility"===e&&h({...n,hidden:!n.hidden}),v(!1)},items:[{name:"toggleVisibility",text:n.hidden?"Show":"Hide"},{name:"rename",text:"Rename"},{name:"delete",text:"Delete"}]})})]}),(0,z.jsx)($.G7,{style:{flex:1}}),(0,z.jsx)(Jr,{id:n.id,style:o&&{color:"currentColor"}})]});return(0,z.jsx)($.G7,{innerRef:t,style:[{width:200,"& button":{display:"none"}},!o&&!r&&{"&:hover button":{display:"flex",color:H.O9.n1}},o&&{color:H.O9.n8},r&&{backgroundColor:"white",zIndex:1e4,borderRadius:6,overflow:"hidden"},a],onKeyDown:e=>{"Enter"===e.key&&(f(null),e.stopPropagation())},children:(0,z.jsx)(ur.F3,{value:n.name,formatter:e=>x,width:"flex",exposed:i||m,borderColor:r?"transparent":s,onUpdate:e=>{m?""===e?g():""!==e&&h({...n,name:e}):e!==n.name&&h({...n,name:e})},onBlur:()=>f(null),style:[{paddingLeft:13},l&&{borderBottomWidth:0}],inputProps:{placeholder:m?"New Category Name":""}})})}function Nd(e){let{group:t,editing:n,collapsed:r,dragPreview:o,innerRef:i,style:a,borderColor:s=H.O9.border,onEdit:l,onSave:u,onDelete:d,onShowNewCategory:f,onHideNewGroup:h,onToggleCollapse:p}=e;const g="new"===t.id,[m,y]=(0,c.useState)(!1),v=(0,z.jsxs)($.G7,{style:{flexDirection:"row",alignItems:"center",userSelect:"none",WebkitUserSelect:"none"},onClick:e=>{p(t.id)},children:[!o&&(0,z.jsx)(td.Z,{width:8,height:8,style:{marginRight:5,marginLeft:5,flexShrink:0,transition:"transform .1s",transform:r?"rotate(-90deg)":""}}),(0,z.jsxs)("div",{style:{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",minWidth:0},children:[o&&(0,z.jsx)($.xv,{style:{fontWeight:500},children:"Group: "}),t.name]}),!o&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)($.G7,{style:{marginLeft:5,flexShrink:0},children:[(0,z.jsx)($.zx,{bare:!0,onClick:e=>{e.stopPropagation(),y(!0)},style:{padding:3},children:(0,z.jsx)(er,{width:14,height:14})}),m&&(0,z.jsx)($.u,{position:"bottom-left",width:200,style:{padding:0},onClose:()=>y(!1),children:(0,z.jsx)($.v2,{onMenuSelect:e=>{"rename"===e?l(t.id):"add-category"===e?f(t.id):"delete"===e?d(t.id):"toggleVisibility"===e&&u({...t,hidden:!t.hidden}),y(!1)},items:[{name:"add-category",text:"Add category"},{name:"toggleVisibility",text:t.hidden?"Show":"Hide"},{name:"rename",text:"Rename"},d&&{name:"delete",text:"Delete"}]})})]}),(0,z.jsx)($.G7,{style:{flex:1}}),(0,z.jsx)(Jr,{id:t.id})]})]});return(0,z.jsx)($.G7,{innerRef:i,style:[a,{width:200,backgroundColor:H.O9.n11,"& button":{display:"none"},"&:hover button":{display:"flex",color:H.O9.n1}},o&&{paddingLeft:10,zIndex:1e4,borderRadius:6,overflow:"hidden"}],onKeyDown:e=>{"Enter"===e.key&&(l(null),e.stopPropagation())},children:(0,z.jsx)(ur.F3,{value:t.name,formatter:e=>v,width:"flex",exposed:n,borderColor:H.O9.border,onUpdate:e=>{g?""===e?h():""!==e&&u({id:t.id,name:e}):u({id:t.id,name:e})},onBlur:()=>l(null),style:{fontWeight:600},inputProps:{style:{marginLeft:20},placeholder:g?"New Group Name":""}})})}function Ld(e){let{component:t,editingIndex:n,args:r,style:o}=e,{months:i,type:a}=(0,c.useContext)(wd);return i.map(((e,i)=>{let s=n===i;return(0,z.jsx)(ao.Z.Provider,{value:fn.cv(e,a),children:(0,z.jsx)($.G7,{style:[{flex:1},{borderLeft:"1px solid "+H.O9.border},o],children:(0,z.jsx)(t,{monthIndex:i,editing:s,...r})})},i)}))}const Fd=(0,c.memo)((function(e){let{MonthComponent:t,toggleHiddenCategories:n,expandAllCategories:r,collapseAllCategories:o}=e;const[i,a]=(0,c.useState)(!1);return(0,z.jsxs)($.G7,{"data-testid":"budget-totals",style:{backgroundColor:"white",flexDirection:"row",flexShrink:0,boxShadow:jd,marginLeft:5,marginRight:5+_d(),borderRadius:"4px 4px 0 0",borderBottom:"1px solid "+H.O9.border},children:[(0,z.jsxs)($.G7,{style:{width:200,color:H.O9.n4,justifyContent:"center",paddingLeft:15,paddingRight:5,display:"flex",flexDirection:"row",alignItems:"center",userSelect:"none",WebkitUserSelect:"none"},children:[(0,z.jsx)($.G7,{style:{flexGrow:"1"},children:"Category"}),(0,z.jsxs)($.zx,{bare:!0,onClick:()=>{a(!0)},style:{color:"currentColor",padding:3},children:[(0,z.jsx)(xd.Z,{width:15,height:15,style:{color:H.O9.n5}}),i&&(0,z.jsx)($.u,{position:"bottom-right",width:200,style:{padding:0},onClose:()=>{a(!1)},children:(0,z.jsx)($.v2,{onMenuSelect:e=>{"toggleVisibility"===e?n():"expandAllCategories"===e?r():"collapseAllCategories"===e&&o(),a(!1)},items:[{name:"toggleVisibility",text:"Toggle hidden"},{name:"expandAllCategories",text:"Expand all"},{name:"collapseAllCategories",text:"Collapse all"}]})})]})]}),(0,z.jsx)(Ld,{component:t})]})}));function Wd(e){let{group:t,collapsed:n,editingCell:r,dragState:o,itemPos:i,MonthComponent:a,onEditName:s,onSave:l,onDelete:u,onDragChange:c,onReorderGroup:d,onReorderCategory:f,onToggleCollapse:h,onShowNewCategory:p}=e,g=o&&o.item===t,{dragRef:m}=Wc({type:"group",onDragChange:c,item:t,canDrag:null===r}),{dropRef:y,dropPos:v}=Bc({types:"group",id:t.id,onDrop:d}),{dropRef:x,dropPos:b}=Bc({types:"category",id:t.id,onDrop:f,onLongHover:()=>{n&&h(t.id)}});return(0,z.jsxs)(ur.X2,{collapsed:!0,backgroundColor:H.O9.n11,style:{fontWeight:600,opacity:t.hidden?.33:void 0},children:[o&&!o.preview&&"group"===o.type&&(0,z.jsx)($.G7,{innerRef:y,style:{position:"absolute",left:0,right:0,height:n?ur.dN-1:(1+t.categories.length)*(ur.dN-1)+1,zIndex:1e4},children:(0,z.jsx)(Gc,{pos:v,offset:{top:1}})}),(0,z.jsx)(Gc,{pos:b,offset:{top:1}}),(0,z.jsxs)($.G7,{innerRef:x,style:{flex:1,flexDirection:"row",opacity:g&&!o.preview?.3:1},children:[(0,z.jsx)(Nd,{innerRef:m,group:t,editing:r&&"name"===r.cell&&r.id===t.id,dragPreview:g&&o.preview,collapsed:n,onToggleCollapse:h,onEdit:s,onSave:l,onDelete:u,onShowNewCategory:p}),(0,z.jsx)(Ld,{component:a,args:{group:t}})]})]})}function Bd(e){let{cat:t,budgetArray:n,editingCell:r,dragState:o,MonthComponent:i,onEditName:a,onEditMonth:s,onSave:l,onDelete:u,onBudgetAction:c,onShowActivity:d,onDragChange:f,onReorder:h}=e,p=o&&o.item===t;o&&o.item.id===t.cat_group&&(p=!0);let{dragRef:g}=Wc({type:"category",onDragChange:f,item:t,canDrag:null===r}),{dropRef:m,dropPos:y}=Bc({types:"category",id:t.id,onDrop:h});return(0,z.jsxs)(ur.X2,{innerRef:m,collapsed:!0,style:{backgroundColor:"transparent",opacity:t.hidden?.5:void 0},children:[(0,z.jsx)(Gc,{pos:y,offset:{top:1}}),(0,z.jsxs)($.G7,{style:[{flex:1,flexDirection:"row"}],children:[(0,z.jsx)(Rd,{innerRef:g,category:t,dragPreview:p&&o.preview,dragging:p&&!o.preview,editing:r&&"name"===r.cell&&r.id===t.id,onEditName:a,onSave:l,onDelete:u,onDragChange:f}),(0,z.jsx)(Ld,{component:i,editingIndex:r&&r.id===t.id&&r.cell,args:{category:t,onEdit:s,onBudgetAction:c,onShowActivity:d}})]})]})}function zd(e){let{group:t,editingCell:n,collapsed:r,MonthComponent:o,onEditName:i,onSave:a,onToggleCollapse:s,onShowNewCategory:l}=e;return(0,z.jsxs)(ur.X2,{collapsed:!0,backgroundColor:H.O9.n11,style:{fontWeight:600},children:[(0,z.jsx)(Nd,{group:t,collapsed:r,editing:n&&"name"===n.cell&&n.id===t.id,onEdit:i,onSave:a,onToggleCollapse:s,onShowNewCategory:l}),(0,z.jsx)(Ld,{component:o,args:{group:t}})]})}function Gd(e){let{cat:t,isLast:n,editingCell:r,MonthComponent:o,onEditName:i,onEditMonth:a,onSave:s,onDelete:l,onDragChange:u,onBudgetAction:c,onReorder:d,onShowActivity:f}=e,{dragRef:h}=Wc({type:"income-category",onDragChange:u,item:t,canDrag:null===r}),{dropRef:p,dropPos:g}=Bc({types:"income-category",id:t.id,onDrop:d});return(0,z.jsxs)(ur.X2,{innerRef:p,collapsed:!0,backgroundColor:"transparent",children:[(0,z.jsx)(Gc,{pos:g,offset:{top:1}}),(0,z.jsx)(Rd,{innerRef:h,category:t,isLast:n,editing:r&&"name"===r.cell&&r.id===t.id,onEditName:i,onSave:s,onDelete:l}),(0,z.jsx)(Ld,{component:o,editingIndex:r&&r.id===t.id&&r.cell,args:{category:t,onEdit:a,isLast:n,onShowActivity:f,onBudgetAction:c}})]})}const Zd=(0,c.memo)((e=>{let{categoryGroups:t,newCategoryForGroup:n,showHiddenCategories:r,isAddingGroup:o,editingCell:i,collapsed:a,setCollapsed:s,dataComponents:l,onBudgetAction:u,onShowActivity:d,onEditName:f,onEditMonth:h,onSaveCategory:p,onSaveGroup:g,onDeleteCategory:m,onDeleteGroup:y,onReorderCategory:v,onReorderGroup:x,onShowNewCategory:b,onHideNewCategory:w,onShowNewGroup:S,onHideNewGroup:C}=e,j=(0,c.useMemo)((()=>{let[e,i]=function(e){return[e.filter((e=>!e.is_income)),e.find((e=>e.is_income))]}(t),s=Array.prototype.concat.apply([],e.map((e=>{if(e.hidden&&!r)return[];const t=e.categories.filter((e=>r||!e.hidden));let o=[{type:"expense-group",value:{...e}}];return n===e.id&&o.push({type:"new-category"}),[...o,...(a.includes(e.id)?[]:t).map((e=>({type:"expense-category",value:e})))]})));return o&&s.push({type:"new-group"}),i&&(s=s.concat([{type:"income-separator"},{type:"income-group",value:i},n===i.id&&{type:"new-category"},...(a.includes(i.id)?[]:i.categories.filter((e=>r||!e.hidden))).map((e=>({type:"income-category",value:e})))].filter((e=>e)))),s}),[t,a,n,o,r]),[k,E]=(0,c.useState)(null),[T,O]=(0,c.useState)(null);function I(e){let{state:t}=e;"start-preview"===t?E({type:e.type,item:e.item,preview:!0}):"start"===t?k&&(E({...k,preview:!1}),O(a)):"hover"===t?E({...k,hoveredId:e.id,hoveredPos:e.pos}):"end"===t&&(E(null),s(T||[]))}function D(e){a.includes(e)?s(a.filter((t=>t!==e))):s([...a,e])}return(0,z.jsx)($.G7,{style:{marginBottom:10,backgroundColor:"white",overflow:"hidden",boxShadow:jd,borderRadius:"0 0 4px 4px",flex:1},children:j.map(((e,r)=>{let o;switch(e.type){case"new-group":o=(0,z.jsx)(ur.X2,{style:{backgroundColor:H.O9.n11},children:(0,z.jsx)(Nd,{group:{id:"new",name:""},editing:!0,onSave:g,onHideNewGroup:C,onEdit:f})});break;case"new-category":o=(0,z.jsx)(ur.X2,{children:(0,z.jsx)(Rd,{category:{name:"",cat_group:n,is_income:n===t.find((e=>e.is_income)).id,id:"new"},editing:!0,onSave:p,onHideNewCategory:w,onEditName:f})});break;case"expense-group":o=(0,z.jsx)(Wd,{group:e.value,editingCell:i,collapsed:a.includes(e.value.id),MonthComponent:l.ExpenseGroupComponent,dragState:k,onEditName:f,onSave:g,onDelete:y,onDragChange:I,onReorderGroup:x,onReorderCategory:v,onToggleCollapse:D,onShowNewCategory:b});break;case"expense-category":o=(0,z.jsx)(Bd,{cat:e.value,editingCell:i,MonthComponent:l.ExpenseCategoryComponent,dragState:k,onEditName:f,onEditMonth:h,onSave:p,onDelete:m,onDragChange:I,onReorder:v,onBudgetAction:u,onShowActivity:d});break;case"income-separator":o=(0,z.jsx)($.G7,{style:{height:70,backgroundColor:"white"},children:(0,z.jsx)(Ud,{MonthComponent:l.IncomeHeaderComponent,onShowNewGroup:S})});break;case"income-group":o=(0,z.jsx)(zd,{group:e.value,editingCell:i,MonthComponent:l.IncomeGroupComponent,collapsed:a.includes(e.value.id),onEditName:f,onSave:g,onToggleCollapse:D,onShowNewCategory:b});break;case"income-category":o=(0,z.jsx)(Gd,{cat:e.value,editingCell:i,isLast:r===j.length-1,MonthComponent:l.IncomeCategoryComponent,onEditName:f,onEditMonth:h,onSave:p,onDelete:m,onDragChange:I,onReorder:v,onBudgetAction:u,onShowActivity:d});break;default:throw new Error("Unknown item type: "+e.type)}let s=0===r?"first":r===j.length-1?"last":null;return(0,z.jsx)(zc.Provider,{value:s,children:(0,z.jsx)($.G7,{style:!k&&{":hover":{backgroundColor:"#fcfcfc"}},children:o})},e.value?e.value.id:"income-separator"===e.type?"separator":r)}))})}));function Ud(e){let{MonthComponent:t,onShowNewGroup:n}=e;return(0,z.jsxs)($.G7,{style:{flexDirection:"row",flex:1},children:[(0,z.jsx)($.G7,{style:{width:200,alignItems:"flex-start",justifyContent:"flex-start"},children:(0,z.jsx)($.zx,{onClick:n,style:{fontSize:12,margin:10},children:"Add Group"})}),(0,z.jsx)(Ld,{component:t,style:{border:0,justifyContent:"flex-end"}})]})}const Hd=(0,c.memo)((e=>{let{startMonth:t,onMonthSelect:n,numMonths:r,monthBounds:o,style:i}=e;return(0,z.jsx)($.G7,{style:{marginLeft:205,flexShrink:0},children:(0,z.jsx)($.G7,{style:{marginRight:5+_d()},children:(0,z.jsx)(Kd,{startMonth:t,numDisplayed:r,monthBounds:o,style:{paddingTop:5},onSelect:e=>n(function(e){let t=o.start,n=fn.W9(o.end,r-1);return e<t?t:e>n?n:e}(e))})})})}));const Kd=e=>{let{startMonth:t,numDisplayed:n,monthBounds:r,style:o,onSelect:i}=e;const a=fn.dK(),s=function(e){return fn.Do(fn.W8(e),fn.Q9(e))}(a),l=s.map((e=>fn.WU(e,"MMM"))),u=function(e,t){return fn.So(e)===fn.So(t)?fn.WU(t,"MMM"):null}(t,a),d=fn.So(t),f=fn.yl(t),[h,p]=(0,c.useState)("small"),g=(0,md.Z)((e=>{p(e.width<=320?"small":e.width<=400?"medium":"big")}));return(0,z.jsxs)($.G7,{style:[{flexDirection:"row",alignItems:"center",justifyContent:"space-between"},o],children:[(0,z.jsx)($.G7,{style:{padding:"3px 0px",margin:"3px 0",fontWeight:"bold",fontSize:14,flex:"0 0 40px"},children:fn.WU(d,"yyyy")}),(0,z.jsx)($.G7,{innerRef:g,style:{flexDirection:"row",flex:1,alignItems:"center",justifyContent:"center"},children:l.map(((e,t)=>{const o=f+n,a=t>=f&&t<o,s=e===u,l=function(e,t){return fn.zI(e,t)}(d,t),c=l>=r.start&&l<=r.end;return(0,z.jsx)($.G7,{style:[{marginRight:1,padding:"big"===h?"3px 5px":"3px 3px",textAlign:"center",cursor:"default",borderRadius:2,":hover":c&&{backgroundColor:H.O9.p6,color:"white"}},!c&&{color:H.O9.n7},H.W2.smallText,a&&{backgroundColor:H.O9.p6,color:"white",borderRadius:0},t===f&&{borderTopLeftRadius:2,borderBottomLeftRadius:2},t===o-1&&{borderTopRightRadius:2,borderBottomRightRadius:2},t>=f&&t<o-1&&{marginRight:0,borderRight:"solid 1px",borderColor:H.O9.p6},s&&{textDecoration:"underline"}],onClick:()=>i(l),children:"small"===h?e[0]:e},e)}))}),(0,z.jsxs)($.G7,{style:{flexDirection:"row",alignItems:"center",flex:"0 0 50px",justifyContent:"flex-end"},children:[(0,z.jsx)($.zx,{onClick:()=>i(fn.W9(t,1)),bare:!0,children:(0,z.jsx)(yd,{width:12,height:12})}),(0,z.jsx)($.zx,{onClick:()=>i(fn.zI(t,1)),bare:!0,children:(0,z.jsx)(vd,{width:12,height:12})})]})]})};const Vd=(0,c.forwardRef)(((e,t)=>{let{width:n,height:r,categoryGroups:o,prewarmStartMonth:i,startMonth:a,maxMonths:s=3,monthBounds:l,onMonthSelect:u,onPreload:d,...f}=e,{setDisplayMax:h}=rc(),p=function(e){let t=e-200;return t<500?1:t<750?2:t<1e3?3:t<1250?4:t<1500?5:6}(n),g=Math.min(p,s),m=200+500*g;return(0,c.useEffect)((()=>{h(p)}),[p]),(0,z.jsx)(Ed.Provider,{value:o,children:(0,z.jsx)($.G7,{style:{width:n,height:r,alignItems:"center",opacity:n<=0||r<=0?0:1},children:(0,z.jsxs)($.G7,{style:{width:"100%",maxWidth:m},children:[(0,z.jsx)(Hd,{startMonth:i,numMonths:g,monthBounds:l,onMonthSelect:function(e){u(e,g)}}),(0,z.jsx)(Md,{ref:t,categoryGroups:o,prewarmStartMonth:i,startMonth:a,numMonths:g,monthBounds:l,...f})]})})})}));var qd=(0,c.forwardRef)(((e,t)=>(0,z.jsx)(gd.Z,{children:n=>{let{width:r,height:o}=n;return(0,z.jsx)(Vd,{ref:t,width:r,height:o,...e})}})));function $d(e){let{carryover:t,balance:n,disabled:r}=e,o=so(t),i=so(n);return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(io,{binding:n,type:"financial",getStyle:Id,style:[{textAlign:"right"},!r&&{cursor:"pointer",":hover":{textDecoration:"underline"}}]}),!0===o&&(0,z.jsx)($.G7,{style:{alignSelf:"center",marginLeft:2,position:"absolute",right:-4,top:0,bottom:0,justifyContent:"center"},children:(0,z.jsx)(vd,{width:7,height:7,style:{...Id(i)}})})]})}var Yd=e=>(0,z.jsxs)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:[(0,z.jsx)("path",{d:"M12 13.584a2.643 2.643 0 0 1-1.875-.775L.584 3.268a1.768 1.768 0 0 1 2.5-2.5l8.739 8.739a.25.25 0 0 0 .354 0L20.916.768a1.768 1.768 0 0 1 2.5 2.5l-9.541 9.541a2.643 2.643 0 0 1-1.875.775Z",fill:"currentColor"}),(0,z.jsx)("path",{d:"M12 23.75a2.643 2.643 0 0 1-1.875-.775L.584 13.434a1.768 1.768 0 0 1 2.5-2.5l8.739 8.739a.25.25 0 0 0 .354 0l8.739-8.739a1.768 1.768 0 0 1 2.5 2.5l-9.541 9.541A2.643 2.643 0 0 1 12 23.75Z",fill:"currentColor"})]});var Qd=e=>(0,z.jsxs)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:[(0,z.jsx)("path",{d:"M12 10.416a2.643 2.643 0 0 1 1.875.775l9.541 9.541a1.768 1.768 0 0 1-2.5 2.5l-8.739-8.739a.25.25 0 0 0-.354 0l-8.739 8.739a1.768 1.768 0 0 1-2.5-2.5l9.541-9.541A2.643 2.643 0 0 1 12 10.416Z",fill:"currentColor"}),(0,z.jsx)("path",{d:"M12 .25a2.643 2.643 0 0 1 1.875.775l9.541 9.541a1.768 1.768 0 0 1-2.5 2.5l-8.739-8.739a.25.25 0 0 0-.354 0l-8.739 8.739a1.768 1.768 0 0 1-2.5-2.5l9.541-9.541A2.643 2.643 0 0 1 12 .25Z",fill:"currentColor"})]});let Xd=(0,c.createContext)(null);function Jd(e){let{summaryCollapsed:t,onBudgetAction:n,onToggleSummaryCollapse:r,children:o}=e,i=fn.dK();return(0,z.jsx)(Xd.Provider,{value:{currentMonth:i,summaryCollapsed:t,onBudgetAction:n,onToggleSummaryCollapse:r},children:o})}function ef(e){let{style:t,progress:n,color:r,backgroundColor:o}=e,i=2*Math.PI*4,a=n*i,s=i;return(0,z.jsxs)("svg",{viewBox:"0 0 20 20",style:t,children:[(0,z.jsx)("circle",{r:"10",cx:"10",cy:"10",fill:o}),(0,z.jsx)("circle",{r:4,cx:"10",cy:"10",fill:"none",stroke:r,strokeWidth:8,strokeDasharray:`${a} ${s}`,transform:"rotate(-90) translate(-20)"})," "]})}function tf(e,t){return 0===t?e>0?1:0:e/t}function nf(e){let{current:t,target:n}=e,r=so(t)||0,o=!1;r<0&&(o=!0,r=-r);let i=tf(r,so(n)||0);return(0,z.jsx)(ef,{progress:i,color:o?H.O9.r7:H.O9.g5,backgroundColor:o?H.O9.r10:H.O9.n10,style:{width:20,height:20}})}function rf(e){let t,{current:n,target:r}=e,o=so(n)||0,i=so(r)||0;o=Math.max(-o,0);let a=!1;return o>i?(t=(o-i)/i,a=!0):t=tf(o,i),(0,z.jsx)(ef,{progress:t,color:a?H.O9.r7:H.O9.g5,backgroundColor:a?H.O9.r10:H.O9.n10,style:{width:20,height:20}})}function of(e){let{title:t,current:n,target:r,ProgressComponent:o,style:i}=e;return(0,z.jsxs)($.G7,{style:[{lineHeight:1.5,flexDirection:"row",alignItems:"center",fontSize:14},i],children:[(0,z.jsx)(o,{current:n,target:r}),(0,z.jsxs)($.G7,{style:{marginLeft:10},children:[(0,z.jsx)($.G7,{children:(0,z.jsx)($.xv,{style:{color:H.O9.n4},children:t})}),(0,z.jsxs)($.xv,{children:[(0,z.jsx)(io,{binding:n,type:"financial"}),(0,z.jsxs)($.xv,{style:{color:H.O9.n6,fontStyle:"italic"},children:[" of ",(0,z.jsx)(io,{binding:r,type:"financial",style:H.W2.notFixed})]})]})]})]})}function af(e){let{style:t}=e;return(0,z.jsx)(of,{title:"Income",current:Cn.totalIncome,target:Cn.totalBudgetedIncome,ProgressComponent:nf,style:t})}function sf(e){let{style:t}=e;return(0,z.jsx)(of,{title:"Expenses",current:Cn.totalSpent,target:Cn.totalBudgetedExpense,ProgressComponent:rf,style:t})}function lf(e){let{projected:t,style:n}=e,r=so(Cn.totalBudgetedSaved)||0,o=so(Cn.totalSaved)||0,i=t?r:o,a=i<0;return(0,z.jsxs)($.G7,{style:[{alignItems:"center",fontSize:14},n],children:[t?(0,z.jsx)($.xv,{style:{color:H.O9.n4},children:"Projected Savings:"}):(0,z.jsx)($.G7,{style:{color:H.O9.n4},children:a?"Overspent:":"Saved:"}),(0,z.jsx)($.yL,{renderContent:()=>{if(!t){let e=o-r;return(0,z.jsxs)($.u,{position:"bottom-center",style:{padding:10,fontSize:14},children:[(0,z.jsx)($.OI,{left:"Projected Savings:",right:(0,z.jsx)($.xv,{style:[Dd(r),H.W2.tnum],children:(0,ro.Z)(r,"financial-with-sign")})}),(0,z.jsx)($.OI,{left:"Difference:",right:(0,z.jsx)($.xv,{style:[Dd(e),H.W2.tnum],children:(0,ro.Z)(e,"financial-with-sign")})})]})}return null},children:(0,z.jsx)($.G7,{...(0,L.iv)([{fontSize:25,color:t?H.O9.y3:a?H.O9.r4:H.O9.p5}]),children:(0,ro.Z)(i,"financial")})})]})}const uf=(0,c.memo)((function(e){let{month:t}=e,{currentMonth:n,summaryCollapsed:r,onBudgetAction:o,onToggleSummaryCollapse:i}=(0,c.useContext)(Xd),[a,s]=(0,c.useState)(!1);function l(){s(!1)}let u=r?Yd:Qd;return(0,z.jsx)($.G7,{style:{backgroundColor:"white",boxShadow:jd,borderRadius:6,marginLeft:0,marginRight:0,marginTop:5,flex:1,cursor:"default",marginBottom:5,overflow:"hidden","& .hover-visible":{opacity:0,transition:"opacity .25s"},"&:hover .hover-visible":{opacity:1}},children:(0,z.jsxs)(ao.Z.Provider,{value:fn.cv(t),children:[(0,z.jsxs)($.G7,{style:[{padding:"0 13px"},r?{margin:"10px 0"}:{marginTop:16}],children:[(0,z.jsx)($.G7,{style:{position:"absolute",left:10,top:0},children:(0,z.jsx)($.zx,{className:"hover-visible",bare:!0,onClick:i,children:(0,z.jsx)(u,{width:13,height:13,style:{color:H.O9.n6,margin:1}})})}),(0,z.jsx)("div",{...(0,L.iv)([{textAlign:"center",marginTop:3,fontSize:18,fontWeight:500,textDecorationSkip:"ink"},n===t&&{textDecoration:"underline"}]),children:fn.WU(t,"MMMM")}),(0,z.jsxs)($.G7,{style:{position:"absolute",right:10,top:0,flexDirection:"row",alignItems:"center"},children:[(0,z.jsx)($.G7,{children:(0,z.jsx)(Jr,{id:`budget-${t}`,width:15,height:15,tooltipPosition:"bottom-right",defaultColor:H.O9.n6})}),(0,z.jsxs)($.G7,{style:{userSelect:"none"},children:[(0,z.jsx)($.zx,{bare:!0,onClick:function(){s(!0)},children:(0,z.jsx)(xd.Z,{width:15,height:15,style:{color:H.O9.n5}})}),a&&(0,z.jsx)($.u,{position:"bottom-right",width:200,style:{padding:0},onClose:l,children:(0,z.jsx)($.v2,{onMenuSelect:e=>{l(),o(t,e)},items:[{name:"copy-last",text:"Copy last month\u2019s budget"},{name:"set-zero",text:"Set budgets to zero"},{name:"set-3-avg",text:"Set budgets to 3 month avg"}]})})]})]})]}),!r&&(0,z.jsxs)($.Kq,{spacing:2,style:{alignSelf:"center",backgroundColor:H.O9.n11,borderRadius:4,padding:"10px 15px",marginTop:13},children:[(0,z.jsx)(af,{}),(0,z.jsx)(sf,{})]}),r?(0,z.jsx)($.G7,{style:{alignItems:"center",padding:"10px 20px",justifyContent:"space-between",backgroundColor:H.O9.n11,borderTop:"1px solid "+H.O9.n10},children:(0,z.jsx)(lf,{projected:t>=n})}):(0,z.jsx)(lf,{projected:t>=n,style:{marginTop:13,marginBottom:20}})]})})}));let cf={flex:1,padding:"0 5px",textAlign:"right"};const df=(0,c.memo)((function(){return(0,z.jsxs)($.G7,{style:{flex:1,flexDirection:"row",marginRight:kd,paddingTop:10,paddingBottom:10},children:[(0,z.jsxs)($.G7,{style:cf,children:[(0,z.jsx)($.xv,{style:{color:H.O9.n4},children:"Budgeted"}),(0,z.jsx)(io,{binding:Cn.totalBudgetedExpense,type:"financial",style:{color:H.O9.n4,fontWeight:600},formatter:e=>(0,ro.Z)(parseFloat(e||"0"),"financial")})]}),(0,z.jsxs)($.G7,{style:cf,children:[(0,z.jsx)($.xv,{style:{color:H.O9.n4},children:"Spent"}),(0,z.jsx)(io,{binding:Cn.totalSpent,type:"financial",style:{color:H.O9.n4,fontWeight:600}})]}),(0,z.jsxs)($.G7,{style:cf,children:[(0,z.jsx)($.xv,{style:{color:H.O9.n4},children:"Balance"}),(0,z.jsx)(io,{binding:Cn.totalLeftover,type:"financial",style:{color:H.O9.n4,fontWeight:600}})]})]})}));function ff(){return(0,z.jsxs)($.G7,{style:{flexDirection:"row",marginRight:kd,paddingBottom:5},children:[(0,z.jsx)($.G7,{style:cf,children:(0,z.jsx)($.xv,{style:{color:H.O9.n4},children:"Budgeted"})}),(0,z.jsx)($.G7,{style:cf,children:(0,z.jsx)($.xv,{style:{color:H.O9.n4},children:"Received"})})]})}const hf=(0,c.memo)((function(e){let{group:t}=e,n=H.O9.border,{id:r}=t;return(0,z.jsxs)($.G7,{style:{flex:1,flexDirection:"row"},children:[(0,z.jsx)(ur.OX,{name:"budgeted",width:"flex",borderColor:n,textAlign:"right",style:[{fontWeight:600},H.W2.tnum],valueProps:{binding:Cn.groupBudgeted(r),type:"financial"}}),(0,z.jsx)(ur.OX,{name:"spent",width:"flex",textAlign:"right",borderColor:n,style:[{fontWeight:600},H.W2.tnum],valueProps:{binding:Cn.groupSumAmount(r),type:"financial"}}),!t.is_income&&(0,z.jsx)(ur.OX,{name:"balance",width:"flex",borderColor:n,textAlign:"right",style:[{fontWeight:600,paddingRight:kd},H.W2.tnum],valueProps:{binding:Cn.groupBalance(r),type:"financial"}})]})}));function pf(e){let{categoryId:t,tooltip:n,monthIndex:r,onBudgetAction:o}=e,i=so(Cn.catCarryover(t));return(0,z.jsx)($.u,{position:"bottom-right",width:200,style:{padding:0},onClose:n.close,children:(0,z.jsx)($.v2,{onMenuSelect:e=>{o(r,"carryover",{category:t,flag:!i}),n.close()},items:[{name:"carryover",text:i?"Remove overspending rollover":"Rollover overspending"}]})})}const gf=(0,c.memo)((function(e){let{monthIndex:t,category:n,editing:r,onEdit:o,onBudgetAction:i,onShowActivity:a}=e,s=H.O9.border,l=(0,$.lL)();return(0,z.jsxs)($.G7,{style:{flex:1,flexDirection:"row"},children:[(0,z.jsx)(ur.OX,{name:"budget",exposed:r,width:"flex",borderColor:s,onExpose:()=>o(n.id,t),style:[r&&{zIndex:100},H.W2.tnum],textAlign:"right",valueStyle:[{cursor:"default",margin:1,padding:"0 4px",borderRadius:4},{":hover":{boxShadow:"inset 0 0 0 1px "+H.O9.n7,backgroundColor:"white"}}],valueProps:{binding:Cn.catBudgeted(n.id),type:"financial",getValueStyle:Od,formatExpr:e=>(0,I.zA)(e),unformatExpr:e=>(0,I.l9)(Yn(e,0))},inputProps:{onBlur:()=>{o(null)}},onSave:e=>{i(t,"budget-amount",{category:n.id,amount:e})}}),(0,z.jsx)(ur.gN,{name:"spent",width:"flex",borderColor:s,style:{textAlign:"right"},children:(0,z.jsx)("span",{"data-testid":"category-month-spent",onClick:()=>a(n.name,n.id,t),children:(0,z.jsx)(io,{binding:Cn.catSumAmount(n.id),type:"financial",getStyle:Od,style:{cursor:"pointer",":hover":{textDecoration:"underline"}}})})}),!n.is_income&&(0,z.jsxs)(ur.gN,{name:"balance",width:"flex",borderColor:s,style:{paddingRight:kd,textAlign:"right"},children:[(0,z.jsx)("span",{...n.is_income?{}:l.getOpenEvents(),children:(0,z.jsx)($d,{disabled:n.is_income,carryover:Cn.catCarryover(n.id),balance:Cn.catBalance(n.id)})}),l.isOpen&&(0,z.jsx)(pf,{categoryId:n.id,tooltip:l,monthIndex:t,onBudgetAction:i})]})]})})),mf=hf,yf=gf,vf=hf,xf=gf;function bf(e){let{initialAmount:t,initialAmountName:n,showToBeBudgeted:r,tooltipProps:o,onSubmit:i,onClose:a}=e,s=(0,Ft.M)(),l=(0,c.useContext)(ao.Z),u=(0,c.useContext)(Ed);u=u.filter((e=>!e.is_income)),r&&(u=Td(u));let[d,f]=(0,c.useState)(null),[h,p]=(0,c.useState)(null);function g(){let e=Yn(d,null);e&&h&&(i((0,I.l9)(e),h),a())}return(0,c.useEffect)((()=>{(async()=>{if(n){const e=await s.get(l,n);f((0,I.zA)(Math.max(e.value,0)))}else f((0,I.zA)(Math.max(t,0)))})()}),[]),null===d?null:(0,z.jsxs)($.u,{position:"bottom-right",width:200,style:{padding:10},...o,onClose:a,children:[(0,z.jsx)($.G7,{style:{marginBottom:5},children:"Transfer this amount:"}),(0,z.jsx)($.G7,{children:(0,z.jsx)($.$Y,{children:(0,z.jsx)($.II,{value:d,onChange:e=>f(e.target.value),onEnter:g})})}),(0,z.jsx)($.G7,{style:{margin:"10px 0 5px 0"},children:"To:"}),(0,z.jsx)(ir.Z,{categoryGroups:u,value:null,openOnFocus:!0,onUpdate:e=>{},onSelect:e=>p(e),inputProps:{onEnter:g,placeholder:"(none)"}}),(0,z.jsx)($.G7,{style:{alignItems:"flex-end",marginTop:10},children:(0,z.jsx)($.zx,{primary:!0,style:{fontSize:12,paddingTop:3,paddingBottom:3},onClick:g,children:"Transfer"})})]})}function wf(e){let{onSubmit:t,onClose:n}=e;const r=(0,Ft.M)(),o=(0,c.useContext)(ao.Z),[i,a]=(0,c.useState)(null);function s(){const e=Yn(i,null);e&&t((0,I.l9)(e)),n()}return(0,c.useEffect)((()=>{(async()=>{const e=await r.get(o,"to-budget");a((0,I.zA)(Math.max(e.value,0)))})()}),[]),null===i?null:(0,z.jsxs)($.u,{position:"bottom-right",width:200,style:{padding:10},onClose:n,children:[(0,z.jsx)($.G7,{style:{marginBottom:5},children:"Hold this amount:"}),(0,z.jsx)($.G7,{children:(0,z.jsx)($.$Y,{children:(0,z.jsx)($.II,{value:i,onChange:e=>a(e.target.value),onEnter:s})})}),(0,z.jsx)($.G7,{style:{alignItems:"flex-end",marginTop:10},children:(0,z.jsx)($.zx,{primary:!0,style:{fontSize:12,paddingTop:3,paddingBottom:3},onClick:s,children:"Hold"})})]})}let Sf=(0,c.createContext)(null);function Cf(e){let{categoryGroups:t,summaryCollapsed:n,onBudgetAction:r,onToggleSummaryCollapse:o,children:i}=e,a=fn.dK();return(0,z.jsx)(Sf.Provider,{value:{currentMonth:a,categoryGroups:t,summaryCollapsed:n,onBudgetAction:r,onToggleSummaryCollapse:o},children:i})}function jf(e){let{prevMonthName:t,collapsed:n}=e;return(0,z.jsxs)($.G7,{style:[{flexDirection:"row",lineHeight:1.5,justifyContent:"center"},!n&&{padding:"5px 0",marginTop:17,backgroundColor:H.O9.n11,borderTopWidth:1,borderBottomWidth:1,borderColor:H.O9.n9},n&&{padding:7},H.W2.smallText],children:[(0,z.jsxs)($.G7,{style:{textAlign:"right",marginRight:10,minWidth:50},children:[(0,z.jsx)($.yL,{style:{flexShrink:0},renderContent:()=>(0,z.jsxs)($.u,{width:200,style:{lineHeight:1.5,padding:"6px 10px"},children:[(0,z.jsx)($.OI,{left:"Income:",right:(0,z.jsx)(io,{binding:Sn.totalIncome,type:"financial"})}),(0,z.jsx)($.OI,{left:"From Last Month:",right:(0,z.jsx)(io,{binding:Sn.fromLastMonth,type:"financial"})})]}),children:(0,z.jsx)(io,{binding:Sn.incomeAvailable,type:"financial",style:{fontWeight:600}})}),(0,z.jsx)(io,{binding:Sn.lastMonthOverspent,formatter:e=>{let t=(0,ro.Z)(e,"financial");return e>0?"+"+t:0===e?"-"+t:t},style:[{fontWeight:600},H.W2.tnum]}),(0,z.jsx)(io,{binding:Sn.totalBudgeted,formatter:e=>{let t=(0,ro.Z)(e,"financial");return e>0?"+"+t:0===e?"-"+t:t},style:[{fontWeight:600},H.W2.tnum]}),(0,z.jsx)(io,{binding:Sn.forNextMonth,formatter:e=>{let t=parseInt(e)||0,n=(0,ro.Z)(Math.abs(t),"financial");return t>=0?"-"+n:"+"+n},style:[{fontWeight:600},H.W2.tnum]})]}),(0,z.jsxs)($.G7,{children:[(0,z.jsx)($.gO,{children:"Available Funds"}),(0,z.jsxs)($.gO,{children:["Overspent in ",t]}),(0,z.jsx)($.gO,{children:"Budgeted"}),(0,z.jsx)($.gO,{children:"For Next Month"})]})]})}function kf(e){let{month:t,prevMonthName:n,collapsed:r,onBudgetAction:o}=e,[i,a]=(0,c.useState)(null);return(0,z.jsx)(oo.Z,{binding:Sn.toBudget,initialValue:0,children:e=>{const s=parseInt(e.value),l=isNaN(s)?0:s,u=l<0;return(0,z.jsxs)($.G7,{style:{alignItems:"center"},children:[(0,z.jsx)($.gO,{children:u?"Overbudgeted:":"To Budget:"}),(0,z.jsxs)($.G7,{children:[(0,z.jsx)($.yL,{disabled:!r||i,renderContent:()=>(0,z.jsx)($.u,{position:"bottom-center",children:(0,z.jsx)(jf,{collapsed:!0,prevMonthName:n})}),children:(0,z.jsx)($.gO,{onClick:()=>a("actions"),"data-cellname":e.name,...(0,L.iv)([H.W2.veryLargeText,{fontWeight:400,userSelect:"none",cursor:"pointer",color:u?H.O9.r4:H.O9.p5,marginBottom:-1,borderBottom:"1px solid transparent",":hover":{borderColor:u?H.O9.r4:H.O9.p5}}]),children:(0,ro.Z)(l,"financial")})}),"actions"===i&&(0,z.jsx)($.u,{position:"bottom-center",width:200,style:{padding:0},onClose:()=>a(null),children:(0,z.jsx)($.v2,{onMenuSelect:e=>{"reset-buffer"===e?(o(t,"reset-hold"),a(null)):a(e)},items:[{name:"transfer",text:"Move to a category"},{name:"buffer",text:"Hold for next month"},{name:"reset-buffer",text:"Reset next month\u2019s buffer"}]})}),"buffer"===i&&(0,z.jsx)(wf,{onClose:()=>a(null),onSubmit:e=>{o(t,"hold",{amount:e})}}),"transfer"===i&&(0,z.jsx)(bf,{initialAmount:s,onClose:()=>a(null),onSubmit:(e,n)=>{o(t,"transfer-available",{amount:e,category:n})}})]})]})}})}function Ef(e){let{month:t,isGoalTemplatesEnabled:n}=e,{currentMonth:r,summaryCollapsed:o,onBudgetAction:i,onToggleSummaryCollapse:a}=(0,c.useContext)(Sf),[s,l]=(0,c.useState)(!1);function u(){l(!1)}let d=fn.WU(fn.dy(t),"MMM"),f=o?Yd:Qd;return(0,z.jsx)($.G7,{"data-testid":"budget-summary",style:{backgroundColor:"white",boxShadow:jd,borderRadius:6,marginLeft:0,marginRight:0,marginTop:5,flex:1,cursor:"default",marginBottom:5,overflow:"hidden","& .hover-visible":{opacity:0,transition:"opacity .25s"},"&:hover .hover-visible":{opacity:1}},children:(0,z.jsxs)(ao.Z.Provider,{value:fn.cv(t),children:[(0,z.jsxs)($.G7,{style:[{padding:"0 13px"},o?{margin:"10px 0"}:{marginTop:16}],children:[(0,z.jsx)($.G7,{style:{position:"absolute",left:10,top:0},children:(0,z.jsx)($.zx,{className:"hover-visible",bare:!0,onClick:a,children:(0,z.jsx)(f,{width:13,height:13,style:{color:H.O9.n6,margin:1}})})}),(0,z.jsx)("div",{...(0,L.iv)([{textAlign:"center",marginTop:3,fontSize:18,fontWeight:500,textDecorationSkip:"ink"},r===t&&{textDecoration:"underline"}]),children:fn.WU(t,"MMMM")}),(0,z.jsxs)($.G7,{style:{position:"absolute",right:10,top:0,flexDirection:"row",alignItems:"center"},children:[(0,z.jsx)($.G7,{children:(0,z.jsx)(Jr,{id:`budget-${t}`,width:15,height:15,tooltipPosition:"bottom-right",defaultColor:H.O9.n6})}),(0,z.jsxs)($.G7,{style:{userSelect:"none",marginLeft:2},children:[(0,z.jsx)($.zx,{bare:!0,onClick:function(e){l(!0)},children:(0,z.jsx)(xd.Z,{width:15,height:15,style:{color:H.O9.n5}})}),s&&(0,z.jsx)($.u,{position:"bottom-right",width:200,style:{padding:0},onClose:u,children:(0,z.jsx)($.v2,{onMenuSelect:e=>{u(),i(t,e)},items:[{name:"copy-last",text:"Copy last month\u2019s budget"},{name:"set-zero",text:"Set budgets to zero"},{name:"set-3-avg",text:"Set budgets to 3 month avg"},n&&{name:"check-templates",text:"Check templates"},n&&{name:"apply-goal-template",text:"Apply budget template"},n&&{name:"overwrite-goal-template",text:"Overwrite with budget template"},n&&{name:"cleanup-goal-template",text:"End of month cleanup"}]})})]})]})]}),o?(0,z.jsx)($.G7,{style:{alignItems:"center",padding:"10px 20px",justifyContent:"space-between",backgroundColor:H.O9.n11,borderTop:"1px solid "+H.O9.n10},children:(0,z.jsx)(kf,{collapsed:o,prevMonthName:d,month:t,onBudgetAction:i})}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(jf,{prevMonthName:d}),(0,z.jsx)($.G7,{style:{margin:"23px 0"},children:(0,z.jsx)(kf,{month:t,onBudgetAction:i})})]})]})})}function Tf(e){let{tooltipProps:t,onSubmit:n,onClose:r}=e,o=(0,c.useContext)(Ed);o=Td(o.filter((e=>!e.is_income)));let[i,a]=(0,c.useState)(null);function s(){i&&(n(i),r())}return(0,z.jsxs)($.u,{position:"bottom-right",width:200,style:{padding:10},...t,onClose:r,children:[(0,z.jsx)($.G7,{style:{marginBottom:5},children:"Cover from category:"}),(0,z.jsx)($.$Y,{children:e=>(0,z.jsx)(ir.Z,{categoryGroups:o,value:null,openOnFocus:!0,onUpdate:e=>{},onSelect:e=>a(e),inputProps:{inputRef:e,onKeyDown:e=>{"Enter"===e.key&&s()}}})}),(0,z.jsx)($.G7,{style:{alignItems:"flex-end",marginTop:10},children:(0,z.jsx)($.zx,{primary:!0,style:{fontSize:12,paddingTop:3},onClick:s,children:"Transfer"})})]})}function Of(e){let{categoryId:t,tooltip:n,monthIndex:r,onBudgetAction:o}=e,i=so(Sn.catCarryover(t)),a=so(Sn.catBalance(t)),[s,l]=(0,c.useState)("menu");return(0,z.jsxs)(z.Fragment,{children:["menu"===s&&(0,z.jsx)($.u,{position:"bottom-right",width:200,style:{padding:0},onClose:n.close,children:(0,z.jsx)($.v2,{onMenuSelect:e=>{"carryover"===e?(o(r,"carryover",{category:t,flag:!i}),n.close()):l(e)},items:[{name:"transfer",text:"Transfer to another category"},{name:"carryover",text:i?"Remove overspending rollover":"Rollover overspending"},a<0&&{name:"cover",text:"Cover overspending"}].filter((e=>e))})}),"transfer"===s&&(0,z.jsx)(bf,{initialAmountName:Sn.catBalance(t),showToBeBudgeted:!0,onClose:n.close,onSubmit:(e,n)=>{o(r,"transfer-category",{amount:e,from:t,to:n})}}),"cover"===s&&(0,z.jsx)(Tf,{onClose:n.close,onSubmit:e=>{o(r,"cover",{to:t,from:e})}})]})}let If={flex:1,padding:"0 5px",textAlign:"right"};const Df=(0,c.memo)((function(){return(0,z.jsxs)($.G7,{style:{flex:1,flexDirection:"row",marginRight:kd,paddingTop:10,paddingBottom:10},children:[(0,z.jsxs)($.G7,{style:If,children:[(0,z.jsx)($.xv,{style:{color:H.O9.n4},children:"Budgeted"}),(0,z.jsx)(io,{binding:Sn.totalBudgeted,type:"financial",style:{color:H.O9.n4,fontWeight:600},formatter:e=>(0,ro.Z)(-parseFloat(e||"0"),"financial")})]}),(0,z.jsxs)($.G7,{style:If,children:[(0,z.jsx)($.xv,{style:{color:H.O9.n4},children:"Spent"}),(0,z.jsx)(io,{binding:Sn.totalSpent,type:"financial",style:{color:H.O9.n4,fontWeight:600}})]}),(0,z.jsxs)($.G7,{style:If,children:[(0,z.jsx)($.xv,{style:{color:H.O9.n4},children:"Balance"}),(0,z.jsx)(io,{binding:Sn.totalBalance,type:"financial",style:{color:H.O9.n4,fontWeight:600}})]})]})}));function Af(){return(0,z.jsx)(ur.X2,{style:{color:H.O9.n4,alignItems:"center",paddingRight:10},children:(0,z.jsx)($.G7,{style:{flex:1,textAlign:"right"},children:"Received"})})}const _f=(0,c.memo)((function(e){let{group:t}=e,n=H.O9.border,{id:r}=t;return(0,z.jsxs)($.G7,{style:{flex:1,flexDirection:"row"},children:[(0,z.jsx)(ur.OX,{name:"budgeted",width:"flex",borderColor:n,textAlign:"right",style:[{fontWeight:600},H.W2.tnum],valueProps:{binding:Sn.groupBudgeted(r),type:"financial"}}),(0,z.jsx)(ur.OX,{name:"spent",width:"flex",textAlign:"right",borderColor:n,style:[{fontWeight:600},H.W2.tnum],valueProps:{binding:Sn.groupSumAmount(r),type:"financial"}}),(0,z.jsx)(ur.OX,{name:"balance",width:"flex",borderColor:n,textAlign:"right",style:[{fontWeight:600,paddingRight:kd},H.W2.tnum],valueProps:{binding:Sn.groupBalance(r),type:"financial"}})]})})),Pf=(0,c.memo)((function(e){let{monthIndex:t,category:n,editing:r,onEdit:o,onBudgetAction:i,onShowActivity:a}=e,s=H.O9.border,l=(0,$.lL)();return(0,z.jsxs)($.G7,{style:{flex:1,flexDirection:"row"},children:[(0,z.jsx)(ur.OX,{name:"budget",exposed:r,width:"flex",borderColor:s,onExpose:()=>o(n.id,t),style:[r&&{zIndex:100},H.W2.tnum],textAlign:"right",valueStyle:[{cursor:"default",margin:1,padding:"0 4px",borderRadius:4},{":hover":{boxShadow:"inset 0 0 0 1px "+H.O9.n7,backgroundColor:"white"}}],valueProps:{binding:Sn.catBudgeted(n.id),type:"financial",getValueStyle:Od,formatExpr:e=>(0,I.zA)(e),unformatExpr:e=>(0,I.l9)(Yn(e,0))},inputProps:{onBlur:()=>{o(null)}},onSave:e=>{i(t,"budget-amount",{category:n.id,amount:e})}}),(0,z.jsx)(ur.gN,{name:"spent",width:"flex",borderColor:s,style:{textAlign:"right"},children:(0,z.jsx)("span",{"data-testid":"category-month-spent",onClick:()=>a(n.name,n.id,t),children:(0,z.jsx)(io,{binding:Sn.catSumAmount(n.id),type:"financial",getStyle:Od,style:{cursor:"pointer",":hover":{textDecoration:"underline"}}})})}),(0,z.jsxs)(ur.gN,{name:"balance",width:"flex",borderColor:s,style:{paddingRight:kd,textAlign:"right"},children:[(0,z.jsx)("span",{...l.getOpenEvents(),children:(0,z.jsx)($d,{carryover:Sn.catCarryover(n.id),balance:Sn.catBalance(n.id)})}),l.isOpen&&(0,z.jsx)(Of,{categoryId:n.id,tooltip:l,monthIndex:t,onBudgetAction:i})]})]})}));function Mf(){return(0,z.jsx)($.G7,{style:{flex:1},children:(0,z.jsx)(ur.OX,{name:"received",width:"flex",borderColor:H.O9.border,textAlign:"right",style:[{fontWeight:600,paddingRight:kd},H.W2.tnum],valueProps:{binding:Sn.groupIncomeReceived,type:"financial"}})})}function Rf(e){let{category:t,isLast:n,monthIndex:r,onShowActivity:o}=e;return(0,z.jsx)($.G7,{style:{flex:1},children:(0,z.jsx)(ur.gN,{name:"received",width:"flex",borderColor:H.O9.border,style:[{paddingRight:kd,textAlign:"right"},n&&{borderBottomWidth:0}],children:(0,z.jsx)("span",{onClick:()=>o(t.name,t.id,r),children:(0,z.jsx)(io,{binding:Sn.catSumAmount(t.id),type:"financial",style:{cursor:"pointer",":hover":{textDecoration:"underline"}}})})})})}let Nf=null;class Lf extends c.PureComponent{constructor(e){var t;super(e),t=this,this.prewarmMonth=async function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;n=n||t.props.budgetType;let r="report"===n?"report-budget-month":"rollover-budget-month",o=await(0,N.lW)(r,{month:e});for(let i of o)t.props.spreadsheet.prewarmCache(i.name,i)},this.onMonthSelect=async(e,t)=>{let{startMonth:n}=this.state;this.setState({prewarmStartMonth:e}),this.warmingMonth=e,e<n?await this.prewarmMonth(fn.W9(e,1)):e>n&&await this.prewarmMonth(fn.zI(e,t)),this.warmingMonth===e&&this.setState({startMonth:e})},this.onShowNewCategory=e=>{this.setState({newCategoryForGroup:e,collapsed:this.state.collapsed.filter((t=>t!==e))})},this.onHideNewCategory=()=>{this.setState({newCategoryForGroup:null})},this.onShowNewGroup=()=>{this.setState({isAddingGroup:!0})},this.onHideNewGroup=()=>{this.setState({isAddingGroup:!1})},this.setCollapsed=e=>{this.setState({collapsed:e})},this.onSaveCategory=async e=>{let{categoryGroups:t}=this.state;if("new"===e.id){let n=await this.props.createCategory(e.name,e.cat_group,e.is_income);this.setState({newCategoryForGroup:null,categoryGroups:Fu(t,{...e,is_income:e.is_income?1:0,id:n})})}else{const n={...e,hidden:e.hidden?1:0};this.props.updateCategory(n),this.setState({categoryGroups:Wu(t,n)})}},this.onDeleteCategory=async e=>{const t=await(0,N.lW)("must-category-transfer",{id:e});let{categoryGroups:n}=this.state;t?this.props.pushModal("confirm-category-delete",{category:e,onDelete:t=>{e!==t&&(this.props.deleteCategory(e,t),this.setState({categoryGroups:Gu(n,e)}))}}):(this.props.deleteCategory(e),this.setState({categoryGroups:Gu(n,e)}))},this.onSaveGroup=async e=>{let{categoryGroups:t}=this.state;if("new"===e.id){let n=await this.props.createGroup(e.name);this.setState({isAddingGroup:!1,categoryGroups:Zu(t,{...e,is_income:0,categories:e.categories||[],id:n})})}else{const n={...e,hidden:e.hidden?1:0};this.props.updateGroup(n),this.setState({categoryGroups:Uu(t,n)})}},this.onDeleteGroup=async e=>{let{categoryGroups:t}=this.state,n=t.find((t=>t.id===e)),r=!1;for(let o of n.categories)if(await(0,N.lW)("must-category-transfer",{id:o.id})){r=!0;break}r?this.props.pushModal("confirm-category-delete",{group:e,onDelete:n=>{this.props.deleteGroup(e,n),this.setState({categoryGroups:Hu(t,e)})}}):(this.props.deleteGroup(e),this.setState({categoryGroups:Hu(t,e)}))},this.onBudgetAction=(e,t,n)=>{this.props.applyBudgetAction(e,t,n)},this.onShowActivity=(e,t,n)=>{this.props.navigate("/accounts",{state:{goBack:!0,filterName:`${e} (${fn.WU(n,"MMMM yyyy")})`,filter:{category:t,date:{$transform:"$month",$eq:n}}}})},this.onReorderCategory=async e=>{let{categoryGroups:t}=this.state;this.props.moveCategory(e.id,e.groupId,e.targetId),this.setState({categoryGroups:Bu(t,e.id,e.groupId,e.targetId)})},this.onReorderGroup=async e=>{let{categoryGroups:t}=this.state;this.props.moveCategoryGroup(e.id,e.targetId),this.setState({categoryGroups:zu(t,e.id,e.targetId)})},this.onToggleCollapse=()=>{let e=!this.state.summaryCollapsed;this.setState({summaryCollapsed:e}),this.props.savePrefs({"budget.summaryCollapsed":e})},this.onTitlebarEvent=async e=>{switch(e){case"budget/switch-type":{let e="rollover"===this.props.budgetType?"report":"rollover";this.props.spreadsheet.disableObservers(),await(0,N.lW)("budget-set-type",{type:e}),await this.prewarmAllMonths(this.state.bounds,e),this.props.spreadsheet.enableObservers(),this.props.loadPrefs();break}}};const n=Nf||fn.dK();this.state={initialized:!1,prewarmStartMonth:n,startMonth:n,newCategoryForGroup:null,isAddingGroup:!1,collapsed:e.collapsedPrefs||[],bounds:{start:n,end:n},categoryGroups:null,summaryCollapsed:e.summaryCollapsed}}async loadCategories(){let e=await this.props.getCategories();this.setState({categoryGroups:e.grouped})}async componentDidMount(){let{titlebar:e,budgetType:t}=this.props;this.loadCategories();let{start:n,end:r}=await(0,N.lW)("get-budget-bounds");this.setState({bounds:{start:n,end:r}}),this.prewarmAllMonths({start:n,end:r},t);let o=[(0,N.oL)("sync-event",(e=>{let{type:t,tables:n}=e;"success"===t&&(n.includes("categories")||n.includes("category_mapping")||n.includes("category_groups"))&&this.loadCategories()})),(0,N.oL)("undo-event",(e=>{let{tables:t}=e;this.table&&this.table.clearEditing(),t.includes("categories")&&this.loadCategories()})),e.subscribe(this.onTitlebarEvent)];this.cleanup=()=>{o.forEach((e=>e()))}}componentDidUpdate(e,t){t.collapsed!==this.state.collapsed&&this.props.savePrefs({"budget.collapsed":this.state.collapsed}),t.startMonth!==this.state.startMonth&&(Nf=this.state.startMonth),this.props.accountId!==e.accountId&&(0,N.lW)("get-budget-bounds").then((e=>{let{start:t,end:n}=e,{bounds:r}=this.state;r.start===t&&r.end===n||this.setState({bounds:{start:t,end:n}})}))}componentWillUnmount(){this.cleanup&&this.cleanup()}async prewarmAllMonths(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,{startMonth:n}=this.state;e=bd(e,fn.W9(n,1),fn.zI(n,4));let r=fn.Do(e.start,e.end);await Promise.all(r.map((e=>this.prewarmMonth(e,t)))),this.setState({initialized:!0})}onCopy(e){this.props.copyPreviousMonthInto(e,this.props.categories)}render(){let e,{maxMonths:t,budgetType:n,reportComponents:r,rolloverComponents:o}=this.props,{initialized:i,categoryGroups:a,prewarmStartMonth:s,startMonth:l,newCategoryForGroup:u,isAddingGroup:c,collapsed:d,summaryCollapsed:f,bounds:h}=this.state;return t=t||1,i&&a?(e="report"===n?(0,z.jsx)(Jd,{summaryCollapsed:f,onBudgetAction:this.onBudgetAction,onToggleSummaryCollapse:this.onToggleCollapse,children:(0,z.jsx)(qd,{ref:e=>this.table=e,type:n,categoryGroups:a,prewarmStartMonth:s,startMonth:l,monthBounds:h,maxMonths:t,collapsed:d,setCollapsed:this.setCollapsed,newCategoryForGroup:u,isAddingGroup:c,dataComponents:r,onMonthSelect:this.onMonthSelect,onShowNewCategory:this.onShowNewCategory,onHideNewCategory:this.onHideNewCategory,onShowNewGroup:this.onShowNewGroup,onHideNewGroup:this.onHideNewGroup,onDeleteCategory:this.onDeleteCategory,onDeleteGroup:this.onDeleteGroup,onSaveCategory:this.onSaveCategory,onSaveGroup:this.onSaveGroup,onBudgetAction:this.onBudgetAction,onShowActivity:this.onShowActivity,onReorderCategory:this.onReorderCategory,onReorderGroup:this.onReorderGroup})}):(0,z.jsx)(Cf,{categoryGroups:a,summaryCollapsed:f,onBudgetAction:this.onBudgetAction,onToggleSummaryCollapse:this.onToggleCollapse,children:(0,z.jsx)(qd,{ref:e=>this.table=e,type:n,categoryGroups:a,prewarmStartMonth:s,startMonth:l,monthBounds:h,maxMonths:t,collapsed:d,setCollapsed:this.setCollapsed,newCategoryForGroup:u,isAddingGroup:c,dataComponents:o,onMonthSelect:this.onMonthSelect,onShowNewCategory:this.onShowNewCategory,onHideNewCategory:this.onHideNewCategory,onShowNewGroup:this.onShowNewGroup,onHideNewGroup:this.onHideNewGroup,onDeleteCategory:this.onDeleteCategory,onDeleteGroup:this.onDeleteGroup,onSaveCategory:this.onSaveCategory,onSaveGroup:this.onSaveGroup,onBudgetAction:this.onBudgetAction,onShowActivity:this.onShowActivity,onReorderCategory:this.onReorderCategory,onReorderGroup:this.onReorderGroup})}),(0,z.jsx)($.G7,{style:{flex:1},innerRef:e=>this.page=e,children:e})):null}}const Ff=(0,c.memo)((e=>{const t=Vu("goalTemplatesEnabled");return(0,z.jsx)(Ef,{...e,isGoalTemplatesEnabled:t})}));var Wf=(0,d.$j)((e=>({collapsedPrefs:e.prefs.local["budget.collapsed"],summaryCollapsed:e.prefs.local["budget.summaryCollapsed"],budgetType:e.prefs.local.budgetType||"rollover",maxMonths:e.prefs.global.maxMonths,categoryGroups:e.queries.categories.grouped})),y)((function(e){let n=(0,Ft.M)(),o=(0,c.useContext)(ud),i=(0,Pt.TH)(),a=(0,Pt.bS)(i.pathname),s=(0,Pt.s0)(),l=(0,c.useMemo)((()=>({SummaryComponent:uf,ExpenseCategoryComponent:yf,ExpenseGroupComponent:mf,IncomeCategoryComponent:xf,IncomeGroupComponent:vf,BudgetTotalsComponent:df,IncomeHeaderComponent:ff})),[t]),u=(0,c.useMemo)((()=>({SummaryComponent:Ff,ExpenseCategoryComponent:Pf,ExpenseGroupComponent:_f,IncomeCategoryComponent:Rf,IncomeGroupComponent:Mf,BudgetTotalsComponent:Df,IncomeHeaderComponent:Af})),[r]);return(0,z.jsx)($.G7,{style:[H.W2.page,{paddingLeft:8,paddingRight:8,overflow:"hidden"}],children:(0,z.jsx)(Lf,{...e,reportComponents:l,rolloverComponents:u,spreadsheet:n,titlebar:o,navigate:s,match:a})})})),Bf=n(1218);const zf=e=>{let{children:t,style:n,...r}=e;return(0,z.jsx)($.G7,{style:[{height:50,borderBottomWidth:1,borderColor:H.O9.border,flexDirection:"row",alignItems:"center",paddingLeft:10,paddingRight:10,zIndex:1},n],...r,children:t})};function Gf(e){let{toBudget:t,onClick:n}=e;return(0,z.jsx)(oo.Z,{binding:t,children:e=>{let{value:t}=e;return(0,z.jsxs)($.zx,{bare:!0,style:{flexDirection:"column",alignItems:"flex-start"},onClick:n,children:[(0,z.jsx)($.__,{title:t<0?"OVERBUDGETED":"TO BUDGET",style:{color:H.O9.n1,flexShrink:0}}),(0,z.jsx)($.xv,{style:[H.W2.smallText,{fontWeight:"500",color:t<0?H.O9.r4:H.O9.n1}],children:(0,ro.Z)(t,"financial")})]})}})}function Zf(e){let{projected:t}=e,n=so(Cn.totalBudgetedSaved)||0,r=so(Cn.totalSaved)||0,o=t?n:r,i=o<0;return(0,z.jsxs)($.G7,{style:{flexDirection:"column",alignItems:"flex-start"},children:[t?(0,z.jsx)($.__,{title:"PROJECTED SAVINGS",style:{color:H.O9.n1}}):(0,z.jsx)($.__,{title:i?"OVERSPENT":"SAVED",style:{color:H.O9.n1}}),(0,z.jsx)($.xv,{style:[H.W2.smallText,{fontWeight:"500",color:t?H.O9.y3:i?H.O9.r4:H.O9.n1}],children:(0,ro.Z)(o,"financial")})]})}class Uf extends c.PureComponent{render(){const{name:e,binding:t,editing:n,style:r,textStyle:o,categoryId:i,month:a,onBudgetAction:s}=this.props;return(0,z.jsx)(oo.Z,{binding:t,children:t=>(0,z.jsxs)($.G7,{style:r,children:[(0,z.jsx)(Bf._,{value:(0,I.Bf)(t.value||0),style:{height:46,transform:"translateX(6px)",...!n&&{opacity:0,position:"absolute",top:0}},focused:n,textStyle:[H.W2.smallText,o],onChange:()=>{},onBlur:e=>{s(a,"budget-amount",{category:i,amount:(0,I.l9)(e)})}}),(0,z.jsx)($.G7,{style:{justifyContent:"center",height:46,...n&&{display:"none"}},children:(0,z.jsx)($.xv,{style:[H.W2.smallText,o],"data-testid":e,children:(0,ro.Z)(t.value||0,"financial")})})]})})}}class Hf extends c.PureComponent{constructor(e){super(e);let{editMode:t,blank:n}=e;this.opacity=t||n?0:1}render(){let{category:e,editing:t,index:n,style:r,month:o,onBudgetAction:i}=this.props,a=Sn.catBudgeted(e.id),s=Sn.catBalance(e.id),l=(0,z.jsxs)(zf,{style:[{backgroundColor:t?H.O9.p11:"transparent",borderBottomWidth:0,borderTopWidth:n>0?1:0},r],"data-testid":"row",children:[(0,z.jsx)($.G7,{style:{flex:1},children:(0,z.jsx)($.xv,{style:H.W2.smallText,children:e.name})}),(0,z.jsxs)($.G7,{style:{alignItems:"center",flexDirection:"row",opacity:this.opacity},children:[(0,z.jsx)(Uf,{name:"budgeted",binding:a,editing:t,style:{width:90},textStyle:[H.W2.smallText,{textAlign:"right"}],categoryId:e.id,month:o,onBudgetAction:i}),(0,z.jsx)(io,{name:"balance",binding:s,style:[H.W2.smallText,{width:90,textAlign:"right"}],getStyle:e=>e<0&&{color:H.O9.r4},type:"financial"})]})]});return(0,z.jsx)("div",{children:l})}}class Kf extends c.PureComponent{constructor(e){super(e);let{editMode:t,blank:n}=e;this.opacity=t||n?0:1}render(){let{group:e,editMode:t,onAddCategory:n}=this.props,r=(0,z.jsxs)(zf,{style:{flexDirection:"row",alignItems:"center",backgroundColor:H.O9.n11},"data-testid":"totals",children:[(0,z.jsx)($.G7,{style:{flex:1},children:(0,z.jsx)($.xv,{style:[H.W2.smallText,{fontWeight:"500"}],"data-testid":"name",children:e.name})}),(0,z.jsxs)($.G7,{style:{flexDirection:"row",alignItems:"center",opacity:this.opacity},children:[(0,z.jsx)(io,{binding:Sn.groupBudgeted(e.id),style:[H.W2.smallText,{width:90,fontWeight:"500",textAlign:"right"}],type:"financial"}),(0,z.jsx)(io,{binding:Sn.groupBalance(e.id),style:[H.W2.smallText,{width:90,fontWeight:"500",textAlign:"right"}],type:"financial"})]}),t&&(0,z.jsx)($.G7,{children:(0,z.jsx)($.zx,{onClick:()=>n(e.id),style:{padding:10},children:(0,z.jsx)(Lr.Z,{width:15,height:15,color:H.O9.n1})})})]});return r}}class Vf extends c.PureComponent{render(){const{name:e,budget:t,balance:n,style:r,nameTextStyle:o,amountTextStyle:i}=this.props;return(0,z.jsxs)(zf,{style:[{flexDirection:"row",alignItems:"center",padding:10,backgroundColor:"transparent"},r],children:[(0,z.jsx)($.G7,{style:{flex:1},children:(0,z.jsx)($.xv,{style:[H.W2.smallText,o],"data-testid":"name",children:e})}),t&&(0,z.jsx)(io,{binding:t,style:[H.W2.smallText,{width:90,textAlign:"right"},i],type:"financial"}),(0,z.jsx)(io,{binding:n,style:[H.W2.smallText,{width:90,textAlign:"right"},i],type:"financial"})]})}}class qf extends c.PureComponent{render(){const{group:e,editMode:t,gestures:n,month:r,onEditCategory:o,onReorderCategory:i,onAddCategory:a,onBudgetAction:s}=this.props;return(0,z.jsxs)($.Zb,{style:{marginTop:7,marginBottom:7},children:[(0,z.jsx)(Kf,{group:e,budgeted:Sn.groupBudgeted(e.id),balance:Sn.groupBalance(e.id),editMode:t,onAddCategory:a,onReorderCategory:i}),e.categories.map(((e,a)=>(0,z.jsx)(Hf,{index:a,category:e,editing:void 0,editMode:t,gestures:n,month:r,onEdit:o,onReorder:i,onBudgetAction:s},e.id)))]})}}class $f extends c.Component{render(){const{type:e,group:t}=this.props;return(0,z.jsxs)($.G7,{children:[(0,z.jsxs)($.G7,{style:{flexDirection:"row",alignItems:"center",justifyContent:"flex-end",marginTop:50,marginBottom:5,marginRight:14},children:["report"===e&&(0,z.jsx)($.__,{title:"BUDGETED",style:{width:90}}),(0,z.jsx)($.__,{title:"RECEIVED",style:{width:90}})]}),(0,z.jsxs)($.Zb,{style:{marginTop:0},children:[(0,z.jsx)(Vf,{name:"Income",budget:"report"===e?Cn.groupBudgeted(t.id):null,balance:"report"===e?Cn.groupSumAmount(t.id):Sn.groupSumAmount(t.id),nameTextStyle:{fontWeight:"500"},amountTextStyle:{fontWeight:"500"},style:{backgroundColor:H.O9.n11}}),t.categories.map(((t,n)=>(0,z.jsx)(Vf,{type:e,name:t.name,budget:"report"===e?Cn.catBudgeted(t.id):null,balance:"report"===e?Cn.catSumAmount(t.id):Sn.catSumAmount(t.id),index:n},t.id)))]})]})}}class Yf extends c.Component{constructor(){super(...arguments),this.getGroups=(0,jo.Z)((e=>({incomeGroup:e.find((e=>e.is_income)),expenseGroups:e.filter((e=>!e.is_income))})))}render(){const{type:e,categoryGroups:t,editingId:n,gestures:r,month:o,onEditCategory:i,onAddCategory:a,onReorderCategory:s,onReorderGroup:l,onBudgetAction:u}=this.props,{incomeGroup:c,expenseGroups:d}=this.getGroups(t);return(0,z.jsxs)($.G7,{"data-testid":"budget-groups",style:{flex:"1 0 auto",overflowY:"auto",paddingBottom:15},children:[d.map((e=>(0,z.jsx)(qf,{group:e,editingId:n,editMode:void 0,gestures:r,month:o,onEditCategory:i,onAddCategory:a,onReorderCategory:s,onReorderGroup:l,onBudgetAction:u},e.id))),c&&(0,z.jsx)($f,{type:e,group:c})]})}}class Qf extends c.Component{constructor(){super(...arguments),this.state={editingCategory:null},this.onEditCategory=e=>{this.setState({editingCategory:e})}}render(){const{type:e,categoryGroups:t,month:n,monthBounds:r,editMode:o,onPrevMonth:i,onNextMonth:a,onAddCategory:s,onReorderCategory:l,onReorderGroup:u,onShowBudgetDetails:c,onOpenActionSheet:d,onBudgetAction:f}=this.props;let{editingCategory:h}=this.state,p=fn.dK();return(0,z.jsx)(ao.Z.Provider,{value:fn.cv(n,e),children:(0,z.jsxs)($.G7,{style:{flex:1,overflowY:"hidden"},"data-testid":"budget-table",children:[(0,z.jsx)(Xf,{currentMonth:n,monthBounds:r,editMode:o,onDone:()=>this.props.onEditMode(!1),onOpenActionSheet:d,onPrevMonth:i,onNextMonth:a}),(0,z.jsxs)($.G7,{style:{flexDirection:"row",flex:"1 0 auto",padding:10,paddingRight:14,backgroundColor:"white",borderBottomWidth:1,borderColor:H.O9.n9},children:["report"===e?(0,z.jsx)(Zf,{projected:n>=p}):(0,z.jsx)(Gf,{toBudget:Sn.toBudget,onClick:c}),(0,z.jsx)($.G7,{style:{flex:1}}),(0,z.jsxs)($.G7,{style:{width:90},children:[(0,z.jsx)($.__,{title:"BUDGETED",style:{color:H.O9.n1}}),(0,z.jsx)(io,{binding:Cn.totalBudgetedExpense,type:"financial",style:[H.W2.smallText,{color:H.O9.n1,textAlign:"right",fontWeight:"500"}],formatter:e=>(0,ro.Z)(-parseFloat(e||"0"),"financial")})]}),(0,z.jsxs)($.G7,{style:{width:90},children:[(0,z.jsx)($.__,{title:"BALANCE",style:{color:H.O9.n1}}),(0,z.jsx)(io,{binding:Sn.totalBalance,type:"financial",style:[H.W2.smallText,{color:H.O9.n1,textAlign:"right",fontWeight:"500"}]})]})]}),(0,z.jsx)($.G7,{style:{overflowY:"auto"},children:o?(0,z.jsx)(z.Fragment,{children:(0,z.jsx)($.G7,{children:(0,z.jsx)(Yf,{categoryGroups:t,editingId:h,editMode:o,gestures:this.gestures,onEditCategory:()=>{},onAddCategory:s,onReorderCategory:l,onReorderGroup:u})})}):(0,z.jsx)($.G7,{children:(0,z.jsx)(Yf,{type:e,categoryGroups:t,editingId:h,editMode:o,gestures:this.gestures,month:n,onEditCategory:this.onEditCategory,onAddCategory:s,onReorderCategory:l,onReorderGroup:u,onBudgetAction:f})})})]})})}}const Xf=(0,d.$j)((e=>({localPrefs:e.prefs.local})),y)((function(e){let{currentMonth:t,monthBounds:n,editMode:r,onDone:o,onPrevMonth:i,onNextMonth:a,sync:s,localPrefs:l}=e,u=t>n.start,c=t<fn.W9(n.end,1),d={paddingLeft:15,paddingRight:15,backgroundColor:"transparent"};return(0,z.jsxs)($.G7,{style:{alignItems:"center",flexDirection:"row",flexShrink:0,height:50,justifyContent:"center",backgroundColor:H.O9.p5},children:[!r&&(0,z.jsx)($.zx,{bare:!0,onClick:u&&i,style:[d,{left:0,opacity:u?1:.6,padding:"5px 30px 5px 0"}],children:(0,z.jsx)(yd,{style:{color:H.O9.n11},width:"15",height:"15"})}),(0,z.jsx)($.xv,{style:[H.W2.mediumText,{marginTop:12,marginBottom:12,color:H.O9.n11,textAlign:"center"}],children:fn.WU(t,"MMMM ''yy")}),r?(0,z.jsx)($.zx,{bare:!0,onClick:o,style:[d,{position:"absolute",top:0,bottom:0,right:0}],textStyle:{color:H.O9.n11,fontSize:15,fontWeight:"500"},children:"Done"}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)($.zx,{bare:!0,onClick:c&&a,style:[d,{opacity:c?1:.6}],children:(0,z.jsx)(vd,{style:{color:H.O9.n11},width:"15",height:"15"})}),(0,z.jsx)(fd,{style:{color:"white",position:"absolute",top:0,bottom:0,right:0,backgroundColor:"transparent",paddingLeft:12,paddingRight:12},localPrefs:l,onSync:s})]})]})}));class Jf extends c.Component{constructor(e){var t;super(e),t=this,this.prewarmMonth=async function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;n=n||t.props.budgetType;let r="report"===n?"report-budget-month":"rollover-budget-month",o=await(0,N.lW)(r,{month:e});for(let i of o)t.props.spreadsheet.prewarmCache(i.name,i);t.state.initialized||t.setState({initialized:!0})},this.onShowBudgetDetails=()=>{this.props.pushModal("budget-summary",{month:this.state.currentMonth})},this.onBudgetAction=e=>{const{currentMonth:t}=this.state;this.props.applyBudgetAction(t,e,this.state.bounds)},this.onAddCategory=e=>{this.props.navigation.navigate("AddCategoryModal",{groupId:e,onAdd:async t=>{let n=await this.props.createCategory(t,e),{categoryGroups:r}=this.state;this.setState({categoryGroups:Fu(r,{name:t,cat_group:e,is_income:0,id:n})})}})},this.onReorderCategory=(e,t)=>{let n,r,{inGroup:o,aroundCategory:i}=t,{categoryGroups:a}=this.state;if(o)n=o;else if(i){let{id:e,position:t}=i,o=a.find((t=>t.categories.find((t=>t.id===e))));if("bottom"===t){let{categories:t}=o,n=t.findIndex((t=>t.id===e));e=n<t.length-1?t[n+1].id:null}n=o.id,r=e}this.props.moveCategory(e,n,r),this.setState({categoryGroups:Bu(a,e,n,r)})},this.onReorderGroup=(e,t,n)=>{let{categoryGroups:r}=this.state;if("bottom"===n){let e=r.findIndex((e=>e.id===t));t=e<r.length-1?r[e+1].id:null}this.props.moveCategoryGroup(e,t),this.setState({categoryGroups:zu(r,e,t)})},this.sync=async()=>{const{updated:e,error:t}=await this.props.sync();return t?"error":e?"updated":null},this.onPrevMonth=async()=>{let e=fn.W9(this.state.currentMonth,1);await this.prewarmMonth(e),this.setState({currentMonth:e})},this.onNextMonth=async()=>{let e=fn.zI(this.state.currentMonth,1);await this.prewarmMonth(e),this.setState({currentMonth:e})},this.onOpenActionSheet=()=>{let{budgetType:e}=this.props,t=["Edit Categories","Copy last month\u2019s budget","Set budgets to zero","Set budgets to 3 month average","report"===e&&"Apply to all future budgets","Cancel"].filter(Boolean);this.props.showActionSheetWithOptions({options:t,cancelButtonIndex:t.length-1,title:"Actions"},(t=>{switch(t){case 0:this.setState({editMode:!0});break;case 1:this.onBudgetAction("copy-last");break;case 2:this.onBudgetAction("set-zero");break;case 3:this.onBudgetAction("set-3-avg");break;case 4:"report"===e&&this.onBudgetAction("set-all-future")}}))},this.summary=0;const n=fn.dK();this.state={bounds:{start:n,end:n},currentMonth:n,initialized:!1,editMode:!1,categoryGroups:null}}async loadCategories(){let e=await this.props.getCategories();this.setState({categoryGroups:e.grouped})}async componentDidMount(){this.loadCategories();const{start:e,end:t}=await(0,N.lW)("get-budget-bounds");this.setState({bounds:{start:e,end:t}}),this.prewarmMonth(this.state.currentMonth);let n=(0,N.oL)("sync-event",(e=>{let{type:t,tables:n}=e;"success"===t&&(n.includes("categories")||n.includes("category_mapping")||n.includes("category_groups"))&&this.loadCategories()}));this.cleanup=()=>{n()}}componentWillUnmount(){}render(){const{currentMonth:e,bounds:t,editMode:n,initialized:r}=this.state,{categories:o,categoryGroups:i,prefs:a,budgetType:s,navigation:l,applyBudgetAction:u}=this.props;let c=a.numberFormat||"comma-dot",d=a.hideFraction||!1;return i&&r?(0,z.jsx)(To,{onSync:this.sync,children:r=>{let{refreshing:a,onRefresh:f}=r;return(0,z.jsx)(Qf,{categories:o,categoryGroups:i,type:s,month:e,monthBounds:t,editMode:n,navigation:l,onEditMode:e=>this.setState({editMode:e}),onShowBudgetDetails:this.onShowBudgetDetails,onPrevMonth:this.onPrevMonth,onNextMonth:this.onNextMonth,onAddCategory:this.onAddCategory,onReorderCategory:this.onReorderCategory,onReorderGroup:this.onReorderGroup,onOpenActionSheet:()=>{},onBudgetAction:u},c+d)}}):(0,z.jsx)($.G7,{style:{flex:1,backgroundColor:"white",alignItems:"center",justifyContent:"center",marginBottom:25},children:(0,z.jsx)(K.Z,{width:25,height:25})})}}var eh=(0,d.$j)((e=>({categoryGroups:e.queries.categories.grouped,categories:e.queries.categories.list,budgetType:e.prefs.local.budgetType||"rollover",prefs:e.prefs.local,initialBudgetMonth:e.app.budgetMonth})),y)(ko(H.O9.p5)((function(e){let t=(0,Ft.M)();return(0,z.jsx)(Jf,{...e,spreadsheet:t})})));function th(){let e=(0,Pt.s0)();return(0,c.useEffect)((()=>{const t=t=>{if(!qu.jU&&t.metaKey)switch(t.key){case"1":e("/budget");break;case"2":e("/reports");break;case"3":e("/accounts");break;case",":"mac"===qu.OS&&e("/settings")}};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)}),[]),null}var nh=n(945);function rh(){return(0,z.jsx)($t,{title:"Rules",children:(0,z.jsx)(nh.Z,{})})}var oh=function(e){let{month:t,modalProps:n}=e;const r=fn.WU(fn.dy(t),"MMM");return(0,z.jsx)($.u_,{title:"Budget Details",...n,animate:!0,children:()=>(0,z.jsxs)(ao.Z.Provider,{value:fn.cv(t),children:[(0,z.jsxs)($.G7,{style:{flexDirection:"row",justifyContent:"center",paddingTop:15,paddingBottom:15},children:[(0,z.jsxs)($.G7,{style:[H.W2.text,{fontWeight:"600",textAlign:"right",marginRight:10}],children:[(0,z.jsx)(io,{binding:Sn.incomeAvailable,type:"financial"}),(0,z.jsx)(io,{binding:Sn.lastMonthOverspent,type:"financial"}),(0,z.jsx)(io,{binding:Sn.totalBudgeted,type:"financial"}),(0,z.jsx)(io,{binding:Sn.forNextMonth,type:"financial"})]}),(0,z.jsxs)($.G7,{style:[H.W2.text,{display:"flex",flexDirection:"column",textAlign:"left"}],children:[(0,z.jsx)($.xv,{children:"Available Funds"}),(0,z.jsxs)($.xv,{children:["Overspent in ",r]}),(0,z.jsx)($.xv,{children:"Budgeted"}),(0,z.jsx)($.xv,{children:"For Next Month"})]})]}),(0,z.jsx)($.G7,{style:{alignItems:"center",marginBottom:15},children:(0,z.jsx)(oo.Z,{binding:Sn.toBudget,children:e=>{let{value:t}=e;return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)($.xv,{style:H.W2.text,children:t<0?"Overbudget:":"To budget:"}),(0,z.jsx)($.xv,{style:[H.W2.text,{fontWeight:"600",fontSize:22,color:t<0?H.O9.r4:H.O9.n1}],children:(0,ro.Z)(t,"financial")})]})}})}),(0,z.jsx)($.G7,{style:{flexDirection:"row",justifyContent:"center",paddingBottom:15},children:(0,z.jsx)($.zx,{style:{marginRight:10},onClick:n.onClose,children:"Close"})})]})})},ih=n(3743),ah=n(134),sh=n(2131);function lh(e,t,n){const r=n.find((e=>e.id===t)),o=r&&1===r.offbudget;return 0===e.offbudget&&o}var uh=function(e){let{account:t,accounts:n,categoryGroups:r,balance:o,canDelete:i,actions:a,modalProps:s}=e,[l,u]=(0,c.useState)(!1),[d,f]=(0,c.useState)(""),[h,p]=(0,c.useState)(""),[g,m]=(0,c.useState)(!1),[y,v]=(0,c.useState)(!1);return(0,z.jsx)(sh.C,{title:"Close Account",...s,style:{flex:0},loading:l,children:()=>(0,z.jsxs)(Q.Z,{children:[(0,z.jsxs)($.P,{children:["Are you sure you want to close ",(0,z.jsx)("strong",{children:t.name}),"?"," ",i?(0,z.jsx)("span",{children:"This account has no transactions so it will be permanently deleted."}):(0,z.jsx)("span",{children:"This account has transactions so we can\u2019t permanently delete it."})]}),(0,z.jsxs)("form",{onSubmit:e=>{e.preventDefault();let r=0!==o&&""===d;m(r);let i=lh(t,d,n)&&""===h;v(i),r||i||(u(!0),a.closeAccount(t.id,d||null,h||null).then((()=>{s.onClose()})))},children:[0!==o&&(0,z.jsxs)(Q.Z,{children:[(0,z.jsxs)($.P,{children:["This account has a balance of"," ",(0,z.jsx)("strong",{children:(0,I.zA)(o)}),". To close this account, select a different account to transfer this balance to:"]}),(0,z.jsx)(Q.Z,{style:{marginBottom:15},children:(0,z.jsx)(or.Z,{includeClosedAccounts:!1,value:d,accounts:n,inputProps:{placeholder:"Select account..."},onSelect:e=>{f(e),g&&e&&m(!1)}})}),g&&(0,z.jsx)(ah.Z,{style:{marginBottom:15},children:"Transfer is required"}),lh(t,d,n)&&(0,z.jsxs)(Q.Z,{style:{marginBottom:15},children:[(0,z.jsx)($.P,{children:"Since you are transferring the balance from a budgeted account to an off-budget account, this transaction must be categorized. Select a category:"}),(0,z.jsx)(ir.Z,{categoryGroups:r,value:h,inputProps:{placeholder:"Select category..."},onSelect:e=>{p(e),y&&e&&v(!1)}}),y&&(0,z.jsx)(ah.Z,{children:"Category is required"})]})]}),!i&&(0,z.jsx)(Q.Z,{style:{marginBottom:15},children:(0,z.jsxs)(no.Z,{style:{fontSize:12},children:["You can also"," ",(0,z.jsx)($.Qj,{onClick:()=>{u(!0),a.forceCloseAccount(t.id).then((()=>s.onClose()))},style:{color:H.O9.r6},children:"force close"})," ","the account which will delete it and all its transactions permanently. Doing so may change your budget unexpectedly since money in it may vanish."]})}),(0,z.jsxs)(Q.Z,{style:{flexDirection:"row",justifyContent:"flex-end"},children:[(0,z.jsx)(ih.Z,{type:"submit",style:{marginRight:10},onClick:s.onClose,children:"Cancel"}),(0,z.jsx)(ih.Z,{type:"submit",primary:!0,children:"Close Account"})]})]})]})})};var ch=n(7871);function dh(){return null}function fh(e){let{account:t,offbudget:n,onSelect:r}=e;return(0,z.jsx)($.G7,{style:[{marginBottom:8,flexShrink:0,userSelect:"none"},H.W2.mediumText],onClick:r,children:(0,z.jsxs)($.G7,{style:[{padding:12,...H.W2.shadow,cursor:"pointer",transition:"transform .20s",fontSize:14,borderRadius:4,flexDirection:"row",alignItems:"center",border:"1px solid "+H.O9.n10}],children:[(0,z.jsxs)($.G7,{style:{flex:1},children:[(0,z.jsx)($.G7,{style:{fontWeight:600},children:t.name}),(0,z.jsx)($.G7,{style:{fontSize:13,color:H.O9.n5,flexDirection:"row"},children:(0,z.jsxs)($.xv,{style:{marginLeft:4},children:["...",t.mask]})})]}),n?(0,z.jsx)($.xv,{style:{color:H.O9.n8},children:"Off budget"}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(ch.Z,{style:{width:15,height:15,color:H.O9.g5}}),(0,z.jsx)($.xv,{style:{color:H.O9.g5,marginLeft:5},children:"Budgeted"})]})]})})}function hh(e){let{institution:t,publicToken:n,upgradingId:r,modalProps:o,accounts:i,actions:a}=e,[s,l]=(0,c.useState)((()=>i.filter((e=>function(e){switch(e){case"brokerage":case"investment":case"loan":case"other":return!0;default:return!1}}(e.type))).map((e=>e.id))));async function u(){let e=await a.connectNordigenAccounts(t,n,i.map((e=>e.id)),s);a.closeModal(),1===e.length?window.location.hash="/accounts/"+e[0]:e.length>0&&(window.location.hash="/accounts")}return(0,z.jsx)($.u_,{title:r?"Link Account":"Link Accounts",...o,children:()=>(0,z.jsxs)($.G7,{style:{maxWidth:500},children:[(0,z.jsxs)($.xv,{style:{fontSize:15,marginBottom:15,lineHeight:"1.4em"},children:["A ",(0,z.jsx)("strong",{children:"budgeted account"})," is one where expenses and income affect the budget. Usually things like investments are off budget. We\u2019ve chosen some defaults here, but you can change the status if you like."]}),(0,z.jsx)($.G7,{style:{maxHeight:300,overflow:"auto",paddingLeft:5,paddingRight:5,marginLeft:-5,marginRight:-5},children:(0,z.jsx)($.G7,{children:0===i.length?(0,z.jsx)(dh,{}):i.map((e=>{let t=s.includes(e.id);return(0,z.jsx)(fh,{account:e,offbudget:t,onSelect:()=>{return t=e.id,void(s.includes(t)?l(s.filter((e=>e!==t))):l([...s,t]));var t}},e.id)}))})}),(0,z.jsxs)($.G7,{style:{flexDirection:"row",justifyContent:"flex-end",marginTop:30},children:[(0,z.jsx)($.zx,{style:{marginRight:10},onClick:o.onBack,children:"Back"}),(0,z.jsx)($.zx,{primary:!0,onClick:u,children:r?"Link Account":"Next"})]})]})})}function ph(e){let{modalProps:t,category:n,group:r,categoryGroups:o,onDelete:i}=e;const[a,s]=(0,c.useState)(null),[l,u]=(0,c.useState)(null),d=(0,c.useRef)(null);(0,c.useEffect)((()=>{setTimeout((()=>{d.current.focus()}),200)}),[]);const f=e=>{let t;if("required-transfer"===e)t="You must select a category";else t="Something bad happened, sorry!";return(0,z.jsx)($.xv,{style:{marginTop:15,color:H.O9.r4},children:t})},h=!!(n||r).is_income;return(0,z.jsx)($.u_,{title:"Confirm Delete",...t,style:{flex:0},children:()=>(0,z.jsxs)($.G7,{style:{lineHeight:1.5},children:[r?(0,z.jsxs)($.gO,{children:["Categories in the group ",(0,z.jsx)("strong",{children:r.name})," are used by existing transaction",!h&&" or it has a positive leftover balance currently","."," ",(0,z.jsx)("strong",{children:"Are you sure you want to delete it?"})," If so, you must select another category to transfer existing transactions and balance to."]}):(0,z.jsxs)($.gO,{children:[(0,z.jsx)("strong",{children:n.name})," is used by existing transactions",!h&&" or it has a positive leftover balance currently","."," ",(0,z.jsx)("strong",{children:"Are you sure you want to delete it?"})," If so, you must select another category to transfer existing transactions and balance to."]}),l&&f(l),(0,z.jsxs)($.G7,{style:{marginTop:20,flexDirection:"row",justifyContent:"flex-start",alignItems:"center"},children:[(0,z.jsx)($.xv,{children:"Transfer to:"}),(0,z.jsx)($.G7,{style:{flex:1,marginLeft:10,marginRight:30},children:(0,z.jsx)(ir.e,{ref:d,categoryGroups:r?o.filter((e=>e.id!==r.id&&!!e.is_income===h)):o.filter((e=>!!e.is_income===h)).map((e=>({...e,categories:e.categories.filter((e=>e.id!==n.id))}))),name:"category",value:a,onChange:e=>s(e.target.value)})}),(0,z.jsx)($.zx,{primary:!0,onClick:()=>{a?(i(a),t.onClose()):u("required-transfer")},children:"Delete"})]})]})})}var gh=n(1669);function mh(){const[e,t]=(0,c.useState)(null),[n,r]=(0,c.useState)(!1),o=Nr();return(0,c.useEffect)((()=>{"online"===o&&async function(){r(!0);const e=await(0,N.lW)("nordigen-status");t(e.configured||!1),r(!1)}()}),[o]),{configured:e,isLoading:n}}function yh(e){let{modalProps:t,syncServerStatus:n}=e;const r=(0,d.I0)(),[o,i]=(0,c.useState)(null),a=()=>{o?Bn(((e,t)=>r((0,gh.Ll)(e,t)))):s()},s=()=>{r((0,gh.Ll)("nordigen-init",{onSuccess:()=>i(!0)}))},l=()=>{r((0,gh.Ll)("add-local-account"))},{configured:u}=mh();return(0,c.useEffect)((()=>{i(u)}),[u]),(0,z.jsx)($.u_,{title:"Add Account",...t,children:()=>(0,z.jsxs)($.G7,{style:{maxWidth:500,gap:30},children:[(0,z.jsxs)($.G7,{style:{gap:10},children:[(0,z.jsx)($.zx,{primary:!0,style:{padding:"10px 0",fontSize:15,fontWeight:600},onClick:l,children:"Create local account"}),(0,z.jsx)($.G7,{style:{lineHeight:"1.4em",fontSize:15},children:(0,z.jsxs)($.xv,{children:[(0,z.jsx)("strong",{children:"Create a local account"})," if you want to add transactions manually. You can also"," ",(0,z.jsx)($.dL,{to:"https://actualbudget.org/docs/transactions/importing",linkColor:"muted",children:"import QIF/OFX/QFX files into a local account"}),"."]})})]}),(0,z.jsx)($.G7,{style:{gap:10},children:"online"===n?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)($.yp,{disabled:"online"!==n,style:{padding:"10px 0",fontSize:15,fontWeight:600,flex:1},onClick:a,children:o?"Link bank account with Nordigen":"Set up Nordigen for bank sync"}),(0,z.jsxs)($.xv,{style:{lineHeight:"1.4em",fontSize:15},children:[(0,z.jsx)("strong",{children:"Link a bank account"})," to automatically download transactions. Nordigen provides reliable, up-to-date information from hundreds of banks."]})]}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)($.zx,{disabled:!0,style:{padding:"10px 0",fontSize:15,fontWeight:600},children:"Set up Nordigen for bank sync"}),(0,z.jsxs)($.P,{style:{fontSize:15},children:["Connect to an Actual server to set up"," ",(0,z.jsx)($.dL,{to:"https://actualbudget.org/docs/advanced/bank-sync",linkColor:"muted",children:"automatic syncing with Nordigen"}),"."]})]})})]})})}var vh=n(6218);function xh(e){let{modalProps:t,actions:n,options:r={}}=e,[o,i]=(0,c.useState)(""),[a,s]=(0,c.useState)(!1),[l,u]=(0,c.useState)(""),[d,f]=(0,c.useState)(!1),h=r.recreate;return(0,z.jsx)($.u_,{...t,style:{width:600},title:h?"Generate new key":"Enable encryption",onClose:()=>n.popModal(),children:()=>(0,z.jsxs)(z.Fragment,{children:[h?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)($.P,{style:{marginTop:5},children:["This will generate a new key for encrypting your data."," ",(0,z.jsx)("strong",{children:"This requires a sync reset"})," and all other devices will have to revert to this version of your data. Actual will take you through that process on those devices."," ",(0,z.jsx)($.dL,{to:"https://actualbudget.org/docs/getting-started/sync/#end-to-end-encryption",children:"Learn more"})]}),(0,z.jsx)($.P,{children:"Key generation is randomized. The same password will create different keys, so this will change your key regardless of the password being different."})]}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)($.P,{style:{marginTop:5},children:["To enable end-to-end encryption, you need to create a key. We will generate a key based on a password and use it to encrypt from now on. ",(0,z.jsx)("strong",{children:"This requires a sync reset"})," and all other devices will have to revert to this version of your data."," ",(0,z.jsx)($.dL,{to:"https://actualbudget.org/docs/getting-started/sync/#end-to-end-encryption",children:"Learn more"})]}),(0,z.jsx)($.P,{children:(0,z.jsxs)("ul",{...(0,L.iv)({marginTop:0,"& li":{marginBottom:8}}),children:[(0,z.jsxs)("li",{children:[(0,z.jsx)("strong",{children:"Important:"})," if you forget this password"," ",(0,z.jsx)("em",{children:"and"})," you don\u2019t have any local copies of your data, you will lose access to all your data. The data cannot be decrypted without the password."]}),(0,z.jsx)("li",{children:"This key only applies to this file. You will need to generate a new key for each file you want to encrypt."}),(0,z.jsx)("li",{children:"If you\u2019ve already downloaded your data on other devices, you will need to reset them. Actual will automatically take you through this process."}),(0,z.jsx)("li",{children:"It is recommended for the encryption password to be different than the log-in password in order to better protect your data."})]})})]}),(0,z.jsxs)("form",{onSubmit:e=>{e.preventDefault(),async function(){if(""!==o&&!a){s(!0),u(null);let e=await(0,N.lW)("key-make",{password:o});if(e.error)return s(null),void u((0,vh.zJ)(e.error));n.loadGlobalPrefs(),n.loadAllFiles(),n.sync(),s(!1),n.popModal()}}()},children:[(0,z.jsxs)($.G7,{style:{alignItems:"center"},children:[(0,z.jsx)($.xv,{style:{fontWeight:600,marginBottom:3},children:"Password"}),l&&(0,z.jsx)($.G7,{style:{color:H.O9.r4,textAlign:"center",fontSize:13,marginBottom:3},children:l}),(0,z.jsx)($.$Y,{children:(0,z.jsx)($.II,{type:d?"text":"password",style:{width:300},onChange:e=>i(e.target.value)})}),(0,z.jsx)($.xv,{style:{marginTop:5},children:(0,z.jsxs)("label",{style:{userSelect:"none"},children:[(0,z.jsx)("input",{type:"checkbox",onClick:()=>f(!d)})," ","Show password"]})})]}),(0,z.jsx)($.Zf,{style:{marginTop:20},children:(0,z.jsx)($.yp,{loading:a,primary:!0,children:"Enable"})})]})]})})}var bh=function(e){let{modalProps:t,actions:n}=e,r=(0,Pt.s0)(),[o,i]=(0,c.useState)(""),[a,s]=(0,c.useState)(!1),[l,u]=(0,c.useState)("0"),[d,f]=(0,c.useState)(!1),[h,p]=(0,c.useState)(!1),g=e=>!isNaN(parseFloat(e));return(0,z.jsx)($.u_,{title:"Create Local Account",...t,showBack:!1,children:()=>(0,z.jsx)($.G7,{children:(0,z.jsxs)("form",{onSubmit:async e=>{e.preventDefault();let t=!o;f(t);let i=!g(l);if(p(i),!t&&!i){n.closeModal();let e=await n.createAccount(o,(0,I.sD)(l),a);r("/accounts/"+e)}},children:[(0,z.jsx)($._9,{label:"Name",width:"75%",children:(0,z.jsx)($.$Y,{children:(0,z.jsx)($.II,{name:"name",value:o,onChange:e=>i(e.target.value),onBlur:e=>{let t=e.target.value.trim();i(t),t&&d&&f(!1)},style:{flex:1}})})}),d&&(0,z.jsx)($.Xq,{style:{marginLeft:75},children:"Name is required"}),(0,z.jsx)($.G7,{style:{width:"75%",flexDirection:"row",justifyContent:"flex-end"},children:(0,z.jsxs)($.G7,{style:{flexDirection:"column"},children:[(0,z.jsxs)("label",{style:{userSelect:"none",textAlign:"right",width:"100%",display:"flex",verticalAlign:"center",justifyContent:"flex-end"},htmlFor:"offbudget",children:[(0,z.jsx)("input",{id:"offbudget",name:"offbudget",type:"checkbox",checked:a,onChange:e=>s(e.target.checked)}),"Off-budget"]}),(0,z.jsx)("div",{style:{textAlign:"right",fontSize:"0.7em",color:H.O9.n5,marginTop:3},children:(0,z.jsxs)($.xv,{children:["This cannot be changed later. ",(0,z.jsx)("br",{})," ","\n","See"," ",(0,z.jsx)($.dL,{linkColor:"muted",to:"https://actualbudget.org/docs/accounts/#off-budget-accounts",children:"Accounts Overview"})," ","for more information."]})})]})}),(0,z.jsx)($._9,{label:"Balance",width:"75%",children:(0,z.jsx)($.II,{name:"balance",value:l,onChange:e=>u(e.target.value),onBlur:e=>{let t=e.target.value.trim();u(t),g(t)&&h&&p(!1)},style:{flex:1}})}),h&&(0,z.jsx)($.Xq,{style:{marginLeft:75},children:"Balance must be a number"}),(0,z.jsxs)($.Zf,{children:[(0,z.jsx)($.zx,{onClick:()=>t.onBack(),type:"button",children:"Back"}),(0,z.jsx)($.zx,{primary:!0,style:{marginLeft:10},children:"Create"})]})]})})})};var wh=(0,d.$j)((e=>({dateFormat:e.prefs.local.dateFormat||"MM/dd/yyyy",categoryGroups:e.queries.categories.grouped,accounts:e.queries.accounts,payees:e.queries.payees})),y)((function(e){let t,n,r,{actions:o,modalProps:i,name:a,accounts:s,categoryGroups:l,payees:u,onSubmit:c,dateFormat:d,createPayee:f}=e;function h(e){null!=e&&("amount"===a&&(e=(0,I.l9)(e)),c(a,e)),i.onClose()}let p={":focus":{boxShadow:0}},g={inputProps:{style:p},containerProps:{style:{height:275}}};switch(a){case"date":{let e=(0,fn.PR)();t="Date",r=350,n=(0,z.jsx)(lr.Z,{value:(0,Gn.Z)((0,zn.Z)(e),d),dateFormat:d,focused:!0,embedded:!0,onUpdate:()=>{},onSelect:e=>{h((0,fn.is)((0,cn.Z)(e,"yyyy-MM-dd",new Date)))}});break}case"account":t="Account",n=(0,z.jsx)(or.Z,{value:null,accounts:s,focused:!0,embedded:!0,onSelect:e=>{e&&h(e)},...g});break;case"payee":t="Payee",n=(0,z.jsx)(ar.Z,{payees:u,accounts:s,value:null,focused:!0,embedded:!0,showManagePayees:!1,onSelect:async e=>{e&&e.startsWith("new:")&&(e=await f(e.slice(4))),h(e)},isCreatable:!0,...g});break;case"notes":t="Notes",n=(0,z.jsx)($.II,{focused:!0,onEnter:e=>h(e.target.value),style:p});break;case"category":t="Category",n=(0,z.jsx)(ir.Z,{categoryGroups:l,value:null,focused:!0,embedded:!0,showSplitOption:!1,onUpdate:()=>{},onSelect:e=>{h(e)},...g});break;case"amount":t="Amount",n=(0,z.jsx)($.II,{focused:!0,onEnter:e=>h(e.target.value),style:p})}return(0,z.jsx)($.u_,{noAnimation:!0,showHeader:!1,focusAfterClose:!1,...i,padding:0,style:[{flex:0,padding:"15px 10px",backgroundColor:H.O9.n1,color:"white"},r&&{minWidth:r}],children:()=>(0,z.jsxs)($.G7,{children:[(0,z.jsx)(J.eX,{title:t,style:{alignSelf:"center",color:H.O9.b10,marginBottom:10}}),(0,z.jsx)($.G7,{style:{flex:1},children:n})]})})})),Sh=n(7117);function Ch(e){let{modalProps:t,actions:n,options:r={}}=e,{hasExistingKey:o,cloudFileId:i,onSuccess:a}=r,[s,l]=(0,c.useState)(""),[u,d]=(0,c.useState)(""),[f,h]=(0,c.useState)(!1),[p,g]=(0,c.useState)(!1);async function m(){if(""!==s&&!f){h(!0),d(null);let{error:e}=await(0,N.lW)("key-test",{password:s,fileId:i});if(e)return d((0,vh.Ez)(e)),void h(!1);n.popModal(),a&&a()}}return(0,z.jsx)($.u_,{...t,showHeader:!1,style:{width:600},children:()=>(0,z.jsxs)($.G7,{style:{flex:1},children:[(0,z.jsx)($.xv,{style:{fontSize:25,fontWeight:700,color:H.O9.n2,margin:"20px 0"},children:o?"Unable to decrypt file":"This file is encrypted"}),o?(0,z.jsxs)($.P,{children:["This file was encrypted with a different key than you are currently using. This probably means you changed your password. Enter your current password to update your key."," ",(0,z.jsx)($.dL,{to:"https://actualbudget.org/docs/getting-started/sync/#end-to-end-encryption",children:"Learn more"})]}):(0,z.jsxs)($.P,{children:["We don\u2019t have a key that encrypts or decrypts this file. Enter the password for this file to create the key for encryption."," ",(0,z.jsx)($.dL,{to:"https://actualbudget.org/docs/getting-started/sync/#end-to-end-encryption",children:"Learn more"})]}),(0,z.jsxs)("form",{onSubmit:e=>{e.preventDefault(),m()},children:[(0,z.jsxs)($.G7,{style:{marginTop:15,flexDirection:"column",alignItems:"center"},children:[(0,z.jsx)($.xv,{style:{fontWeight:600,marginBottom:5},children:"Password"})," ",u&&(0,z.jsx)($.G7,{style:{color:H.O9.r4,textAlign:"center",fontSize:13,marginBottom:3},children:u}),(0,z.jsx)($.$Y,{children:(0,z.jsx)($.II,{type:p?"text":"password",style:{width:"50%"},onChange:e=>l(e.target.value)})}),(0,z.jsx)($.xv,{style:{marginTop:5},children:(0,z.jsxs)("label",{style:{userSelect:"none"},children:[(0,z.jsx)("input",{type:"checkbox",onClick:()=>g(!p)})," ","Show password"]})})]}),(0,z.jsxs)($.Zf,{style:{marginTop:20},children:[(0,z.jsx)($.zx,{style:{marginRight:10},onClick:()=>t.onBack(),type:"button",children:"Back"}),(0,z.jsx)($.yp,{loading:f,primary:!0,onClick:m,children:o?"Update key":"Create key"})]})]})]})})}let jh=[{format:"yyyy mm dd",label:"YYYY MM DD"},{format:"yy mm dd",label:"YY MM DD"},{format:"mm dd yyyy",label:"MM DD YYYY"},{format:"mm dd yy",label:"MM DD YY"},{format:"dd mm yyyy",label:"DD MM YYYY"},{format:"dd mm yy",label:"DD MM YY"}];function kh(e,t){if("string"!==typeof e)return null;function n(e){return e&&1===e.length?"0"+e:e}const r=(e,t)=>n=>{const r=n.replace(/^[^\d]+/,"").replace(/[^\d]+$/,"").split(/[^\d]+/);if(r.length>=3)return r.slice(0,3);const o=n.replace(/[^\d]/g,"");return[o.slice(0,e),o.slice(e,e+t),o.slice(e+t)]},o=r(4,2),i=r(2,2);let a,s,l,u;switch(t){case"dd mm yyyy":a=i(e),s=a[2],l=a[1],u=a[0];break;case"dd mm yy":a=i(e),s=`20${a[2]}`,l=a[1],u=a[0];break;case"yyyy mm dd":a=o(e),s=a[0],l=a[1],u=a[2];break;case"yy mm dd":a=i(e),s=`20${a[0]}`,l=a[1],u=a[2];break;case"mm dd yy":a=i(e),s=`20${a[2]}`,l=a[0],u=a[1];break;default:a=i(e),s=a[2],l=a[0],u=a[1]}let c=`${s}-${n(l)}-${n(u)}`;return dn.Z(zn.Z(c))?c:null}function Eh(e,t){if(!e)return null;try{return(0,fn.WU)(e,t)}catch(cu){}return null}function Th(e){let t=e.match(/\.([^.]*)$/);return t?t[1].toLowerCase():"ofx"}function Oh(e){let{parseDateFormat:t,showParsed:n,dateFormat:r,date:o}=e,i=o&&Eh(t?kh(o,t):o,r);return(0,z.jsxs)($.xv,{children:[(0,z.jsxs)($.xv,{children:[o||(0,z.jsx)($.xv,{style:{color:H.O9.n4,fontStyle:"italic"},children:"Empty"})," ","\u2192"," "]}),(0,z.jsx)($.xv,{style:{color:i?H.O9.g3:H.O9.r4},children:i||"Invalid"})]})}function Ih(e,t){if(0===e.length||null==t.date)return"yyyy mm dd";let n=e[0][t.date],r=null==n?null:jh.find((e=>null!=kh(n,e.format)));return r?r.format:"mm dd yyyy"}function Dh(e){if(0===e.length)return{};let t=e[0],n=Object.entries(t);function r(e){return e?e[0]:null}let o=r(n.find((e=>{let[t,n]=e;return t.toLowerCase().includes("date")}))||n.find((e=>{let[t,n]=e;return n.match(/^\d+[-/]\d+[-/]\d+$/)}))),i=r(n.find((e=>{let[t,n]=e;return t.toLowerCase().includes("amount")}))||n.find((e=>{let[t,n]=e;return n.match(/^-?[.,\d]+$/)}))),a=r(n.find((e=>{let[t,n]=e;return t!==o&&t!==i}))),s=r(n.find((e=>{let[t,n]=e;return t!==o&&t!==i&&t!==a})));return{date:o,amount:i,payee:a,notes:s}}function Ah(e,t){let n={};for(let[r,o]of Object.entries(t))"payee"===r&&(r="payee_name"),n[r]=e[o||r];return n}function _h(e,t){if(null==e)return null;return t("string"===typeof e?(0,I.qP)(e):e)}function Ph(e,t,n,r){const o=parseFloat(r)||1;if(t){let t=_h(e.outflow,(e=>-Math.abs(e)))*o,n=t?0:_h(e.inflow,(e=>Math.abs(e)))*o;return{amount:t||n,outflow:t,inflow:n}}return{amount:_h(e.amount,(e=>n?-1*e:e))*o,outflow:null,inflow:null}}function Mh(e){let{transaction:t,fieldMappings:n,showParsed:r,parseDateFormat:o,dateFormat:i,splitMode:a,flipAmount:s,multiplierAmount:l}=e,u=(0,c.useMemo)((()=>n?Ah(t,n):t),[t,n]),{amount:d,outflow:f,inflow:h}=Ph(u,a,s,l);return d=(0,I.eY)(d),f=(0,I.eY)(f),h=(0,I.eY)(h),(0,z.jsxs)(ur.X2,{style:{backgroundColor:"white"},children:[(0,z.jsx)(ur.gN,{width:200,borderColor:H.O9.border,children:r?(0,z.jsx)(Oh,{parseDateFormat:o,dateFormat:i,date:u.date}):Eh(u.date,i)}),(0,z.jsx)(ur.gN,{width:"flex",borderColor:H.O9.border,title:u.imported_payee||u.payee_name,children:u.payee_name}),(0,z.jsx)(ur.gN,{width:"flex",borderColor:H.O9.border,title:u.notes,children:u.notes}),a?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(ur.gN,{width:90,borderColor:H.O9.border,contentStyle:[{textAlign:"right"},H.W2.tnum],title:f,children:f}),(0,z.jsx)(ur.gN,{width:90,borderColor:H.O9.border,contentStyle:[{textAlign:"right"},H.W2.tnum],title:h,children:h})]}):(0,z.jsx)(ur.gN,{width:90,borderColor:H.O9.border,contentStyle:[{textAlign:"right"},H.W2.tnum],title:d,children:d})]})}function Rh(e){let{title:t}=e;return(0,z.jsx)($.xv,{style:{fontSize:13,marginBottom:3,color:H.O9.n3},children:t})}function Nh(e){let{width:t,style:n,options:r,value:o,onChange:i}=e;return(0,z.jsxs)($.Ph,{value:o,style:n,onChange:e=>i(e.target.value),children:[(0,z.jsx)("option",{value:"",children:"Choose field..."}),r.map((e=>(0,z.jsx)("option",{value:e,children:e},e)))]})}function Lh(e){let{transactions:t,fieldMappings:n,parseDateFormat:r,onChange:o}=e,i="-";if(t.length>0&&n&&null!=n.date){let e=t[0][n.date],r=e&&e.match(/[/.,-/\\]/);i=r?r[0]:" "}return(0,z.jsxs)($.G7,{style:{width:120},children:[(0,z.jsx)(J.eX,{title:"Date format"}),(0,z.jsx)($.Ph,{value:r||"",onChange:e=>o(e.target.value),children:jh.map((e=>(0,z.jsx)("option",{value:e.format,children:e.label.replace(/ /g,i)},e.format)))})]})}function Fh(e){let{value:t,onChange:n}=e;return(0,z.jsxs)($.G7,{style:{flex:1,flexDirection:"row",alignItems:"center",userSelect:"none"},children:[(0,z.jsx)(J.XZ,{id:"add_multiplier",checked:t,onChange:n}),(0,z.jsx)("label",{htmlFor:"add_multiplier",children:"Add Multiplier"})]})}function Wh(e){let{value:t,disabled:n,onChange:r}=e;return(0,z.jsxs)($.G7,{style:{flex:1,flexDirection:"row",alignItems:"center",userSelect:"none"},children:[(0,z.jsx)(J.XZ,{id:"form_flip",checked:t,disabled:n,onChange:r}),(0,z.jsx)("label",{htmlFor:"form_flip",style:{userSelect:"none",color:n?H.O9.n6:null},children:"Flip amount"})]})}function Bh(e){let{value:t,onChange:n}=e;return(0,z.jsxs)($.G7,{style:{flex:1,flexDirection:"row",alignItems:"center",userSelect:"none"},children:[(0,z.jsx)(J.XZ,{id:"form_split",checked:t,onChange:n}),(0,z.jsx)("label",{htmlFor:"form_split",style:{userSelect:"none"},children:"Split amount into separate inflow/outflow columns"})]})}function zh(e){let{transactions:t,mappings:n,onChange:r,splitMode:o}=e;if(0===t.length)return null;let i=Object.keys(t[0]);return n=n||{},(0,z.jsxs)($.G7,{children:[(0,z.jsx)(J.eX,{title:"CSV FIELDS"}),(0,z.jsxs)($.Kq,{direction:"row",align:"flex-start",spacing:1,style:{marginTop:5},children:[(0,z.jsxs)($.G7,{style:{width:200},children:[(0,z.jsx)(Rh,{title:"Date"}),(0,z.jsx)(Nh,{width:200,options:i,value:n.date||"",style:{marginRight:5},onChange:e=>r("date",e)})]}),(0,z.jsxs)($.G7,{style:{flex:1},children:[(0,z.jsx)(Rh,{title:"Payee"}),(0,z.jsx)(Nh,{width:"flex",options:i,value:n.payee||"",style:{marginRight:5},onChange:e=>r("payee",e)})]}),(0,z.jsxs)($.G7,{style:{flex:1},children:[(0,z.jsx)(Rh,{title:"Notes"}),(0,z.jsx)(Nh,{width:"flex",options:i,value:n.notes||"",style:{marginRight:5},onChange:e=>r("notes",e)})]}),o?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)($.G7,{style:{width:90},children:[(0,z.jsx)(Rh,{title:"Outflow"}),(0,z.jsx)(Nh,{width:90,options:i,value:n.outflow||"",onChange:e=>r("outflow",e)})]}),(0,z.jsxs)($.G7,{style:{width:90},children:[(0,z.jsx)(Rh,{title:"Inflow"}),(0,z.jsx)(Nh,{width:90,options:i,value:n.inflow||"",onChange:e=>r("inflow",e)})]})]}):(0,z.jsxs)($.G7,{style:{width:90},children:[(0,z.jsx)(Rh,{title:"Amount"}),(0,z.jsx)(Nh,{width:90,options:i,value:n.amount||"",onChange:e=>r("amount",e)})]})]})]})}function Gh(e){let{multiplierCB:t,value:n,onChange:r}=e;const o=t?"inherit":"none";return(0,z.jsx)($.II,{type:"text",style:{display:o},value:n,placeholder:"Optional",onUpdate:r})}var Zh=(0,d.$j)((e=>({dateFormat:e.prefs.local.dateFormat||"MM/dd/yyyy",prefs:e.prefs.local})),y)((function(e){let{modalProps:t,options:n,dateFormat:r="MM/dd/yyyy",prefs:o,parseTransactions:i,importTransactions:a,getPayees:s,savePrefs:l}=e,[u,d]=(0,c.useState)(""),[f,h]=(0,c.useState)("parsing"),[p,g]=(0,c.useState)(null),[m,y]=(0,c.useState)(n.filename),[v,x]=(0,c.useState)([]),[b,w]=(0,c.useState)(null),[S,C]=(0,c.useState)(null),[j,k]=(0,c.useState)(!1),[E,T]=(0,c.useState)(!1),[O,D]=(0,c.useState)(!1),{accountId:A,onImported:_}=n,[P,M]=(0,c.useState)(o[`csv-delimiter-${A}`]||","),[R,N]=(0,c.useState)(null);async function L(e,t){h("parsing");let n=Th(e);y(e),w(n);let{errors:r,transactions:a}=await i(e,t);if(h(null),g(null),r.length>0)g({parsed:!0,message:r[0].message||"Internal error"});else{if("csv"!==n&&"qif"!==n||T(o[`flip-amount-${A}-${n}`]||!1),"csv"===n){let e=o[`csv-mappings-${A}`];e=e?JSON.parse(e):Dh(a),C(e);let t=!(!e.outflow&&!e.inflow);k(t),N(o[`parse-date-${A}-${n}`]||Ih(a,e))}else"qif"===n?N(o[`parse-date-${A}-${n}`]||Ih(a,{date:"date"})):(C(null),N(null));x(a.reverse())}}(0,c.useEffect)((()=>{L(n.filename,"csv"===Th(n.filename)?{delimiter:P}:null)}),[i,n.filename]);let F=[{name:"Date",width:200},{name:"Payee",width:"flex"},{name:"Notes",width:"flex"}];return j?(F.push({name:"Outflow",width:90,style:{textAlign:"right"}}),F.push({name:"Inflow",width:90,style:{textAlign:"right"}})):F.push({name:"Amount",width:90,style:{textAlign:"right"}}),(0,z.jsxs)($.u_,{title:"Import transactions"+(b?` (${b.toUpperCase()})`:""),...t,loading:"parsing"===f,style:{width:800},children:[p&&!p.parsed&&(0,z.jsx)($.G7,{style:{alignItems:"center",marginBottom:15},children:(0,z.jsxs)($.xv,{style:{marginRight:10,color:H.O9.r4},children:[(0,z.jsx)("strong",{children:"Error:"})," ",p.message]})}),(!p||!p.parsed)&&(0,z.jsxs)($.G7,{style:{flex:"unset",height:300,border:"1px solid "+H.O9.border},children:[(0,z.jsx)(ur.xD,{headers:F}),(0,z.jsx)(ur.pX,{items:v,fields:["payee","amount"],style:{backgroundColor:H.O9.n11},getItemKey:e=>e,renderEmpty:()=>(0,z.jsx)($.G7,{style:{textAlign:"center",marginTop:25,color:H.O9.n4,fontStyle:"italic"},children:"No transactions found"}),renderItem:e=>{let{key:t,style:n,item:o,editing:i,focusedField:a}=e;return(0,z.jsx)($.G7,{style:n,children:(0,z.jsx)(Mh,{transaction:o,showParsed:"csv"===b||"qif"===b,parseDateFormat:R,dateFormat:r,fieldMappings:S,splitMode:j,flipAmount:E,multiplierAmount:u})},t)}})]}),p&&p.parsed&&(0,z.jsxs)($.G7,{style:{color:H.O9.r4,alignItems:"center",marginTop:10},children:[(0,z.jsxs)($.xv,{style:{maxWidth:450,marginBottom:15},children:[(0,z.jsx)("strong",{children:"Error:"})," ",p.message]}),p.parsed&&(0,z.jsx)($.zx,{onClick:()=>function(){const e=window.Actual.openFileDialog({filters:[{name:"Financial Files",extensions:["qif","ofx","qfx","csv"]}]});L(e[0],"csv"===Th(e[0])?{delimiter:P}:null)}(),children:"Select new file..."})]}),"csv"===b&&(0,z.jsx)($.G7,{style:{marginTop:25},children:(0,z.jsx)(zh,{transactions:v,onChange:function(e,t){C({...S,[e]:""===t?null:t})},mappings:S,splitMode:j})}),("qif"===b||"csv"===b)&&(0,z.jsx)($.G7,{style:{marginTop:25},children:(0,z.jsxs)($.Kq,{direction:"row",align:"flex-start",spacing:1,style:{marginTop:5},children:[(0,z.jsx)($.G7,{children:("qif"===b||"csv"===b)&&(0,z.jsx)(Lh,{transactions:v,fieldMappings:S,parseDateFormat:R,onChange:N})}),(0,z.jsx)($.G7,{children:"csv"===b&&(0,z.jsxs)($.G7,{style:{marginLeft:25},children:[(0,z.jsx)(J.eX,{title:"CSV DELIMITER"}),(0,z.jsxs)($.Ph,{value:P,onChange:e=>{M(e.target.value),L(m,{delimiter:e.target.value})},children:[(0,z.jsx)("option",{value:",",children:","}),(0,z.jsx)("option",{value:";",children:";"})]})]})}),(0,z.jsx)($.G7,{style:{flex:1}}),(0,z.jsxs)($.G7,{style:{marginRight:25},children:[(0,z.jsx)(J.eX,{title:"IMPORT OPTIONS"}),(0,z.jsx)($.G7,{style:{marginTop:5},children:(0,z.jsx)(Wh,{value:E,disabled:j,onChange:()=>{T(!E)}})}),"csv"===b&&(0,z.jsx)($.G7,{style:{marginTop:10},children:(0,z.jsx)(Bh,{value:j,onChange:function(){if(null==S)return;!0===E&&T(!E);let e=!j;k(e);let t=Dh(v),n=e?{amount:null,outflow:t.amount,inflow:null}:{amount:t.amount,outflow:null,inflow:null};C({...S,...n})}})}),(0,z.jsxs)($.G7,{style:{flexDirection:"row",marginTop:10},children:[(0,z.jsx)($.G7,{style:{marginRight:30},children:(0,z.jsx)(Fh,{value:O,onChange:()=>{D(!O),d("")}})}),(0,z.jsx)($.G7,{style:{width:75},children:(0,z.jsx)(Gh,{multiplierCB:O,value:u,onChange:function(e){const t=e;t&&!t.match(/^\d{1,}(\.\d{0,4})?$/)||d(t)}})})]})]})]})}),(0,z.jsx)($.G7,{style:{flexDirection:"row",marginTop:5},children:(0,z.jsx)($.G7,{style:{alignSelf:"flex-end",flexDirection:"row",alignItems:"center"},children:(0,z.jsxs)($.yp,{primary:!0,disabled:0===v.length,loading:"importing"===f,onClick:async function(){h("importing");let e,n=[];for(let t of v){t=S?Ah(t,S):t;let r="qfx"===b||"ofx"===b?t.date:kh(t.date,R);if(null==r){e=`Unable to parse date ${t.date||"(empty)"} with given date format`;break}let{amount:o}=Ph(t,j,E,u);if(null==o){e=`Transaction on ${t.date} has no amount`;break}let{inflow:i,outflow:a,...s}=t;n.push({...s,date:r,amount:(0,I.l9)(o)})}if(e)return h(null),void g({parsed:!1,message:e});if("ofx"!==b&&"qfx"!==b){l({[`parse-date-${A}-${b}`]:R})}"csv"===b&&(l({[`csv-mappings-${A}`]:JSON.stringify(S)}),l({[`csv-delimiter-${A}`]:P})),"csv"!==b&&"qif"!==b||l({[`flip-amount-${A}-${b}`]:E});let r=await a(A,n);r&&await s(),_&&_(r),t.onClose()},children:["Import ",v.length," transactions"]})})})]})}));class Uh extends c.Component{constructor(){super(...arguments),this.state={hoveredBackup:null},this.onHover=e=>{this.setState({hoveredBackup:e})}}render(){const{backups:e,onSelect:t}=this.props,{hoveredBackup:n}=this.state;return(0,z.jsx)($.G7,{style:{flex:1,maxHeight:200,overflow:"auto"},onMouseLeave:()=>this.onHover(null),children:e.map(((e,r)=>(0,z.jsx)(ur.X2,{collapsed:0!==r,focused:n===e.id,onMouseEnter:()=>this.onHover(e.id),onClick:()=>t(e.id),style:{cursor:"pointer"},children:(0,z.jsx)(ur.bL,{width:"flex",value:e.date?e.date:"Revert to Latest",valueStyle:{paddingLeft:20}})},e.id)))})}}var Hh=function(e){let{budgetId:t,watchUpdates:n,backupDisabled:r,actions:o,modalProps:i}=e,[a,s]=(0,c.useState)([]);(0,c.useEffect)((()=>{(0,N.lW)("backups-get",{id:t}).then(s)}),[t]),(0,c.useEffect)((()=>{if(n)return(0,N.oL)("backups-updated",s),()=>(0,N.Ev)("backups-updated",s)}),[n]);const l=a.find((e=>e.isLatest)),u=a.filter((e=>!e.isLatest));return(0,z.jsx)($.u_,{title:"Load Backup",padding:0,...i,style:{flex:0},children:()=>(0,z.jsxs)($.G7,{style:{marginBottom:30},children:[(0,z.jsx)($.G7,{style:{margin:20,marginTop:0,marginBottom:15,lineHeight:1.5},children:l?(0,z.jsxs)($.gO,{children:[(0,z.jsxs)($.gO,{style:{marginBottom:10},children:[(0,z.jsx)($.xv,{style:{fontWeight:600},children:"You are currently working from a backup."})," ","You can load a different backup or revert to the original version below."]}),(0,z.jsx)($.zx,{primary:!0,onClick:()=>o.loadBackup(t,l.id),children:"Revert to original version"})]}):(0,z.jsxs)($.G7,{style:{alignItems:"flex-start"},children:[(0,z.jsxs)($.gO,{style:{marginBottom:10},children:["Select a backup to load. After loading a backup, you will have a chance to revert to the current version in this screen."," ",(0,z.jsx)($.xv,{style:{fontWeight:600},children:"If you use a backup, you will have to setup all your devices to sync from the new budget."})]}),(0,z.jsx)($.zx,{primary:!0,disabled:r,onClick:()=>o.makeBackup(),children:"Backup Now"})]})}),0===u.length?(0,z.jsx)($.gO,{style:{color:H.O9.n6,marginLeft:20},children:"No backups available"}):(0,z.jsx)(Uh,{backups:u,onSelect:e=>o.loadBackup(t,e)})]})})},Kh=n(4812);function Vh(e){let{modalProps:t,payeeId:n}=e,[r,o]=(0,c.useState)(!0),i=(0,Pt.TH)();if((0,Kh.Ry)()&&"/payees"!==i.pathname)throw new Error(`Possibly invalid use of ManageRulesModal, add the current url \`${i.pathname}\` to the allowlist if you\u2019re confident the modal can never appear on top of the \`/rules\` page.`);return(0,z.jsx)($.u_,{title:"Rules",padding:0,loading:r,...t,style:[t.style,{flex:1,maxWidth:"90%",maxHeight:"90%"}],children:()=>(0,z.jsx)(nh.Z,{isModal:!0,payeeId:n,setLoading:o})})}var qh=n(2101);const $h=e=>{let{icon:t,color:n,backgroundColor:r,style:o,children:i}=e;return(0,z.jsxs)(Q.Z,{style:[{color:n,fontSize:13,...H.W2.shadow,borderRadius:4,backgroundColor:r,padding:10,flexDirection:"row","& a, & a:active, & a:visited":{color:H.O9.b3}},o],children:[(0,z.jsx)(Q.Z,{style:{paddingLeft:2,paddingTop:".11em",alignSelf:"stretch",flexShrink:0,marginRight:5},children:(0,z.jsx)(t,{width:13,style:{color:n,marginTop:2}})}),(0,z.jsx)(no.Z,{style:{zIndex:1,lineHeight:1.5},children:i})]})},Yh=e=>{let{style:t,children:n}=e;return(0,z.jsx)($h,{icon:qh.Z,color:H.O9.n4,backgroundColor:"transparent",style:[t,{boxShadow:"none",padding:5}],children:n})},Qh=e=>{let{style:t,children:n}=e;return(0,z.jsx)($h,{icon:Xu,color:H.O9.y2,backgroundColor:H.O9.y10,style:t,children:n})},Xh=e=>{let{style:t,children:n}=e;return(0,z.jsx)($h,{icon:Xu,color:H.O9.r2,backgroundColor:H.O9.r10,style:t,children:n})};let Jh={color:H.O9.p5};function ep(e){let{modalProps:t,payeeIds:n,targetPayeeId:r}=e,{payees:o,modalStack:i}=(0,d.v9)((e=>({payees:e.queries.payees,modalStack:e.modals.modalStack}))),a=!!i.find((e=>"edit-rule"===e.name)),s=(0,d.I0)(),[l,u]=(0,c.useState)(!0),f=(0,c.useRef)(null);(0,c.useEffect)((()=>{if(f.current){let e=f.current,t=e.scrollTop;e.scrollTop=t+1,e.scrollTop=t}}),[f.current,!0]);let[h]=(0,c.useState)((()=>n.map((e=>o.find((t=>t.id===e)))))),p=o.find((e=>e.id===r));if(!p)return null;async function g(){let e;if(await(0,N.lW)("payees-merge",{targetId:p.id,mergeIds:h.map((e=>e.id))}),l&&!a){let t=await(0,N.lW)("rule-add-payee-rename",{fromNames:h.map((e=>e.name)),to:p.id});e=t}return t.onClose(),e}async function m(){let e=await g();if(e){let t=await(0,N.lW)("rule-get",{id:e});s((0,gh.OB)("edit-rule",{rule:t}))}}return(0,z.jsx)($.u_,{title:"Merge payee?",padding:0,showHeader:!1,...t,style:t.style,children:()=>(0,z.jsx)($.G7,{style:{padding:20,maxWidth:500},children:(0,z.jsxs)($.G7,{children:[(0,z.jsx)($.P,{style:{marginBottom:10,fontWeight:500},children:1===h.length?(0,z.jsxs)(z.Fragment,{children:["The payee ",(0,z.jsx)($.xv,{style:Jh,children:h[0].name})," ","is not used by transactions any more. Would like to merge it with ",(0,z.jsx)($.xv,{style:Jh,children:p.name}),"?"]}):(0,z.jsxs)(z.Fragment,{children:["The following payees are not used by transactions any more. Would like to merge them with"," ",(0,z.jsx)($.xv,{style:Jh,children:p.name}),"?",(0,z.jsx)("ul",{ref:f,style:{margin:0,marginTop:10,maxHeight:140,overflow:"auto"},children:h.map((e=>(0,z.jsx)("li",{children:(0,z.jsx)($.xv,{style:Jh,children:e.name})},e.id)))})]})}),(0,z.jsx)(Yh,{children:"Merging will remove the payee and transfer any existing rules to the new payee. If checked below, a rule will be created to do this rename while importing transactions."}),!a&&(0,z.jsxs)("label",{style:{fontSize:13,marginTop:10,color:H.O9.n4,userSelect:"none",display:"flex",alignItems:"center",justifyContent:"center"},children:[(0,z.jsx)("input",{type:"checkbox",checked:l,onChange:e=>u(e.target.checked)}),(0,z.jsxs)($.xv,{style:{marginLeft:3},children:["Automatically rename"," ",1===h.length?"this payee":"these payees"," in the future"]})]}),(0,z.jsxs)($.Zf,{style:{marginTop:20},focusButton:!0,children:[(0,z.jsx)($.zx,{primary:!0,style:{marginRight:10},onClick:g,type:"button",children:"Merge"}),!a&&(0,z.jsx)($.zx,{style:{marginRight:10},onClick:m,type:"button",children:"Merge and edit rule"}),(0,z.jsx)($.zx,{style:{marginRight:10},onClick:()=>t.onBack(),type:"button",children:"Do nothing"})]})]})})})}var tp=n(7835);const np=[{id:"AT",name:"Austria"},{id:"BE",name:"Belgium"},{id:"BG",name:"Bulgaria"},{id:"HR",name:"Croatia"},{id:"CY",name:"Cyprus"},{id:"CZ",name:"Czechia"},{id:"DK",name:"Denmark"},{id:"EE",name:"Estonia"},{id:"FI",name:"Finland"},{id:"FR",name:"France"},{id:"DE",name:"Germany"},{id:"GR",name:"Greece"},{id:"HU",name:"Hungary"},{id:"IS",name:"Iceland"},{id:"IE",name:"Ireland"},{id:"IT",name:"Italy"},{id:"LV",name:"Latvia"},{id:"LI",name:"Liechtenstein"},{id:"LT",name:"Lithuania"},{id:"LU",name:"Luxembourg"},{id:"MT",name:"Malta"},{id:"NL",name:"Netherlands"},{id:"NO",name:"Norway"},{id:"PL",name:"Poland"},{id:"PT",name:"Portugal"},{id:"RO",name:"Romania"},{id:"SK",name:"Slovakia"},{id:"SI",name:"Slovenia"},{id:"ES",name:"Spain"},{id:"SE",name:"Sweden"},{id:"GB",name:"United Kingdom"}];function rp(e){return(0,z.jsx)(Xh,{style:{alignSelf:"center"},children:"timeout"===e?"Timed out. Please try again.":"An error occurred while linking your account, sorry!"})}function op(e){let{modalProps:t,onMoveExternal:n,onSuccess:r,onClose:o}=e;const i=(0,d.I0)();let[a,s]=(0,c.useState)(null),[l,u]=(0,c.useState)(!1),[f,h]=(0,c.useState)(),[p,g]=(0,c.useState)(),[m,y]=(0,c.useState)(null),[v,x]=(0,c.useState)(null),[b,w]=(0,c.useState)(!1),S=(0,c.useRef)(null);const{data:C,isLoading:j,isError:k}=function(e){const[t,n]=(0,c.useState)([]),[r,o]=(0,c.useState)(!1),[i,a]=(0,c.useState)(!1);return(0,c.useEffect)((()=>{!async function(){if(a(!1),!e)return n([]),void o(!1);o(!0);const{data:t,error:r}=await(0,N.OK)("nordigen-get-banks",e);r?(a(!0),n([])):n(t),o(!1)}()}),[n,o,e]),{data:t,isLoading:r,isError:i}}(p),{configured:E,isLoading:T}=mh();async function O(){y(null),s("browser");let e=await n({institutionId:f});if(e.error)return y(e.error),void s(null);S.current=e.data,s(null),u(!0)}async function I(){s("accounts"),await r(S.current),s(null)}const D=()=>{i((0,gh.Ll)("nordigen-init",{onSuccess:()=>x(!0)}))};return(0,z.jsx)($.u_,{title:"Link Your Bank",...t,onClose:function(){o&&o(),t.onClose()},style:{flex:0},children:()=>(0,z.jsxs)($.G7,{children:[(0,z.jsx)($.P,{style:{fontSize:15},children:"To link your bank account, you will be redirected to a new page where Nordigen will ask to connect to your bank. Nordigen will not be able to withdraw funds from your accounts."}),m&&rp(m),a||T?(0,z.jsxs)($.G7,{style:{alignItems:"center",marginTop:15},children:[(0,z.jsx)(K.Z,{color:H.O9.n1,style:{width:20,height:20}}),(0,z.jsx)($.G7,{style:{marginTop:10,color:H.O9.n4},children:T?"Checking Nordigen configuration..":"browser"===a?"Waiting on Nordigen...":"accounts"===a?"Loading accounts...":null}),"browser"===a&&(0,z.jsx)($.Qj,{onClick:O,style:{marginTop:10},children:"(Account linking not opening in a new tab? Click here)"})]}):l?(0,z.jsx)($.zx,{primary:!0,style:{padding:"10px 0",fontSize:15,fontWeight:600,marginTop:10,backgroundColor:H.O9.g4,borderColor:H.O9.g4},onClick:I,children:"Success! Click to continue \u2192"}):E||v?(0,z.jsxs)($.G7,{style:{gap:10},children:[(0,z.jsxs)(J.Wi,{children:[(0,z.jsx)(J.lX,{title:"Choose your country:",htmlFor:"country-field"}),(0,z.jsx)(tp.ZP,{strict:!0,highlightFirst:!0,disabled:T,suggestions:np,onSelect:g,value:p,inputProps:{id:"country-field",placeholder:"(please select)"}})]}),k?(0,z.jsxs)(Xh,{children:["Failed loading available banks: Nordigen access credentials might be misconfigured. Please"," ",(0,z.jsx)($.Qj,{onClick:D,style:{color:H.O9.b3,display:"inline"},children:"set them up"})," ","again."]}):p&&(j?"Loading banks...":(0,z.jsxs)(J.Wi,{children:[(0,z.jsx)(J.lX,{title:"Choose your bank:",htmlFor:"bank-field"}),(0,z.jsx)(tp.ZP,{focused:!0,strict:!0,highlightFirst:!0,suggestions:C,onSelect:h,value:f,inputProps:{id:"bank-field",placeholder:"(please select)"}})]})),(0,z.jsxs)(Qh,{children:["By enabling bank-sync, you will be granting Nordigen (a third party service) read-only access to your entire account\u2019s transaction history. This service is not affiliated with Actual in any way. Make sure you\u2019ve read and understand Nordigen\u2019s"," ",(0,z.jsx)($.dL,{to:"https://nordigen.com/en/company/privacy-policy/",children:"Privacy Policy"})," ","and"," ",(0,z.jsx)($.dL,{to:"https://nordigen.com/en/company/privacy-policy-end-user/",children:"End User Privacy Policy"})," ","before proceeding."]}),(0,z.jsxs)($.G7,{style:{flexDirection:"row",gap:10,alignItems:"center"},children:[(0,z.jsx)($.zx,{primary:!0,style:{padding:"10px 0",fontSize:15,fontWeight:600,flexGrow:1},onClick:O,disabled:!f||!p,children:"Link bank in browser \u2192"}),(0,z.jsxs)($.zx,{bare:!0,onClick:()=>w(!0),"aria-label":"Menu",children:[(0,z.jsx)(xd.Z,{width:15,height:15,style:{color:"inherit",transform:"rotateZ(90deg)"}}),b&&(0,z.jsx)($.u,{position:"bottom-right",width:200,style:{padding:0},onClose:()=>w(!1),children:(0,z.jsx)($.v2,{onMenuSelect:e=>{"reconfigure"===e&&D()},items:[{name:"reconfigure",text:"Set new API secrets"}]})})]})]})]}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)($.P,{style:{color:H.O9.r5},children:"Nordigen integration has not yet been configured."}),(0,z.jsx)($.zx,{primary:!0,onClick:D,children:"Configure Nordigen integration"})]})]})})}var ip=n(7904);var ap=e=>{let{modalProps:t,onSuccess:n}=e;const[r,o]=(0,c.useState)(""),[i,a]=(0,c.useState)(""),[s,l]=(0,c.useState)(!0),[u,d]=(0,c.useState)(!1);return(0,z.jsxs)(sh.C,{title:"Set-up Nordigen",size:{width:300},...t,children:[(0,z.jsxs)(Q.Z,{style:{display:"flex",gap:10},children:[(0,z.jsxs)(no.Z,{children:["In order to enable bank-sync via Nordigen (only for EU banks) you will need to create access credentials. This can be done by creating an account with"," ",(0,z.jsx)($.dL,{to:"https://nordigen.com/",children:"Nordigen"}),"."]}),(0,z.jsxs)(J.Wi,{children:[(0,z.jsx)(J.lX,{title:"Secret ID:",htmlFor:"secret-id-field"}),(0,z.jsx)(ip.C,{id:"secret-id-field",type:"password",value:r,onUpdate:o,onChange:()=>l(!0)})]}),(0,z.jsxs)(J.Wi,{children:[(0,z.jsx)(J.lX,{title:"Secret Key:",htmlFor:"secret-key-field"}),(0,z.jsx)(ip.C,{id:"secret-key-field",type:"password",value:i,onUpdate:a,onChange:()=>l(!0)})]}),!s&&(0,z.jsx)(Xh,{children:"It is required to provide both the secret id and secret key."})]}),(0,z.jsx)(sh.Z,{children:(0,z.jsx)(ih.y,{loading:u,primary:!0,onClick:async()=>{r&&i?(d(!0),await Promise.all([(0,N.lW)("secret-set",{name:"nordigen_secretId",value:r}),(0,N.lW)("secret-set",{name:"nordigen_secretKey",value:i})]),n(),t.onClose(),d(!1)):l(!1)},children:"Save and continue"})})]})};function sp(e){return(0,z.jsx)(Xh,{style:{alignSelf:"center"},children:"timeout"===e?"Timed out. Please try again.":"An error occurred while linking your account, sorry!"})}function lp(e){let{modalProps:t,onMoveExternal:n,onSuccess:r,onClose:o}=e,[i,a]=(0,c.useState)(null),[s,l]=(0,c.useState)(!1),[u,d]=(0,c.useState)(null),f=(0,c.useRef)(null);async function h(){d(null),a("browser");let e=await n();if(e.error)return d(e.error),void a(null);f.current=e.data,a(null),l(!0)}async function p(){a("accounts"),await r(f.current),a(null)}return(0,z.jsx)($.u_,{title:"Link Your Bank",...t,onClose:function(){o&&o(),t.onClose()},style:{flex:0},children:()=>(0,z.jsxs)($.G7,{children:[(0,z.jsx)($.P,{style:{fontSize:15},children:"To link your bank account, you will be moved to your browser for enhanced security. Click below and Actual will automatically resume when you have given your bank\u2019s credentials."}),u&&sp(u),i?(0,z.jsxs)($.G7,{style:{alignItems:"center",marginTop:15},children:[(0,z.jsx)(K.Z,{color:H.O9.n1,style:{width:20,height:20}}),(0,z.jsx)($.G7,{style:{marginTop:10,color:H.O9.n4},children:"browser"===i?"Waiting on browser...":"accounts"===i?"Loading accounts...":null})]}):s?(0,z.jsx)($.zx,{primary:!0,style:{padding:"10px 0",fontSize:15,fontWeight:600,marginTop:10,backgroundColor:H.O9.g4,borderColor:H.O9.g4},onClick:p,children:"Success! Click to continue \u2192"}):(0,z.jsx)($.zx,{primary:!0,style:{padding:"10px 0",fontSize:15,fontWeight:600,marginTop:10},onClick:h,children:"Link bank in browser \u2192"}),(0,z.jsx)("div",{style:{marginTop:i?30:35},children:(0,z.jsx)($.xv,{style:{color:H.O9.n5,fontWeight:600},children:"Why not link it in the app?"})}),(0,z.jsx)($.xv,{style:{marginTop:10,color:H.O9.n5,fontSize:13,"& a, & a:visited":{color:H.O9.n5}},children:"Typing your bank\u2019s username and password is one of the most security-sensitive things you can do, and the browser is the most secure app in the world. Why not use it to make sure your information is safe? [TODO: Link to docs article]"}),(0,z.jsx)($.Zf,{style:{marginTop:10},children:(0,z.jsx)($.zx,{onClick:()=>t.onBack(),children:"Back"})})]})})}const up={id:"new",name:"Create new account"};function cp(e){let{modalProps:t,requisitionId:n,externalAccounts:r,localAccounts:o,actions:i}=e;const[a,s]=(0,c.useState)((()=>Object.fromEntries(o.filter((e=>e.account_id)).map((e=>[e.account_id,e.id])))));async function l(){const e=Object.values(a);o.filter((e=>e.account_id)).filter((t=>!e.includes(t.id))).forEach((e=>i.unlinkAccount(e.id))),Object.entries(a).forEach((e=>{let[t,o]=e;const a=r.find((e=>e.account_id===t));a&&i.linkAccount(n,a,o!==up.id?o:void 0)})),i.closeModal()}const u=o.filter((e=>!Object.values(a).includes(e.id)));function d(e,t){s((n=>{const r={...n};return t?r[e.account_id]=t:delete r[e.account_id],r}))}return(0,z.jsx)($.u_,{title:"Link Accounts",...t,style:{width:800},children:()=>(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)($.xv,{style:{marginBottom:10},children:"We found the following accounts. Select which ones you want to add:"}),(0,z.jsxs)($.G7,{style:{flex:"unset",height:300,border:"1px solid "+H.O9.border},children:[(0,z.jsx)(ur.xD,{headers:[{name:"Bank Account To Sync",width:200},{name:"Account in Actual",width:"flex"},{name:"Actions",width:"flex"}]}),(0,z.jsx)(ur.iA,{items:r,style:{backgroundColor:H.O9.n11},getItemKey:e=>e,renderItem:e=>{let{key:t,item:n}=e;return(0,z.jsx)($.G7,{children:(0,z.jsx)(dp,{externalAccount:n,chosenAccount:a[n.account_id]===up.id?up:o.find((e=>a[n.account_id]===e.id)),unlinkedAccounts:u,onSetLinkedAccount:d})},t)}})]}),(0,z.jsx)($.G7,{style:{flexDirection:"row",justifyContent:"flex-end",marginTop:10},children:(0,z.jsx)($.zx,{primary:!0,onClick:l,disabled:!Object.keys(a).length,children:"Link accounts"})})]})})}function dp(e){let{externalAccount:t,chosenAccount:n,unlinkedAccounts:r,onSetLinkedAccount:o}=e;const[i,a]=(0,c.useState)(null),s=[...r,(null===n||void 0===n?void 0:n.id)!==up.id&&n,up].filter(Boolean);return(0,z.jsxs)(ur.X2,{style:{backgroundColor:"white"},children:[(0,z.jsx)(ur.gN,{width:200,children:t.name}),(0,z.jsx)(ur.gN,{width:"flex",truncate:"account"!==i,onClick:()=>a("account"),children:"account"===i?(0,z.jsx)(tp.ZP,{focused:!0,strict:!0,highlightFirst:!0,suggestions:s,onSelect:e=>{o(t,e)},inputProps:{onBlur:()=>a(null)},value:null===n||void 0===n?void 0:n.id}):null===n||void 0===n?void 0:n.name}),(0,z.jsx)(ur.gN,{width:"flex",children:n?(0,z.jsx)($.zx,{onClick:()=>{o(t,null)},style:{float:"right"},children:"Remove bank-sync"}):(0,z.jsx)($.zx,{primary:!0,onClick:()=>{a("account")},style:{float:"right"},children:"Setup bank-sync"})})]})}var fp=(0,d.$j)((e=>({modalStack:e.modals.modalStack,isHidden:e.modals.isHidden,accounts:e.queries.accounts,categoryGroups:e.queries.categories.grouped,categories:e.queries.categories.list,budgetId:e.prefs.local&&e.prefs.local.id})),(e=>({actions:(0,h.DE)(y,e)})))((function(e){let{modalStack:t,isHidden:n,accounts:r,categoryGroups:o,categories:i,budgetId:a,actions:s}=e;const l=Vu("goalTemplatesEnabled"),u=Nr();return t.map(((e,c)=>{let{name:d,options:f={}}=e;const h={onClose:s.popModal,onBack:s.popModal,showBack:c>0,isCurrent:c===t.length-1,isHidden:n,stackIndex:c};switch(d){case"import-transactions":return(0,z.jsx)(Zh,{modalProps:h,options:f});case"add-account":return(0,z.jsx)(yh,{modalProps:h,actions:s,syncServerStatus:u});case"add-local-account":return(0,z.jsx)(bh,{modalProps:h,actions:s});case"close-account":return(0,z.jsx)(uh,{modalProps:h,account:f.account,balance:f.balance,canDelete:f.canDelete,accounts:r.filter((e=>0===e.closed)),categoryGroups:o,actions:s});case"select-linked-accounts":return(0,z.jsx)(cp,{modalProps:h,externalAccounts:f.accounts,requisitionId:f.requisitionId,localAccounts:r.filter((e=>0===e.closed)),upgradingAccountId:f.upgradingAccountId,actions:s});case"configure-linked-accounts":return(0,z.jsx)(hh,{modalProps:h,institution:f.institution,publicToken:f.publicToken,accounts:f.accounts,upgradingId:f.upgradingId,actions:s});case"confirm-category-delete":return(0,z.jsx)(ph,{modalProps:h,actions:s,category:i.find((e=>e.id===f.category)),group:o.find((e=>e.id===f.group)),categoryGroups:o,onDelete:f.onDelete});case"load-backup":return(0,z.jsx)(Hh,{watchUpdates:!0,budgetId:a,modalProps:h,actions:s});case"manage-rules":return(0,z.jsx)(Vh,{modalProps:h,payeeId:f.payeeId});case"edit-rule":return(0,z.jsx)(Sh.ZP,{modalProps:h,defaultRule:f.rule,onSave:f.onSave});case"merge-unused-payees":return(0,z.jsx)(ep,{modalProps:h,payeeIds:f.payeeIds,targetPayeeId:f.targetPayeeId});case"plaid-external-msg":return(0,z.jsx)(lp,{modalProps:h,actions:s,onMoveExternal:f.onMoveExternal,onClose:()=>{f.onClose&&f.onClose(),(0,N.lW)("poll-web-token-stop")},onSuccess:f.onSuccess});case"nordigen-init":return(0,z.jsx)(ap,{modalProps:h,onSuccess:f.onSuccess});case"nordigen-external-msg":return(0,z.jsx)(op,{modalProps:h,actions:s,onMoveExternal:f.onMoveExternal,onClose:()=>{f.onClose&&f.onClose(),(0,N.lW)("nordigen-poll-web-token-stop")},onSuccess:f.onSuccess});case"create-encryption-key":return(0,z.jsx)(xh,{modalProps:h,actions:s,options:f},d);case"fix-encryption-key":return(0,z.jsx)(Ch,{modalProps:h,actions:s,options:f},d);case"edit-field":return(0,z.jsx)(wh,{modalProps:h,actions:s,name:f.name,onSubmit:f.onSubmit},d);case"budget-summary":return(0,z.jsx)(oh,{modalProps:h,month:f.month,actions:s,isGoalTemplatesEnabled:l},d);default:return console.error("Unknown modal:",d),null}})).map(((e,n)=>(0,z.jsx)(c.Fragment,{children:e},t[n].name)))}));function hp(){return window.close(),(0,z.jsx)($.u_,{isCurrent:!0,showClose:!1,title:"Account sync",children:()=>(0,z.jsxs)($.G7,{style:{maxWidth:500},children:[(0,z.jsx)($.P,{children:"Please wait..."}),(0,z.jsx)($.P,{children:"The window should close automatically. If nothing happend you can close this window or tab."})]})})}var pp=n(8091);function gp(e){let{notification:t,onRemove:n}=e,{type:r,title:o,message:i,pre:a,messageActions:s,sticky:l,internal:u,button:d}=t,[f,h]=(0,c.useState)(!1),[p,g]=(0,c.useState)(!1);(0,c.useEffect)((()=>{"error"===r&&u&&console.error("Internal error:",u),l||setTimeout(n,6500)}),[]);let m="message"===r,y="error"===r,v=(0,c.useMemo)((()=>function(e,t,n,r){return(0,z.jsx)($.Kq,{spacing:2,children:e.split(/\n\n/).map(((e,o)=>{let i=e.split(/(\[[^\]]*\]\([^)]*\))/g);return(0,z.jsx)($.xv,{style:{lineHeight:"1.4em"},children:i.map(((e,o)=>{let i=e.match(/\[([^\]]*)\]\(([^)]*)\)/);if(i){let[e,a,s]=i;if("#"===s[0]){let e=s.slice(1);return(0,z.jsx)($.Qj,{onClick:async o=>{o.preventDefault(),t[e]&&(n(!0),await t[e](),r())},children:a})}return(0,z.jsx)($.dL,{to:i[2],children:i[1]},o)}return(0,z.jsx)($.xv,{children:e},o)}))},o)}))})}(i,s,g,n)),[i,s]);return(0,z.jsxs)($.G7,{style:{marginTop:10,color:m?H.O9.g3:y?H.O9.r3:H.O9.y2},children:[(0,z.jsxs)($.Kq,{align:"center",direction:"row",style:{padding:"14px 14px",fontSize:14,backgroundColor:m?H.O9.g11:y?H.O9.r11:H.O9.y10,borderTop:`3px solid ${m?H.O9.g5:y?H.O9.r5:H.O9.y4}`,...H.W2.shadowLarge,maxWidth:550,"& a":{color:"currentColor"}},children:[(0,z.jsxs)($.Kq,{align:"flex-start",children:[o&&(0,z.jsx)($.G7,{style:{fontWeight:700,marginBottom:10},children:o}),(0,z.jsx)($.G7,{children:v}),a?a.split("\n\n").map(((e,t)=>(0,z.jsx)($.G7,{style:{whiteSpace:"pre-wrap",fontFamily:"monospace",fontSize:12,backgroundColor:"rgba(0, 0, 0, .05)",padding:10,borderRadius:4},children:e},t))):null,d&&(0,z.jsx)($.yp,{bare:!0,loading:f,onClick:async()=>{h(!0),await d.action(),n(),h(!1)},style:{backgroundColor:"transparent",border:`1px solid ${m?H.O9.g5:y?H.O9.r4:H.O9.y3}`,color:"currentColor",fontSize:14,flexShrink:0,"&:hover, &:active":{backgroundColor:m?H.O9.g9:y?H.O9.r10:H.O9.y9}},children:d.title})]}),l&&(0,z.jsx)($.zx,{bare:!0,style:{flexShrink:0,color:"currentColor"},onClick:n,children:(0,z.jsx)(pp.Z,{style:{width:9,height:9,color:"currentColor"}})})]}),p&&(0,z.jsx)($.G7,{style:{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(250, 250, 250, .75)",alignItems:"center",justifyContent:"center"},children:(0,z.jsx)(K.Z,{color:"currentColor",style:{width:20,height:20,color:"currentColor"}})})]})}var mp=(0,d.$j)((e=>({notifications:e.notifications.notifications})),(e=>(0,h.DE)(y,e)))((function(e){let{notifications:t,removeNotification:n,style:r}=e;return(0,z.jsx)($.G7,{style:[{position:"fixed",bottom:20,right:13,zIndex:1e4},r],children:t.map((e=>(0,z.jsx)(gp,{notification:e,onRemove:()=>{e.onClose&&e.onClose(),n(e.id)}},e.id)))})}));var yp=e=>(0,z.jsx)("svg",{...e,fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",style:{color:"#242134",...e.style},children:(0,z.jsx)("path",{d:"M24 29h5.333M8 29H2.667M16 21l-8 8M16 21l8 8M16 2.667v18.666M16 2.667 8 9.333M16 2.667l8 6.666",fill:"none",stroke:"currentColor",strokeWidth:3.5,strokeMiterlimit:10,strokeLinecap:"round"})});let vp=(0,jo.Z)((e=>(0,I.ZZ)(e)));function xp(e,t,n){return 1===e?t:n}function bp(e){let{ruleCount:t,focused:n,onEdit:r,onClick:o}=e;return(0,z.jsx)(ur.bL,{name:"rule-count",width:"auto",focused:n,style:{padding:"0 10px"},plain:!0,children:(0,z.jsxs)(ur.Sx,{style:{borderRadius:4,padding:"3px 6px",backgroundColor:H.O9.g9,border:"1px solid "+H.O9.g9,color:H.O9.g1,fontSize:12},onEdit:r,onSelect:o,onFocus:r,children:[(0,z.jsx)($.xv,{style:{paddingRight:5},children:t>0?(0,z.jsxs)(z.Fragment,{children:[t," associated ",xp(t,"rule","rules")]}):(0,z.jsx)(z.Fragment,{children:"Create rule"})}),(0,z.jsx)(vd,{style:{width:8,height:8,color:H.O9.g1}})]})})}let wp=(0,c.memo)((e=>{let{style:t,payee:n,ruleCount:r,categoryGroups:o,selected:i,highlighted:a,hovered:s,editing:l,focusedField:u,onViewRules:c,onCreateRule:d,onHover:f,onEdit:h,onUpdate:p,ruleActions:g}=e,{id:m}=n,y=(0,Wn.YP)(),v=i?H.O9.b8:H.O9.border,x=s||"select"===u;return(0,z.jsxs)(ur.X2,{borderColor:v,backgroundColor:i?H.O9.b9:x?H.O9.hover:"white",highlighted:a,style:[{alignItems:"stretch"},t,{backgroundColor:s?H.O9.hover:null},i&&{backgroundColor:H.O9.b9,zIndex:100}],"data-focus-key":n.id,onMouseEnter:()=>f&&f(n.id),children:[(0,z.jsx)(ur._7,{exposed:null==n.transfer_acct&&(s||i||l),focused:"select"===u,selected:i,onSelect:e=>{y({type:"select",id:n.id,event:e})}}),(0,z.jsx)(ur.F3,{value:(n.transfer_acct?"Transfer: ":"")+n.name,valueStyle:!i&&n.transfer_acct&&{color:H.O9.n7},exposed:"name"===u,width:"flex",onUpdate:e=>!n.transfer_acct&&p(m,"name",e),onExpose:()=>h(m,"name"),inputProps:{readOnly:!!n.transfer_acct}}),(0,z.jsx)(bp,{ruleCount:r,focused:"rule-count"===u,onEdit:()=>h(m,"rule-count"),onClick:()=>r>0?c(n.id):d(n.id)})]})}));const Sp=(0,c.forwardRef)(((e,t)=>{let{payees:n,ruleCounts:r,navigator:o,categoryGroups:i,highlightedRows:a,ruleActions:s,onUpdate:l,onViewRules:u,onCreateRule:d}=e,[f,h]=(0,c.useState)(null),p=(0,Wn.D9)();(0,c.useLayoutEffect)((()=>{let e=[...p][0];t.current.scrollTo(e,"center"),o.onEdit(e,"select")}),[]);let g=(0,c.useCallback)((e=>{h(e)}),[]);return(0,z.jsx)($.G7,{style:[{flex:1}],onMouseLeave:()=>h(null),children:(0,z.jsx)(ur.iA,{ref:t,items:n,navigator:o,renderItem:e=>{let{item:t,editing:n,focusedField:o,onEdit:s}=e;return(0,z.jsx)(wp,{payee:t,ruleCount:r.get(t.id)||0,categoryGroups:i,selected:p.has(t.id),highlighted:a&&a.has(t.id),editing:n,focusedField:o,hovered:f===t.id,onHover:g,onEdit:s,onUpdate:l,onViewRules:u,onCreateRule:d})}})})}));function Cp(){let e=H.O9.border,t=(0,Wn.YP)(),n=(0,Wn.D9)();return(0,z.jsx)($.G7,{children:(0,z.jsxs)(ur.xD,{borderColor:e,style:{backgroundColor:"white",color:H.O9.n4,zIndex:200,userSelect:"none"},collapsed:!0,version:"v2",children:[(0,z.jsx)(ur._7,{exposed:!0,focused:!1,selected:n.size>0,onSelect:e=>t({type:"select-all",event:e})}),(0,z.jsx)(ur.bL,{value:"Name",width:"flex"})]})})}function jp(e){let{text:t,style:n}=e;return(0,z.jsx)($.G7,{style:[{textAlign:"center",color:H.O9.n7,fontStyle:"italic",fontSize:13,marginTop:5},n],children:t})}function kp(e){let{payeesById:t,selectedPayees:n,onDelete:r,onMerge:o,onClose:i}=e,a=[...n].some((e=>null==t[e]||t[e].transfer_acct));return(0,z.jsx)($.u,{position:"bottom",width:250,style:{padding:0},onClose:i,children:(0,z.jsx)($.v2,{onMenuSelect:e=>{switch(i(),e){case"delete":r();break;case"merge":o()}},footer:(0,z.jsx)($.G7,{style:{padding:3,fontSize:11,fontStyle:"italic",color:H.O9.n7},children:[...n].slice(0,4).map((e=>t[e].name)).join(", ")+(n.size>4?", and more":"")}),items:[{icon:pp.Z,name:"delete",text:"Delete",disabled:a},{icon:yp,iconSize:9,name:"merge",text:"Merge",disabled:a||n.size<2},$.v2.line]})})}const Ep=(0,c.forwardRef)(((e,t)=>{let{modalProps:n,payees:r,ruleCounts:o,orphanedPayees:i,categoryGroups:a,initialSelectedIds:s,ruleActions:l,onBatchChange:u,onViewRules:d,onCreateRule:f,...h}=e,[p,g]=(0,c.useState)(null),[m,y]=(0,c.useState)(""),v=(0,c.useRef)(null),x=(0,c.useRef)(null),b=(0,c.useRef)(!1);const[w,S]=(0,c.useState)(!1);let C=(0,c.useMemo)((()=>{let e=r;return m&&(e=e.filter((e=>e.name.toLowerCase().includes(m.toLowerCase())))),w&&(e=e.filter((e=>i.map((e=>e.id)).includes(e.id)))),e}),[r,m,w]),j=(0,Wn.ZP)("payees",C,s);function k(e){m!==e&&(v.current&&v.current.setRowAnimation(!1),y(e),b.current=!0)}function E(e){k(""),x.current=e}(0,c.useEffect)((()=>{b.current&&(setTimeout((()=>{v.current&&v.current.setRowAnimation(!0)}),0),b.current=!1)})),(0,c.useImperativeHandle)(t,(()=>({selectRows:(e,t)=>{D.onEdit(null),j.dispatch({type:"select-all",ids:e}),g(null),t&&e.length>0&&E(e[0])},highlightRow:e=>{D.onEdit(null),g(new Set([e])),E(e)}}))),(0,c.useEffect)((()=>{p&&g(null)}),[p]),(0,c.useLayoutEffect)((()=>{x.current&&(v.current.scrollTo(x.current),x.current=null)}));let T=(0,$.R9)(((e,t,n)=>{let o=r.find((t=>t.id===e));o[t]!==n&&u({updated:[{id:e,[t]:n}]})})),O=(0,c.useCallback)((()=>C.filter((e=>null==e.transfer_acct)).map((e=>e.id))),[C]);let I=0===j.items.size,D=(0,ur.wz)(C,(e=>["select","name","rule-count"].filter((t=>"select"!==t||null==e.transfer_acct)))),A=vp(r),[_,P]=(0,c.useState)(!1);return(0,z.jsxs)($.G7,{style:{height:"100%"},children:[(0,z.jsxs)($.G7,{style:{flexDirection:"row",alignItems:"center",padding:"0 10px 5px"},children:[(0,z.jsxs)($.G7,{children:[(0,z.jsxs)($.zx,{bare:!0,style:{marginRight:10},disabled:I,onClick:()=>P(!0),children:[I?"No payees selected":j.items.size+" "+xp(j.items.size,"payee","payees"),(0,z.jsx)(td.Z,{width:8,height:8,style:{marginLeft:5}})]}),_&&(0,z.jsx)(kp,{payeesById:A,selectedPayees:j.items,onClose:()=>P(!1),onDelete:function(){u({deleted:[...j.items].map((e=>({id:e})))}),j.dispatch({type:"select-none"})},onMerge:async function(){let e=[...j.items];await h.onMerge(e),D.onEdit(e[0],"name"),j.dispatch({type:"select-none"}),E(e[0])}})]}),(0,z.jsx)($.G7,{children:(0,z.jsx)($.zx,{bare:!0,style:{marginRight:"10px"},disabled:!((null===i||void 0===i?void 0:i.length)>0)&&!w,onClick:()=>{S(!w);k(document.getElementById("filter-input").value),D.onEdit(null)},children:w?"Show all payees":"Show unused payees"})}),(0,z.jsx)($.G7,{style:{flex:1}}),(0,z.jsx)($.II,{id:"filter-input",placeholder:"Filter payees...",value:m,onChange:e=>{k(e.target.value),D.onEdit(null)},style:{width:350,borderColor:"transparent",backgroundColor:H.O9.n11,":focus":{backgroundColor:"white","::placeholder":{color:H.O9.n8}}}})]}),(0,z.jsx)(Wn.i5,{instance:j,fetchAllIds:O,children:(0,z.jsxs)($.G7,{style:{flex:1,border:"1px solid "+H.O9.border,borderRadius:4,overflow:"hidden"},children:[(0,z.jsx)(Cp,{}),0===C.length?(0,z.jsx)(jp,{text:"No payees",style:{marginTop:15}}):(0,z.jsx)(Sp,{ref:v,payees:C,ruleCounts:o,categoryGroups:a,highlightedRows:p,navigator:D,onUpdate:T,onViewRules:d,onCreateRule:f})]})})]})}));var Tp=(0,d.$j)((e=>({initialPayees:e.queries.payees,lastUndoState:e.app.lastUndoState,categoryGroups:e.queries.categories.grouped})),y)((function(e){let{modalProps:t,initialSelectedIds:n,lastUndoState:r,initialPayees:o,categoryGroups:i,initiallyLoadPayees:a,getPayees:s,setLastUndoState:l,pushModal:u}=e,[d,f]=(0,c.useState)(o),[h,p]=(0,c.useState)({value:new Map}),[g,m]=(0,c.useState)({value:new Map}),y=(0,c.useRef)();async function v(){let e=await(0,N.lW)("payees-get-orphaned");m(e)}async function x(){let e=await(0,N.lW)("payees-get-rule-counts");e=new Map(Object.entries(e)),p({value:e})}async function b(e){let{tables:t,messages:n,meta:r,url:o}=e;(t.includes("payees")||t.includes("payee_mapping"))&&(f(await s()),v(),(r&&r.targetId||n.find((e=>"rules"===e.dataset)))&&x(),l(null))}return(0,c.useEffect)((()=>{!async function(){let e=await a();await new Promise((e=>setTimeout(e,100))),e&&f(e),x(),v()}();let e=(0,N.oL)("sync-event",(async e=>{let{type:t,tables:n}=e;"applied"===t&&n.includes("rules")&&x()}));return()=>{e()}}),[]),(0,c.useEffect)((()=>(r.current&&b(r.current,!0),(0,N.oL)("undo-event",b))),[]),(0,z.jsx)(Ep,{ref:y,modalProps:t,payees:d,ruleCounts:h.value,orphanedPayees:g,categoryGroups:i,initialSelectedIds:n,lastUndoState:r,onBatchChange:e=>{(0,N.lW)("payees-batch-change",e),f((0,I.zb)(e,d)),m((0,I.zb)(e,g))},onMerge:async e=>{let[t,...n]=e;await(0,N.lW)("payees-merge",{targetId:t,mergeIds:n});let r=g.map((e=>e.id)).includes(t),o=n.filter((e=>g.map((e=>e.id)).includes(e)));r&&o.length!==n.length&&(g=g.filter((e=>e.id!==t))),g=g.filter((e=>!n.includes(e.id)));let i=d.filter((e=>!n.includes(e.id)));n.forEach((e=>{let n=h.value.get(e)||0;h.value.set(t,(h.value.get(t)||0)+n)})),f(i),m(g),p({value:h.value})},onViewRules:function(e){u("manage-rules",{payeeId:e})},onCreateRule:function(e){u("edit-rule",{rule:{stage:null,conditionsOp:"and",conditions:[{field:"payee",op:"is",value:e,type:"id"}],actions:[{op:"set",field:"category",value:null,type:"id"}]}})}})}));function Op(){let e=(0,Pt.TH)();return(0,z.jsx)($t,{title:"Payees",children:(0,z.jsx)(Tp,{initialSelectedIds:e.state&&e.state.selectedPayee?[e.state.selectedPayee]:null})})}function Ip(){let[e,t]=(0,c.useState)(null);return(0,c.useEffect)((()=>{Promise.all([n.e(457),n.e(992)]).then(n.bind(n,8063)).then((e=>{t((()=>e.ReportRouter))}))}),[]),(0,z.jsx)($.G7,{style:{flex:1},"data-testid":"reports-page",children:e?(0,z.jsx)(e,{}):(0,z.jsxs)($.G7,{style:[{flex:1,gap:20,justifyContent:"center",alignItems:"center"},H.W2.delayedFadeIn],children:[(0,z.jsx)($.gO,{style:{marginBottom:20,fontSize:18},children:"Loading reports\u2026"}),(0,z.jsx)(K.Z,{width:25,color:H.O9.n1})]})})}var Dp=e=>(0,z.jsx)("svg",{...e,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",style:{color:"#242134",...e.style},children:(0,z.jsx)("path",{d:"M6.847 21.429a3.408 3.408 0 0 1-2.662-1.34l-3.76-4.273a1.714 1.714 0 0 1 2.572-2.263l3.522 4.01a.429.429 0 0 0 .631.014L21.036 3.105a1.715 1.715 0 1 1 2.486 2.362l-14.06 14.8a3.327 3.327 0 0 1-2.615 1.162Z",fill:"currentColor"})}),Ap=n(4652);let _p=43;function Pp(e){let{schedule:t,status:n,onAction:r}=e,[o,i]=(0,c.useState)(!1);return(0,z.jsxs)($.G7,{children:[(0,z.jsx)($.zx,{bare:!0,onClick:e=>{e.stopPropagation(),i(!0)},children:(0,z.jsx)(xd.Z,{width:15,height:15,style:{color:"inherit",transform:"rotateZ(90deg)"}})}),o&&(0,z.jsx)($.u,{position:"bottom-right",width:150,style:{padding:0},onClose:()=>i(!1),children:(0,z.jsx)($.v2,{onMenuSelect:e=>{r(e,t.id),i(!1)},items:["due"===n&&{name:"post-transaction",text:"Post transaction"},...t.completed?[{name:"restart",text:"Restart"}]:[{name:"skip",text:"Skip next date"},{name:"complete",text:"Complete"}],{name:"delete",text:"Delete"}]})})]})}function Mp(e){let{amount:t,op:n}=e,r=(0,Qn.lP)(t),o=(0,I.zA)(Math.abs(r||0)),i="isapprox"===n||"isbetween"===n;return(0,z.jsxs)(ur.bL,{width:100,plain:!0,style:{textAlign:"right",flexDirection:"row",alignItems:"center",padding:"0 5px"},name:"amount",children:[i&&(0,z.jsx)($.G7,{style:{textAlign:"left",color:H.O9.n7,lineHeight:"1em",marginRight:10},title:(i?"Approximately ":"")+o,children:"~"}),(0,z.jsx)($.xv,{style:{flex:1,color:r>0?H.O9.g5:null,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},title:(i?"Approximately ":"")+o,children:r>0?`+${o}`:`${o}`})]})}function Rp(e){let{schedules:t,statuses:n,filter:r,minimal:o,allowCompleted:i,style:a,onSelect:s,onAction:l,tableStyle:u}=e,f=(0,d.v9)((e=>e.prefs.local.dateFormat||"MM/dd/yyyy")),[h,p]=(0,c.useState)(!1),g=(0,Lt.n4)(),m=(0,Nt.gM)(),y=(0,c.useMemo)((()=>{if(!r)return t;const e=e=>!!e&&(e.toLowerCase().includes(r.toLowerCase())||r.toLowerCase().includes(e.toLowerCase()));return t.filter((t=>{let r=g.find((e=>t._payee===e.id)),o=m.find((e=>t._account===e.id)),i=(0,Qn.lP)(t._amount),a=("isapprox"===t._amountOp||"isbetween"===t._amountOp?"~":"")+(i>0?"+":"")+(0,I.zA)(Math.abs(i||0)),s=t.next_date?fn.WU(t.next_date,f):null;return e(r&&r.name)||e(o&&o.name)||e(a)||e(n.get(t.id))||e(s)}))}),[t,r,n]),v=(0,c.useMemo)((()=>{if(!i)return y.filter((e=>!e.completed));if(h)return y;let e=y.filter((e=>!e.completed));return y.find((e=>e.completed))&&e.push({type:"show-completed"}),e}),[y,h,i]);return(0,z.jsxs)($.G7,{style:[{flex:1},u],children:[(0,z.jsxs)(ur.xD,{height:_p,inset:15,version:"v2",children:[(0,z.jsx)(ur.gN,{width:"flex",children:"Name"}),(0,z.jsx)(ur.gN,{width:"flex",children:"Payee"}),(0,z.jsx)(ur.gN,{width:"flex",children:"Account"}),(0,z.jsx)(ur.gN,{width:110,children:"Next date"}),(0,z.jsx)(ur.gN,{width:120,children:"Status"}),(0,z.jsx)(ur.gN,{width:100,style:{textAlign:"right"},children:"Amount"}),!o&&(0,z.jsx)(ur.gN,{width:80,style:{textAlign:"center"},children:"Recurring"}),!o&&(0,z.jsx)(ur.gN,{width:40})]}),(0,z.jsx)(ur.iA,{rowHeight:_p,backgroundColor:"transparent",version:"v2",style:[{flex:1,backgroundColor:"transparent"},a],items:v,renderItem:function(e){let{item:t}=e;return"show-completed"===t.type?(0,z.jsx)(ur.X2,{height:_p,inset:15,backgroundColor:"transparent",style:{cursor:"pointer",backgroundColor:"white",":hover":{backgroundColor:H.O9.hover}},onClick:()=>p(!0),children:(0,z.jsx)(ur.gN,{width:"flex",style:{fontStyle:"italic",textAlign:"center",color:H.O9.n6},children:"Show completed schedules"})}):function(e){let{item:t}=e;return(0,z.jsxs)(ur.X2,{height:_p,inset:15,backgroundColor:"transparent",onClick:()=>s(t.id),style:{cursor:"pointer",backgroundColor:"white",":hover":{backgroundColor:H.O9.hover}},children:[(0,z.jsx)(ur.gN,{width:"flex",name:"name",children:(0,z.jsx)($.xv,{style:null==t.name?{color:H.O9.n8}:null,title:t.name?t.name:"",children:t.name?t.name:"None"})}),(0,z.jsx)(ur.gN,{width:"flex",name:"payee",children:(0,z.jsx)(Ap.Z,{type:"payees",id:t._payee})}),(0,z.jsx)(ur.gN,{width:"flex",name:"account",children:(0,z.jsx)(Ap.Z,{type:"accounts",id:t._account})}),(0,z.jsx)(ur.gN,{width:110,name:"date",children:t.next_date?fn.WU(t.next_date,f):null}),(0,z.jsx)(ur.gN,{width:120,name:"status",style:{alignItems:"flex-start"},children:(0,z.jsx)(sr.O,{status:n.get(t.id)})}),(0,z.jsx)(Mp,{amount:t._amount,op:t._amountOp}),!o&&(0,z.jsx)(ur.gN,{width:80,style:{textAlign:"center"},children:t._date&&t._date.frequency&&(0,z.jsx)(Dp,{style:{width:13,height:13}})}),!o&&(0,z.jsx)(ur.gN,{width:40,name:"actions",children:(0,z.jsx)(Pp,{schedule:t,status:n.get(t.id),onAction:l})})]})}({item:t})},renderEmpty:r?"No matching schedules":"No schedules",allowPopupsEscape:v.length<6})]})}function Np(){let e=Xt(),[t,n]=(0,c.useState)(""),r=(0,un.gZ)();if(null==r)return null;let{schedules:o,statuses:i}=r;return(0,z.jsxs)($t,{title:"Schedules",children:[(0,z.jsx)($.G7,{style:{alignItems:"flex-end"},children:(0,z.jsx)($.ol,{placeholder:"Filter schedules\u2026",value:t,onChange:n})}),(0,z.jsx)($.G7,{style:{marginTop:20,flexBasis:(_p-1)*(Math.max(o.length,1)+1),overflow:"hidden"},children:(0,z.jsx)(Rp,{schedules:o,filter:t,statuses:i,allowCompleted:!0,onSelect:function(t){e(`/schedule/edit/${t}`)},onAction:async function(e,t){switch(e){case"post-transaction":await(0,N.lW)("schedule/post-transaction",{id:t});break;case"skip":await(0,N.lW)("schedule/skip-next-date",{id:t});break;case"complete":await(0,N.lW)("schedule/update",{schedule:{id:t,completed:!0}});break;case"restart":await(0,N.lW)("schedule/update",{schedule:{id:t,completed:!1},resetNextDate:!0});break;case"delete":await(0,N.lW)("schedule/delete",{id:t})}},style:{backgroundColor:"white"}})}),(0,z.jsxs)($.G7,{style:{flexDirection:"row",justifyContent:"space-between",margin:"20px 0",flexShrink:0},children:[(0,z.jsx)($.zx,{onClick:function(){e("/schedule/discover")},children:"Find schedules"}),(0,z.jsx)($.zx,{primary:!0,onClick:function(){e("/schedule/edit")},children:"Add new schedule"})]})]})}let Lp=43;function Fp(e){let{schedules:t,loading:n}=e,r=Vt(),o=(0,Wn.D9)(),i=(0,Wn.YP)();return(0,z.jsxs)($.G7,{style:{flex:1},children:[(0,z.jsxs)(ur.xD,{height:Lp,inset:15,version:"v2",children:[(0,z.jsx)(ur._7,{exposed:!n,focused:!1,selected:o.size>0,onSelect:e=>i({type:"select-all",event:e})}),(0,z.jsx)(ur.gN,{width:"flex",children:"Payee"}),(0,z.jsx)(ur.gN,{width:"flex",children:"Account"}),(0,z.jsx)(ur.gN,{width:"auto",style:{flex:1.5},children:"When"}),(0,z.jsx)(ur.gN,{width:100,style:{textAlign:"right"},children:"Amount"})]}),(0,z.jsx)(ur.iA,{rowHeight:Lp,version:"v2",backgroundColor:"modal"===r.type?"transparent":void 0,style:{flex:1,backgroundColor:"modal"===r.type?"transparent":void 0},items:t,loading:n,isSelected:e=>o.has(e),renderItem:function(e){let{item:t}=e,n=o.has(t.id),r=t._conditions.find((e=>"amount"===e.field)).op,a=(0,Qn.o7)(t.date);return(0,z.jsxs)(ur.X2,{height:Lp,inset:15,backgroundColor:"transparent",onClick:e=>{i({type:"select",id:t.id,event:e})},borderColor:n?H.O9.b8:H.O9.border,style:{cursor:"pointer",backgroundColor:n?H.O9.selected:"white",":hover":{backgroundColor:n?H.O9.selected:H.O9.hover}},children:[(0,z.jsx)(ur._7,{exposed:!0,focused:!1,selected:n,onSelect:e=>{i({type:"select",id:t.id,event:e})}}),(0,z.jsx)(ur.gN,{width:"flex",children:(0,z.jsx)(Ap.Z,{type:"payees",id:t.payee})}),(0,z.jsx)(ur.gN,{width:"flex",children:(0,z.jsx)(Ap.Z,{type:"accounts",id:t.account})}),(0,z.jsx)(ur.gN,{width:"auto",title:a,style:{flex:1.5},children:a}),(0,z.jsx)(Mp,{amount:t.amount,op:r})]})},renderEmpty:"No schedules found"})]})}function Wp(){let e=Vt(),t=(0,Pt.s0)(),{data:n,isLoading:r}=function(e,t,n){const[r,o]=(0,c.useState)(null),[i,a]=(0,c.useState)(null);return(0,c.useEffect)((()=>{!async function(){a(!0),o(await(0,N.lW)(e,t,n)),a(!1)}()}),[e,t,n]),{data:r,isLoading:i}}("schedule/discover");n||(n=[]);let[o,i]=(0,c.useState)(!1),a=(0,Wn.ZP)("discover-schedules",n,[]);if(!Jt((0,Pt.TH)()))return(0,z.jsx)(Pt.Fg,{to:"/schedules",replace:!0});return(0,z.jsxs)($t,{title:"Found schedules",modalSize:{width:850,height:650},children:[(0,z.jsx)($.P,{children:"We found some possible schedules in your current transactions. Select the ones you want to create."}),(0,z.jsx)($.P,{children:"If you expected a schedule here and don\u2019t see it, it might be because the payees of the transactions don\u2019t match. Make sure you rename payees on all transactions for a schedule to be the same payee."}),(0,z.jsx)(Wn.i5,{instance:a,children:(0,z.jsx)(Fp,{loading:r,schedules:n})}),(0,z.jsx)($.Kq,{direction:"row",align:"center",justify:"flex-end",style:{paddingTop:20,paddingBottom:"modal"===e.type?0:20},children:(0,z.jsx)($.yp,{primary:!0,loading:o,disabled:0===a.items.size,onClick:async function(){let e=n.filter((e=>a.items.has(e.id)));i(!0);for(let t of e){let e=await(0,N.lW)("schedule/create",{conditions:t._conditions}),{filters:n}=await(0,N.lW)("make-filters-from-conditions",{conditions:t._conditions});if(n.length>0){let{data:t}=await(0,x.Vn)((0,x.ZP)("transactions").filter({$and:n}).select("id"));await(0,N.lW)("transactions-batch-update",{updated:t.map((t=>({id:t.id,schedule:e})))})}}i(!1),t(-1)},children:"Create schedules"})})]})}var Bp=n(3964),zp=n(9432),Gp=n(9446);function Zp(e,t){let n={...e};return t&&Object.keys(t).forEach((r=>{r in e&&(n[r]=t[r])})),n}function Up(e,t){let n=(0,Qn.lq)(e._conditions),r=(e,t,n,r)=>e?{...e,value:r}:null!=r?{op:t,field:n,value:r}:null;return null==t.date?{error:"Date is required"}:null==t.amount?{error:"A valid amount is required"}:{conditions:[r(n.payee,"is","payee",t.payee),r(n.account,"is","account",t.account),r(n.date,"isapprox","date",t.date),{op:t.amountOp,field:"amount",value:t.amount}].filter(Boolean)}}function Hp(){let{id:e,initialFields:t}=(0,Pt.UO)(),n=null==e,r=(0,Lt.n4)({idKey:!0}),o=(0,Pt.s0)(),i=(0,d.I0)(),a=(0,d.v9)((e=>e.prefs.local.dateFormat||"MM/dd/yyyy")),[s,l]=(0,c.useReducer)(((e,t)=>{switch(t.type){case"set-schedule":{let n=t.schedule,r=(0,Qn.lq)(n._conditions),o=new Set(Object.values(r)),i=n._conditions.find((e=>!o.has(e)))||n._actions.find((e=>"link-schedule"!==e.op));return{...e,schedule:t.schedule,isCustom:i,fields:{payee:n._payee,account:n._account,amount:n._amount||0,amountOp:n._amountOp||"isapprox",date:n._date,posts_transaction:t.schedule.posts_transaction,name:n.name}}}case"set-field":if(!(t.field in e.fields))throw new Error("Unknown field: "+t.field);let n={[t.field]:t.value};return"amountOp"===t.field&&t.value!==e.fields.amountOp&&("isbetween"===t.value?n.amount="number"===typeof e.fields.amount?{num1:e.fields.amount,num2:e.fields.amount}:{num1:0,num2:0}:"isbetween"===e.fields.amountOp&&(n.amount="number"===typeof e.fields.amount?e.fields.amount:e.fields.amount.num1)),{...e,fields:{...e.fields,...n}};case"set-transactions":return{...e,transactions:t.transactions};case"set-repeats":return{...e,fields:{...e.fields,date:t.repeats?{frequency:"monthly",start:fn.PR(),patterns:[]}:fn.PR()}};case"set-upcoming-dates":return{...e,upcomingDates:t.dates};case"form-error":return{...e,error:t.error};case"switch-transactions":return{...e,transactionsMode:t.mode};default:throw new Error("Unknown action: "+t.type)}}),{schedule:null,upcomingDates:null,error:null,fields:Zp({payee:null,account:null,amount:null,amountOp:null,date:null,posts_transaction:!1,name:null},t),transactions:[],transactionsMode:n?"matched":"linked"});async function u(){let{data:t}=await(0,x.Vn)((0,x.ZP)("schedules").filter({id:e}).select("*"));return t[0]}(0,c.useEffect)((()=>{!async function(){if(n){let e={start:fn.PR(),frequency:"monthly",patterns:[]};l({type:"set-schedule",schedule:{posts_transaction:!1,_date:e,_conditions:[{op:"isapprox",field:"date",value:e}],_actions:[]}})}else{let e=await u();e&&null==s.schedule&&l({type:"set-schedule",schedule:e})}}()}),[]),(0,c.useEffect)((()=>{!async function(){let e=s.fields.date;if(null==e)l({type:"set-upcoming-dates",dates:null});else if(e.frequency){let{data:t}=await(0,N.OK)("schedule/get-upcoming-dates",{config:e,count:3});l({type:"set-upcoming-dates",dates:t})}else{let t=fn.PR();e===t||fn.Ax(e,t)?l({type:"set-upcoming-dates",dates:[e]}):l({type:"set-upcoming-dates",dates:null})}}()}),[s.fields.date]),(0,c.useEffect)((()=>{if(s.schedule&&s.schedule.id&&"linked"===s.transactionsMode){return(0,x.Y1)((0,x.ZP)("transactions").filter({schedule:s.schedule.id}).select("*").options({splits:"none"}),(e=>l({type:"set-transactions",transactions:e}))).unsubscribe}}),[s.schedule,s.transactionsMode]),(0,c.useEffect)((()=>{let e,t=!0;if(s.schedule&&"matched"===s.transactionsMode){let{error:n,conditions:r}=Up(s.schedule,s.fields);if(n)return void l({type:"form-error",error:n});r=r.map((e=>"description"===e.field?{...e,field:"payee"}:"acct"===e.field?{...e,field:"account"}:e)),(0,N.lW)("make-filters-from-conditions",{conditions:r}).then((n=>{let{filters:r}=n;if(t){let t=(0,x.Y1)((0,x.ZP)("transactions").filter({$and:r}).select("*").options({splits:"none"}),(e=>l({type:"set-transactions",transactions:e})));e=t.unsubscribe}}))}return()=>{t=!1,e&&e()}}),[s.schedule,s.transactionsMode,s.fields]);let f=(0,Wn.ZP)("transactions",s.transactions,[]);async function h(e,t){await(0,N.lW)("transactions-batch-update",{updated:e.map((e=>({id:e,schedule:t||s.schedule.id})))}),f.dispatch({type:"select-none"})}if(null==s.schedule)return null;function p(e){l({type:"switch-transactions",mode:e}),f.dispatch({type:"select-none"})}let g=r?r[s.fields.payee]:null,m=!!s.fields.date&&!!s.fields.date.frequency;return(0,z.jsxs)($t,{title:g?`Schedule: ${g.name}`:"Schedule",modalSize:"medium",children:[(0,z.jsx)($.Kq,{direction:"row",style:{marginTop:10},children:(0,z.jsxs)(J.Wi,{style:{flex:1},children:[(0,z.jsx)(J.lX,{title:"Schedule Name",htmlFor:"name-field"}),(0,z.jsx)(Gp.Z,{field:"string",type:"string",value:s.fields.name,multi:!1,onChange:e=>{l({type:"set-field",field:"name",value:e})}})]})}),(0,z.jsxs)($.Kq,{direction:"row",style:{marginTop:20},children:[(0,z.jsxs)(J.Wi,{style:{flex:1},children:[(0,z.jsx)(J.lX,{title:"Payee",id:"payee-label",htmlFor:"payee-field"}),(0,z.jsx)(ar.Z,{value:s.fields.payee,labelProps:{id:"payee-label"},inputProps:{id:"payee-field",placeholder:"(none)"},onSelect:e=>l({type:"set-field",field:"payee",value:e}),isCreatable:!0})]}),(0,z.jsxs)(J.Wi,{style:{flex:1},children:[(0,z.jsx)(J.lX,{title:"Account",id:"account-label",htmlFor:"account-field"}),(0,z.jsx)(or.Z,{includeClosedAccounts:!1,value:s.fields.account,labelProps:{id:"account-label"},inputProps:{id:"account-field",placeholder:"(none)"},onSelect:e=>l({type:"set-field",field:"account",value:e})})]}),(0,z.jsxs)(J.Wi,{style:{flex:1},children:[(0,z.jsxs)($.Kq,{direction:"row",align:"center",style:{marginBottom:3},children:[(0,z.jsx)(J.lX,{title:"Amount",htmlFor:"amount-field",style:{margin:0,flex:1}}),(0,z.jsx)(Sh.Jz,{ops:["isapprox","is","isbetween"],value:s.fields.amountOp,formatOp:e=>{switch(e){case"is":return"is exactly";case"isapprox":return"is approximately";case"isbetween":return"is between";default:throw new Error("Invalid op for select: "+e)}},style:{padding:"0 10px",color:H.O9.n5,fontSize:12},onChange:(e,t)=>l({type:"set-field",field:"amountOp",value:t})})]}),"isbetween"===s.fields.amountOp?(0,z.jsx)(Bf.I,{defaultValue:s.fields.amount,onChange:e=>l({type:"set-field",field:"amount",value:e})}):(0,z.jsx)(Bf._,{id:"amount-field",defaultValue:s.fields.amount,onChange:e=>l({type:"set-field",field:"amount",value:e})})]})]}),(0,z.jsx)($.G7,{style:{marginTop:20},children:(0,z.jsx)(J.lX,{title:"Date"})}),(0,z.jsxs)($.Kq,{direction:"row",align:"flex-start",children:[(0,z.jsxs)($.G7,{style:{flex:1},children:[m?(0,z.jsx)(Bp.Z,{value:s.fields.date,onChange:e=>l({type:"set-field",field:"date",value:e})}):(0,z.jsx)(lr.Z,{value:s.fields.date,onSelect:e=>l({type:"set-field",field:"date",value:e}),dateFormat:a}),s.upcomingDates&&(0,z.jsxs)($.G7,{style:{fontSize:13,marginTop:20},children:[(0,z.jsx)($.xv,{style:{color:H.O9.n4,fontWeight:600},children:"Upcoming dates"}),(0,z.jsx)($.Kq,{direction:"column",spacing:1,style:{marginTop:10,color:H.O9.n4},children:s.upcomingDates.map((e=>(0,z.jsx)($.G7,{children:fn.WU(e,`${a} EEEE`)},e)))})]})]}),(0,z.jsxs)($.G7,{style:{marginTop:5,flex:1,flexDirection:"row",alignItems:"center",userSelect:"none"},children:[(0,z.jsx)(J.XZ,{id:"form_repeats",checked:m,onChange:e=>{l({type:"set-repeats",repeats:e.target.checked})}}),(0,z.jsx)("label",{htmlFor:"form_repeats",style:{userSelect:"none"},children:"Repeats"})]}),(0,z.jsxs)($.G7,{style:{alignItems:"flex-end",flex:1},children:[(0,z.jsxs)($.G7,{style:{marginTop:5,flexDirection:"row",alignItems:"center",userSelect:"none",justifyContent:"flex-end"},children:[(0,z.jsx)(J.XZ,{id:"form_posts_transaction",checked:s.fields.posts_transaction,onChange:e=>{l({type:"set-field",field:"posts_transaction",value:e.target.checked})}}),(0,z.jsx)("label",{htmlFor:"form_posts_transaction",style:{userSelect:"none"},children:"Automatically add transaction"})]}),(0,z.jsx)($.xv,{style:{width:350,textAlign:"right",color:H.O9.n4,marginTop:10,fontSize:13,lineHeight:"1.4em"},children:"If checked, the schedule will automatically create transactions for you in the specified account"}),!n&&s.schedule.rule&&(0,z.jsxs)($.Kq,{direction:"row",align:"center",style:{marginTop:30},children:[s.isCustom&&(0,z.jsx)($.xv,{style:{color:H.O9.b5,fontSize:13,textAlign:"right",width:350},children:"This schedule has custom conditions and actions"}),(0,z.jsx)($.zx,{onClick:()=>async function(e){let t=await(0,N.lW)("rule-get",{id:e||s.schedule.rule});i((0,gh.Ll)("edit-rule",{rule:t,onSave:async()=>{let e=await u();l({type:"set-schedule",schedule:e})}}))}(),disabled:n,children:"Edit as rule"})]})]})]}),(0,z.jsx)($.G7,{style:{marginTop:30,flex:1},children:(0,z.jsxs)(Wn.i5,{instance:f,children:[n?(0,z.jsxs)($.G7,{style:{flexDirection:"row",padding:"5px 0"},children:[(0,z.jsx)($.xv,{style:{color:H.O9.n4},children:"These transactions match this schedule:"}),(0,z.jsx)($.G7,{style:{flex:1}}),(0,z.jsx)($.xv,{style:{color:H.O9.n6},children:"Select transactions to link on save"})]}):(0,z.jsxs)($.G7,{style:{flexDirection:"row",alignItems:"center"},children:[(0,z.jsx)($.zx,{bare:!0,style:{color:"linked"===s.transactionsMode?H.O9.b4:H.O9.n7,marginRight:10,fontSize:14},onClick:()=>p("linked"),children:"Linked transactions"})," ",(0,z.jsx)($.zx,{bare:!0,style:{color:"matched"===s.transactionsMode?H.O9.b4:H.O9.n7,fontSize:14},onClick:()=>p("matched"),children:"Find matching transactions"}),(0,z.jsx)($.G7,{style:{flex:1}}),(0,z.jsx)(ur.Vg,{name:"transactions",items:"linked"===s.transactionsMode?[{name:"unlink",text:"Unlink from schedule"}]:[{name:"link",text:"Link to schedule"}],onSelect:(e,t)=>{switch(e){case"link":h(t);break;case"unlink":!async function(e){await(0,N.lW)("transactions-batch-update",{updated:e.map((e=>({id:e,schedule:null})))}),f.dispatch({type:"select-none"})}(t)}}})]}),(0,z.jsx)(zp.Z,{renderEmpty:"matched"===s.transactionsMode&&(()=>(0,z.jsx)($.G7,{style:{padding:20,color:H.O9.n4,textAlign:"center"},children:s.error?(0,z.jsxs)($.xv,{style:{color:H.O9.r4},children:["Could not search: ",s.error]}):"No transactions found"})),transactions:s.transactions,fields:["date","payee","amount"],style:{border:"1px solid "+H.O9.border,borderRadius:4,overflow:"hidden",marginTop:5}})]})}),(0,z.jsxs)($.Kq,{direction:"row",justify:"flex-end",align:"center",style:{marginTop:20},children:[s.error&&(0,z.jsx)($.xv,{style:{color:H.O9.r4},children:s.error}),(0,z.jsx)($.zx,{style:{marginRight:10},onClick:()=>o(-1),children:"Cancel"}),(0,z.jsx)($.zx,{primary:!0,onClick:async function(){if(l({type:"form-error",error:null}),s.fields.name){let{data:e}=await(0,x.Vn)((0,x.ZP)("schedules").filter({name:s.fields.name}).select("id"));if(e.length>0&&e[0].id!==s.schedule.id)return void l({type:"form-error",error:"There is already a schedule with this name"})}let{error:e,conditions:t}=Up(s.schedule,s.fields);if(e)return void l({type:"form-error",error:e});let r=await(0,N.OK)(n?"schedule/create":"schedule/update",{schedule:{id:s.schedule.id,posts_transaction:s.fields.posts_transaction,name:s.fields.name},conditions:t});r.error?l({type:"form-error",error:"An error occurred while saving. Please visit https://actualbudget.org/contact/ for support."}):(n&&await h([...f.items],r.data),o(-1))},children:n?"Add":"Save"})]})]})}function Kp(){let e=(0,Pt.TH)(),t=(0,Pt.s0)(),n=(0,un.gZ)((0,c.useCallback)((e=>e.filter({completed:!1})),[])),[r,o]=(0,c.useState)("");if(null==n)return null;let{schedules:i,statuses:a}=n;return(0,z.jsxs)($t,{title:"Link Schedule",modalSize:"medium",children:[(0,z.jsxs)($.G7,{style:{flexDirection:"row",marginBottom:20,alignItems:"center"},children:[(0,z.jsx)($.xv,{children:"Choose a schedule to link these transactions to:"}),(0,z.jsx)($.G7,{style:{flex:1}}),(0,z.jsx)($.ol,{isInModal:!0,width:300,placeholder:"Filter schedules\u2026",value:r,onChange:o})]}),(0,z.jsx)(Rp,{schedules:i,filter:r,statuses:a,minimal:!0,onSelect:async function(n){let{state:r}=e,o=r.transactionIds;o&&o.length>0&&await(0,N.lW)("transactions-batch-update",{updated:o.map((e=>({id:e,schedule:n})))}),t(-1)},tableStyle:{marginInline:-20}})]})}function Vp(){let e=(0,Pt.TH)(),t=(0,Pt.s0)(),n=e.state&&e.state.payees||[],r=n.length>1;return(0,z.jsxs)($t,{title:"Post transactions?",modalSize:"small",children:[(0,z.jsxs)($.P,{children:[n.length>0?(0,z.jsxs)($.xv,{children:["The ",r?"payees ":"payee ",n.map(((e,t)=>(0,z.jsxs)($.xv,{children:[(0,z.jsx)($.xv,{style:{color:H.O9.p4},children:(0,z.jsx)(Ap.Z,{id:e,type:"payees"},e)}),t===n.length-1?" ":t===n.length-2?", and ":", "]})))]}):(0,z.jsxs)($.xv,{children:["There ",r?"are payees ":"is a payee "," that "]}),(0,z.jsxs)($.xv,{children:[r?"have ":"has "," schedules that are due today. Usually we automatically post transactions for these, but you are offline or syncing failed. In order to avoid duplicate transactions, we let you choose whether or not to create transactions for these schedules."]})]}),(0,z.jsx)($.P,{children:"Be aware that other devices may have already created these transactions. If you have multiple devices, make sure you only do this on one device or you will have duplicate transactions."}),(0,z.jsx)($.P,{children:"You can always manually post a transaction later for a due schedule by selecting the schedule and clicking \u201cPost transaction\u201d in the action menu."}),(0,z.jsxs)($.Kq,{direction:"row",justify:"flex-end",style:{marginTop:20},spacing:2,children:[(0,z.jsx)($.zx,{onClick:function(){t(-1)},children:"Decide later"}),(0,z.jsx)($.zx,{primary:!0,onClick:async function(){await(0,N.lW)("schedule/force-run-service"),t(-1)},children:"Post transactions"})]})]})}function qp(){let[e,t]=(0,c.useState)("");return(0,c.useEffect)((()=>{(async()=>{t(await rn())})()}),[]),e}var $p=qp;const Yp=e=>{let{primaryAction:t,style:n,children:r}=e;return(0,z.jsxs)($.G7,{...(0,L.iv)([{backgroundColor:H.O9.n9,alignSelf:"flex-start",alignItems:"flex-start",padding:15,borderRadius:4,border:"1px solid "+H.O9.n8,width:"100%"},n]),children:[(0,z.jsx)($.G7,{style:{marginBottom:t?10:0,maxWidth:500,lineHeight:1.5,gap:10},children:r}),t||null]})},Qp=e=>{let{children:t}=e,n=(0,Pt.TH)(),[r,o]=(0,c.useState)("#advanced"===n.hash);return r?(0,z.jsxs)($.G7,{id:"advanced",style:[{gap:20,alignItems:"flex-start",marginBottom:25,width:"100%"},(0,L.BC)(`(min-width: ${B.Z.breakpoint_small})`,{width:"auto"})],innerRef:e=>{e&&"#advanced"===n.hash&&e.scrollIntoView(!0)},children:[(0,z.jsx)($.G7,{style:{fontSize:20,fontWeight:500,flexShrink:0},children:"Advanced Settings"}),t]}):(0,z.jsx)($.Qj,{id:"advanced",onClick:()=>o(!0),style:{flexShrink:0,alignSelf:"flex-start",color:H.O9.p4,marginBottom:25},children:"Show advanced settings"})};function Xp(e){let{prefs:t,pushModal:n}=e;const r=Ar(),o=!(window.crypto&&crypto.subtle);return t.encryptKeyId?(0,z.jsx)(Yp,{primaryAction:(0,z.jsx)($.zx,{onClick:function(){n("create-encryption-key",{recreate:!0})},children:"Generate new key"}),children:(0,z.jsxs)($.xv,{children:[(0,z.jsx)($.xv,{style:{color:H.O9.g4,fontWeight:600},children:"End-to-end Encryption is turned on."})," ","Your data is encrypted with a key that only you have before sending it it out to the cloud. Local data remains unencrypted so if you forget your password you can re-encrypt it."," ",(0,z.jsx)($.dL,{to:"https://actualbudget.org/docs/getting-started/sync/#end-to-end-encryption",children:"Learn more\u2026"})]})}):o?(0,z.jsx)(Yp,{primaryAction:(0,z.jsx)($.zx,{disabled:!0,children:"Enable encryption\u2026"}),children:(0,z.jsxs)($.xv,{children:[(0,z.jsx)("strong",{children:"End-to-end encryption"})," is not available when making an unencrypted connection to a remote server. You\u2019ll need to enable HTTPS on your server to use end-to-end encryption. This problem may also occur if your browser is too old to work with Actual."," ",(0,z.jsx)($.dL,{to:"https://actualbudget.org/docs/config/https",children:"Learn more\u2026"})]})}):r?(0,z.jsx)(Yp,{primaryAction:(0,z.jsx)($.zx,{onClick:()=>n("create-encryption-key"),children:"Enable encryption\u2026"}),children:(0,z.jsxs)($.xv,{children:[(0,z.jsx)("strong",{children:"End-to-end encryption"})," is not enabled. Any data on the server is still protected by the server password, but it\u2019s not end-to-end encrypted which means the server owners have the ability to read it. If you want, you can use an additional password to encrypt your data on the server."," ",(0,z.jsx)($.dL,{to:"https://actualbudget.org/docs/getting-started/sync/#end-to-end-encryption",children:"Learn more\u2026"})]})}):(0,z.jsx)(Yp,{primaryAction:(0,z.jsx)($.zx,{disabled:!0,children:"Enable encryption\u2026"}),children:(0,z.jsxs)($.xv,{children:[(0,z.jsx)("strong",{children:"End-to-end encryption"})," is not available when running without a server. Budget files are always kept unencrypted locally, and encryption is only applied when sending data to a server."," ",(0,z.jsx)($.dL,{to:"https://actualbudget.org/docs/getting-started/sync/#end-to-end-encryption",children:"Learn more\u2026"})]})})}function Jp(e){let{prefs:t,savePrefs:n}=e,[r,o]=(0,c.useState)(!1);const i=(0,d.v9)((e=>({...Ku,...Object.fromEntries(Object.entries(e.prefs.local).filter((e=>{let[t]=e;return t.startsWith("flags.")})).map((e=>{let[t,n]=e;return[t.replace("flags.",""),n]})))})));let a="report"===t.budgetType&&i.reportBudget;return(0,z.jsx)(Yp,{primaryAction:r?(0,z.jsxs)($.G7,{style:{gap:"1em"},children:[(0,z.jsxs)("label",{style:{display:"flex",color:a?H.O9.n5:"inherit"},children:[(0,z.jsx)(J.XZ,{id:"report-budget-flag",checked:i.reportBudget,onChange:()=>{n({"flags.reportBudget":!i.reportBudget})},disabled:a})," ",(0,z.jsxs)($.G7,{children:["Budget mode toggle",a&&(0,z.jsx)($.xv,{style:{color:H.O9.r3,fontWeight:500},children:"Switch to a rollover budget before turning off this feature"})]})]}),(0,z.jsxs)("label",{style:{display:"flex"},children:[(0,z.jsx)(J.XZ,{id:"goal-templates-flag",checked:i.goalTemplatesEnabled,onChange:()=>{n({"flags.goalTemplatesEnabled":!i.goalTemplatesEnabled})}})," ",(0,z.jsx)($.G7,{children:"Goal templates"})]})]}):(0,z.jsx)($.Qj,{onClick:()=>o(!0),style:{flexShrink:0,alignSelf:"flex-start",color:H.O9.p4},children:"I understand the risks, show experimental features"}),children:(0,z.jsxs)($.xv,{children:[(0,z.jsx)("strong",{children:"Experimental features."})," These features are not fully tested and may not work as expected. THEY MAY CAUSE IRRECOVERABLE DATA LOSS. They may do nothing at all. Only enable them if you know what you are doing."]})})}function eg(e){let{prefs:t}=e;return(0,z.jsxs)(Yp,{primaryAction:(0,z.jsx)($.zx,{onClick:async function(){let e=await(0,N.lW)("export-budget");window.Actual.saveFile(e,`${(0,Gn.Z)(new Date,"yyyy-MM-dd")}-${t.id}.zip`,"Export budget")},children:"Export data"}),children:[(0,z.jsxs)($.xv,{children:[(0,z.jsx)("strong",{children:"Export"})," your data as a zip file containing"," ",(0,z.jsx)("code",{children:"db.sqlite"})," and ",(0,z.jsx)("code",{children:"metadata.json"})," files. It can be imported into another Actual instance by closing an open file (if any), then clicking the \u201cImport file\u201d button, then choosing \u201cActual.\u201d"]}),t.encryptKeyId?(0,z.jsx)($.xv,{children:"Even though encryption is enabled, the exported zip file will not have any encryption."}):null]})}function tg(e){let{numBlankPayees:t,numCleared:n,numDeleted:r}=e,o="";return 0===t&&0===n&&0===r?o="No split transactions found needing repair.":(t>0&&(o+=`Fixed ${t} splits with a blank payee.`),n>0&&(""!==o&&(o+="\n"),o+=`Fixed ${n} splits with the wrong cleared flag.`),r>0&&(""!==o&&(o+="\n"),o+=`Fixed ${r} splits that weren\u2019t properly deleted.`)),(0,z.jsx)($.P,{style:{color:H.O9.g3,marginBottom:0,marginLeft:"1em",textAlign:"right",whiteSpace:"pre-wrap"},children:o})}function ng(){let[e,t]=(0,c.useState)(!1),[n,r]=(0,c.useState)(null);return(0,z.jsxs)(Yp,{primaryAction:(0,z.jsxs)($.G7,{style:{flexDirection:"row",justifyContent:"space-between",maxWidth:500,width:"100%",alignItems:"center"},children:[(0,z.jsx)($.yp,{loading:e,onClick:async function(){t(!0);let e=await(0,N.lW)("tools/fix-split-transactions");r(e),t(!1)},children:"Repair split transactions"}),n&&tg(n)]}),children:[(0,z.jsxs)($.xv,{children:[(0,z.jsx)("strong",{children:"Repair split transactions"})," if you are experiencing bugs relating to split transactions and the \u201cReset budget cache\u201d button above does not help. If you see blank payees on splits or account balances (or any balances) are incorrect, this tool may fix them. This tool does two things:"]}),(0,z.jsxs)("ul",{style:{margin:0,paddingLeft:"1.5em"},children:[(0,z.jsx)("li",{style:{marginBottom:"0.5em"},children:"Ensures that deleted split transactions are fully deleted. In previous versions of the app, certain split transactions may appear deleted but not all of them are actually deleted. This causes the transactions list to look correct, but certain balances may be incorrect when filtering."}),(0,z.jsx)("li",{children:"Sync the payee and cleared flag of a split transaction to the main or \u201cparent\u201d transaction, if appropriate. The payee will only be set if it currently doesn\u2019t have one."})]})]})}let rg=[{value:"0",label:"Sunday"},{value:"1",label:"Monday"},{value:"2",label:"Tuesday"},{value:"3",label:"Wednesday"},{value:"4",label:"Thursday"},{value:"5",label:"Friday"},{value:"6",label:"Saturday"}],og=[{value:"MM/dd/yyyy",label:"MM/DD/YYYY"},{value:"dd/MM/yyyy",label:"DD/MM/YYYY"},{value:"yyyy-MM-dd",label:"YYYY-MM-DD"},{value:"MM.dd.yyyy",label:"MM.DD.YYYY"},{value:"dd.MM.yyyy",label:"DD.MM.YYYY"}];function ig(e){let{title:t,children:n}=e;return(0,z.jsxs)($.G7,{style:{alignItems:"flex-start",flexGrow:1,gap:"0.5em",width:"100%"},children:[(0,z.jsx)($.xv,{style:{fontWeight:500},children:t}),(0,z.jsx)($.G7,{style:{alignItems:"flex-start",gap:"1em"},children:n})]})}function ag(e){let{prefs:t,savePrefs:n}=e;let r=ad(),o=t.firstDayOfWeekIdx||"0",i=t.dateFormat||"MM/dd/yyyy",a=t.numberFormat||"comma-dot";return(0,z.jsx)(Yp,{primaryAction:(0,z.jsxs)($.G7,{style:{flexDirection:"column",gap:"1em",width:"100%",[`@media (min-width: ${r.floating?B.Z.breakpoint_small:B.Z.breakpoint_medium})`]:{flexDirection:"row"}},children:[(0,z.jsxs)(ig,{title:"Numbers",children:[(0,z.jsx)($.zx,{bounce:!1,style:{padding:0},children:(0,z.jsx)($.AP,{value:a,onChange:function(e){n({numberFormat:e})},options:I.id.map((e=>[e.value,t.hideFraction?e.labelNoFraction:e.label])),style:{padding:"5px 10px",fontSize:15}},t.hideFraction)}),(0,z.jsxs)($.xv,{style:{display:"flex"},children:[(0,z.jsx)(J.XZ,{id:"settings-textDecimal",checked:!!t.hideFraction,onChange:function(e){let t=e.target.checked;n({hideFraction:t})}}),(0,z.jsx)("label",{htmlFor:"settings-textDecimal",children:"Hide decimal places"})]})]}),(0,z.jsx)(ig,{title:"Dates",children:(0,z.jsx)($.zx,{bounce:!1,style:{padding:0},children:(0,z.jsx)($.AP,{value:i,onChange:function(e){n({dateFormat:e})},options:og.map((e=>[e.value,e.label])),style:{padding:"5px 10px",fontSize:15}})})}),(0,z.jsx)(ig,{title:"First day of the week",children:(0,z.jsx)($.zx,{bounce:!1,style:{padding:0},children:(0,z.jsx)($.AP,{value:o,onChange:function(e){n({firstDayOfWeekIdx:e})},options:rg.map((e=>[e.value,e.label])),style:{padding:"5px 10px",fontSize:15}})})})]}),children:(0,z.jsxs)($.xv,{children:[(0,z.jsx)("strong",{children:"Formatting"})," does not affect how budget data is stored, and can be changed at any time."]})})}function sg(e){let{globalPrefs:t,saveGlobalPrefs:n}=e,[r,o]=(0,c.useState)(!1),i=(0,c.useRef)(null);return(0,c.useEffect)((()=>{i.current&&i.current.scrollTo(1e4,0)}),[]),(0,z.jsxs)(Yp,{primaryAction:(0,z.jsxs)($.G7,{style:{flexDirection:"row"},children:[(0,z.jsx)($.zx,{onClick:async function(){let e=await window.Actual.openFileDialog({properties:["openDirectory"]});e&&(n({documentDir:e[0]}),o(!0))},children:"Change location"}),r&&(0,z.jsx)(Yh,{children:"A restart is required for this change to take effect"})]}),children:[(0,z.jsxs)($.xv,{children:[(0,z.jsx)("strong",{children:"Actual\u2019s files"})," are stored in a folder on your computer. Currently, that\u2019s:"]}),(0,z.jsx)($.xv,{innerRef:i,style:{backgroundColor:H.O9.n10,padding:"7px 10px",borderRadius:4,overflow:"auto",whiteSpace:"nowrap","::-webkit-scrollbar":{display:"none"}},children:t.documentDir})]})}function lg(){let[e,t]=(0,c.useState)(!1);return(0,z.jsx)(Yp,{primaryAction:(0,z.jsx)($.yp,{loading:e,onClick:async function(){t(!0),await(0,N.lW)("reset-budget-cache"),t(!1)},children:"Reset budget cache"}),children:(0,z.jsxs)($.xv,{children:[(0,z.jsx)("strong",{children:"Reset budget cache"})," will clear all cached values for the budget and recalculate the entire budget. All values in the budget are cached for performance reasons, and if there is a bug in the cache you won\u2019t see correct values. There is no danger in resetting the cache. Hopefully you never have to do this."]})})}function ug(e){let{isEnabled:t,resetSync:n}=e,[r,o]=(0,c.useState)(!1);return(0,z.jsx)(Yp,{primaryAction:(0,z.jsx)($.yp,{loading:r,disabled:!t,onClick:async function(){o(!0),await n(),o(!1)},children:"Reset sync"}),children:t?(0,z.jsxs)($.xv,{children:[(0,z.jsx)("strong",{children:"Reset sync"})," will remove all local data used to track changes for syncing, and create a fresh sync ID on the server. This file on other devices will have to be re-downloaded to use the new sync ID. Use this if there is a problem with syncing and you want to start fresh."]}):(0,z.jsxs)($.xv,{children:[(0,z.jsx)("strong",{children:"Reset sync"})," is only available when syncing is enabled."]})})}function cg(){const e=_r(),t=$p(),n=function(){let[e,t]=(0,c.useState)(!1);const n=qp();return(0,c.useEffect)((()=>{(async()=>{t(await on(n))})()}),[n]),e}();return(0,z.jsxs)(Yp,{children:[(0,z.jsxs)($.xv,{children:[(0,z.jsx)("strong",{children:"Actual"})," is a super fast privacy-focused app for managing your finances."]}),(0,z.jsxs)($.G7,{style:[{flexDirection:"column",gap:10},(0,L.BC)(`(min-width: ${B.Z.breakpoint_small})`,{display:"grid",gridTemplateRows:"1fr 1fr",gridTemplateColumns:"50% 50%",columnGap:"2em",gridAutoFlow:"column"})],children:[(0,z.jsxs)($.xv,{children:["Client version: v",window.Actual.ACTUAL_VERSION]}),(0,z.jsxs)($.xv,{children:["Server version: ",e]}),n?(0,z.jsxs)($.dL,{to:"https://actualbudget.org/docs/releases",linkColor:"purple",children:["New version available: ",t]}):(0,z.jsx)($.xv,{style:{color:H.O9.g2,fontWeight:600},children:"You\u2019re up to date!"}),(0,z.jsx)($.xv,{children:(0,z.jsx)($.dL,{to:"https://actualbudget.org/docs/releases",children:"Release Notes"})})]})]})}function dg(e){let{children:t}=e;return(0,z.jsx)($.xv,{style:{fontWeight:500},children:t})}function fg(e){let{prefs:t}=e;return(0,z.jsxs)(Yp,{children:[(0,z.jsxs)($.xv,{children:[(0,z.jsx)("strong",{children:"IDs"})," are the names Actual uses to identify your budget internally. There are several different IDs associated with your budget. The Budget ID is used to identify your budget file. The Sync ID is used to access the budget on the server."]}),(0,z.jsxs)($.xv,{children:[(0,z.jsx)(dg,{children:"Budget ID:"})," ",t.id]}),(0,z.jsxs)($.xv,{style:{color:H.O9.n5},children:[(0,z.jsx)(dg,{children:"Sync ID:"})," ",t.groupId||"(none)"]})]})}var hg=ko(H.O9.n11)((0,d.$j)((e=>({prefs:e.prefs.local,globalPrefs:e.prefs.global})),y)((function(e){let{loadPrefs:t,savePrefs:n,saveGlobalPrefs:r,prefs:o,globalPrefs:i,pushModal:a,resetSync:s,closeBudget:l}=e;(0,c.useEffect)((()=>{let e=(0,N.oL)("prefs-updated",(()=>{t()}));return t(),()=>e()}),[t]);const{isNarrowWidth:u}=U();return(0,z.jsx)($.G7,{style:{marginInline:i.floatingSidebar&&!u?"auto":0},children:(0,z.jsx)($t,{title:"Settings",titleStyle:u?{backgroundColor:H.O9.n11,color:H.O9.n1}:void 0,children:(0,z.jsxs)($.G7,{style:{flexShrink:0,gap:30},children:[u&&(0,z.jsxs)($.G7,{style:{gap:10,flexDirection:"row",alignItems:"flex-end"},children:[(0,z.jsxs)(J.Wi,{children:[(0,z.jsx)(J.lX,{title:"Budget Name"}),(0,z.jsx)($.II,{value:o.budgetName,disabled:!0,style:{color:"#999"}})]}),(0,z.jsx)($.zx,{onClick:l,children:"Close Budget"})]}),(0,z.jsx)(cg,{}),!qu.jU&&(0,z.jsx)(sg,{globalPrefs:i,saveGlobalPrefs:r}),(0,z.jsx)(ag,{prefs:o,savePrefs:n}),(0,z.jsx)(Xp,{prefs:o,pushModal:a}),(0,z.jsx)(eg,{prefs:o}),(0,z.jsxs)(Qp,{children:[(0,z.jsx)(fg,{prefs:o}),(0,z.jsx)(lg,{}),(0,z.jsx)(ug,{isEnabled:!!o.groupId,resetSync:s}),(0,z.jsx)(ng,{}),(0,z.jsx)(Jp,{prefs:o,savePrefs:n})]})]})})})})));function pg(e){let{children:t,redirectTo:n="/budget"}=e;const{isNarrowWidth:r}=U(),o=(0,Pt.s0)();return(0,c.useEffect)((()=>{r&&o(n)}),[r,o,n]),r?null:t}function gg(e){let{location:t}=e;const{isNarrowWidth:n}=U();return(0,z.jsxs)(Pt.Z5,{location:t,children:[(0,z.jsx)(Pt.AW,{path:"/",element:(0,z.jsx)(Pt.Fg,{to:"/budget",replace:!0})}),(0,z.jsx)(Pt.AW,{path:"/reports/*",element:(0,z.jsx)(pg,{children:(0,z.jsx)(Ip,{})})}),(0,z.jsx)(Pt.AW,{path:"/budget",element:n?(0,z.jsx)(eh,{}):(0,z.jsx)(Wf,{})}),(0,z.jsx)(Pt.AW,{path:"/schedules",element:(0,z.jsx)(pg,{children:(0,z.jsx)(Np,{})})}),(0,z.jsx)(Pt.AW,{path:"/schedule/edit",element:(0,z.jsx)(pg,{children:(0,z.jsx)(Hp,{})})}),(0,z.jsx)(Pt.AW,{path:"/schedule/edit/:id",element:(0,z.jsx)(pg,{children:(0,z.jsx)(Hp,{})})}),(0,z.jsx)(Pt.AW,{path:"/schedule/link",element:(0,z.jsx)(pg,{children:(0,z.jsx)(Kp,{})})}),(0,z.jsx)(Pt.AW,{path:"/schedule/discover",element:(0,z.jsx)(pg,{children:(0,z.jsx)(Wp,{})})}),(0,z.jsx)(Pt.AW,{path:"/schedule/posts-offline-notification",element:(0,z.jsx)(Vp,{})}),(0,z.jsx)(Pt.AW,{path:"/payees",element:(0,z.jsx)(Op,{})}),(0,z.jsx)(Pt.AW,{path:"/rules",element:(0,z.jsx)(rh,{})}),(0,z.jsx)(Pt.AW,{path:"/settings",element:(0,z.jsx)(hg,{})}),(0,z.jsx)(Pt.AW,{path:"/nordigen/link",element:(0,z.jsx)(pg,{children:(0,z.jsx)(hp,{})})}),(0,z.jsx)(Pt.AW,{path:"/accounts/:id",element:n?(0,z.jsx)(Vi,{}):(0,z.jsx)(Co,{})}),(0,z.jsx)(Pt.AW,{path:"/accounts",element:n?(0,z.jsx)(Xi,{}):(0,z.jsx)(Co,{})})]})}function mg(e){let{icon:t,name:n,path:r}=e;return(0,z.jsxs)(Mt.OL,{to:r,style:e=>{let{isActive:t}=e;return{alignItems:"center",color:t?H.O9.p5:"#8E8E8F",display:"flex",flexDirection:"column",textDecoration:"none"}},children:[(0,z.jsx)(t,{width:22,height:22,style:{color:"inherit",marginBottom:"5px"}}),n]})}function yg(){const{isNarrowWidth:e}=U();return(0,z.jsxs)("div",{style:{backgroundColor:"white",borderTop:`1px solid ${H.O9.n10}`,bottom:0,...H.W2.shadow,display:e?"flex":"none",height:"80px",justifyContent:"space-around",paddingTop:10,width:"100%"},children:[(0,z.jsx)(mg,{name:"Budget",path:"/budget",icon:Gt}),(0,z.jsx)(mg,{name:"Accounts",path:"/accounts",icon:zt}),(0,z.jsx)(mg,{name:"Settings",path:"/settings",icon:Bt})]})}function vg(e){let{getAccounts:t}=e,n=(0,Pt.s0)();(0,c.useEffect)((()=>{t().then((e=>{0===e.length&&n("/accounts")}))}),[]);let r=(0,Pt.TH)(),o=(0,Pt.oQ)(r);(0,c.useEffect)((()=>{Wt.kp("url",o)}),[o])}function xg(e){return(0,c.useEffect)((()=>{Rt.Z.setScope("app"),setTimeout((async()=>{await e.sync(),await async function(e,t,n,r,o){let i=await n();await t(i)&&(await r())["flags.updateNotificationShownForVersion"]!==i&&e({type:"message",title:"A new version of Actual is available!",message:`Version ${i} of Actual was recently released.`,sticky:!0,id:"update-notification",button:{title:"Open changelog",action:()=>{window.open("https://actualbudget.org/docs/releases")}},onClose:async()=>{await o({"flags.updateNotificationShownForVersion":i})}})}(e.addNotification,on,rn,e.loadPrefs,e.savePrefs)}),100)}),[]),(0,z.jsxs)(Mt.VK,{children:[(0,z.jsx)(vg,{getAccounts:e.getAccounts}),(0,z.jsx)(Qt,{}),(0,z.jsxs)($.G7,{style:{height:"100%",backgroundColor:H.O9.n10},children:[(0,z.jsx)(th,{}),(0,z.jsxs)($.G7,{style:{flexDirection:"row",flex:1},children:[(0,z.jsx)(sd,{}),(0,z.jsxs)($.G7,{style:{flex:1,overflow:"hidden",width:"100%"},children:[(0,z.jsx)(pd,{style:{WebkitAppRegion:"drag",position:"absolute",top:0,left:0,right:0,zIndex:1e3}}),(0,z.jsxs)("div",{style:{flex:1,display:"flex",overflow:"auto",position:"relative"},children:[(0,z.jsx)(mp,{}),(0,z.jsx)(Lu,{}),(0,z.jsx)(en,{render:e=>(0,z.jsx)(gg,{location:e})}),(0,z.jsx)(fp,{})]}),(0,z.jsxs)(Pt.Z5,{children:[(0,z.jsx)(Pt.AW,{path:"/budget",element:(0,z.jsx)(yg,{})}),(0,z.jsx)(Pt.AW,{path:"/accounts",element:(0,z.jsx)(yg,{})}),(0,z.jsx)(Pt.AW,{path:"/settings",element:(0,z.jsx)(yg,{})}),(0,z.jsx)(Pt.AW,{path:"*",element:null})]})]})]})]})]})}var bg=(0,d.$j)(null,y)((function(e){let t=(0,c.useMemo)((()=>(0,z.jsx)(xg,{...e})),[e]);return(0,z.jsx)(Ft.Y,{children:(0,z.jsx)(cd,{children:(0,z.jsx)(id,{children:(0,z.jsx)(nc,{children:(0,z.jsx)(Lt.Zr,{children:(0,z.jsx)(Nt.BB,{children:(0,z.jsx)(ut,{backend:_t,children:t})})})})})})})}));var wg=e=>(0,z.jsxs)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:[(0,z.jsx)("path",{d:"M24 11.113a5.765 5.765 0 0 0-5.216-5.952.249.249 0 0 1-.191-.12 7.684 7.684 0 0 0-14.1 2.294.251.251 0 0 1-.227.2A4.643 4.643 0 0 0 .624 9.774 4.47 4.47 0 0 0 0 12.223a4.293 4.293 0 0 0 1.235 3.1 4.624 4.624 0 0 0 1.78 1.062.963.963 0 0 0 1.243-.86v-.026a.985.985 0 0 0-.658-1.033 2.58 2.58 0 0 1-.96-.572A2.374 2.374 0 0 1 2 12.109a2.588 2.588 0 0 1 2.586-2.588 2.7 2.7 0 0 1 .535.054.989.989 0 0 0 .811-.184 1 1 0 0 0 .392-.779c.085-5.736 8.293-7.372 10.818-2.044a.974.974 0 0 0 .941.57 3.733 3.733 0 0 1 3 1.309 3.888 3.888 0 0 1 .9 2.812 3.428 3.428 0 0 1-1.473 2.667.973.973 0 0 0-.4.964l.01.059a.968.968 0 0 0 1.525.608A5.4 5.4 0 0 0 24 11.113Z",fill:"currentColor"}),(0,z.jsx)("path",{d:"M12.231 9.7a6.5 6.5 0 1 0 6.5 6.5 6.508 6.508 0 0 0-6.5-6.5Zm3.124 4.155a.75.75 0 0 1 .15 1.05l-2.905 3.87a1.493 1.493 0 0 1-1.1.6h-.111a1.485 1.485 0 0 1-1.055-.443l-1.5-1.5a.75.75 0 0 1 1.066-1.06l1.3 1.3a.249.249 0 0 0 .376-.026L14.305 14a.751.751 0 0 1 1.05-.149Z",fill:"currentColor"})]});var Sg=e=>(0,z.jsxs)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:[(0,z.jsx)("path",{d:"M24 10.663A5.817 5.817 0 0 0 22.228 6.5a5.711 5.711 0 0 0-3.447-1.585.249.249 0 0 1-.191-.12 7.684 7.684 0 0 0-14.1 2.294.251.251 0 0 1-.227.2A4.59 4.59 0 0 0 0 11.859a4.324 4.324 0 0 0 1.236 3.21 5.529 5.529 0 0 0 3.605 1.377 1 1 0 0 0 .985-1.015 1.023 1.023 0 0 0-1.015-.985 3.3 3.3 0 0 1-2.172-.8A2.374 2.374 0 0 1 2 11.859a2.576 2.576 0 0 1 .954-2.007 2.6 2.6 0 0 1 2.167-.527 1 1 0 0 0 1.2-.919 5.686 5.686 0 0 1 10.82-2.088.959.959 0 0 0 .941.57 3.687 3.687 0 0 1 2.758 1.049A3.752 3.752 0 0 1 22 10.663a3.835 3.835 0 0 1-3.438 3.791 1 1 0 0 0 .132 1.992.961.961 0 0 0 .131-.009A5.807 5.807 0 0 0 24 10.663Z",fill:"currentColor"}),(0,z.jsx)("path",{d:"M15.5 17.446h-1.75a.25.25 0 0 1-.25-.25v-7.25a1.5 1.5 0 1 0-3 0V17.2a.25.25 0 0 1-.25.25H8.5a1 1 0 0 0-.707 1.707l3.5 3.5a1 1 0 0 0 1.414 0l3.5-3.5a1 1 0 0 0-.707-1.707Z",fill:"currentColor"})]});var Cg=e=>(0,z.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:(0,z.jsx)("path",{d:"M21.941 3.607 18.87.554A1.912 1.912 0 0 0 17.527 0H8.9A1.9 1.9 0 0 0 7 1.9V5H3.4a1.9 1.9 0 0 0-1.9 1.9v15.21A1.9 1.9 0 0 0 3.4 24h11.7a1.9 1.9 0 0 0 1.9-1.895V19h3.6a1.9 1.9 0 0 0 1.9-1.895V4.949a1.882 1.882 0 0 0-.559-1.342ZM14.5 22H4a.5.5 0 0 1-.5-.5v-14A.5.5 0 0 1 4 7h7.784a.5.5 0 0 1 .35.143L14.85 9.8a.5.5 0 0 1 .15.357V21.5a.5.5 0 0 1-.5.5Zm5.5-5h-2.75a.25.25 0 0 1-.25-.25v-6.8a1.892 1.892 0 0 0-.558-1.341L13.37 5.554A1.9 1.9 0 0 0 12.028 5H9.25A.25.25 0 0 1 9 4.75V2.5a.5.5 0 0 1 .5-.5l7.756-.026a.5.5 0 0 1 .351.143L20.35 4.8a.5.5 0 0 1 .15.357V16.5a.5.5 0 0 1-.5.5Z",fill:"currentColor"})});var jg=e=>(0,z.jsxs)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:[(0,z.jsx)("path",{d:"M3.566 15.457a1 1 0 0 0-.5-.844 2.248 2.248 0 0 1-.431-.329A2.371 2.371 0 0 1 2 12.5a2.588 2.588 0 0 1 2.585-2.588 2.645 2.645 0 0 1 .536.056A1 1 0 0 0 6.324 9c.081-5.754 8.3-7.363 10.818-2.045a.97.97 0 0 0 .941.571 3.7 3.7 0 0 1 3 1.3 3.874 3.874 0 0 1 .908 2.811 3.428 3.428 0 0 1-1.1 2.375 1.316 1.316 0 0 0-.42 1.089.912.912 0 0 0 1.476.628A5.408 5.408 0 0 0 24 11.418a5.763 5.763 0 0 0-5.22-5.866.25.25 0 0 1-.19-.12 7.685 7.685 0 0 0-14.1 2.3.251.251 0 0 1-.227.2 4.642 4.642 0 0 0-3.643 2.24A4.471 4.471 0 0 0 0 12.619a4.287 4.287 0 0 0 1.235 3.09 4.177 4.177 0 0 0 .852.645 1 1 0 0 0 1.478-.9Z",fill:"currentColor"}),(0,z.jsx)("path",{d:"M18.5 15.8a6.5 6.5 0 1 0-6.5 6.5 6.508 6.508 0 0 0 6.5-6.5Zm-7.25 1.25v-.55a1.257 1.257 0 0 1 .986-1.221 1.125 1.125 0 1 0-1.361-1.1.75.75 0 1 1-1.5 0 2.625 2.625 0 1 1 3.538 2.461.25.25 0 0 0-.163.234v.18a.75.75 0 0 1-1.5 0ZM12 18.8a1 1 0 1 1-1 1 1 1 0 0 1 1-1Z",fill:"currentColor"})]});var kg=e=>(0,z.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:(0,z.jsx)("path",{d:"M23.113 5.954 21.849 4.69l.881-.88a1.914 1.914 0 1 0-2.707-2.71L9.04 12.085a6.014 6.014 0 1 0 2.707 2.707l3.739-3.737.762.762a1.75 1.75 0 1 0 2.475-2.475l-.763-.762 1.416-1.417 1.264 1.263a1.788 1.788 0 0 0 2.473 0 1.751 1.751 0 0 0 0-2.472Zm-16.737 8.5a3 3 0 1 1-3 3 3 3 0 0 1 3-2.998Z",fill:"currentColor"})});var Eg=e=>(0,z.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:(0,z.jsx)("path",{d:"M10.664 20.073a1.249 1.249 0 1 0-.507 2.447A10.739 10.739 0 1 0 2.4 16.1a.25.25 0 0 1-.084.3l-1 .726a1 1 0 0 0 .377 1.787l3.946.849a1.062 1.062 0 0 0 .21.022 1 1 0 0 0 .978-.79l.945-4.4a1 1 0 0 0-1.565-1.02l-1.361.989a.25.25 0 0 1-.386-.128 8.255 8.255 0 1 1 6.205 5.643Z",fill:"currentColor"})});function Tg(e){return"unknown"===e.state?"This is a cloud-based file but its state is unknown because you are offline.":e.encryptKeyId?e.hasKey?"This file is encrypted and you have key to access it.":"This file is encrypted and you do not have the key for it.":null}function Og(e){let{onDelete:t,onClose:n}=e;return(0,z.jsx)($.v2,{onMenuSelect:function(e){if(n(),"delete"===e)t()},items:[{name:"delete",text:"Delete"}]})}function Ig(e){let{state:t,onDelete:n}=e,[r,o]=(0,c.useState)(!1);return(0,z.jsxs)($.G7,{children:[(0,z.jsx)($.zx,{bare:!0,onClick:e=>{e.stopPropagation(),o(!0)},children:(0,z.jsx)(xd.Z,{style:{width:16,height:16}})}),r&&(0,z.jsx)($.u,{position:"bottom-right",style:{padding:0},onClose:()=>o(!1),children:(0,z.jsx)(Og,{state:t,onDelete:n,onClose:()=>o(!1)})})]})}function Dg(e){let t,n,r,{file:o}=e;switch(o.state){case"unknown":t=jg,n="Network unavailable",r=H.O9.n7;break;case"remote":t=Sg,n="Available for download";break;case"local":case"broken":t=Cg,n="Local";break;default:t=wg,n="Syncing"}return(0,z.jsxs)($.G7,{style:{color:r,alignItems:"center",flexDirection:"row",marginTop:8},children:[(0,z.jsx)(t,{color:r,style:{width:18,height:18,color:"currentColor"}}),(0,z.jsx)($.xv,{style:{marginLeft:5},children:n})]})}function Ag(e){let{file:t,onSelect:n,onDelete:r}=e,o=(0,c.useRef)(!1);return(0,z.jsxs)($.G7,{onClick:()=>async function(e){o.current||(o.current=!0,await n(e),o.current=!1)}(t),title:Tg(t),style:[{flexDirection:"row",justifyContent:"space-between",alignItems:"center",...H.W2.shadow,margin:10,padding:"12px 15px",backgroundColor:"white",borderRadius:6,flexShrink:0,cursor:"pointer",":hover":{backgroundColor:H.O9.hover}}],children:[(0,z.jsxs)($.G7,{style:{alignItems:"flex-start"},children:[(0,z.jsx)($.xv,{style:[{fontSize:16,fontWeight:700}],children:t.name}),(0,z.jsx)(Dg,{file:t})]}),(0,z.jsxs)($.G7,{style:{flex:"0 0 auto",flexDirection:"row",alignItems:"center"},children:[t.encryptKeyId&&(0,z.jsx)(kg,{style:{width:13,height:13,marginRight:8,color:t.hasKey?H.O9.b5:H.O9.n8}}),(0,z.jsx)(Ig,{state:t.state,onDelete:()=>r(t)})]})]})}function _g(e){let{files:t,onSelect:n,onDelete:r}=e;return(0,z.jsx)($.G7,{style:{flexGrow:1,[`@media (min-width: ${B.Z.breakpoint_small})`]:{flexGrow:0,maxHeight:310},overflow:"auto","& *":{userSelect:"none"}},children:t.map((e=>(0,z.jsx)(Ag,{file:e,onSelect:n,onDelete:r},e.id||e.cloudFileId)))})}function Pg(e){let{onRefresh:t}=e,[n,r]=(0,c.useState)(!1);let o=n?K.Z:Eg;return(0,z.jsx)($.zx,{bare:!0,style:{padding:10,marginRight:5},onClick:async function(){r(!0),await t(),r(!1)},children:(0,z.jsx)(o,{color:H.O9.n1,style:{width:18,height:18,color:H.O9.n1}})})}var Mg=(0,d.$j)((e=>({files:e.budgets.allFiles,isLoggedIn:!!e.user.data})),y)((function(e){let{files:t=[],getUserData:n,loadAllFiles:r,pushModal:o,loadBudget:i,createBudget:a,downloadBudget:s}=e;const[l,u]=(0,c.useState)(!1),d=function(){let{testMode:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};l||(u(!0),a({testMode:e}))};return(0,z.jsxs)($.G7,{style:{flex:1,justifyContent:"center",marginInline:-20,marginTop:20,width:"100vw",[`@media (min-width: ${B.Z.breakpoint_small})`]:{maxWidth:B.Z.breakpoint_small,width:"100%"}},children:[(0,z.jsxs)($.G7,{children:[(0,z.jsx)($.xv,{style:[H.W2.veryLargeText,{margin:20}],children:"Files"}),(0,z.jsx)($.G7,{style:{position:"absolute",right:0,top:0,bottom:0,justifyContent:"center",marginRight:5},children:(0,z.jsx)(Pg,{onRefresh:()=>{n(),r()}})})]}),(0,z.jsx)(_g,{files:t,actions:y,onSelect:e=>{"remote"===e.state?s(e.cloudFileId):i(e.id)},onDelete:e=>o("delete-budget",{file:e})}),(0,z.jsxs)($.G7,{style:{flexDirection:"row",justifyContent:"flex-end",padding:25,paddingLeft:5},children:[(0,z.jsx)($.zx,{bare:!0,style:{marginLeft:10,color:H.O9.n4},onClick:e=>{e.preventDefault(),o("import")},children:"Import file"}),(0,z.jsx)($.zx,{primary:!0,onClick:d,style:{marginLeft:15},children:"Create new file"}),(0,Kh.Ry)()&&(0,z.jsx)($.zx,{primary:!0,onClick:()=>d({testMode:!0}),style:{marginLeft:15},children:"Create test file"})]})]})})),Rg=n(9169);function Ng(){let[e,t]=(0,c.useState)(!1),n=(0,Pt.s0)(),r=(0,Pt.TH)(),o=Pr();return(0,c.useEffect)((()=>{!async function(){let e=e=>{r.pathname!==e?n(e):t(!0)},i=await(0,N.lW)("get-server-url"),a=await(0,N.lW)("get-did-bootstrap");if(null!=i||a){let t=await(0,N.lW)("subscribe-needs-bootstrap");"error"in t?n("/error",{state:{error:t.error}}):t.bootstrapped?e("/login"):e("/bootstrap")}else{let t=window.location.origin,r=await(0,N.lW)("subscribe-needs-bootstrap",{url:t});if("error"in r||!r.hasServer)return console.log("error"in r&&r.error),void n("/config-server");await o(t,{validate:!1}),r.bootstrapped?e("/login"):e("/bootstrap")}}()}),[r]),{checked:e}}function Lg(e){let{text:t}=e;return(0,z.jsx)("h1",{style:{fontSize:40,fontWeight:700,color:H.O9.p3,marginBottom:20},children:t})}const Fg=(0,c.forwardRef)(((e,t)=>(0,z.jsx)($.II,{...e,style:[{padding:10,fontSize:15,border:"none",...H.W2.shadow,":focus":{border:"none",...H.W2.shadow}},e.style]})));function Wg(){var e;e=H.O9.p5,(0,c.useEffect)((()=>{Eo(e)}),[e,Eo]);let t=(0,d.I0)(),n=(0,Pt.s0)(),[r,o]=(0,c.useState)(""),i=Ar(),a=Pr();(0,c.useEffect)((()=>{o(i)}),[i]);let[s,l]=(0,c.useState)(!1),[u,f]=(0,c.useState)(null);async function h(){await a(null),await t((0,Rg.Pl)()),n("/")}return(0,z.jsxs)($.G7,{style:{maxWidth:500,marginTop:-30},children:[(0,z.jsx)(Lg,{text:"Where\u2019s the server?"}),(0,z.jsx)($.xv,{style:{fontSize:16,color:H.O9.n2,lineHeight:1.5},children:i?(0,z.jsx)(z.Fragment,{children:"Existing sessions will be logged out and you will log in to this server. We will validate that Actual is running at this URL."}):(0,z.jsx)(z.Fragment,{children:"There is no server configured. After running the server, specify the URL here to use the app. You can always change this later. We will validate that Actual is running at this URL."})}),u&&(0,z.jsx)($.xv,{style:{marginTop:20,color:H.O9.r4,borderRadius:4,fontSize:15},children:function(e){return"network-failure"===e?"Server is not running at this URL. Make sure you have HTTPS set up properly.":"Server does not look like an Actual server. Is it set up correctly?"}(u)}),(0,z.jsxs)("form",{style:{display:"flex",flexDirection:"row",marginTop:30},onSubmit:e=>{e.preventDefault(),async function(){if(""===r||s)return;f(null),l(!0);let{error:e}=await a(r);if("network-failure"!==e||r.startsWith("http://")||r.startsWith("https://"))e?(l(!1),f(e)):(l(!1),await t((0,Rg.w7)()),n("/"));else{let{error:e}=await a("https://"+r);e?(o("https://"+r),f(e)):(await t((0,Rg.w7)()),n("/")),l(!1)}}()},children:[(0,z.jsx)(Fg,{autoFocus:!0,placeholder:"https://example.com",value:r||"",onChange:e=>o(e.target.value),style:{flex:1,marginRight:10}}),(0,z.jsx)($.yp,{primary:!0,loading:s,style:{fontSize:15},children:"OK"}),i&&(0,z.jsx)($.zx,{bare:!0,type:"button",style:{fontSize:15,marginLeft:10},onClick:()=>n(-1),children:"Cancel"})]}),(0,z.jsx)($.G7,{style:{flexDirection:"row",flexFlow:"row wrap",justifyContent:"center",marginTop:15},children:i?(0,z.jsx)($.zx,{bare:!0,style:{color:H.O9.n4},onClick:h,children:"Stop using a server"}):(0,z.jsxs)(z.Fragment,{children:[!(0,Kh.d)()&&(0,z.jsxs)($.zx,{bare:!0,style:{color:H.O9.n4,margin:5,marginRight:15},onClick:function(){o(window.location.origin)},children:["Use ",window.location.origin.replace(/https?:\/\//,"")]}),(0,z.jsx)($.zx,{bare:!0,style:{color:H.O9.n4,margin:5},onClick:h,children:"Don\u2019t use a server"}),(0,Kh.Ry)()&&(0,z.jsx)($.zx,{primary:!0,style:{marginLeft:15},onClick:async function(){await a(null),await t((0,ed.xp)({testMode:!0})),window.__navigate("/")},children:"Create test file"})]})})]})}function Bg(e){let{modalProps:t,actions:n,file:r}=e,[o,i]=(0,c.useState)(null);async function a(){i("cloud"),await n.deleteBudget(r.id,r.cloudFileId),i(null),t.onBack()}async function s(){i("local"),await n.deleteBudget(r.id),i(null),t.onBack()}let l=r.cloudFileId&&"broken"!==r.state;return(0,z.jsx)($.u_,{...t,title:"Delete "+r.name,padding:0,showOverlay:!1,onClose:t.onBack,children:()=>(0,z.jsxs)($.G7,{style:{padding:15,gap:15,paddingTop:0,paddingBottom:25,maxWidth:512,lineHeight:"1.5em"},children:[l&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)($.xv,{children:["This is a ",(0,z.jsx)("strong",{children:"hosted file"})," which means it is stored on your server to make it available for download on any device. You can delete it from the server, which will also remove it from all of your devices."]}),(0,z.jsx)($.yp,{primary:!0,loading:"cloud"===o,style:{backgroundColor:H.O9.r4,alignSelf:"center",border:0,padding:"10px 30px",fontSize:14},onClick:a,children:"Delete file from all devices"})]}),r.id&&(0,z.jsxs)(z.Fragment,{children:[l?(0,z.jsx)($.xv,{children:"You can also delete just the local copy. This will remove all local data and the file will be listed as available for download."}):(0,z.jsxs)($.xv,{children:["broken"===r.state?(0,z.jsxs)(z.Fragment,{children:["This is a ",(0,z.jsx)("strong",{children:"hosted file"})," but it was created by another user. You can only delete the local copy."]}):(0,z.jsxs)(z.Fragment,{children:["This a ",(0,z.jsx)("strong",{children:"local file"})," which is not stored on a server."]})," ","Deleting it will remove it and all of its backups permanently."]}),(0,z.jsx)($.yp,{primary:!l,loading:"local"===o,style:[{alignSelf:"center",marginTop:10,padding:"10px 30px",fontSize:14},l?{color:H.O9.r4,borderColor:H.O9.r4}:{border:0,backgroundColor:H.O9.r4}],onClick:s,children:"Delete file locally"})]})]})})}function zg(e){return"not-ynab4"===e?"This file is not valid. Please select a .ynab4 file":"An unknown error occurred while importing. Please report this as a new issue on Github."}var Gg=function(e){let{modalProps:t,actions:n}=e;const[r]=(0,c.useState)(!1);function o(e){switch(e){case"ynab4":n.pushModal("import-ynab4");break;case"ynab5":n.pushModal("import-ynab5");break;case"actual":n.pushModal("import-actual")}}let i={padding:10,border:"1px solid "+H.O9.border,borderRadius:6,marginBottom:10,display:"block"};return(0,z.jsx)($.u_,{...t,title:"Import From",style:{width:400},children:()=>(0,z.jsxs)($.G7,{style:[H.W2.smallText,{lineHeight:1.5}],children:[r&&(0,z.jsx)($.gO,{style:{color:H.O9.r4,marginBottom:15},children:zg(r)}),(0,z.jsx)($.xv,{style:{marginBottom:15},children:"Select an app to import from, and we\u2019ll guide you through the process."}),(0,z.jsxs)($.zx,{style:i,onClick:()=>o("ynab4"),children:[(0,z.jsx)("span",{style:{fontWeight:700},children:"YNAB4"}),(0,z.jsx)($.G7,{style:{color:H.O9.n5},children:"The old unsupported desktop app"})]}),(0,z.jsxs)($.zx,{style:i,onClick:()=>o("ynab5"),children:[(0,z.jsx)("span",{style:{fontWeight:700},children:"nYNAB"}),(0,z.jsx)($.G7,{style:{color:H.O9.n5},children:(0,z.jsx)("div",{children:"The newer web app"})})]}),(0,z.jsxs)($.zx,{style:i,onClick:()=>o("actual"),children:[(0,z.jsx)("span",{style:{fontWeight:700},children:"Actual"}),(0,z.jsx)($.G7,{style:{color:H.O9.n5},children:(0,z.jsx)("div",{children:"Import a file exported from Actual"})})]})]})})};function Zg(e){switch(e){case"parse-error":return"Unable to parse file. Please select a JSON file exported from nYNAB.";case"not-ynab5":return"This file is not valid. Please select a JSON file exported from nYNAB.";case"not-zip-file":return"This file is not valid. Please select an unencrypted archive of Actual data.";case"invalid-zip-file":return"This archive is not a valid Actual export file.";case"invalid-metadata-file":return"The metadata file in the given archive is corrupted.";default:return"An unknown error occurred while importing. Please report this as a new issue on Github."}}var Ug=function(e){let{modalProps:t,availableImports:n}=e;const r=(0,d.I0)(),[o,i]=(0,c.useState)(!1),[a,s]=(0,c.useState)(!1);async function l(){const e=await window.Actual.openFileDialog({properties:["openFile"],filters:[{name:"actual",extensions:["zip","blob"]}]});if(e){s(!0),i(!1);try{await r((0,ed.ef)(e[0],"actual"))}catch(t){i(t.message)}finally{s(!1)}}}return(0,z.jsx)($.u_,{...t,title:"Import from Actual export",style:{width:400},children:()=>(0,z.jsxs)($.G7,{style:[H.W2.smallText,{lineHeight:1.5,marginTop:20}],children:[o&&(0,z.jsx)($.gO,{style:{color:H.O9.r4,marginBottom:15},children:Zg(o)}),(0,z.jsxs)($.G7,{style:{"& > div":{lineHeight:"1.7em"}},children:[(0,z.jsxs)($.P,{children:["You can import data from another Actual account or instance. First export your data from a different account, and it will give you a compressed file. This file is a simple zip file that contains the"," ",(0,z.jsx)("code",{children:"db.sqlite"})," and ",(0,z.jsx)("code",{children:"metadata.json"})," files."]}),(0,z.jsx)($.P,{children:"Select one of these compressed files and import it here."}),(0,z.jsx)($.G7,{style:{alignSelf:"center"},children:(0,z.jsx)($.yp,{loading:a,primary:!0,onClick:l,children:"Select file..."})})]})]})})};function Hg(e){return"not-ynab4"===e?"This file is not valid. Please select a compressed ynab4 zip file.":"An unknown error occurred while importing. Please report this as a new issue on Github."}var Kg=function(e){let{modalProps:t,availableImports:n}=e;const r=(0,d.I0)(),[o,i]=(0,c.useState)(!1),[a,s]=(0,c.useState)(!1);async function l(){const e=await window.Actual.openFileDialog({properties:["openFile"],filters:[{name:"ynab",extensions:["zip"]}]});if(e){s(!0),i(!1);try{await r((0,ed.ef)(e[0],"ynab4"))}catch(t){i(t.message)}finally{s(!1)}}}return(0,z.jsx)($.u_,{...t,title:"Import from YNAB4",style:{width:400},children:()=>(0,z.jsxs)($.G7,{style:[H.W2.smallText,{lineHeight:1.5,marginTop:20}],children:[o&&(0,z.jsx)($.gO,{style:{color:H.O9.r4,marginBottom:15},children:Hg(o)}),(0,z.jsxs)($.G7,{style:{alignItems:"center"},children:[(0,z.jsxs)($.P,{children:["To import data from YNAB4, locate where your YNAB4 data is stored. It is usually in your Documents folder under YNAB. Your data is a directory inside that with the ",(0,z.jsx)("code",{children:".ynab4"})," suffix."]}),(0,z.jsxs)($.P,{children:["When you\u2019ve located your data,"," ",(0,z.jsx)("strong",{children:"compress it into a zip file"}),". On macOS, right-click the folder and select \u201cCompress\u201d. On Windows, right-click and select \u201cSend to \u2192 Compressed (zipped) folder\u201d. Upload the zipped folder for importing."]}),(0,z.jsx)($.G7,{children:(0,z.jsx)($.yp,{loading:a,primary:!0,onClick:l,children:"Select zip file..."})})]})]})})};function Vg(e){switch(e){case"parse-error":return"Unable to parse file. Please select a JSON file exported from nYNAB.";case"not-ynab5":return"This file is not valid. Please select a JSON file exported from nYNAB.";default:return"An unknown error occurred while importing. Please report this as a new issue on Github."}}var qg=function(e){let{modalProps:t,availableImports:n}=e;const r=(0,d.I0)(),[o,i]=(0,c.useState)(!1),[a,s]=(0,c.useState)(!1);async function l(){const e=await window.Actual.openFileDialog({properties:["openFile"],filters:[{name:"ynab",extensions:["json"]}]});if(e){s(!0),i(!1);try{await r((0,ed.ef)(e[0],"ynab5"))}catch(t){i(t.message)}finally{s(!1)}}}return(0,z.jsx)($.u_,{...t,title:"Import from nYNAB",style:{width:400},children:()=>(0,z.jsxs)($.G7,{style:[H.W2.smallText,{lineHeight:1.5,marginTop:20}],children:[o&&(0,z.jsx)($.gO,{style:{color:H.O9.r4,marginBottom:15},children:Vg(o)}),(0,z.jsxs)($.G7,{style:{alignItems:"center","& > div":{lineHeight:"1.7em"}},children:[(0,z.jsxs)($.P,{children:[(0,z.jsx)($.dL,{to:"https://actualbudget.org/docs/migration/nynab",children:"Read here"})," ","for instructions on how to migrate your data from YNAB. You need to export your data as JSON, and that page explains how to do that."]}),(0,z.jsx)($.P,{children:"Once you have exported your data, select the file and Actual will import it. Budgets may not match up exactly because things work slightly differently, but you should be able to fix up any problems."}),(0,z.jsx)($.G7,{children:(0,z.jsx)($.yp,{loading:a,primary:!0,onClick:l,children:"Select file..."})})]})]})})};var $g=(0,d.$j)((e=>({modalStack:e.modals.modalStack,isHidden:e.modals.isHidden,budgets:e.budgets.budgets,availableImports:e.budgets.availableImports})),(e=>({actions:(0,h.DE)(y,e)})))((function(e){let{modalStack:t,isHidden:n,availableImports:r,actions:o}=e,i=t.map(((e,i)=>{let{name:a,options:s}=e;const l={onClose:o.popModal,onPush:o.pushModal,onBack:o.popModal,isCurrent:i===t.length-1,isHidden:n,stackIndex:i};switch(a){case"delete-budget":return(0,z.jsx)(Bg,{modalProps:l,actions:o,file:s.file},a);case"import":return(0,z.jsx)(Gg,{modalProps:l,actions:o,availableImports:r},a);case"import-ynab4":return(0,z.jsx)(Kg,{modalProps:l,actions:o},a);case"import-ynab5":return(0,z.jsx)(qg,{modalProps:l,actions:o},a);case"import-actual":return(0,z.jsx)(Ug,{modalProps:l,actions:o},a);case"load-backup":return(0,z.jsx)(Hh,{budgetId:s.budgetId,modalProps:{...l,onClose:o.popModal},backupDisabled:!0,actions:o});case"create-encryption-key":return(0,z.jsx)(xh,{modalProps:l,actions:o,options:s},a);case"fix-encryption-key":return(0,z.jsx)(Ch,{modalProps:l,actions:o,options:s},a);default:throw new Error("Unknown modal: "+a)}}));return(0,z.jsx)($.G7,{style:{flex:1,padding:50},children:i})}));function Yg(){const e=Ar();return(0,z.jsxs)($.G7,{style:{position:"absolute",bottom:0,left:0,right:0,justifyContent:"center",flexDirection:"row",marginBottom:15,zIndex:5e3},children:[(0,z.jsx)($.xv,{children:e?(0,z.jsxs)(z.Fragment,{children:["Using server: ",(0,z.jsx)("strong",{children:e})]}):(0,z.jsx)("strong",{children:"No server configured"})}),(0,z.jsx)($.PN,{bare:!0,to:"/config-server",style:{marginLeft:15},children:"Change"})]})}function Qg(e){let{buttons:t,onSetPassword:n,onError:r}=e,[o,i]=(0,c.useState)(""),[a,s]=(0,c.useState)(""),[l,u]=(0,c.useState)(!1),[d,f]=(0,c.useState)(!1);async function h(e){e.preventDefault(),d||(o===a?(f(!0),await n(o),f(!1)):r("password-match"))}return(0,z.jsxs)("form",{style:{display:"flex",flexDirection:"column",alignItems:"stretch",marginTop:30},onSubmit:h,children:[(0,z.jsx)(Fg,{autoFocus:!0,placeholder:"Password",type:l?"text":"password",value:o,onChange:e=>i(e.target.value),onEnter:h}),(0,z.jsx)(Fg,{placeholder:"Confirm password",type:l?"text":"password",value:a,onChange:e=>s(e.target.value),style:{marginTop:10},onEnter:h}),(0,z.jsxs)($.G7,{style:{flexDirection:"row",alignItems:"center",fontSize:15,marginTop:20},children:[(0,z.jsxs)("label",{style:{userSelect:"none"},children:[(0,z.jsx)("input",{type:"checkbox",onChange:function(e){u(e.target.checked)}})," Show password"]}),(0,z.jsx)($.G7,{style:{flex:1}}),t,(0,z.jsx)($.yp,{primary:!0,loading:d,children:"OK"})]})]})}function Xg(){let e=(0,d.I0)(),[t,n]=(0,c.useState)(null),{checked:r}=Ng();return r?(0,z.jsxs)($.G7,{style:{maxWidth:450,marginTop:-30},children:[(0,z.jsx)(Lg,{text:"Welcome to Actual!"}),(0,z.jsx)($.P,{style:{fontSize:16,color:H.O9.n2},children:"Actual is a super fast privacy-focused app for managing your finances. To secure your data, you\u2019ll need to set a password for your server."}),(0,z.jsxs)($.P,{isLast:!0,style:{fontSize:16,color:H.O9.n2},children:["Consider opening"," ",(0,z.jsx)($.dL,{to:"https://actualbudget.org/docs/tour/",children:"our tour"})," ","in a new tab for some guidance on what to do when you\u2019ve set your password."]}),t&&(0,z.jsx)($.xv,{style:{marginTop:20,color:H.O9.r4,borderRadius:4,fontSize:15},children:function(e){switch(e){case"invalid-password":return"Password cannot be empty";case"password-match":return"Passwords do not match";case"network-failure":return"Unable to contact the server";default:return`An unknown error occurred: ${e}`}}(t)}),(0,z.jsx)(Qg,{buttons:(0,z.jsx)($.zx,{bare:!0,style:{fontSize:15,color:H.O9.b4,marginRight:15},onClick:async function(){await e((0,ed.xp)({demoMode:!0}))},children:"Try Demo"}),onSetPassword:async function(t){n(null);let{error:r}=await(0,N.lW)("subscribe-bootstrap",{password:t});r?n(r):e((0,Rg.Pl)())},onError:n})]}):null}function Jg(){let e=(0,Pt.s0)(),[t,n]=(0,c.useState)(null),[r,o]=(0,c.useState)(null);return(0,z.jsxs)($.G7,{style:{maxWidth:500,marginTop:-30},children:[(0,z.jsx)(Lg,{text:"Change server password"}),(0,z.jsx)($.xv,{style:{fontSize:16,color:H.O9.n2,lineHeight:1.4},children:"This will change the password for this server instance. All existing sessions will stay logged in."}),t&&(0,z.jsx)($.xv,{style:{marginTop:20,color:H.O9.r4,borderRadius:4,fontSize:15},children:function(e){switch(e){case"invalid-password":return"Password cannot be empty";case"password-match":return"Passwords do not match";case"network-failure":return"Unable to contact the server";default:return"Internal server error"}}(t)}),r&&(0,z.jsx)($.xv,{style:{marginTop:20,color:H.O9.g4,borderRadius:4,fontSize:15},children:r}),(0,z.jsx)(Qg,{buttons:(0,z.jsx)($.zx,{bare:!0,type:"button",style:{fontSize:15,marginRight:10},onClick:()=>e("/"),children:"Cancel"}),onSetPassword:async function(t){n(null);let{error:r}=await(0,N.lW)("subscribe-change-password",{password:t});r?n(r):(o("Password successfully changed"),await(0,N.lW)("subscribe-sign-in",{password:t}),e("/"))},onError:n})]})}function em(){let e=(0,Pt.s0)(),t=(0,Pt.TH)(),{error:n}=t.state||{};return(0,z.jsxs)($.G7,{style:{alignItems:"center"},children:[(0,z.jsx)($.xv,{style:{fontSize:16,color:H.O9.n2,lineHeight:1.4},children:(r=n,"network-failure"===r?"Unable to access server. Make sure the configured URL for the server is accessible.":"Server returned an error while checking its status.")}),(0,z.jsx)($.zx,{onClick:function(){e("/")},style:{marginTop:20},children:"Try again"})]});var r}function tm(){let e=(0,d.I0)(),[t,n]=(0,c.useState)(""),[r,o]=(0,c.useState)(!1),[i,a]=(0,c.useState)(null),{checked:s}=Ng();return s?(0,z.jsxs)($.G7,{style:{maxWidth:450,marginTop:-30},children:[(0,z.jsx)(Lg,{text:"Sign in to this Actual instance"}),(0,z.jsx)($.xv,{style:{fontSize:16,color:H.O9.n2,lineHeight:1.4},children:"If you lost your password, you likely still have access to your server to manually reset it."}),i&&(0,z.jsx)($.xv,{style:{marginTop:20,color:H.O9.r4,borderRadius:4,fontSize:15},children:function(e){switch(e){case"invalid-password":return"Invalid password";case"network-failure":return"Unable to contact the server";default:return`An unknown error occurred: ${e}`}}(i)}),(0,z.jsxs)("form",{style:{display:"flex",flexDirection:"row",marginTop:30},onSubmit:async function(n){if(n.preventDefault(),""===t||r)return;a(null),o(!0);let{error:i}=await(0,N.lW)("subscribe-sign-in",{password:t});o(!1),i?a(i):e((0,Rg.Pl)())},children:[(0,z.jsx)(Fg,{autoFocus:!0,placeholder:"Password",type:"password",onChange:e=>n(e.target.value),style:{flex:1,marginRight:10}}),(0,z.jsx)($.yp,{primary:!0,loading:r,style:{fontSize:15},children:"Sign in"})]}),(0,z.jsx)($.G7,{style:{flexDirection:"row",justifyContent:"center",marginTop:15},children:(0,z.jsx)($.zx,{bare:!0,style:{fontSize:15,color:H.O9.b4,marginLeft:10},onClick:async function(){await e((0,ed.xp)({demoMode:!0}))},children:"Try Demo \u2192"})})]}):null}var nm=(0,d.$j)(null,y)((function(e){let{createBudget:t,pushModal:n}=e;return(0,z.jsxs)($.G7,{style:{gap:10,maxWidth:500,fontSize:15,maxHeight:"100vh",marginBlock:20},children:[(0,z.jsx)($.xv,{style:H.W2.veryLargeText,children:"Let\u2019s get started!"}),(0,z.jsxs)($.G7,{style:{overflowY:"auto"},children:[(0,z.jsxs)($.P,{children:["Actual is a personal finance tool that focuses on beautiful design and a slick user experience."," ",(0,z.jsx)("strong",{children:"Editing your data should be as fast as possible."})," On top of that, we want to provide powerful tools to allow you to do whatever you want with your data."]}),(0,z.jsxs)($.P,{children:["Currently, Actual implements budgeting based on a"," ",(0,z.jsx)($.dL,{to:"https://actualbudget.org/docs/budgeting/",linkColor:"purple",children:"monthly envelope system"}),". Consider taking our"," ",(0,z.jsx)($.dL,{to:"https://actualbudget.org/docs/tour/",linkColor:"purple",children:"guided tour"})," ","to help you get your bearings, and check out the rest of the documentation while you\u2019re there to learn more about advanced topics."]}),(0,z.jsx)($.P,{style:{color:H.O9.n5},children:"Get started by importing an existing budget file from Actual or another budgeting app, or start fresh with an empty budget. You can always create or import another budget later."})]}),(0,z.jsxs)($.G7,{style:{flexDirection:"row",justifyContent:"space-between",alignItems:"flex-end",flexShrink:0},children:[(0,z.jsx)($.zx,{onClick:()=>n("import"),children:"Import my budget"}),(0,z.jsx)($.zx,{primary:!0,onClick:t,children:"Start fresh"})]})]})}));function rm(){const e=_r();return(0,z.jsx)($.xv,{style:{color:H.O9.n7,":hover":{color:H.O9.n2},margin:15,marginLeft:17,[`@media (min-width: ${B.Z.breakpoint_small})`]:{position:"absolute",bottom:0,right:0,marginLeft:15,marginRight:17,zIndex:5001}},children:`App: v${window.Actual.ACTUAL_VERSION} | Server: ${e}`})}var om=(0,d.$j)((e=>{let{modalStack:t}=e.modals;return{files:e.budgets.allFiles,userData:e.user.data,managerHasInitialized:e.app.managerHasInitialized,currentModals:t.map((e=>e.name))}}),y)((function(e){let{isLoading:t,files:n,userData:r,managerHasInitialized:o,setAppState:i,getUserData:a,loadAllFiles:s}=e;return(0,c.useEffect)((()=>{o||t||i({loadingText:""}),async function(){await a()&&await s(),i({managerHasInitialized:!0,...t?null:{loadingText:null}})}()}),[]),o?t?null:(0,z.jsxs)(Mt.VK,{children:[(0,z.jsx)(Qt,{}),(0,z.jsxs)($.G7,{style:{height:"100%"},children:[(0,z.jsx)($.G7,{style:{position:"absolute",top:0,left:0,right:0,height:40,WebkitAppRegion:"drag"}}),(0,z.jsx)($.G7,{style:{position:"absolute",bottom:40,right:15},children:(0,z.jsx)(mp,{style:{position:"relative",left:"initial",right:"initial"}})}),o&&(0,z.jsx)($.G7,{style:{alignItems:"center",bottom:0,justifyContent:"center",left:0,padding:20,position:"absolute",right:0,top:0},children:r&&n?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(Pt.Z5,{children:[(0,z.jsx)(Pt.AW,{path:"/config-server",element:(0,z.jsx)(Wg,{})}),(0,z.jsx)(Pt.AW,{path:"/change-password",element:(0,z.jsx)(Jg,{})}),n&&n.length>0?(0,z.jsx)(Pt.AW,{path:"/",element:(0,z.jsx)(Mg,{})}):(0,z.jsx)(Pt.AW,{path:"/",element:(0,z.jsx)(nm,{})}),(0,z.jsx)(Pt.AW,{path:"/*",element:(0,z.jsx)(Pt.Fg,{to:"/"})})]}),(0,z.jsx)($.G7,{style:{position:"absolute",top:0,right:0,padding:"6px 10px",zIndex:4e3},children:(0,z.jsxs)(Pt.Z5,{children:[(0,z.jsx)(Pt.AW,{path:"/config-server",element:null}),(0,z.jsx)(Pt.AW,{path:"/*",element:(0,z.jsx)(ld,{hideIfNoServer:!0,style:{padding:"4px 7px"}})})]})})]}):(0,z.jsxs)(Pt.Z5,{children:[(0,z.jsx)(Pt.AW,{path:"/login",element:(0,z.jsx)(tm,{})}),(0,z.jsx)(Pt.AW,{path:"/error",element:(0,z.jsx)(em,{})}),(0,z.jsx)(Pt.AW,{path:"/config-server",element:(0,z.jsx)(Wg,{})}),(0,z.jsx)(Pt.AW,{path:"/bootstrap",element:(0,z.jsx)(Xg,{})}),(0,z.jsx)(Pt.AW,{path:"/*",element:(0,z.jsx)(Pt.Fg,{to:"/bootstrap",replace:!0})})]})}),(0,z.jsxs)(Pt.Z5,{children:[(0,z.jsx)(Pt.AW,{path:"/config-server",element:null}),(0,z.jsx)(Pt.AW,{path:"/*",element:(0,z.jsx)(Yg,{})})]}),(0,z.jsx)(rm,{})]}),(0,z.jsx)($g,{})]}):null}));let im={border:0,fontSize:15,padding:"10px 13px"};function am(){const e=(0,d.v9)((e=>e.prefs.local&&e.prefs.local.hideMobileMessage||!0)),{isNarrowWidth:t}=U();let[n,r]=(0,c.useState)(t&&!e&&!document.cookie.match(/hideMobileMessage=true/)),[o,i]=(0,c.useState)(!1),a=(0,d.I0)();return n?(0,z.jsxs)($.G7,{style:{position:"absolute",bottom:0,left:0,right:0,backgroundColor:H.O9.n1,color:"white",padding:10,margin:10,borderRadius:6,zIndex:1e4,fontSize:15,...H.W2.shadowLarge},children:[(0,z.jsxs)($.xv,{style:{lineHeight:"1.5em"},children:[(0,z.jsx)("strong",{children:"Actual features are limited on small screens."}),(0,z.jsx)("br",{}),(0,z.jsx)("span",{children:"While we work to improve this experience, you may find the full Actual feature set on devices with larger screens."})]}),(0,z.jsxs)($.G7,{style:{gap:16,marginTop:20,justifyContent:"center"},children:[(0,z.jsx)($.zx,{style:im,onClick:function(){if(r(!1),o)a((0,y.savePrefs)({hideMobileMessage:!0}));else{let e=new Date;e.setTime(e.getTime()+3e5),document.cookie="hideMobileMessage=true;path=/;expires="+e.toGMTString()}},children:"Try it anyway"}),(0,z.jsxs)($.G7,{style:{alignItems:"center",flexDirection:"row",justifyContent:"flex-end"},children:[(0,z.jsx)(J.XZ,{id:"dont_remind_me",checked:o,onChange:()=>{i(!o)}}),(0,z.jsx)("label",{htmlFor:"dont_remind_me",style:{userSelect:"none"},children:"Don\u2019t remind me again"})]})]})]}):null}var sm=e=>(0,z.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"#242134",...e.style},children:(0,z.jsx)("path",{d:"M10 8.586 2.929 1.515 1.515 2.929 8.586 10l-7.071 7.071 1.414 1.414L10 11.414l7.071 7.071 1.414-1.414L11.414 10l7.071-7.071-1.414-1.414L10 8.586z",fill:"currentColor"})});var lm=(0,d.$j)((e=>({updateInfo:e.app.updateInfo,showUpdateNotification:e.app.showUpdateNotification})),(e=>(0,h.DE)(y,e)))((function(e){let{updateInfo:t,showUpdateNotification:n,updateApp:r,setAppState:o}=e;if(t&&n){let e=t.releaseNotes;return(0,z.jsxs)($.G7,{style:{position:"absolute",bottom:0,right:0,margin:"15px 17px",backgroundColor:H.O9.p6,color:"white",padding:"7px 10px",borderRadius:4,zIndex:1e4,maxWidth:450},children:[(0,z.jsxs)($.G7,{style:{flexDirection:"row",alignItems:"center"},children:[(0,z.jsx)($.G7,{style:{marginRight:10,fontWeight:700},children:(0,z.jsxs)($.xv,{children:["App updated to ",t.version]})}),(0,z.jsx)($.G7,{style:{flex:1}}),(0,z.jsx)($.G7,{style:{marginTop:-1},children:(0,z.jsxs)($.xv,{children:[(0,z.jsx)($.Qj,{onClick:r,style:{color:"white",textDecoration:"underline"},children:"Restart"})," ","(",(0,z.jsx)($.Qj,{style:{color:"white",textDecoration:"underline"},onClick:()=>window.Actual.openURLInBrowser("https://actualbudget.org/docs/releases"),children:"notes"}),")",(0,z.jsx)($.zx,{bare:!0,style:{display:"inline",padding:"1px 7px 2px 7px"},onClick:()=>function(e){e({updateInfo:null,showUpdateNotification:!1})}(o),children:(0,z.jsx)(sm,{width:9,style:{color:"white"}})})]})})]}),e&&(0,z.jsx)($.G7,{style:{marginTop:10,fontWeight:500},children:e})]})}return null}));class um extends c.Component{constructor(){super(...arguments),this.state={fatalError:null,initializing:!0,hiddenScrollbars:(0,H.bA)()}}async init(){const e=await n.g.Actual.getServerSocket();try{await(0,N.S1)(e)}catch(cu){if("app-init-failure"===cu.type)return void this.setState({initializing:!1,fatalError:cu});throw cu}await this.props.loadGlobalPrefs();const t=await(0,N.lW)("get-last-opened-backup");t&&(await this.props.loadBudget(t),(0,N.lW)("get-remote-files").then((e=>{if(e){let t=e.find((e=>e.fileId===this.props.cloudFileId));t&&t.deleted&&this.props.closeBudget()}})))}async componentDidMount(){await Promise.all([F(),this.init()]),this.setState({initializing:!1});let e=()=>{this.state.hiddenScrollbars!==(0,H.bA)()&&this.setState({hiddenScrollbars:(0,H.bA)()})};window.addEventListener("focus",e),this.cleanup=()=>window.removeEventListener("focus",e)}componentDidCatch(e){this.setState({fatalError:e})}componentDidUpdate(e){this.props.budgetId!==e.budgetId&&n.g.Actual.updateAppMenu(!!this.props.budgetId)}render(){const{budgetId:e,loadingText:t}=this.props,{fatalError:n,initializing:r,hiddenScrollbars:o}=this.state;return(0,z.jsx)(Z,{children:(0,z.jsxs)("div",{style:{height:"100%",display:"flex",flexDirection:"column"},children:[{NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_BACKEND_WORKER_HASH:"7aebb51bfd02e5b1a78f"}.REACT_APP_REVIEW_ID&&(0,z.jsx)(X,{}),(0,z.jsxs)("div",{...(0,L.iv)([{flexGrow:1,backgroundColor:"#E8ECF0",overflow:"hidden"},H.W2.lightScrollbar]),children:[n?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(Y,{}),(0,z.jsx)(te,{error:n,buttonText:"Restart app"})]}):r?(0,z.jsx)(Y,{initializing:r,loadingText:t}):e?(0,z.jsx)(bg,{}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(Y,{initializing:r,loadingText:t}),(0,z.jsx)(om,{isLoading:null!=t})]}),(0,z.jsx)(lm,{}),(0,z.jsx)(am,{})]},o?"hidden-scrollbars":"scrollbars")]})})}}var cm=(0,d.$j)((e=>({budgetId:e.prefs.local&&e.prefs.local.id,cloudFileId:e.prefs.local&&e.prefs.local.cloudFileId,loadingText:e.app.loadingText})),y)(um);n(1503);const dm=(0,h.UY)(R);const fm=(0,h.MT)((function(e,t){return t.type===v.DC&&(e={budgets:e.budgets,user:e.user,prefs:{local:null,global:e.prefs.global},app:{...w,updateInfo:e.updateInfo,showUpdateNotification:e.showUpdateNotification,managerHasInitialized:e.app.managerHasInitialized,loadingText:e.app.loadingText}}),dm(e,t)}),void 0,(0,h.md)(m)),hm=(0,h.DE)(y,fm.dispatch);!function(e,t){n.g.Actual.onEventFromMain("update-downloaded",((t,n)=>{e.setAppState({updateInfo:n})})),n.g.Actual.onEventFromMain("update-error",(e=>{})),(0,N.oL)("server-error",(t=>{e.addGenericErrorNotification()})),(0,N.oL)("update-loading-status",(t=>{if("updating"===t)e.updateStatusText("Updating...")})),(0,N.oL)("orphaned-payees",(t=>{let{orphanedIds:n,updatedPayeeIds:r}=t;e.pushModal("merge-unused-payees",{payeeIds:n,targetPayeeId:r[0]})})),(0,N.oL)("schedules-offline",(e=>{let{payees:t}=e,n=window.__pushModal;n&&n("/schedule/posts-offline-notification",{payees:t})})),(0,N.oL)("sync-event",(async n=>{let{type:r,tables:o}=n,i=t.getState().prefs.local;i&&i.id&&"applied"===r&&(o.includes("payees")||o.includes("payee_mapping"))&&e.getPayees()})),(0,N.oL)("sync-event",(async t=>{let{type:n}=t;"unauthorized"===n&&e.addNotification({type:"warning",message:"Unable to authenticate with server",sticky:!0,id:"auth-issue"})})),function(e,t){let n=!1;(0,N.oL)("sync-event",(r=>{let{type:o,subtype:i,meta:a,tables:s}=r,l=t.getState().prefs.local;if(l&&l.id)if("success"===o)n&&(n=!1,e.addNotification({title:"Syncing has been fixed!",message:"Happy budgeting!",type:"message"})),s.includes("prefs")&&e.loadPrefs(),(s.includes("categories")||s.includes("category_groups")||s.includes("category_mapping"))&&e.getCategories(),(s.includes("payees")||s.includes("payee_mapping"))&&e.getPayees(),s.includes("accounts")&&e.getAccounts();else if("error"===o){let o=null,s="[Learn more](https://actualbudget.org/docs/getting-started/sync/#debugging-sync-issues)";const l="https://github.com/actualbudget/actual/issues/new?assignees=&labels=bug&template=bug-report.yml&title=%5BBug%5D%3A+";switch(i){case"out-of-sync":o=n?{title:"Your data is still out of sync",message:"We were unable to repair your sync state, sorry! You need to reset your sync state. "+s,sticky:!0,id:"reset-sync",button:{title:"Reset sync",action:e.resetSync}}:{title:"Your data is out of sync",message:"There was a problem syncing your data. We can try to repair your sync state to fix it. "+s,type:"warning",sticky:!0,id:"repair-sync",button:{title:"Repair",action:async()=>{n=!0,await(0,N.lW)("sync-repair"),e.sync()}}};break;case"file-old-version":o={title:"Actual has updated the syncing format",message:"This happens rarely (if ever again). The internal syncing format has changed and you need to reset sync. This will upload data from this device and revert all other devices. [Learn more about what this means](https://actualbudget.org/docs/getting-started/sync/#what-does-resetting-sync-mean).\n\nOld encryption keys are not migrated. If using encryption, [reset encryption here](#makeKey).",messageActions:{makeKey:()=>e.pushModal("create-encryption-key")},sticky:!0,id:"old-file",button:{title:"Reset sync",action:e.resetSync}};break;case"file-key-mismatch":o={title:"Your encryption key need to be reset",message:"Something went wrong when registering your encryption key id. You need to recreate your key. "+s,sticky:!0,id:"invalid-key-state",button:{title:"Reset key",action:()=>e.pushModal("create-encryption-key")}};break;case"file-not-found":o={title:"This file is not a cloud file",message:"You need to register it to take advantage of syncing which allows you to use it across devices and never worry about losing your data. "+s,type:"warning",sticky:!0,id:"register-file",button:{title:"Register",action:async()=>{await e.uploadBudget(),e.sync(),e.loadPrefs()}}};break;case"file-needs-upload":o={title:"File needs upload",message:"Something went wrong when creating this cloud file. You need to upload this file to fix it. "+s,sticky:!0,id:"upload-file",button:{title:"Upload",action:e.resetSync}};break;case"file-has-reset":case"file-has-new-key":let{cloudFileId:i}=t.getState().prefs.local;o={title:"Syncing has been reset on this cloud file",message:"You need to revert it to continue syncing. Any unsynced data will be lost. If you like, you can instead [upload this file](#upload) to be the latest version. "+s,messageActions:{upload:e.resetSync},sticky:!0,id:"needs-revert",button:{title:"Revert",action:()=>e.closeAndDownloadBudget(i)}};break;case"encrypt-failure":case"decrypt-failure":o=a.isMissingKey?{title:"Missing encryption key",message:"Unable to encrypt your data because you are missing the key. Create your key to sync your data.",sticky:!0,id:"encrypt-failure-missing",button:{title:"Create key",action:()=>e.pushModal("fix-encryption-key",{onSuccess:()=>e.sync()})}}:{message:"Unable to encrypt your data. You have the correct key so this is likely an internal failure. To fix this, reset your sync data with a new key.",sticky:!0,id:"encrypt-failure",button:{title:"Reset key",action:()=>e.pushModal("create-encryption-key",{onSuccess:()=>e.sync()})}};break;case"invalid-schema":console.trace("invalid-schema",a),o={title:"Update required",message:"We couldn\u2019t apply changes from the server. This probably means you need to update the app to support the latest database.",type:"warning"};break;case"apply-failure":console.trace("apply-failure",a),o={message:`We couldn\u2019t apply that change to the database. Please report this as a bug by [opening a Github issue](${l}).`};break;case"network":break;default:console.trace("unkown error",r),o={message:`We had problems syncing your changes. Please report this as a bug by [opening a Github issue](${l}).`}}o&&e.addNotification({type:"error",...o})}}))}(e,t),(0,N.oL)("undo-event",(n=>{let{tables:r,undoTag:o}=n,i=[];(r.includes("categories")||r.includes("category_groups")||r.includes("category_mapping"))&&i.push(e.getCategories()),r.includes("accounts")&&i.push(e.getAccounts());let a=Wt.r8(o);a&&Promise.all(i).then((()=>{if(e.setLastUndoState(n),a.openModal){let{modalStack:n}=t.getState().modals;0!==n.length&&n[n.length-1].name===a.openModal||e.replaceModal(a.openModal)}else if(e.closeModal(),window.location.href.replace(window.location.origin,"")!==a.url)return window.__navigate(a.url),!0}))})),(0,N.oL)("fallback-write-error",(()=>{e.addNotification({type:"error",title:"Unable to save changes",sticky:!0,message:"This browser only supports using the app in one tab at a time, and another tab has opened the app. No changes will be saved from this tab; please close it and continue working in the other one."})})),(0,N.oL)("start-load",(()=>{e.closeBudgetUI(),e.setAppState({loadingText:""})})),(0,N.oL)("finish-load",(()=>{e.closeModal(),e.setAppState({loadingText:null}),e.loadPrefs()})),(0,N.oL)("start-import",(()=>{e.closeBudgetUI(),e.setAppState({loadingText:"Importing..."})})),(0,N.oL)("finish-import",(()=>{e.closeModal(),e.setAppState({loadingText:null}),e.loadPrefs()})),(0,N.oL)("show-budgets",(()=>{e.closeBudgetUI(),e.setAppState({loadingText:null})}))}(hm,fm),window.__actionsForMenu=hm,window.$send=N.lW,window.$query=x.Vn,window.$q=x.ZP;const pm=document.getElementById("root");(0,f.s)(pm).render((0,z.jsx)(d.zt,{store:fm,children:(0,z.jsx)(Rr,{children:(0,z.jsx)(cm,{})})}))}()}();
|
|
3
|
+
//# sourceMappingURL=main.6ae08084.js.map
|