@accounter/client 0.0.8-alpha-20251029013932-444b8e803f764eca01e28b85234a1729092a82db → 0.0.8-alpha-20251029111239-192c5afd2d66a4d11ea8217039b86666b6fff216
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/CHANGELOG.md +1 -1
- package/dist/assets/{Checkbox-CSPHEKoR.js → Checkbox-BfB2aYmM.js} +2 -2
- package/dist/assets/{MultiSelect-CszuVk07.js → MultiSelect-CGvaXcuH.js} +1 -1
- package/dist/assets/{Pagination-Cp6iKPSu.js → Pagination-D4fkmYTl.js} +1 -1
- package/dist/assets/{Progress-ByaKYSXX.js → Progress-CQs7EuQ2.js} +1 -1
- package/dist/assets/{Table-CQ4GTcIY.js → Table-C2EjuqpH.js} +1 -1
- package/dist/assets/{Typography-Cn08y9HC.js → Typography-bz4ZX5sI.js} +1 -1
- package/dist/assets/{YearPickerInput-BsQymTcP.js → YearPickerInput-CURoIYu6.js} +1 -1
- package/dist/assets/{accordion-CG93-Cqs.js → accordion-DWmBRtUi.js} +1 -1
- package/dist/assets/{accountant-approvals-Dxy1hGw7.js → accountant-approvals-C9FCfRoL.js} +1 -1
- package/dist/assets/{accounter-table-Dgvw-xm_.js → accounter-table-C70NKDaW.js} +1 -1
- package/dist/assets/{addDays-Di-hbHs3.js → addDays-BGYF7FkS.js} +1 -1
- package/dist/assets/{all-charges-DRl4EcMG.js → all-charges-CkPb7TjD.js} +1 -1
- package/dist/assets/{arrow-up-down-Hh3TlLSU.js → arrow-up-down-B-KqfJyD.js} +1 -1
- package/dist/assets/{building-2-DGfYgfU_.js → building-2-BAwr8r-2.js} +1 -1
- package/dist/assets/{business-aamFaOhr.js → business-DLu0ofgu.js} +17 -7
- package/dist/assets/business-extended-info-vAiMQKwm.js +13 -0
- package/dist/assets/{business-header-BphijNiC.js → business-header-B_qcrJW_.js} +1 -1
- package/dist/assets/business-ledger-filters-CNjRVS0K.js +1 -0
- package/dist/assets/business-ledger-single-BrattJvc.js +1 -0
- package/dist/assets/business-trip-DZqft86E.js +1 -0
- package/dist/assets/{charge-D-99eJ1v.js → charge-aBSxCGi3.js} +1 -1
- package/dist/assets/{charges-filters-Dxaf2lVd.js → charges-filters-BRuJ3XbB.js} +1 -1
- package/dist/assets/{charges-ledger-validation-BAY3PYth.js → charges-ledger-validation-DjuvGES2.js} +1 -1
- package/dist/assets/charges-table--gOKotyF.js +62 -0
- package/dist/assets/{chart-DM5P1yGj.js → chart-BSh0rsm7.js} +1 -1
- package/dist/assets/{data-table-pagination-TG7sqb1-.js → data-table-pagination-BCuaIseR.js} +1 -1
- package/dist/assets/download-csv-button-B0eh9bzg.js +1 -0
- package/dist/assets/{editable-business-trip-DlAsZ0aQ.js → editable-business-trip-BLWzKbN3.js} +1 -1
- package/dist/assets/{funnel-BQEGwl1q.js → funnel-XiON1wPY.js} +1 -1
- package/dist/assets/{index-CJEUQmMx.js → index-3Fyx3NBp.js} +1 -1
- package/dist/assets/{index-CIY9x3TF.js → index-B05N38w4.js} +2 -2
- package/dist/assets/{index-DkKTDpFK.js → index-BPLQ_Cjg.js} +1 -1
- package/dist/assets/index-BS5IhG6A.js +1 -0
- package/dist/assets/{index-CzEcZ0Dn.js → index-BVTpNGNk.js} +2 -2
- package/dist/assets/{index-DKjsW6q7.js → index-BYCdqffp.js} +7 -7
- package/dist/assets/{index-BmZql10x.js → index-BdnLryTF.js} +14 -14
- package/dist/assets/{index-CGQclWiq.js → index-BdzdEbUC.js} +1 -1
- package/dist/assets/{index-CXRSu47J.js → index-BwrF7ixX.js} +2 -2
- package/dist/assets/{index-DgbPiRkF.js → index-By2sHbGk.js} +1 -1
- package/dist/assets/{index-ClzPFBOc.js → index-C-RIsd1H.js} +2 -2
- package/dist/assets/{index-NofRnQ8o.js → index-CA6LHUxs.js} +1 -1
- package/dist/assets/{index-CkIv3Veq.js → index-CJP0f2Bm.js} +1 -1
- package/dist/assets/{index-IuUe41KG.js → index-CVNgfFi3.js} +1 -1
- package/dist/assets/{index-Dt4KpoN0.js → index-C_nLGgCr.js} +1 -1
- package/dist/assets/index-Ci8Rcu9T.js +1 -0
- package/dist/assets/{index-CFY-4iKE.js → index-CtDDVAsw.js} +1 -1
- package/dist/assets/{index-DROHY2Kd.js → index-CxE91GPE.js} +1 -1
- package/dist/assets/{index--OgMtW-2.js → index-D7GKOJU4.js} +2 -2
- package/dist/assets/{index-CiXTFJcq.js → index-D9RA6cVt.js} +2 -2
- package/dist/assets/{index-DnFwBDCa.js → index-DOSLXKPY.js} +1 -1
- package/dist/assets/{index-WaN-m0WB.js → index-DaSx2wiU.js} +1 -1
- package/dist/assets/{index-DOh5XsM3.js → index-DbbPcdZ7.js} +2 -2
- package/dist/assets/{index-D9zE4pLO.js → index-Diqx01g3.js} +1 -1
- package/dist/assets/{index-juMfNCjV.js → index-pjJUDHWQ.js} +1 -1
- package/dist/assets/{index.es-BJEu0vdb.js → index.es-BWSz-k0E.js} +1 -1
- package/dist/assets/{insert-business-trip-modal-CXgUJdgl.js → insert-business-trip-modal-Bk-kugZI.js} +2 -2
- package/dist/assets/issue-document-BcWeUsrG.js +1 -0
- package/dist/assets/{list-plus-BlHtPDEN.js → list-plus-DINtfnSi.js} +1 -1
- package/dist/assets/{login-page-DmCLAM1G.js → login-page-DVwxXAvd.js} +1 -1
- package/dist/assets/{match-document-modal-KjnSxB69.js → match-document-modal--iAusdTp.js} +4 -4
- package/dist/assets/{missing-info-charges-BiEeQwER.js → missing-info-charges-CQNTClQ3.js} +1 -1
- package/dist/assets/{modal-dLkQjDNz.js → modal-BzwJJ2TM.js} +1 -1
- package/dist/assets/{page-layout-DxGYaCiw.js → page-layout-NF77oib6.js} +1 -1
- package/dist/assets/{page-not-found-ChLEFKCs.js → page-not-found-Cu_0zp5u.js} +1 -1
- package/dist/assets/{panel-top-open-CWsfFRNu.js → panel-top-open-BApXXBMD.js} +1 -1
- package/dist/assets/{pencil-BEefjySD.js → pencil-CLaFsm6E.js} +1 -1
- package/dist/assets/{report-commentary-row-Cci0ntye.js → report-commentary-row-BGN_tI-P.js} +1 -1
- package/dist/assets/{save-BkV97OA1.js → save-DsE11_Et.js} +1 -1
- package/dist/assets/{similar-transactions-modal-8T9lL2yX.js → similar-transactions-modal-CoZU6FU3.js} +1 -1
- package/dist/assets/sub-DLRNYZyc.js +1 -0
- package/dist/assets/subMonths-Bc9skHhr.js +1 -0
- package/dist/assets/{summary-DzLJ6sUY.js → summary-BasZ3QlN.js} +1 -1
- package/dist/assets/{toggle-expansion-button-BzVlE1kb.js → toggle-expansion-button-DPcDIe-2.js} +1 -1
- package/dist/assets/tooltip-CICdw5IX.js +1 -0
- package/dist/assets/{use-url-query-DV9K0FAR.js → use-url-query-Bp_LkJaa.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/src/components/business/balance-section.tsx +26 -0
- package/src/components/business/index.tsx +31 -1
- package/src/components/business/ledger-section.tsx +49 -0
- package/src/components/business/transactions-section.tsx +24 -2
- package/src/components/{business-transactions → business-ledger}/business-extended-info.tsx +25 -27
- package/src/components/{business-transactions/business-transactions-filters.tsx → business-ledger/business-ledger-filters.tsx} +12 -12
- package/src/components/{business-transactions/business-transactions-single.tsx → business-ledger/business-ledger-single.tsx} +13 -13
- package/src/components/{business-transactions → business-ledger}/download-csv.tsx +25 -25
- package/src/components/{business-transactions → business-ledger}/index.tsx +15 -15
- package/src/components/charges/charge-extended-info.tsx +45 -4
- package/src/components/layout/sidelinks.tsx +2 -2
- package/src/components/ledger-table/columns.tsx +4 -4
- package/src/components/ledger-table/index.tsx +152 -181
- package/src/components/reports/conto/custom-node.tsx +1 -1
- package/src/components/reports/trial-balance-report/trial-balance-report-account.tsx +1 -1
- package/src/components/transactions-table/columns.tsx +9 -9
- package/src/components/transactions-table/index.tsx +56 -21
- package/src/gql/gql.ts +30 -12
- package/src/gql/graphql.ts +181 -406
- package/src/router/config.tsx +14 -14
- package/src/router/routes.ts +2 -2
- package/dist/assets/business-extended-info-CeEMIazB.js +0 -13
- package/dist/assets/business-transactions-filters-DYBvDjKs.js +0 -1
- package/dist/assets/business-transactions-single-B77wu9sA.js +0 -1
- package/dist/assets/business-trip-C1cYIMHX.js +0 -1
- package/dist/assets/charges-table-CNWVDMmv.js +0 -62
- package/dist/assets/download-csv-button-jQXIlRax.js +0 -1
- package/dist/assets/index-B-USUC2v.js +0 -1
- package/dist/assets/index-BYfofaiM.js +0 -1
- package/dist/assets/issue-document-BSkWYnI5.js +0 -1
- package/dist/assets/sub-DdivcKGZ.js +0 -1
- package/dist/assets/subMonths-Kz3NJUOL.js +0 -1
- package/dist/assets/tooltip-Ht3m2Q26.js +0 -1
- package/src/app.tsx +0 -108
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fE as Ct,fF as Et,fG as Nt,r as y,eJ as G,em as Dt,ei as pr,ab as m,by as j,bB as P,bA as b,bC as T,ff as ur,fH as mr,fI as Tt,cF as Rt,fJ as Mt,fK as At,en as Lt,fg as kt,bz as z,er as Pe,dU as gr,fL as vr,fM as Bt,ek as Ie,cv as be,et as zt,bj as E,eK as Ht,g as _r,fN as Ft,t as H,i as yr,J as xe,j as u,dT as Vt,fO as Ut,fP as Gt,bQ as Xt,fQ as Wt,ed as Kt,R as qt,x as Ce,fR as Yt,fS as Jt,cM as V,aN as U}from"./index-BmZql10x.js";import{c as R}from"./create-event-handler-BiA-1lGu.js";import{T as Qt}from"./Table-CQ4GTcIY.js";function Zt(e,r,t){const[n,o]=Ct(t?.in,e,r),a=Ee(n,o),s=Math.abs(Et(n,o));n.setDate(n.getDate()-a*s);const i=+(Ee(n,o)===-a),c=a*(s-i);return c===0?0:c}function Ee(e,r){const t=e.getFullYear()-r.getFullYear()||e.getMonth()-r.getMonth()||e.getDate()-r.getDate()||e.getHours()-r.getHours()||e.getMinutes()-r.getMinutes()||e.getSeconds()-r.getSeconds()||e.getMilliseconds()-r.getMilliseconds();return t<0?-1:t>0?1:t}function Ne(e,r,t){const n=Nt(e,t?.in);return n.setHours(r),n}function J(e,r){let t=e;for(;(t=t.parentElement)&&!t.matches(r););return t}function en(e,r,t){for(let n=e-1;n>=0;n-=1)if(!r[n].disabled)return n;if(t){for(let n=r.length-1;n>-1;n-=1)if(!r[n].disabled)return n}return e}function rn(e,r,t){for(let n=e+1;n<r.length;n+=1)if(!r[n].disabled)return n;if(t){for(let n=0;n<r.length;n+=1)if(!r[n].disabled)return n}return e}function tn(e,r,t){return J(e,t)===J(r,t)}function hr({parentSelector:e,siblingSelector:r,onKeyDown:t,loop:n=!0,activateOnFocus:o=!1,dir:a="rtl",orientation:s}){return i=>{var c;t?.(i);const d=Array.from(((c=J(i.currentTarget,e))==null?void 0:c.querySelectorAll(r))||[]).filter(_=>tn(i.currentTarget,_,e)),f=d.findIndex(_=>i.currentTarget===_),l=rn(f,d,n),v=en(f,d,n);switch(i.key){case"ArrowRight":break;case"ArrowLeft":break;case"ArrowUp":{i.stopPropagation(),i.preventDefault(),d[v].focus(),o&&d[v].click();break}case"ArrowDown":{i.stopPropagation(),i.preventDefault(),d[l].focus(),o&&d[l].click();break}case"Home":{i.stopPropagation(),i.preventDefault(),!d[0].disabled&&d[0].focus();break}case"End":{i.stopPropagation(),i.preventDefault();const _=d.length-1;!d[_].disabled&&d[_].focus();break}}}}function nn(e,r,t){var n;return t?Array.from(((n=J(t,r))==null?void 0:n.querySelectorAll(e))||[]).findIndex(o=>o===t):null}function De(e,r){return t=>{if(typeof t!="string"||t.trim().length===0)throw new Error(r);return`${e}-${t}`}}function on(){const[e,r]=y.useState(-1);return[e,{setHovered:r,resetHovered:()=>r(-1)}]}const Q={context:"Accordion component was not found in the tree",itemContext:"Accordion.Item component was not found in the tree",value:"Accordion.Item component was rendered with invalid value or without value"},[an,Z]=G(Q.context);function sn({children:e,multiple:r,value:t,defaultValue:n,onChange:o,id:a,loop:s,transitionDuration:i,disableChevronRotation:c,chevronPosition:d,chevronSize:f,order:l,chevron:v,variant:_,radius:p,classNames:g,styles:h,unstyled:O}){const $=Dt(a),[w,N]=pr({value:t,defaultValue:n,finalValue:r?[]:null,onChange:o}),A=S=>Array.isArray(w)?w.includes(S):S===w,L=S=>{const k=Array.isArray(w)?w.includes(S)?w.filter(I=>I!==S):[...w,S]:S===w?null:S;N(k)};return m.createElement(an,{value:{isItemActive:A,onChange:L,getControlId:De(`${$}-control`,Q.value),getRegionId:De(`${$}-panel`,Q.value),transitionDuration:i,disableChevronRotation:c,chevronPosition:d,chevronSize:f,order:l,chevron:v,loop:s,variant:_,radius:p,classNames:g,styles:h,unstyled:O}},e)}const[ln,Or]=G(Q.itemContext);function cn(e,r,{radius:t}){const n=e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3],o=e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[0],a=e.fn.radius(t);return r==="default"?{color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,borderBottom:`${P(1)} solid ${n}`}:r==="contained"?{border:`${P(1)} solid ${n}`,transition:"background-color 150ms ease","&[data-active]":{backgroundColor:o},"&:first-of-type":{borderTopRightRadius:a,borderTopLeftRadius:a,"& > [data-accordion-control]":{borderTopRightRadius:a,borderTopLeftRadius:a}},"&:last-of-type":{borderBottomRightRadius:a,borderBottomLeftRadius:a,"& > [data-accordion-control]":{borderBottomRightRadius:a,borderBottomLeftRadius:a}},"& + &":{borderTop:0}}:r==="filled"?{borderRadius:a,"&[data-active]":{backgroundColor:o}}:r==="separated"?{borderRadius:a,backgroundColor:o,border:`${P(1)} solid transparent`,transition:"background-color 150ms ease","& + &":{marginTop:e.spacing.md},"&[data-active]":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.white,borderColor:n}}:{}}var dn=j((e,r,{variant:t})=>({item:cn(e,t,r)})),fn=Object.defineProperty,ee=Object.getOwnPropertySymbols,$r=Object.prototype.hasOwnProperty,wr=Object.prototype.propertyIsEnumerable,Te=(e,r,t)=>r in e?fn(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,pn=(e,r)=>{for(var t in r||(r={}))$r.call(r,t)&&Te(e,t,r[t]);if(ee)for(var t of ee(r))wr.call(r,t)&&Te(e,t,r[t]);return e},un=(e,r)=>{var t={};for(var n in e)$r.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&ee)for(var n of ee(e))r.indexOf(n)<0&&wr.call(e,n)&&(t[n]=e[n]);return t};const mn={},Pr=y.forwardRef((e,r)=>{const t=b("AccordionItem",mn,e),{children:n,className:o,value:a}=t,s=un(t,["children","className","value"]),i=Z(),{classes:c,cx:d}=dn({radius:i.radius},{name:"Accordion",classNames:i.classNames,styles:i.styles,unstyled:i.unstyled,variant:i.variant});return m.createElement(ln,{value:{value:a}},m.createElement(T,pn({ref:r,className:d(c.item,o),"data-active":i.isItemActive(a)||void 0},s),n))});Pr.displayName="@mantine/core/AccordionItem";var gn=Object.defineProperty,vn=Object.defineProperties,_n=Object.getOwnPropertyDescriptors,Re=Object.getOwnPropertySymbols,yn=Object.prototype.hasOwnProperty,hn=Object.prototype.propertyIsEnumerable,Me=(e,r,t)=>r in e?gn(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,K=(e,r)=>{for(var t in r||(r={}))yn.call(r,t)&&Me(e,t,r[t]);if(Re)for(var t of Re(r))hn.call(r,t)&&Me(e,t,r[t]);return e},On=(e,r)=>vn(e,_n(r));function $n(e,r){return r==="default"||r==="contained"?e.fn.hover({backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[0]}):{}}var wn=j((e,{transitionDuration:r,chevronPosition:t,chevronSize:n},{variant:o})=>({icon:{display:"flex",alignItems:"center",justifyContent:"center",marginRight:t==="left"?0:e.spacing.sm,marginLeft:t==="left"?e.spacing.lg:0},chevron:{display:"flex",alignItems:"center",justifyContent:"center",transition:`transform ${r}ms ease`,marginRight:t==="right"?0:e.spacing.sm,marginLeft:t==="right"?e.spacing.lg:0,width:P(n),minWidth:P(n),"&[data-rotate]":{transform:"rotate(180deg)"}},label:{color:"inherit",fontWeight:400,flex:1,overflow:"hidden",textOverflow:"ellipsis",paddingTop:e.spacing.md,paddingBottom:e.spacing.md},itemTitle:{margin:0,padding:0},control:On(K(K(K({},e.fn.focusStyles()),e.fn.fontStyles()),$n(e,o)),{width:"100%",display:"flex",alignItems:"center",flexDirection:t==="right"?"row-reverse":"row",paddingRight:e.spacing.md,paddingLeft:t==="right"?`calc(${e.spacing.md} + ${P(4)})`:e.spacing.xs,textAlign:"left",color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,"&:disabled":K({opacity:.4,cursor:"not-allowed"},e.fn.hover({backgroundColor:"transparent"}))})})),Pn=Object.defineProperty,bn=Object.defineProperties,xn=Object.getOwnPropertyDescriptors,re=Object.getOwnPropertySymbols,br=Object.prototype.hasOwnProperty,xr=Object.prototype.propertyIsEnumerable,Ae=(e,r,t)=>r in e?Pn(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,Sn=(e,r)=>{for(var t in r||(r={}))br.call(r,t)&&Ae(e,t,r[t]);if(re)for(var t of re(r))xr.call(r,t)&&Ae(e,t,r[t]);return e},jn=(e,r)=>bn(e,xn(r)),In=(e,r)=>{var t={};for(var n in e)br.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&re)for(var n of re(e))r.indexOf(n)<0&&xr.call(e,n)&&(t[n]=e[n]);return t};const Cn={},Sr=y.forwardRef((e,r)=>{const t=b("AccordionControl",Cn,e),{disabled:n,onKeyDown:o,onClick:a,chevron:s,children:i,className:c,icon:d}=t,f=In(t,["disabled","onKeyDown","onClick","chevron","children","className","icon"]),l=Z(),{value:v}=Or(),{classes:_,cx:p}=wn({transitionDuration:l.transitionDuration,chevronPosition:l.chevronPosition,chevronSize:l.chevronSize,radius:l.radius},{name:"Accordion",classNames:l.classNames,styles:l.styles,unstyled:l.unstyled,variant:l.variant}),g=l.isItemActive(v),h=typeof l.order=="number",O=`h${l.order}`,$=m.createElement(ur,jn(Sn({},f),{ref:r,"data-accordion-control":!0,disabled:n,className:p(_.control,c),onClick:w=>{a?.(w),l.onChange(v)},type:"button","data-active":g||void 0,"aria-expanded":g,"aria-controls":l.getRegionId(v),id:l.getControlId(v),unstyled:l.unstyled,onKeyDown:hr({siblingSelector:"[data-accordion-control]",parentSelector:"[data-accordion]",activateOnFocus:!1,loop:l.loop,orientation:"vertical",onKeyDown:o})}),m.createElement("span",{className:_.chevron,"data-rotate":!l.disableChevronRotation&&g||void 0},s||l.chevron),m.createElement("span",{className:_.label},i),d&&m.createElement("span",{className:_.icon},d));return h?m.createElement(O,{className:_.itemTitle},$):$});Sr.displayName="@mantine/core/AccordionControl";var En=Object.defineProperty,Nn=Object.defineProperties,Dn=Object.getOwnPropertyDescriptors,Le=Object.getOwnPropertySymbols,Tn=Object.prototype.hasOwnProperty,Rn=Object.prototype.propertyIsEnumerable,ke=(e,r,t)=>r in e?En(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,Mn=(e,r)=>{for(var t in r||(r={}))Tn.call(r,t)&&ke(e,t,r[t]);if(Le)for(var t of Le(r))Rn.call(r,t)&&ke(e,t,r[t]);return e},An=(e,r)=>Nn(e,Dn(r)),Ln=j((e,r)=>({panel:An(Mn({},e.fn.fontStyles()),{wordBreak:"break-word",lineHeight:e.lineHeight}),content:{padding:e.spacing.md,paddingTop:`calc(${e.spacing.xs} / 2)`}})),kn=Object.defineProperty,Bn=Object.defineProperties,zn=Object.getOwnPropertyDescriptors,te=Object.getOwnPropertySymbols,jr=Object.prototype.hasOwnProperty,Ir=Object.prototype.propertyIsEnumerable,Be=(e,r,t)=>r in e?kn(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,B=(e,r)=>{for(var t in r||(r={}))jr.call(r,t)&&Be(e,t,r[t]);if(te)for(var t of te(r))Ir.call(r,t)&&Be(e,t,r[t]);return e},$e=(e,r)=>Bn(e,zn(r)),Hn=(e,r)=>{var t={};for(var n in e)jr.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&te)for(var n of te(e))r.indexOf(n)<0&&Ir.call(e,n)&&(t[n]=e[n]);return t};function Fn(e){if(!e||typeof e=="string")return 0;const r=e/36;return Math.round((4+15*r**.25+r/5)*10)}function we(e){return e?.current?e.current.scrollHeight:"auto"}const q=typeof window<"u"&&window.requestAnimationFrame;function Vn({transitionDuration:e,transitionTimingFunction:r="ease",onTransitionEnd:t=()=>{},opened:n}){const o=y.useRef(null),a=0,s={display:"none",height:0,overflow:"hidden"},[i,c]=y.useState(n?{}:s),d=p=>{Rt.flushSync(()=>c(p))},f=p=>{d(g=>B(B({},g),p))};function l(p){return{transition:`height ${e||Fn(p)}ms ${r}`}}mr(()=>{q(n?()=>{f({willChange:"height",display:"block",overflow:"hidden"}),q(()=>{const p=we(o);f($e(B({},l(p)),{height:p}))})}:()=>{const p=we(o);f($e(B({},l(p)),{willChange:"height",height:p})),q(()=>f({height:a,overflow:"hidden"}))})},[n]);const v=p=>{if(!(p.target!==o.current||p.propertyName!=="height"))if(n){const g=we(o);g===i.height?d({}):f({height:g}),t()}else i.height===a&&(d(s),t())};function _(p={}){var g=p,{style:h={},refKey:O="ref"}=g,$=Hn(g,["style","refKey"]);const w=$[O];return $e(B({"aria-hidden":!n},$),{[O]:Tt(o,w),onTransitionEnd:v,style:B(B({boxSizing:"border-box"},h),i)})}return _}var Un=Object.defineProperty,ne=Object.getOwnPropertySymbols,Cr=Object.prototype.hasOwnProperty,Er=Object.prototype.propertyIsEnumerable,ze=(e,r,t)=>r in e?Un(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,Y=(e,r)=>{for(var t in r||(r={}))Cr.call(r,t)&&ze(e,t,r[t]);if(ne)for(var t of ne(r))Er.call(r,t)&&ze(e,t,r[t]);return e},Gn=(e,r)=>{var t={};for(var n in e)Cr.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&ne)for(var n of ne(e))r.indexOf(n)<0&&Er.call(e,n)&&(t[n]=e[n]);return t};const Xn={transitionDuration:200,transitionTimingFunction:"ease",animateOpacity:!0},Nr=y.forwardRef((e,r)=>{const t=b("Collapse",Xn,e),{children:n,in:o,transitionDuration:a,transitionTimingFunction:s,style:i,onTransitionEnd:c,animateOpacity:d}=t,f=Gn(t,["children","in","transitionDuration","transitionTimingFunction","style","onTransitionEnd","animateOpacity"]),l=Mt(),v=At(),p=(l.respectReducedMotion?v:!1)?0:a,{systemStyles:g,rest:h}=Lt(f),O=Vn({opened:o,transitionDuration:p,transitionTimingFunction:s,onTransitionEnd:c});return p===0?o?m.createElement(T,Y({},h),n):null:m.createElement(T,Y({},O(Y(Y({style:i,ref:r},h),g))),m.createElement("div",{style:{opacity:o||!d?1:0,transition:d?`opacity ${p}ms ${s}`:"none"}},n))});Nr.displayName="@mantine/core/Collapse";var Wn=Object.defineProperty,Kn=Object.defineProperties,qn=Object.getOwnPropertyDescriptors,oe=Object.getOwnPropertySymbols,Dr=Object.prototype.hasOwnProperty,Tr=Object.prototype.propertyIsEnumerable,He=(e,r,t)=>r in e?Wn(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,Yn=(e,r)=>{for(var t in r||(r={}))Dr.call(r,t)&&He(e,t,r[t]);if(oe)for(var t of oe(r))Tr.call(r,t)&&He(e,t,r[t]);return e},Jn=(e,r)=>Kn(e,qn(r)),Qn=(e,r)=>{var t={};for(var n in e)Dr.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&oe)for(var n of oe(e))r.indexOf(n)<0&&Tr.call(e,n)&&(t[n]=e[n]);return t};const Zn={};function Rr(e){const r=b("AccordionPanel",Zn,e),{children:t,className:n}=r,o=Qn(r,["children","className"]),a=Z(),{value:s}=Or(),{classNames:i,styles:c,unstyled:d}=Z(),{classes:f,cx:l}=Ln({radius:a.radius},{name:"Accordion",classNames:i,styles:c,unstyled:d,variant:a.variant});return m.createElement(Nr,Jn(Yn({},o),{className:l(f.panel,n),in:a.isItemActive(s),transitionDuration:a.transitionDuration,role:"region",id:a.getRegionId(s),"aria-labelledby":a.getControlId(s)}),m.createElement("div",{className:f.content},t))}Rr.displayName="@mantine/core/AccordionPanel";var eo=Object.defineProperty,ro=Object.defineProperties,to=Object.getOwnPropertyDescriptors,ae=Object.getOwnPropertySymbols,Mr=Object.prototype.hasOwnProperty,Ar=Object.prototype.propertyIsEnumerable,Fe=(e,r,t)=>r in e?eo(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,no=(e,r)=>{for(var t in r||(r={}))Mr.call(r,t)&&Fe(e,t,r[t]);if(ae)for(var t of ae(r))Ar.call(r,t)&&Fe(e,t,r[t]);return e},oo=(e,r)=>ro(e,to(r)),ao=(e,r)=>{var t={};for(var n in e)Mr.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&ae)for(var n of ae(e))r.indexOf(n)<0&&Ar.call(e,n)&&(t[n]=e[n]);return t};const so={multiple:!1,disableChevronRotation:!1,transitionDuration:200,chevronPosition:"right",variant:"default",chevronSize:24,chevron:m.createElement(kt,null)};function Oe(e){const r=b("Accordion",so,e),{id:t,loop:n,children:o,multiple:a,value:s,defaultValue:i,onChange:c,transitionDuration:d,disableChevronRotation:f,chevronPosition:l,chevronSize:v,order:_,chevron:p,classNames:g,styles:h,unstyled:O,variant:$,radius:w}=r,N=ao(r,["id","loop","children","multiple","value","defaultValue","onChange","transitionDuration","disableChevronRotation","chevronPosition","chevronSize","order","chevron","classNames","styles","unstyled","variant","radius"]);return m.createElement(sn,{id:t,multiple:a,value:s,defaultValue:i,onChange:c,loop:n,transitionDuration:d,disableChevronRotation:f,chevronPosition:l,chevronSize:v,order:_,chevron:p,variant:$,radius:w,classNames:g,styles:h,unstyled:O},m.createElement(T,oo(no({},N),{"data-accordion":!0}),o))}Oe.Item=Pr;Oe.Control=Sr;Oe.Panel=Rr;Oe.displayName="@mantine/core/Accordion";const io={xs:P(12),sm:P(18),md:P(24),lg:P(34),xl:P(42)};var lo=j((e,{color:r,transitionDuration:t},{size:n})=>{const o=z({size:n,sizes:io}),a=r||(e.colorScheme==="dark"?e.white:e.black);return{root:{borderRadius:e.radius.sm,width:`calc(${o} + ${e.spacing.xs})`,height:`calc(${o} + ${e.spacing.xs})`,padding:`calc(${e.spacing.xs} / 2)`,cursor:"pointer"},burger:{position:"relative",userSelect:"none",boxSizing:"border-box","&, &::before, &::after":{display:"block",width:o,height:`calc(${o} / 12)`,backgroundColor:a,outline:`${P(1)} solid transparent`,transitionProperty:"background-color, transform",transitionDuration:`${t}ms`,"@media (prefers-reduced-motion)":{transitionDuration:e.respectReducedMotion?"0ms":void 0}},"&::before, &::after":{position:"absolute",content:'""',left:0},"&::before":{top:`calc((${o} / 3) * -1)`},"&::after":{top:`calc(${o} / 3)`},"&[data-opened]":{backgroundColor:"transparent","&::before":{transform:`translateY(calc(${o} / 3)) rotate(45deg)`},"&::after":{transform:`translateY(calc(-${o} / 3)) rotate(-45deg)`}}}}}),co=Object.defineProperty,se=Object.getOwnPropertySymbols,Lr=Object.prototype.hasOwnProperty,kr=Object.prototype.propertyIsEnumerable,Ve=(e,r,t)=>r in e?co(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,fo=(e,r)=>{for(var t in r||(r={}))Lr.call(r,t)&&Ve(e,t,r[t]);if(se)for(var t of se(r))kr.call(r,t)&&Ve(e,t,r[t]);return e},po=(e,r)=>{var t={};for(var n in e)Lr.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&se)for(var n of se(e))r.indexOf(n)<0&&kr.call(e,n)&&(t[n]=e[n]);return t};const uo={size:"md",transitionDuration:300},Br=y.forwardRef((e,r)=>{const t=b("Burger",uo,e),{className:n,opened:o,color:a,size:s,classNames:i,styles:c,transitionDuration:d,variant:f}=t,l=po(t,["className","opened","color","size","classNames","styles","transitionDuration","variant"]),{classes:v,cx:_}=lo({color:a,transitionDuration:d},{classNames:i,styles:c,name:"Burger",variant:f,size:s});return m.createElement(ur,fo({className:_(v.root,n),ref:r},l),m.createElement("div",{"data-opened":o||void 0,className:v.burger}))});Br.displayName="@mantine/core/Burger";const zr=y.createContext({padding:0}),mo=zr.Provider,go=()=>y.useContext(zr).padding;var vo=j((e,{padding:r,withBorder:t,inheritPadding:n})=>{const o=z({size:r,sizes:e.spacing}),a=`calc(-1 * ${o})`,s=e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3];return{cardSection:{display:"block",marginLeft:a,marginRight:a,paddingLeft:n?o:void 0,paddingRight:n?o:void 0,borderTop:t?`${P(1)} solid ${s}`:void 0,borderBottom:t?`${P(1)} solid ${s}`:void 0,"& + &":{borderTop:0},"&[data-first]":{marginTop:a,borderTop:0,borderBottom:t?`${P(1)} solid ${s}`:void 0},"&[data-last]":{marginBottom:a,borderBottom:0}}}}),_o=Object.defineProperty,ie=Object.getOwnPropertySymbols,Hr=Object.prototype.hasOwnProperty,Fr=Object.prototype.propertyIsEnumerable,Ue=(e,r,t)=>r in e?_o(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,yo=(e,r)=>{for(var t in r||(r={}))Hr.call(r,t)&&Ue(e,t,r[t]);if(ie)for(var t of ie(r))Fr.call(r,t)&&Ue(e,t,r[t]);return e},ho=(e,r)=>{var t={};for(var n in e)Hr.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&ie)for(var n of ie(e))r.indexOf(n)<0&&Fr.call(e,n)&&(t[n]=e[n]);return t};const Oo={withBorder:!1,inheritPadding:!1},Vr=y.forwardRef((e,r)=>{const t=b("CardSection",Oo,e),{className:n,withBorder:o,inheritPadding:a,unstyled:s,variant:i}=t,c=ho(t,["className","withBorder","inheritPadding","unstyled","variant"]),{classes:d,cx:f}=vo({padding:go(),withBorder:o,inheritPadding:a},{name:"Card",unstyled:s,variant:i});return m.createElement(T,yo({className:f(d.cardSection,n),ref:r},c))});Vr.displayName="@mantine/core/CardSection";const Ur=Pe(Vr);var $o=j(e=>({root:{position:"relative",overflow:"hidden",backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.white}})),wo=Object.defineProperty,le=Object.getOwnPropertySymbols,Gr=Object.prototype.hasOwnProperty,Xr=Object.prototype.propertyIsEnumerable,Ge=(e,r,t)=>r in e?wo(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,Po=(e,r)=>{for(var t in r||(r={}))Gr.call(r,t)&&Ge(e,t,r[t]);if(le)for(var t of le(r))Xr.call(r,t)&&Ge(e,t,r[t]);return e},bo=(e,r)=>{var t={};for(var n in e)Gr.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&le)for(var n of le(e))r.indexOf(n)<0&&Xr.call(e,n)&&(t[n]=e[n]);return t};const xo={padding:"md"},Se=y.forwardRef((e,r)=>{const t=b("Card",xo,e),{className:n,padding:o,radius:a,children:s,unstyled:i,variant:c}=t,d=bo(t,["className","padding","radius","children","unstyled","variant"]),{classes:f,cx:l}=$o(null,{name:"Card",unstyled:i,variant:c}),v=y.Children.toArray(s),_=v.map((p,g)=>typeof p=="object"&&p&&"type"in p&&p.type===Ur?y.cloneElement(p,{variant:c,padding:o,"data-first":g===0||void 0,"data-last":g===v.length-1||void 0}):p);return m.createElement(mo,{value:{padding:o}},m.createElement(gr,Po({className:l(f.root,n),radius:a,p:o,ref:r},d),_))});Se.Section=Ur;Se.displayName="@mantine/core/Card";const ms=Pe(Se),[So,jo]=G("Grid component was not found in tree");var Io=Object.defineProperty,Xe=Object.getOwnPropertySymbols,Co=Object.prototype.hasOwnProperty,Eo=Object.prototype.propertyIsEnumerable,We=(e,r,t)=>r in e?Io(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,No=(e,r)=>{for(var t in r||(r={}))Co.call(r,t)&&We(e,t,r[t]);if(Xe)for(var t of Xe(r))Eo.call(r,t)&&We(e,t,r[t]);return e};const je=(e,r)=>e==="content"?"auto":e==="auto"?"0rem":e?`${100/(r/e)}%`:void 0,Wr=(e,r,t)=>t||e==="auto"||e==="content"?"unset":je(e,r),Kr=(e,r)=>{if(e)return e==="auto"||r?1:0},qr=(e,r)=>e===0?0:e?`${100/(r/e)}%`:void 0,Yr=(e,r)=>typeof e<"u"?`calc(${z({size:e,sizes:r.spacing})} / 2)`:void 0;function Do({sizes:e,offsets:r,orders:t,theme:n,columns:o,gutters:a,grow:s}){return vr.reduce((i,c)=>(i[`@media (min-width: ${Bt(n.breakpoints[c])})`]={order:t[c],flexBasis:je(e[c],o),padding:Yr(a[c],n),flexShrink:0,width:e[c]==="content"?"auto":void 0,maxWidth:Wr(e[c],o,s),marginLeft:qr(r[c],o),flexGrow:Kr(e[c],s)},i),{})}var To=j((e,{gutter:r,gutterXs:t,gutterSm:n,gutterMd:o,gutterLg:a,gutterXl:s,grow:i,offset:c,offsetXs:d,offsetSm:f,offsetMd:l,offsetLg:v,offsetXl:_,columns:p,span:g,xs:h,sm:O,md:$,lg:w,xl:N,order:A,orderXs:L,orderSm:S,orderMd:k,orderLg:I,orderXl:x})=>({col:No({boxSizing:"border-box",flexGrow:Kr(g,i),order:A,padding:Yr(r,e),marginLeft:qr(c,p),flexBasis:je(g,p),flexShrink:0,width:g==="content"?"auto":void 0,maxWidth:Wr(g,p,i)},Do({sizes:{xs:h,sm:O,md:$,lg:w,xl:N},offsets:{xs:d,sm:f,md:l,lg:v,xl:_},orders:{xs:L,sm:S,md:k,lg:I,xl:x},gutters:{xs:t,sm:n,md:o,lg:a,xl:s},theme:e,columns:p,grow:i}))})),Ro=Object.defineProperty,ce=Object.getOwnPropertySymbols,Jr=Object.prototype.hasOwnProperty,Qr=Object.prototype.propertyIsEnumerable,Ke=(e,r,t)=>r in e?Ro(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,Mo=(e,r)=>{for(var t in r||(r={}))Jr.call(r,t)&&Ke(e,t,r[t]);if(ce)for(var t of ce(r))Qr.call(r,t)&&Ke(e,t,r[t]);return e},Ao=(e,r)=>{var t={};for(var n in e)Jr.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&ce)for(var n of ce(e))r.indexOf(n)<0&&Qr.call(e,n)&&(t[n]=e[n]);return t};const Lo={};function ko(e){return e==="auto"||e==="content"?!0:typeof e=="number"&&e>0&&e%1===0}const Zr=y.forwardRef((e,r)=>{const t=b("GridCol",Lo,e),{children:n,span:o,offset:a,offsetXs:s,offsetSm:i,offsetMd:c,offsetLg:d,offsetXl:f,xs:l,sm:v,md:_,lg:p,xl:g,order:h,orderXs:O,orderSm:$,orderMd:w,orderLg:N,orderXl:A,className:L,unstyled:S,variant:k}=t,I=Ao(t,["children","span","offset","offsetXs","offsetSm","offsetMd","offsetLg","offsetXl","xs","sm","md","lg","xl","order","orderXs","orderSm","orderMd","orderLg","orderXl","className","unstyled","variant"]),x=jo(),M=o||x.columns,{classes:F,cx:W}=To({gutter:x.gutter,gutterXs:x.gutterXs,gutterSm:x.gutterSm,gutterMd:x.gutterMd,gutterLg:x.gutterLg,gutterXl:x.gutterXl,offset:a,offsetXs:s,offsetSm:i,offsetMd:c,offsetLg:d,offsetXl:f,xs:l,sm:v,md:_,lg:p,xl:g,order:h,orderXs:O,orderSm:$,orderMd:w,orderLg:N,orderXl:A,grow:x.grow,columns:x.columns,span:M},{unstyled:S,name:"Grid",variant:k});return!ko(M)||M>x.columns?null:m.createElement(T,Mo({className:W(F.col,L),ref:r},I),n)});Zr.displayName="@mantine/core/Col";var Bo=Object.defineProperty,qe=Object.getOwnPropertySymbols,zo=Object.prototype.hasOwnProperty,Ho=Object.prototype.propertyIsEnumerable,Ye=(e,r,t)=>r in e?Bo(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,Fo=(e,r)=>{for(var t in r||(r={}))zo.call(r,t)&&Ye(e,t,r[t]);if(qe)for(var t of qe(r))Ho.call(r,t)&&Ye(e,t,r[t]);return e};function Vo(e,r){return vr.reduce((t,n)=>(typeof e[n]<"u"&&(t[`@media (min-width: ${r.breakpoints[n]})`]={margin:`calc(-${z({size:e[n],sizes:r.spacing})} / 2)`}),t),{})}var Uo=j((e,{justify:r,align:t,gutter:n,gutterXs:o,gutterSm:a,gutterMd:s,gutterLg:i,gutterXl:c})=>({root:Fo({margin:`calc(-${z({size:n,sizes:e.spacing})} / 2)`,display:"flex",flexWrap:"wrap",justifyContent:r,alignItems:t},Vo({xs:o,sm:a,md:s,lg:i,xl:c},e))})),Go=Object.defineProperty,de=Object.getOwnPropertySymbols,et=Object.prototype.hasOwnProperty,rt=Object.prototype.propertyIsEnumerable,Je=(e,r,t)=>r in e?Go(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,Xo=(e,r)=>{for(var t in r||(r={}))et.call(r,t)&&Je(e,t,r[t]);if(de)for(var t of de(r))rt.call(r,t)&&Je(e,t,r[t]);return e},Wo=(e,r)=>{var t={};for(var n in e)et.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&de)for(var n of de(e))r.indexOf(n)<0&&rt.call(e,n)&&(t[n]=e[n]);return t};const Ko={gutter:"md",justify:"flex-start",align:"stretch",columns:12},C=y.forwardRef((e,r)=>{const t=b("Grid",Ko,e),{gutter:n,gutterXs:o,gutterSm:a,gutterMd:s,gutterLg:i,gutterXl:c,children:d,grow:f,justify:l,align:v,columns:_,className:p,unstyled:g,variant:h}=t,O=Wo(t,["gutter","gutterXs","gutterSm","gutterMd","gutterLg","gutterXl","children","grow","justify","align","columns","className","unstyled","variant"]),{classes:$,cx:w}=Uo({gutter:n,justify:l,align:v,gutterXs:o,gutterSm:a,gutterMd:s,gutterLg:i,gutterXl:c},{unstyled:g,name:"Grid",variant:h});return m.createElement(So,{value:{gutter:n,gutterXs:o,gutterSm:a,gutterMd:s,gutterLg:i,gutterXl:c,grow:f,columns:_}},m.createElement(T,Xo({className:w($.root,p),ref:r},O),d))});C.Col=Zr;C.displayName="@mantine/core/Grid";function qo({open:e,close:r,openDelay:t,closeDelay:n}){const o=y.useRef(-1),a=y.useRef(-1),s=()=>{window.clearTimeout(o.current),window.clearTimeout(a.current)},i=()=>{s(),t===0?e():o.current=window.setTimeout(e,t)},c=()=>{s(),n===0?r():a.current=window.setTimeout(r,n)};return y.useEffect(()=>s,[]),{openDropdown:i,closeDropdown:c}}const[Yo,Jo]=G("List component was not found in tree");var Qo=j((e,{spacing:r,center:t})=>({itemWrapper:{ref:Ie("itemWrapper"),display:"inline-flex",flexDirection:"column",whiteSpace:"normal"},item:{whiteSpace:"nowrap",lineHeight:t?1:e.lineHeight,"&:not(:first-of-type)":{marginTop:z({size:r,sizes:e.spacing})},"&[data-with-icon]":{listStyle:"none",[`& .${Ie("itemWrapper")}`]:{display:"inline-flex",alignItems:t?"center":"flex-start",flexDirection:"row"}}},itemIcon:{display:"inline-block",verticalAlign:"middle",marginRight:e.spacing.sm}})),Zo=Object.defineProperty,fe=Object.getOwnPropertySymbols,tt=Object.prototype.hasOwnProperty,nt=Object.prototype.propertyIsEnumerable,Qe=(e,r,t)=>r in e?Zo(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,ea=(e,r)=>{for(var t in r||(r={}))tt.call(r,t)&&Qe(e,t,r[t]);if(fe)for(var t of fe(r))nt.call(r,t)&&Qe(e,t,r[t]);return e},ra=(e,r)=>{var t={};for(var n in e)tt.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&fe)for(var n of fe(e))r.indexOf(n)<0&&nt.call(e,n)&&(t[n]=e[n]);return t};const ta={},ot=y.forwardRef((e,r)=>{const t=b("ListItem",ta,e),{className:n,children:o,icon:a}=t,s=ra(t,["className","children","icon"]),{icon:i,spacing:c,center:d,listStyleType:f,size:l,withPadding:v,classNames:_,styles:p,unstyled:g,variant:h}=Jo(),O=a||i,{classes:$,cx:w}=Qo({withPadding:v,listStyleType:f,center:d,spacing:c},{classNames:_,styles:p,unstyled:g,name:"List",variant:h,size:l});return m.createElement(T,ea({component:"li",className:w($.item,n),"data-with-icon":!!O||void 0,ref:r},s),m.createElement("div",{className:$.itemWrapper},O&&m.createElement("span",{className:$.itemIcon},O),m.createElement("span",null,o)))});ot.displayName="@mantine/core/ListItem";var na=Object.defineProperty,oa=Object.defineProperties,aa=Object.getOwnPropertyDescriptors,Ze=Object.getOwnPropertySymbols,sa=Object.prototype.hasOwnProperty,ia=Object.prototype.propertyIsEnumerable,er=(e,r,t)=>r in e?na(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,la=(e,r)=>{for(var t in r||(r={}))sa.call(r,t)&&er(e,t,r[t]);if(Ze)for(var t of Ze(r))ia.call(r,t)&&er(e,t,r[t]);return e},ca=(e,r)=>oa(e,aa(r)),da=j((e,{withPadding:r,listStyleType:t},{size:n})=>({root:ca(la({},e.fn.fontStyles()),{listStyleType:t,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,fontSize:z({size:n,sizes:e.fontSizes}),lineHeight:e.lineHeight,margin:0,paddingLeft:r?e.spacing.xl:0,listStylePosition:"inside"})})),fa=Object.defineProperty,pe=Object.getOwnPropertySymbols,at=Object.prototype.hasOwnProperty,st=Object.prototype.propertyIsEnumerable,rr=(e,r,t)=>r in e?fa(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,pa=(e,r)=>{for(var t in r||(r={}))at.call(r,t)&&rr(e,t,r[t]);if(pe)for(var t of pe(r))st.call(r,t)&&rr(e,t,r[t]);return e},ua=(e,r)=>{var t={};for(var n in e)at.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&pe)for(var n of pe(e))r.indexOf(n)<0&&st.call(e,n)&&(t[n]=e[n]);return t};const ma={type:"unordered",size:"md",spacing:0},ue=y.forwardRef((e,r)=>{const t=b("List",ma,e),{children:n,type:o,size:a,listStyleType:s,withPadding:i,center:c,spacing:d,icon:f,className:l,styles:v,classNames:_,unstyled:p,variant:g}=t,h=ua(t,["children","type","size","listStyleType","withPadding","center","spacing","icon","className","styles","classNames","unstyled","variant"]),{classes:O,cx:$}=da({withPadding:i,listStyleType:s,center:c,spacing:d},{classNames:_,styles:v,name:"List",unstyled:p,size:a,variant:g});return m.createElement(Yo,{value:{spacing:d,center:c,icon:f,listStyleType:s,size:a,withPadding:i,classNames:_,styles:v,unstyled:p,variant:g}},m.createElement(T,pa({component:o==="unordered"?"ul":"ol",className:$(O.root,l),ref:r},h),n))});ue.Item=ot;ue.displayName="@mantine/core/List";const it={context:"Menu component was not found in the tree",children:"Menu.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported"},[ga,X]=G(it.context);var va=j(e=>({divider:{marginTop:P(4),marginBottom:P(4),borderTop:`${P(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2]}`}})),_a=Object.defineProperty,me=Object.getOwnPropertySymbols,lt=Object.prototype.hasOwnProperty,ct=Object.prototype.propertyIsEnumerable,tr=(e,r,t)=>r in e?_a(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,ya=(e,r)=>{for(var t in r||(r={}))lt.call(r,t)&&tr(e,t,r[t]);if(me)for(var t of me(r))ct.call(r,t)&&tr(e,t,r[t]);return e},ha=(e,r)=>{var t={};for(var n in e)lt.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&me)for(var n of me(e))r.indexOf(n)<0&&ct.call(e,n)&&(t[n]=e[n]);return t};const Oa={},dt=y.forwardRef((e,r)=>{const t=b("MenuDivider",Oa,e),{children:n,className:o}=t,a=ha(t,["children","className"]),{classNames:s,styles:i,unstyled:c,variant:d}=X(),{classes:f,cx:l}=va(null,{name:"Menu",classNames:s,styles:i,unstyled:c,variant:d});return m.createElement(T,ya({className:l(f.divider,o),ref:r},a))});dt.displayName="@mantine/core/MenuDivider";var $a=Object.defineProperty,ge=Object.getOwnPropertySymbols,ft=Object.prototype.hasOwnProperty,pt=Object.prototype.propertyIsEnumerable,nr=(e,r,t)=>r in e?$a(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,wa=(e,r)=>{for(var t in r||(r={}))ft.call(r,t)&&nr(e,t,r[t]);if(ge)for(var t of ge(r))pt.call(r,t)&&nr(e,t,r[t]);return e},Pa=(e,r)=>{var t={};for(var n in e)ft.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&ge)for(var n of ge(e))r.indexOf(n)<0&&pt.call(e,n)&&(t[n]=e[n]);return t};const ba={};function ut(e){const r=b("MenuDropdown",ba,e),{children:t,onMouseEnter:n,onMouseLeave:o}=r,a=Pa(r,["children","onMouseEnter","onMouseLeave"]),s=y.useRef(),i=X(),c=l=>{var v;(l.key==="ArrowUp"||l.key==="ArrowDown")&&(l.preventDefault(),(v=s.current.querySelectorAll("[data-menu-item]:not(:disabled)")[0])==null||v.focus())},d=R(n,()=>i.trigger==="hover"&&i.openDropdown()),f=R(o,()=>i.trigger==="hover"&&i.closeDropdown());return m.createElement(be.Dropdown,wa({onMouseEnter:d,onMouseLeave:f,role:"menu","aria-orientation":"vertical"},a),m.createElement("div",{tabIndex:-1,"data-menu-dropdown":!0,"data-autofocus":!0,onKeyDown:c,ref:s,style:{outline:0}},t))}ut.displayName="@mantine/core/MenuDropdown";var xa=Object.defineProperty,Sa=Object.defineProperties,ja=Object.getOwnPropertyDescriptors,or=Object.getOwnPropertySymbols,Ia=Object.prototype.hasOwnProperty,Ca=Object.prototype.propertyIsEnumerable,ar=(e,r,t)=>r in e?xa(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,Ea=(e,r)=>{for(var t in r||(r={}))Ia.call(r,t)&&ar(e,t,r[t]);if(or)for(var t of or(r))Ca.call(r,t)&&ar(e,t,r[t]);return e},Na=(e,r)=>Sa(e,ja(r)),Da=j((e,{color:r,radius:t})=>({item:Na(Ea({},e.fn.fontStyles()),{WebkitTapHighlightColor:"transparent",fontSize:e.fontSizes.sm,border:0,backgroundColor:"transparent",outline:0,width:"100%",textAlign:"left",textDecoration:"none",boxSizing:"border-box",padding:`${e.spacing.xs} ${e.spacing.sm}`,cursor:"pointer",borderRadius:e.fn.radius(t),color:r?e.fn.variant({variant:"filled",primaryFallback:!1,color:r}).background:e.colorScheme==="dark"?e.colors.dark[0]:e.black,display:"flex",alignItems:"center","&:disabled":{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5],pointerEvents:"none",userSelect:"none"},"&[data-hovered]":{backgroundColor:r?e.fn.variant({variant:"light",color:r}).background:e.colorScheme==="dark"?e.fn.rgba(e.colors.dark[3],.35):e.colors.gray[1]}}),itemLabel:{flex:1},itemIcon:{display:"flex",justifyContent:"center",alignItems:"center",marginRight:e.spacing.xs},itemRightSection:{}})),Ta=Object.defineProperty,Ra=Object.defineProperties,Ma=Object.getOwnPropertyDescriptors,ve=Object.getOwnPropertySymbols,mt=Object.prototype.hasOwnProperty,gt=Object.prototype.propertyIsEnumerable,sr=(e,r,t)=>r in e?Ta(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,Aa=(e,r)=>{for(var t in r||(r={}))mt.call(r,t)&&sr(e,t,r[t]);if(ve)for(var t of ve(r))gt.call(r,t)&&sr(e,t,r[t]);return e},La=(e,r)=>Ra(e,Ma(r)),ka=(e,r)=>{var t={};for(var n in e)mt.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&ve)for(var n of ve(e))r.indexOf(n)<0&>.call(e,n)&&(t[n]=e[n]);return t};const Ba={},vt=y.forwardRef((e,r)=>{const t=b("MenuItem",Ba,e),{children:n,className:o,color:a,closeMenuOnClick:s,icon:i,rightSection:c}=t,d=ka(t,["children","className","color","closeMenuOnClick","icon","rightSection"]),f=X(),{classes:l,cx:v,theme:_}=Da({radius:f.radius,color:a},{name:"Menu",classNames:f.classNames,styles:f.styles,unstyled:f.unstyled,variant:f.variant}),p=y.useRef(),g=f.getItemIndex(p.current),h=d,O=R(h.onMouseLeave,()=>f.setHovered(-1)),$=R(h.onMouseEnter,()=>f.setHovered(f.getItemIndex(p.current))),w=R(h.onClick,()=>{typeof s=="boolean"?s&&f.closeDropdownImmediately():f.closeOnItemClick&&f.closeDropdownImmediately()}),N=R(h.onFocus,()=>f.setHovered(f.getItemIndex(p.current)));return m.createElement(T,La(Aa({component:"button",type:"button"},d),{tabIndex:-1,onFocus:N,className:v(l.item,o),ref:zt(p,r),role:"menuitem","data-menu-item":!0,"data-hovered":f.hovered===g?!0:void 0,onMouseEnter:$,onMouseLeave:O,onClick:w,onKeyDown:hr({siblingSelector:"[data-menu-item]",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:f.loop,dir:_.dir,orientation:"vertical",onKeyDown:h.onKeydown})}),i&&m.createElement("div",{className:l.itemIcon},i),n&&m.createElement("div",{className:l.itemLabel},n),c&&m.createElement("div",{className:l.itemRightSection},c))});vt.displayName="@mantine/core/MenuItem";const za=Pe(vt);var Ha=j(e=>({label:{color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6],fontWeight:500,fontSize:e.fontSizes.xs,padding:`calc(${e.spacing.xs} / 2) ${e.spacing.sm}`,cursor:"default"}})),Fa=Object.defineProperty,_e=Object.getOwnPropertySymbols,_t=Object.prototype.hasOwnProperty,yt=Object.prototype.propertyIsEnumerable,ir=(e,r,t)=>r in e?Fa(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,Va=(e,r)=>{for(var t in r||(r={}))_t.call(r,t)&&ir(e,t,r[t]);if(_e)for(var t of _e(r))yt.call(r,t)&&ir(e,t,r[t]);return e},Ua=(e,r)=>{var t={};for(var n in e)_t.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&_e)for(var n of _e(e))r.indexOf(n)<0&&yt.call(e,n)&&(t[n]=e[n]);return t};const Ga={},ht=y.forwardRef((e,r)=>{const t=b("MenuLabel",Ga,e),{children:n,className:o}=t,a=Ua(t,["children","className"]),{classNames:s,styles:i,unstyled:c,variant:d}=X(),{classes:f,cx:l}=Ha(null,{name:"Menu",classNames:s,styles:i,unstyled:c,variant:d});return m.createElement(E,Va({className:l(f.label,o),ref:r},a),n)});ht.displayName="@mantine/core/MenuLabel";var Xa=Object.defineProperty,ye=Object.getOwnPropertySymbols,Ot=Object.prototype.hasOwnProperty,$t=Object.prototype.propertyIsEnumerable,lr=(e,r,t)=>r in e?Xa(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,Wa=(e,r)=>{for(var t in r||(r={}))Ot.call(r,t)&&lr(e,t,r[t]);if(ye)for(var t of ye(r))$t.call(r,t)&&lr(e,t,r[t]);return e},Ka=(e,r)=>{var t={};for(var n in e)Ot.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&ye)for(var n of ye(e))r.indexOf(n)<0&&$t.call(e,n)&&(t[n]=e[n]);return t};const qa={refProp:"ref"},wt=y.forwardRef((e,r)=>{const t=b("MenuTarget",qa,e),{children:n,refProp:o}=t,a=Ka(t,["children","refProp"]);if(!Ht(n))throw new Error(it.children);const s=X(),i=R(n.props.onClick,()=>s.trigger==="click"&&s.toggleDropdown()),c=R(n.props.onMouseEnter,()=>s.trigger==="hover"&&s.openDropdown()),d=R(n.props.onMouseLeave,()=>s.trigger==="hover"&&s.closeDropdown());return m.createElement(be.Target,Wa({refProp:o,popupType:"menu",ref:r},a),y.cloneElement(n,{onClick:i,onMouseEnter:c,onMouseLeave:d,"data-expanded":s.opened?!0:void 0}))});wt.displayName="@mantine/core/MenuTarget";var Ya=j({dropdown:{padding:P(4)}}),Ja=Object.defineProperty,Qa=Object.defineProperties,Za=Object.getOwnPropertyDescriptors,he=Object.getOwnPropertySymbols,Pt=Object.prototype.hasOwnProperty,bt=Object.prototype.propertyIsEnumerable,cr=(e,r,t)=>r in e?Ja(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,dr=(e,r)=>{for(var t in r||(r={}))Pt.call(r,t)&&cr(e,t,r[t]);if(he)for(var t of he(r))bt.call(r,t)&&cr(e,t,r[t]);return e},fr=(e,r)=>Qa(e,Za(r)),es=(e,r)=>{var t={};for(var n in e)Pt.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&he)for(var n of he(e))r.indexOf(n)<0&&bt.call(e,n)&&(t[n]=e[n]);return t};const rs={closeOnItemClick:!0,loop:!0,trigger:"click",openDelay:0,closeDelay:100};function D(e){const r=b("Menu",rs,e),{children:t,onOpen:n,onClose:o,opened:a,defaultOpened:s,onChange:i,closeOnItemClick:c,loop:d,closeOnEscape:f,trigger:l,openDelay:v,closeDelay:_,classNames:p,styles:g,unstyled:h,radius:O,variant:$}=r,w=es(r,["children","onOpen","onClose","opened","defaultOpened","onChange","closeOnItemClick","loop","closeOnEscape","trigger","openDelay","closeDelay","classNames","styles","unstyled","radius","variant"]),{classes:N,cx:A}=Ya(),[L,{setHovered:S,resetHovered:k}]=on(),[I,x]=pr({value:a,defaultValue:s,finalValue:!1,onChange:i}),M=()=>{x(!1),I&&o?.()},F=()=>{x(!0),!I&&n?.()},W=()=>I?M():F(),{openDropdown:xt,closeDropdown:St}=qo({open:F,close:M,closeDelay:_,openDelay:v}),jt=It=>nn("[data-menu-item]","[data-menu-dropdown]",It);return mr(()=>{k()},[I]),m.createElement(ga,{value:{opened:I,toggleDropdown:W,getItemIndex:jt,hovered:L,setHovered:S,closeOnItemClick:c,closeDropdown:l==="click"?M:St,openDropdown:l==="click"?F:xt,closeDropdownImmediately:M,loop:d,trigger:l,radius:O,classNames:p,styles:g,unstyled:h,variant:$}},m.createElement(be,fr(dr({},w),{radius:O,opened:I,onChange:W,defaultOpened:s,trapFocus:l==="click"&&I,closeOnEscape:f&&l==="click",__staticSelector:"Menu",classNames:fr(dr({},p),{dropdown:A(N.dropdown,p?.dropdown)}),styles:g,unstyled:h,variant:$}),t))}D.displayName="@mantine/core/Menu";D.Item=za;D.Label=ht;D.Dropdown=ut;D.Target=wt;D.Divider=dt;const ts="updateBusinessTripAccountantApproval",ns=()=>{const[{fetching:e},r]=_r(Ft),t=y.useCallback(async n=>{const o=`Error toggling accountant approval for trip [${n.businessTripId}]`,a=`${ts}-${n.businessTripId}`;H.loading("Updating accountant approval status",{id:a});try{const s=await r(n),i=yr(s,o,a);if(i)return H.success("Success",{id:a,description:"Accountant approval status updated"}),i.updateBusinessTripAccountantApproval}catch(s){console.error(`${o}: ${s}`),H.error("Error",{id:a,description:o,duration:1e5,closeButton:!0})}},[r]);return{fetching:e,updateBusinessTripAccountantApproval:t}};function os({data:e,onChange:r}){const t=xe(Ut,e),[n,o]=y.useState(t.accountantApproval),{updateBusinessTripAccountantApproval:a}=ns();return y.useEffect(()=>{n==null&&t.accountantApproval!=null&&o(t.accountantApproval)},[n,t.accountantApproval]),u.jsx(Vt,{value:n,onChange:s=>a({businessTripId:t.id,status:s}).then(r)})}const as="creditShareholdersBusinessTripTravelAndSubsistence",ss=()=>{const[{fetching:e},r]=_r(Gt),t=y.useCallback(async n=>{const o=`Error crediting shareholders for trip ID ${n.businessTripId}`,a=`${as}-${n.businessTripId}`;H.loading("Crediting Shareholders",{id:a});try{const s=await r(n),i=yr(s,o,a);i&&H.success("Shareholders Credited",{id:a,description:`${i.creditShareholdersBusinessTripTravelAndSubsistence.length} Corresponding charges were successfully generated`})}catch(s){console.error(`${o}: ${s}`),H.error("Error",{id:a,description:o,duration:1e5,closeButton:!0})}},[r]);return{fetching:e,creditShareholders:t}};function is({businessTripId:e}){const[r,t]=y.useState(!1),{creditShareholders:n}=ss();return u.jsxs(D,{shadow:"md",width:200,opened:r,children:[u.jsx(D.Target,{children:u.jsx(Br,{opened:r,onClick:o=>{o.stopPropagation(),t(a=>!a)}})}),u.jsxs(D.Dropdown,{children:[u.jsx(D.Label,{children:"Summarize Trip"}),u.jsx(Xt,{onConfirm:()=>{n({businessTripId:e})},title:"Credit shareholders with travel and subsistence surplus?",children:u.jsx(D.Item,{icon:u.jsx(Wt,{size:14}),children:"Credit surplus T&S"})})]})]})}const gs=({data:e,onChange:r})=>{const t=xe(Yt,e),{name:n,dates:o,purpose:a,destination:s}=t;return u.jsxs(C,{children:[u.jsxs(C.Col,{span:12,className:"flex flex-row justify-between items-center",children:[u.jsx(E,{fz:"xl",children:n}),u.jsxs("div",{className:"flex flex-row gap-2",children:[u.jsx(os,{data:t,onChange:r}),u.jsx(Kt,{isLink:!0,content:`${window.location.origin}${qt.BUSINESS_TRIPS.DETAIL(t.id)}`}),u.jsx(is,{businessTripId:t.id})]})]}),u.jsxs(C.Col,{xl:2,lg:3,md:6,children:["From Date:",u.jsx(E,{fz:"lg",children:o?.start?Ce(new Date(o.start),"dd/MM/yy"):"Missing"})]}),u.jsxs(C.Col,{xl:2,lg:3,md:6,children:["To Date:",u.jsx(E,{fz:"lg",children:o?.end?Ce(new Date(o.end),"dd/MM/yy"):"Missing"})]}),u.jsxs(C.Col,{xl:2,lg:3,md:6,children:["Destination:",u.jsx(E,{fz:"lg",children:s?.name})]}),u.jsxs(C.Col,{xl:4,lg:6,md:12,orderMd:6,children:["Description:",u.jsx(E,{fz:"lg",children:a})]}),u.jsxs(C.Col,{xl:2,lg:3,md:6,children:["Total Days:",u.jsx(E,{fz:"lg",children:o?ls(o.start,o.end):"Missing"})]})]})};function ls(e,r){return Zt(Ne(new Date(r),22),Ne(new Date(e),6))+1}function cs(e){return e.split("_").map(ds).join(" ")}function ds(e){return e.slice(0,1).toUpperCase()+e.slice(1,e.length).toLowerCase()}const vs=({data:e})=>{const{summary:r}=xe(Jt,e);return r?u.jsxs("div",{className:"flex flex-col gap-2 mt-5",children:[r.errors?.length&&u.jsxs(gr,{shadow:"xs",p:"md",children:[u.jsx(E,{c:"red",children:"Errors:"}),u.jsx(ue,{size:"sm",withPadding:!0,children:r.errors.map((t,n)=>u.jsx(ue.Item,{children:u.jsx(E,{c:"red",children:t})},n))})]}),u.jsxs(Qt,{highlightOnHover:!0,withBorder:!0,children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{children:"Expense Type"}),u.jsxs("th",{children:["Total ",V(U.Usd)]}),u.jsxs("th",{children:["Total ",V(U.Ils)]}),u.jsxs("th",{children:["Max Taxable ",V(U.Usd)]}),u.jsxs("th",{children:["Taxable ",V(U.Usd)]}),u.jsxs("th",{children:["Taxable ",V(U.Ils)]}),u.jsx("th",{children:"Excess Expenditure"})]})}),u.jsx("tbody",{children:r.rows.map(t=>u.jsxs("tr",{children:[u.jsx("td",{children:cs(t.type)}),u.jsx("td",{children:t.totalForeignCurrency?.formatted}),u.jsx("td",{children:t.totalLocalCurrency?.formatted}),u.jsx("td",{children:t.maxTaxableForeignCurrency?.formatted}),u.jsx("td",{children:t.taxableForeignCurrency?.formatted}),u.jsx("td",{children:t.taxableLocalCurrency?.formatted}),u.jsx("td",{children:t.excessExpenditure?.formatted})]},t.type))})]}),u.jsxs(C,{justify:"flex-end",children:[u.jsxs(C.Col,{lg:2,md:4,children:["Excess Expenditure Tax:",u.jsxs(E,{fz:"lg",children:[r.excessTax??"0","%"]})]}),u.jsx(C.Col,{lg:2,md:3,className:"flex flex-col justify-end",children:u.jsx(E,{fz:"lg",children:r.excessExpenditure?.formatted??"0.00"})})]})]}):u.jsx(E,{children:"Loading..."})};export{Oe as A,Br as B,ms as C,C as G,ue as L,D as M,gs as R,vs as S,Nr as a};
|
|
1
|
+
import{fH as Ct,fI as Et,fJ as Nt,r as y,eL as X,eo as Dt,ek as pr,ab as m,bA as j,bD as P,bC as b,bE as T,fh as ur,fK as mr,fL as Tt,cH as Rt,fM as Mt,fN as At,ep as Lt,fi as kt,bB as z,et as Pe,dW as gr,fO as vr,fP as Bt,em as Ie,cx as be,ev as zt,bl as E,eM as Ht,g as _r,fQ as Vt,t as H,i as yr,J as xe,j as u,dV as Ft,fR as Ut,fS as Xt,bS as Gt,fT as Wt,ef as Kt,R as qt,x as Ce,fU as Yt,fV as Jt,cO as F,aN as U}from"./index-BdnLryTF.js";import{c as R}from"./create-event-handler-BiA-1lGu.js";import{T as Qt}from"./Table-C2EjuqpH.js";function Zt(e,r,t){const[n,o]=Ct(t?.in,e,r),a=Ee(n,o),s=Math.abs(Et(n,o));n.setDate(n.getDate()-a*s);const i=+(Ee(n,o)===-a),c=a*(s-i);return c===0?0:c}function Ee(e,r){const t=e.getFullYear()-r.getFullYear()||e.getMonth()-r.getMonth()||e.getDate()-r.getDate()||e.getHours()-r.getHours()||e.getMinutes()-r.getMinutes()||e.getSeconds()-r.getSeconds()||e.getMilliseconds()-r.getMilliseconds();return t<0?-1:t>0?1:t}function Ne(e,r,t){const n=Nt(e,t?.in);return n.setHours(r),n}function J(e,r){let t=e;for(;(t=t.parentElement)&&!t.matches(r););return t}function en(e,r,t){for(let n=e-1;n>=0;n-=1)if(!r[n].disabled)return n;if(t){for(let n=r.length-1;n>-1;n-=1)if(!r[n].disabled)return n}return e}function rn(e,r,t){for(let n=e+1;n<r.length;n+=1)if(!r[n].disabled)return n;if(t){for(let n=0;n<r.length;n+=1)if(!r[n].disabled)return n}return e}function tn(e,r,t){return J(e,t)===J(r,t)}function hr({parentSelector:e,siblingSelector:r,onKeyDown:t,loop:n=!0,activateOnFocus:o=!1,dir:a="rtl",orientation:s}){return i=>{var c;t?.(i);const d=Array.from(((c=J(i.currentTarget,e))==null?void 0:c.querySelectorAll(r))||[]).filter(_=>tn(i.currentTarget,_,e)),f=d.findIndex(_=>i.currentTarget===_),l=rn(f,d,n),v=en(f,d,n);switch(i.key){case"ArrowRight":break;case"ArrowLeft":break;case"ArrowUp":{i.stopPropagation(),i.preventDefault(),d[v].focus(),o&&d[v].click();break}case"ArrowDown":{i.stopPropagation(),i.preventDefault(),d[l].focus(),o&&d[l].click();break}case"Home":{i.stopPropagation(),i.preventDefault(),!d[0].disabled&&d[0].focus();break}case"End":{i.stopPropagation(),i.preventDefault();const _=d.length-1;!d[_].disabled&&d[_].focus();break}}}}function nn(e,r,t){var n;return t?Array.from(((n=J(t,r))==null?void 0:n.querySelectorAll(e))||[]).findIndex(o=>o===t):null}function De(e,r){return t=>{if(typeof t!="string"||t.trim().length===0)throw new Error(r);return`${e}-${t}`}}function on(){const[e,r]=y.useState(-1);return[e,{setHovered:r,resetHovered:()=>r(-1)}]}const Q={context:"Accordion component was not found in the tree",itemContext:"Accordion.Item component was not found in the tree",value:"Accordion.Item component was rendered with invalid value or without value"},[an,Z]=X(Q.context);function sn({children:e,multiple:r,value:t,defaultValue:n,onChange:o,id:a,loop:s,transitionDuration:i,disableChevronRotation:c,chevronPosition:d,chevronSize:f,order:l,chevron:v,variant:_,radius:p,classNames:g,styles:h,unstyled:O}){const $=Dt(a),[w,N]=pr({value:t,defaultValue:n,finalValue:r?[]:null,onChange:o}),A=S=>Array.isArray(w)?w.includes(S):S===w,L=S=>{const k=Array.isArray(w)?w.includes(S)?w.filter(I=>I!==S):[...w,S]:S===w?null:S;N(k)};return m.createElement(an,{value:{isItemActive:A,onChange:L,getControlId:De(`${$}-control`,Q.value),getRegionId:De(`${$}-panel`,Q.value),transitionDuration:i,disableChevronRotation:c,chevronPosition:d,chevronSize:f,order:l,chevron:v,loop:s,variant:_,radius:p,classNames:g,styles:h,unstyled:O}},e)}const[ln,Or]=X(Q.itemContext);function cn(e,r,{radius:t}){const n=e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3],o=e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[0],a=e.fn.radius(t);return r==="default"?{color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,borderBottom:`${P(1)} solid ${n}`}:r==="contained"?{border:`${P(1)} solid ${n}`,transition:"background-color 150ms ease","&[data-active]":{backgroundColor:o},"&:first-of-type":{borderTopRightRadius:a,borderTopLeftRadius:a,"& > [data-accordion-control]":{borderTopRightRadius:a,borderTopLeftRadius:a}},"&:last-of-type":{borderBottomRightRadius:a,borderBottomLeftRadius:a,"& > [data-accordion-control]":{borderBottomRightRadius:a,borderBottomLeftRadius:a}},"& + &":{borderTop:0}}:r==="filled"?{borderRadius:a,"&[data-active]":{backgroundColor:o}}:r==="separated"?{borderRadius:a,backgroundColor:o,border:`${P(1)} solid transparent`,transition:"background-color 150ms ease","& + &":{marginTop:e.spacing.md},"&[data-active]":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.white,borderColor:n}}:{}}var dn=j((e,r,{variant:t})=>({item:cn(e,t,r)})),fn=Object.defineProperty,ee=Object.getOwnPropertySymbols,$r=Object.prototype.hasOwnProperty,wr=Object.prototype.propertyIsEnumerable,Te=(e,r,t)=>r in e?fn(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,pn=(e,r)=>{for(var t in r||(r={}))$r.call(r,t)&&Te(e,t,r[t]);if(ee)for(var t of ee(r))wr.call(r,t)&&Te(e,t,r[t]);return e},un=(e,r)=>{var t={};for(var n in e)$r.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&ee)for(var n of ee(e))r.indexOf(n)<0&&wr.call(e,n)&&(t[n]=e[n]);return t};const mn={},Pr=y.forwardRef((e,r)=>{const t=b("AccordionItem",mn,e),{children:n,className:o,value:a}=t,s=un(t,["children","className","value"]),i=Z(),{classes:c,cx:d}=dn({radius:i.radius},{name:"Accordion",classNames:i.classNames,styles:i.styles,unstyled:i.unstyled,variant:i.variant});return m.createElement(ln,{value:{value:a}},m.createElement(T,pn({ref:r,className:d(c.item,o),"data-active":i.isItemActive(a)||void 0},s),n))});Pr.displayName="@mantine/core/AccordionItem";var gn=Object.defineProperty,vn=Object.defineProperties,_n=Object.getOwnPropertyDescriptors,Re=Object.getOwnPropertySymbols,yn=Object.prototype.hasOwnProperty,hn=Object.prototype.propertyIsEnumerable,Me=(e,r,t)=>r in e?gn(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,K=(e,r)=>{for(var t in r||(r={}))yn.call(r,t)&&Me(e,t,r[t]);if(Re)for(var t of Re(r))hn.call(r,t)&&Me(e,t,r[t]);return e},On=(e,r)=>vn(e,_n(r));function $n(e,r){return r==="default"||r==="contained"?e.fn.hover({backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[0]}):{}}var wn=j((e,{transitionDuration:r,chevronPosition:t,chevronSize:n},{variant:o})=>({icon:{display:"flex",alignItems:"center",justifyContent:"center",marginRight:t==="left"?0:e.spacing.sm,marginLeft:t==="left"?e.spacing.lg:0},chevron:{display:"flex",alignItems:"center",justifyContent:"center",transition:`transform ${r}ms ease`,marginRight:t==="right"?0:e.spacing.sm,marginLeft:t==="right"?e.spacing.lg:0,width:P(n),minWidth:P(n),"&[data-rotate]":{transform:"rotate(180deg)"}},label:{color:"inherit",fontWeight:400,flex:1,overflow:"hidden",textOverflow:"ellipsis",paddingTop:e.spacing.md,paddingBottom:e.spacing.md},itemTitle:{margin:0,padding:0},control:On(K(K(K({},e.fn.focusStyles()),e.fn.fontStyles()),$n(e,o)),{width:"100%",display:"flex",alignItems:"center",flexDirection:t==="right"?"row-reverse":"row",paddingRight:e.spacing.md,paddingLeft:t==="right"?`calc(${e.spacing.md} + ${P(4)})`:e.spacing.xs,textAlign:"left",color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,"&:disabled":K({opacity:.4,cursor:"not-allowed"},e.fn.hover({backgroundColor:"transparent"}))})})),Pn=Object.defineProperty,bn=Object.defineProperties,xn=Object.getOwnPropertyDescriptors,re=Object.getOwnPropertySymbols,br=Object.prototype.hasOwnProperty,xr=Object.prototype.propertyIsEnumerable,Ae=(e,r,t)=>r in e?Pn(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,Sn=(e,r)=>{for(var t in r||(r={}))br.call(r,t)&&Ae(e,t,r[t]);if(re)for(var t of re(r))xr.call(r,t)&&Ae(e,t,r[t]);return e},jn=(e,r)=>bn(e,xn(r)),In=(e,r)=>{var t={};for(var n in e)br.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&re)for(var n of re(e))r.indexOf(n)<0&&xr.call(e,n)&&(t[n]=e[n]);return t};const Cn={},Sr=y.forwardRef((e,r)=>{const t=b("AccordionControl",Cn,e),{disabled:n,onKeyDown:o,onClick:a,chevron:s,children:i,className:c,icon:d}=t,f=In(t,["disabled","onKeyDown","onClick","chevron","children","className","icon"]),l=Z(),{value:v}=Or(),{classes:_,cx:p}=wn({transitionDuration:l.transitionDuration,chevronPosition:l.chevronPosition,chevronSize:l.chevronSize,radius:l.radius},{name:"Accordion",classNames:l.classNames,styles:l.styles,unstyled:l.unstyled,variant:l.variant}),g=l.isItemActive(v),h=typeof l.order=="number",O=`h${l.order}`,$=m.createElement(ur,jn(Sn({},f),{ref:r,"data-accordion-control":!0,disabled:n,className:p(_.control,c),onClick:w=>{a?.(w),l.onChange(v)},type:"button","data-active":g||void 0,"aria-expanded":g,"aria-controls":l.getRegionId(v),id:l.getControlId(v),unstyled:l.unstyled,onKeyDown:hr({siblingSelector:"[data-accordion-control]",parentSelector:"[data-accordion]",activateOnFocus:!1,loop:l.loop,orientation:"vertical",onKeyDown:o})}),m.createElement("span",{className:_.chevron,"data-rotate":!l.disableChevronRotation&&g||void 0},s||l.chevron),m.createElement("span",{className:_.label},i),d&&m.createElement("span",{className:_.icon},d));return h?m.createElement(O,{className:_.itemTitle},$):$});Sr.displayName="@mantine/core/AccordionControl";var En=Object.defineProperty,Nn=Object.defineProperties,Dn=Object.getOwnPropertyDescriptors,Le=Object.getOwnPropertySymbols,Tn=Object.prototype.hasOwnProperty,Rn=Object.prototype.propertyIsEnumerable,ke=(e,r,t)=>r in e?En(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,Mn=(e,r)=>{for(var t in r||(r={}))Tn.call(r,t)&&ke(e,t,r[t]);if(Le)for(var t of Le(r))Rn.call(r,t)&&ke(e,t,r[t]);return e},An=(e,r)=>Nn(e,Dn(r)),Ln=j((e,r)=>({panel:An(Mn({},e.fn.fontStyles()),{wordBreak:"break-word",lineHeight:e.lineHeight}),content:{padding:e.spacing.md,paddingTop:`calc(${e.spacing.xs} / 2)`}})),kn=Object.defineProperty,Bn=Object.defineProperties,zn=Object.getOwnPropertyDescriptors,te=Object.getOwnPropertySymbols,jr=Object.prototype.hasOwnProperty,Ir=Object.prototype.propertyIsEnumerable,Be=(e,r,t)=>r in e?kn(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,B=(e,r)=>{for(var t in r||(r={}))jr.call(r,t)&&Be(e,t,r[t]);if(te)for(var t of te(r))Ir.call(r,t)&&Be(e,t,r[t]);return e},$e=(e,r)=>Bn(e,zn(r)),Hn=(e,r)=>{var t={};for(var n in e)jr.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&te)for(var n of te(e))r.indexOf(n)<0&&Ir.call(e,n)&&(t[n]=e[n]);return t};function Vn(e){if(!e||typeof e=="string")return 0;const r=e/36;return Math.round((4+15*r**.25+r/5)*10)}function we(e){return e?.current?e.current.scrollHeight:"auto"}const q=typeof window<"u"&&window.requestAnimationFrame;function Fn({transitionDuration:e,transitionTimingFunction:r="ease",onTransitionEnd:t=()=>{},opened:n}){const o=y.useRef(null),a=0,s={display:"none",height:0,overflow:"hidden"},[i,c]=y.useState(n?{}:s),d=p=>{Rt.flushSync(()=>c(p))},f=p=>{d(g=>B(B({},g),p))};function l(p){return{transition:`height ${e||Vn(p)}ms ${r}`}}mr(()=>{q(n?()=>{f({willChange:"height",display:"block",overflow:"hidden"}),q(()=>{const p=we(o);f($e(B({},l(p)),{height:p}))})}:()=>{const p=we(o);f($e(B({},l(p)),{willChange:"height",height:p})),q(()=>f({height:a,overflow:"hidden"}))})},[n]);const v=p=>{if(!(p.target!==o.current||p.propertyName!=="height"))if(n){const g=we(o);g===i.height?d({}):f({height:g}),t()}else i.height===a&&(d(s),t())};function _(p={}){var g=p,{style:h={},refKey:O="ref"}=g,$=Hn(g,["style","refKey"]);const w=$[O];return $e(B({"aria-hidden":!n},$),{[O]:Tt(o,w),onTransitionEnd:v,style:B(B({boxSizing:"border-box"},h),i)})}return _}var Un=Object.defineProperty,ne=Object.getOwnPropertySymbols,Cr=Object.prototype.hasOwnProperty,Er=Object.prototype.propertyIsEnumerable,ze=(e,r,t)=>r in e?Un(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,Y=(e,r)=>{for(var t in r||(r={}))Cr.call(r,t)&&ze(e,t,r[t]);if(ne)for(var t of ne(r))Er.call(r,t)&&ze(e,t,r[t]);return e},Xn=(e,r)=>{var t={};for(var n in e)Cr.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&ne)for(var n of ne(e))r.indexOf(n)<0&&Er.call(e,n)&&(t[n]=e[n]);return t};const Gn={transitionDuration:200,transitionTimingFunction:"ease",animateOpacity:!0},Nr=y.forwardRef((e,r)=>{const t=b("Collapse",Gn,e),{children:n,in:o,transitionDuration:a,transitionTimingFunction:s,style:i,onTransitionEnd:c,animateOpacity:d}=t,f=Xn(t,["children","in","transitionDuration","transitionTimingFunction","style","onTransitionEnd","animateOpacity"]),l=Mt(),v=At(),p=(l.respectReducedMotion?v:!1)?0:a,{systemStyles:g,rest:h}=Lt(f),O=Fn({opened:o,transitionDuration:p,transitionTimingFunction:s,onTransitionEnd:c});return p===0?o?m.createElement(T,Y({},h),n):null:m.createElement(T,Y({},O(Y(Y({style:i,ref:r},h),g))),m.createElement("div",{style:{opacity:o||!d?1:0,transition:d?`opacity ${p}ms ${s}`:"none"}},n))});Nr.displayName="@mantine/core/Collapse";var Wn=Object.defineProperty,Kn=Object.defineProperties,qn=Object.getOwnPropertyDescriptors,oe=Object.getOwnPropertySymbols,Dr=Object.prototype.hasOwnProperty,Tr=Object.prototype.propertyIsEnumerable,He=(e,r,t)=>r in e?Wn(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,Yn=(e,r)=>{for(var t in r||(r={}))Dr.call(r,t)&&He(e,t,r[t]);if(oe)for(var t of oe(r))Tr.call(r,t)&&He(e,t,r[t]);return e},Jn=(e,r)=>Kn(e,qn(r)),Qn=(e,r)=>{var t={};for(var n in e)Dr.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&oe)for(var n of oe(e))r.indexOf(n)<0&&Tr.call(e,n)&&(t[n]=e[n]);return t};const Zn={};function Rr(e){const r=b("AccordionPanel",Zn,e),{children:t,className:n}=r,o=Qn(r,["children","className"]),a=Z(),{value:s}=Or(),{classNames:i,styles:c,unstyled:d}=Z(),{classes:f,cx:l}=Ln({radius:a.radius},{name:"Accordion",classNames:i,styles:c,unstyled:d,variant:a.variant});return m.createElement(Nr,Jn(Yn({},o),{className:l(f.panel,n),in:a.isItemActive(s),transitionDuration:a.transitionDuration,role:"region",id:a.getRegionId(s),"aria-labelledby":a.getControlId(s)}),m.createElement("div",{className:f.content},t))}Rr.displayName="@mantine/core/AccordionPanel";var eo=Object.defineProperty,ro=Object.defineProperties,to=Object.getOwnPropertyDescriptors,ae=Object.getOwnPropertySymbols,Mr=Object.prototype.hasOwnProperty,Ar=Object.prototype.propertyIsEnumerable,Ve=(e,r,t)=>r in e?eo(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,no=(e,r)=>{for(var t in r||(r={}))Mr.call(r,t)&&Ve(e,t,r[t]);if(ae)for(var t of ae(r))Ar.call(r,t)&&Ve(e,t,r[t]);return e},oo=(e,r)=>ro(e,to(r)),ao=(e,r)=>{var t={};for(var n in e)Mr.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&ae)for(var n of ae(e))r.indexOf(n)<0&&Ar.call(e,n)&&(t[n]=e[n]);return t};const so={multiple:!1,disableChevronRotation:!1,transitionDuration:200,chevronPosition:"right",variant:"default",chevronSize:24,chevron:m.createElement(kt,null)};function Oe(e){const r=b("Accordion",so,e),{id:t,loop:n,children:o,multiple:a,value:s,defaultValue:i,onChange:c,transitionDuration:d,disableChevronRotation:f,chevronPosition:l,chevronSize:v,order:_,chevron:p,classNames:g,styles:h,unstyled:O,variant:$,radius:w}=r,N=ao(r,["id","loop","children","multiple","value","defaultValue","onChange","transitionDuration","disableChevronRotation","chevronPosition","chevronSize","order","chevron","classNames","styles","unstyled","variant","radius"]);return m.createElement(sn,{id:t,multiple:a,value:s,defaultValue:i,onChange:c,loop:n,transitionDuration:d,disableChevronRotation:f,chevronPosition:l,chevronSize:v,order:_,chevron:p,variant:$,radius:w,classNames:g,styles:h,unstyled:O},m.createElement(T,oo(no({},N),{"data-accordion":!0}),o))}Oe.Item=Pr;Oe.Control=Sr;Oe.Panel=Rr;Oe.displayName="@mantine/core/Accordion";const io={xs:P(12),sm:P(18),md:P(24),lg:P(34),xl:P(42)};var lo=j((e,{color:r,transitionDuration:t},{size:n})=>{const o=z({size:n,sizes:io}),a=r||(e.colorScheme==="dark"?e.white:e.black);return{root:{borderRadius:e.radius.sm,width:`calc(${o} + ${e.spacing.xs})`,height:`calc(${o} + ${e.spacing.xs})`,padding:`calc(${e.spacing.xs} / 2)`,cursor:"pointer"},burger:{position:"relative",userSelect:"none",boxSizing:"border-box","&, &::before, &::after":{display:"block",width:o,height:`calc(${o} / 12)`,backgroundColor:a,outline:`${P(1)} solid transparent`,transitionProperty:"background-color, transform",transitionDuration:`${t}ms`,"@media (prefers-reduced-motion)":{transitionDuration:e.respectReducedMotion?"0ms":void 0}},"&::before, &::after":{position:"absolute",content:'""',left:0},"&::before":{top:`calc((${o} / 3) * -1)`},"&::after":{top:`calc(${o} / 3)`},"&[data-opened]":{backgroundColor:"transparent","&::before":{transform:`translateY(calc(${o} / 3)) rotate(45deg)`},"&::after":{transform:`translateY(calc(-${o} / 3)) rotate(-45deg)`}}}}}),co=Object.defineProperty,se=Object.getOwnPropertySymbols,Lr=Object.prototype.hasOwnProperty,kr=Object.prototype.propertyIsEnumerable,Fe=(e,r,t)=>r in e?co(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,fo=(e,r)=>{for(var t in r||(r={}))Lr.call(r,t)&&Fe(e,t,r[t]);if(se)for(var t of se(r))kr.call(r,t)&&Fe(e,t,r[t]);return e},po=(e,r)=>{var t={};for(var n in e)Lr.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&se)for(var n of se(e))r.indexOf(n)<0&&kr.call(e,n)&&(t[n]=e[n]);return t};const uo={size:"md",transitionDuration:300},Br=y.forwardRef((e,r)=>{const t=b("Burger",uo,e),{className:n,opened:o,color:a,size:s,classNames:i,styles:c,transitionDuration:d,variant:f}=t,l=po(t,["className","opened","color","size","classNames","styles","transitionDuration","variant"]),{classes:v,cx:_}=lo({color:a,transitionDuration:d},{classNames:i,styles:c,name:"Burger",variant:f,size:s});return m.createElement(ur,fo({className:_(v.root,n),ref:r},l),m.createElement("div",{"data-opened":o||void 0,className:v.burger}))});Br.displayName="@mantine/core/Burger";const zr=y.createContext({padding:0}),mo=zr.Provider,go=()=>y.useContext(zr).padding;var vo=j((e,{padding:r,withBorder:t,inheritPadding:n})=>{const o=z({size:r,sizes:e.spacing}),a=`calc(-1 * ${o})`,s=e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3];return{cardSection:{display:"block",marginLeft:a,marginRight:a,paddingLeft:n?o:void 0,paddingRight:n?o:void 0,borderTop:t?`${P(1)} solid ${s}`:void 0,borderBottom:t?`${P(1)} solid ${s}`:void 0,"& + &":{borderTop:0},"&[data-first]":{marginTop:a,borderTop:0,borderBottom:t?`${P(1)} solid ${s}`:void 0},"&[data-last]":{marginBottom:a,borderBottom:0}}}}),_o=Object.defineProperty,ie=Object.getOwnPropertySymbols,Hr=Object.prototype.hasOwnProperty,Vr=Object.prototype.propertyIsEnumerable,Ue=(e,r,t)=>r in e?_o(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,yo=(e,r)=>{for(var t in r||(r={}))Hr.call(r,t)&&Ue(e,t,r[t]);if(ie)for(var t of ie(r))Vr.call(r,t)&&Ue(e,t,r[t]);return e},ho=(e,r)=>{var t={};for(var n in e)Hr.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&ie)for(var n of ie(e))r.indexOf(n)<0&&Vr.call(e,n)&&(t[n]=e[n]);return t};const Oo={withBorder:!1,inheritPadding:!1},Fr=y.forwardRef((e,r)=>{const t=b("CardSection",Oo,e),{className:n,withBorder:o,inheritPadding:a,unstyled:s,variant:i}=t,c=ho(t,["className","withBorder","inheritPadding","unstyled","variant"]),{classes:d,cx:f}=vo({padding:go(),withBorder:o,inheritPadding:a},{name:"Card",unstyled:s,variant:i});return m.createElement(T,yo({className:f(d.cardSection,n),ref:r},c))});Fr.displayName="@mantine/core/CardSection";const Ur=Pe(Fr);var $o=j(e=>({root:{position:"relative",overflow:"hidden",backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.white}})),wo=Object.defineProperty,le=Object.getOwnPropertySymbols,Xr=Object.prototype.hasOwnProperty,Gr=Object.prototype.propertyIsEnumerable,Xe=(e,r,t)=>r in e?wo(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,Po=(e,r)=>{for(var t in r||(r={}))Xr.call(r,t)&&Xe(e,t,r[t]);if(le)for(var t of le(r))Gr.call(r,t)&&Xe(e,t,r[t]);return e},bo=(e,r)=>{var t={};for(var n in e)Xr.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&le)for(var n of le(e))r.indexOf(n)<0&&Gr.call(e,n)&&(t[n]=e[n]);return t};const xo={padding:"md"},Se=y.forwardRef((e,r)=>{const t=b("Card",xo,e),{className:n,padding:o,radius:a,children:s,unstyled:i,variant:c}=t,d=bo(t,["className","padding","radius","children","unstyled","variant"]),{classes:f,cx:l}=$o(null,{name:"Card",unstyled:i,variant:c}),v=y.Children.toArray(s),_=v.map((p,g)=>typeof p=="object"&&p&&"type"in p&&p.type===Ur?y.cloneElement(p,{variant:c,padding:o,"data-first":g===0||void 0,"data-last":g===v.length-1||void 0}):p);return m.createElement(mo,{value:{padding:o}},m.createElement(gr,Po({className:l(f.root,n),radius:a,p:o,ref:r},d),_))});Se.Section=Ur;Se.displayName="@mantine/core/Card";const ms=Pe(Se),[So,jo]=X("Grid component was not found in tree");var Io=Object.defineProperty,Ge=Object.getOwnPropertySymbols,Co=Object.prototype.hasOwnProperty,Eo=Object.prototype.propertyIsEnumerable,We=(e,r,t)=>r in e?Io(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,No=(e,r)=>{for(var t in r||(r={}))Co.call(r,t)&&We(e,t,r[t]);if(Ge)for(var t of Ge(r))Eo.call(r,t)&&We(e,t,r[t]);return e};const je=(e,r)=>e==="content"?"auto":e==="auto"?"0rem":e?`${100/(r/e)}%`:void 0,Wr=(e,r,t)=>t||e==="auto"||e==="content"?"unset":je(e,r),Kr=(e,r)=>{if(e)return e==="auto"||r?1:0},qr=(e,r)=>e===0?0:e?`${100/(r/e)}%`:void 0,Yr=(e,r)=>typeof e<"u"?`calc(${z({size:e,sizes:r.spacing})} / 2)`:void 0;function Do({sizes:e,offsets:r,orders:t,theme:n,columns:o,gutters:a,grow:s}){return vr.reduce((i,c)=>(i[`@media (min-width: ${Bt(n.breakpoints[c])})`]={order:t[c],flexBasis:je(e[c],o),padding:Yr(a[c],n),flexShrink:0,width:e[c]==="content"?"auto":void 0,maxWidth:Wr(e[c],o,s),marginLeft:qr(r[c],o),flexGrow:Kr(e[c],s)},i),{})}var To=j((e,{gutter:r,gutterXs:t,gutterSm:n,gutterMd:o,gutterLg:a,gutterXl:s,grow:i,offset:c,offsetXs:d,offsetSm:f,offsetMd:l,offsetLg:v,offsetXl:_,columns:p,span:g,xs:h,sm:O,md:$,lg:w,xl:N,order:A,orderXs:L,orderSm:S,orderMd:k,orderLg:I,orderXl:x})=>({col:No({boxSizing:"border-box",flexGrow:Kr(g,i),order:A,padding:Yr(r,e),marginLeft:qr(c,p),flexBasis:je(g,p),flexShrink:0,width:g==="content"?"auto":void 0,maxWidth:Wr(g,p,i)},Do({sizes:{xs:h,sm:O,md:$,lg:w,xl:N},offsets:{xs:d,sm:f,md:l,lg:v,xl:_},orders:{xs:L,sm:S,md:k,lg:I,xl:x},gutters:{xs:t,sm:n,md:o,lg:a,xl:s},theme:e,columns:p,grow:i}))})),Ro=Object.defineProperty,ce=Object.getOwnPropertySymbols,Jr=Object.prototype.hasOwnProperty,Qr=Object.prototype.propertyIsEnumerable,Ke=(e,r,t)=>r in e?Ro(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,Mo=(e,r)=>{for(var t in r||(r={}))Jr.call(r,t)&&Ke(e,t,r[t]);if(ce)for(var t of ce(r))Qr.call(r,t)&&Ke(e,t,r[t]);return e},Ao=(e,r)=>{var t={};for(var n in e)Jr.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&ce)for(var n of ce(e))r.indexOf(n)<0&&Qr.call(e,n)&&(t[n]=e[n]);return t};const Lo={};function ko(e){return e==="auto"||e==="content"?!0:typeof e=="number"&&e>0&&e%1===0}const Zr=y.forwardRef((e,r)=>{const t=b("GridCol",Lo,e),{children:n,span:o,offset:a,offsetXs:s,offsetSm:i,offsetMd:c,offsetLg:d,offsetXl:f,xs:l,sm:v,md:_,lg:p,xl:g,order:h,orderXs:O,orderSm:$,orderMd:w,orderLg:N,orderXl:A,className:L,unstyled:S,variant:k}=t,I=Ao(t,["children","span","offset","offsetXs","offsetSm","offsetMd","offsetLg","offsetXl","xs","sm","md","lg","xl","order","orderXs","orderSm","orderMd","orderLg","orderXl","className","unstyled","variant"]),x=jo(),M=o||x.columns,{classes:V,cx:W}=To({gutter:x.gutter,gutterXs:x.gutterXs,gutterSm:x.gutterSm,gutterMd:x.gutterMd,gutterLg:x.gutterLg,gutterXl:x.gutterXl,offset:a,offsetXs:s,offsetSm:i,offsetMd:c,offsetLg:d,offsetXl:f,xs:l,sm:v,md:_,lg:p,xl:g,order:h,orderXs:O,orderSm:$,orderMd:w,orderLg:N,orderXl:A,grow:x.grow,columns:x.columns,span:M},{unstyled:S,name:"Grid",variant:k});return!ko(M)||M>x.columns?null:m.createElement(T,Mo({className:W(V.col,L),ref:r},I),n)});Zr.displayName="@mantine/core/Col";var Bo=Object.defineProperty,qe=Object.getOwnPropertySymbols,zo=Object.prototype.hasOwnProperty,Ho=Object.prototype.propertyIsEnumerable,Ye=(e,r,t)=>r in e?Bo(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,Vo=(e,r)=>{for(var t in r||(r={}))zo.call(r,t)&&Ye(e,t,r[t]);if(qe)for(var t of qe(r))Ho.call(r,t)&&Ye(e,t,r[t]);return e};function Fo(e,r){return vr.reduce((t,n)=>(typeof e[n]<"u"&&(t[`@media (min-width: ${r.breakpoints[n]})`]={margin:`calc(-${z({size:e[n],sizes:r.spacing})} / 2)`}),t),{})}var Uo=j((e,{justify:r,align:t,gutter:n,gutterXs:o,gutterSm:a,gutterMd:s,gutterLg:i,gutterXl:c})=>({root:Vo({margin:`calc(-${z({size:n,sizes:e.spacing})} / 2)`,display:"flex",flexWrap:"wrap",justifyContent:r,alignItems:t},Fo({xs:o,sm:a,md:s,lg:i,xl:c},e))})),Xo=Object.defineProperty,de=Object.getOwnPropertySymbols,et=Object.prototype.hasOwnProperty,rt=Object.prototype.propertyIsEnumerable,Je=(e,r,t)=>r in e?Xo(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,Go=(e,r)=>{for(var t in r||(r={}))et.call(r,t)&&Je(e,t,r[t]);if(de)for(var t of de(r))rt.call(r,t)&&Je(e,t,r[t]);return e},Wo=(e,r)=>{var t={};for(var n in e)et.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&de)for(var n of de(e))r.indexOf(n)<0&&rt.call(e,n)&&(t[n]=e[n]);return t};const Ko={gutter:"md",justify:"flex-start",align:"stretch",columns:12},C=y.forwardRef((e,r)=>{const t=b("Grid",Ko,e),{gutter:n,gutterXs:o,gutterSm:a,gutterMd:s,gutterLg:i,gutterXl:c,children:d,grow:f,justify:l,align:v,columns:_,className:p,unstyled:g,variant:h}=t,O=Wo(t,["gutter","gutterXs","gutterSm","gutterMd","gutterLg","gutterXl","children","grow","justify","align","columns","className","unstyled","variant"]),{classes:$,cx:w}=Uo({gutter:n,justify:l,align:v,gutterXs:o,gutterSm:a,gutterMd:s,gutterLg:i,gutterXl:c},{unstyled:g,name:"Grid",variant:h});return m.createElement(So,{value:{gutter:n,gutterXs:o,gutterSm:a,gutterMd:s,gutterLg:i,gutterXl:c,grow:f,columns:_}},m.createElement(T,Go({className:w($.root,p),ref:r},O),d))});C.Col=Zr;C.displayName="@mantine/core/Grid";function qo({open:e,close:r,openDelay:t,closeDelay:n}){const o=y.useRef(-1),a=y.useRef(-1),s=()=>{window.clearTimeout(o.current),window.clearTimeout(a.current)},i=()=>{s(),t===0?e():o.current=window.setTimeout(e,t)},c=()=>{s(),n===0?r():a.current=window.setTimeout(r,n)};return y.useEffect(()=>s,[]),{openDropdown:i,closeDropdown:c}}const[Yo,Jo]=X("List component was not found in tree");var Qo=j((e,{spacing:r,center:t})=>({itemWrapper:{ref:Ie("itemWrapper"),display:"inline-flex",flexDirection:"column",whiteSpace:"normal"},item:{whiteSpace:"nowrap",lineHeight:t?1:e.lineHeight,"&:not(:first-of-type)":{marginTop:z({size:r,sizes:e.spacing})},"&[data-with-icon]":{listStyle:"none",[`& .${Ie("itemWrapper")}`]:{display:"inline-flex",alignItems:t?"center":"flex-start",flexDirection:"row"}}},itemIcon:{display:"inline-block",verticalAlign:"middle",marginRight:e.spacing.sm}})),Zo=Object.defineProperty,fe=Object.getOwnPropertySymbols,tt=Object.prototype.hasOwnProperty,nt=Object.prototype.propertyIsEnumerable,Qe=(e,r,t)=>r in e?Zo(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,ea=(e,r)=>{for(var t in r||(r={}))tt.call(r,t)&&Qe(e,t,r[t]);if(fe)for(var t of fe(r))nt.call(r,t)&&Qe(e,t,r[t]);return e},ra=(e,r)=>{var t={};for(var n in e)tt.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&fe)for(var n of fe(e))r.indexOf(n)<0&&nt.call(e,n)&&(t[n]=e[n]);return t};const ta={},ot=y.forwardRef((e,r)=>{const t=b("ListItem",ta,e),{className:n,children:o,icon:a}=t,s=ra(t,["className","children","icon"]),{icon:i,spacing:c,center:d,listStyleType:f,size:l,withPadding:v,classNames:_,styles:p,unstyled:g,variant:h}=Jo(),O=a||i,{classes:$,cx:w}=Qo({withPadding:v,listStyleType:f,center:d,spacing:c},{classNames:_,styles:p,unstyled:g,name:"List",variant:h,size:l});return m.createElement(T,ea({component:"li",className:w($.item,n),"data-with-icon":!!O||void 0,ref:r},s),m.createElement("div",{className:$.itemWrapper},O&&m.createElement("span",{className:$.itemIcon},O),m.createElement("span",null,o)))});ot.displayName="@mantine/core/ListItem";var na=Object.defineProperty,oa=Object.defineProperties,aa=Object.getOwnPropertyDescriptors,Ze=Object.getOwnPropertySymbols,sa=Object.prototype.hasOwnProperty,ia=Object.prototype.propertyIsEnumerable,er=(e,r,t)=>r in e?na(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,la=(e,r)=>{for(var t in r||(r={}))sa.call(r,t)&&er(e,t,r[t]);if(Ze)for(var t of Ze(r))ia.call(r,t)&&er(e,t,r[t]);return e},ca=(e,r)=>oa(e,aa(r)),da=j((e,{withPadding:r,listStyleType:t},{size:n})=>({root:ca(la({},e.fn.fontStyles()),{listStyleType:t,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,fontSize:z({size:n,sizes:e.fontSizes}),lineHeight:e.lineHeight,margin:0,paddingLeft:r?e.spacing.xl:0,listStylePosition:"inside"})})),fa=Object.defineProperty,pe=Object.getOwnPropertySymbols,at=Object.prototype.hasOwnProperty,st=Object.prototype.propertyIsEnumerable,rr=(e,r,t)=>r in e?fa(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,pa=(e,r)=>{for(var t in r||(r={}))at.call(r,t)&&rr(e,t,r[t]);if(pe)for(var t of pe(r))st.call(r,t)&&rr(e,t,r[t]);return e},ua=(e,r)=>{var t={};for(var n in e)at.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&pe)for(var n of pe(e))r.indexOf(n)<0&&st.call(e,n)&&(t[n]=e[n]);return t};const ma={type:"unordered",size:"md",spacing:0},ue=y.forwardRef((e,r)=>{const t=b("List",ma,e),{children:n,type:o,size:a,listStyleType:s,withPadding:i,center:c,spacing:d,icon:f,className:l,styles:v,classNames:_,unstyled:p,variant:g}=t,h=ua(t,["children","type","size","listStyleType","withPadding","center","spacing","icon","className","styles","classNames","unstyled","variant"]),{classes:O,cx:$}=da({withPadding:i,listStyleType:s,center:c,spacing:d},{classNames:_,styles:v,name:"List",unstyled:p,size:a,variant:g});return m.createElement(Yo,{value:{spacing:d,center:c,icon:f,listStyleType:s,size:a,withPadding:i,classNames:_,styles:v,unstyled:p,variant:g}},m.createElement(T,pa({component:o==="unordered"?"ul":"ol",className:$(O.root,l),ref:r},h),n))});ue.Item=ot;ue.displayName="@mantine/core/List";const it={context:"Menu component was not found in the tree",children:"Menu.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported"},[ga,G]=X(it.context);var va=j(e=>({divider:{marginTop:P(4),marginBottom:P(4),borderTop:`${P(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2]}`}})),_a=Object.defineProperty,me=Object.getOwnPropertySymbols,lt=Object.prototype.hasOwnProperty,ct=Object.prototype.propertyIsEnumerable,tr=(e,r,t)=>r in e?_a(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,ya=(e,r)=>{for(var t in r||(r={}))lt.call(r,t)&&tr(e,t,r[t]);if(me)for(var t of me(r))ct.call(r,t)&&tr(e,t,r[t]);return e},ha=(e,r)=>{var t={};for(var n in e)lt.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&me)for(var n of me(e))r.indexOf(n)<0&&ct.call(e,n)&&(t[n]=e[n]);return t};const Oa={},dt=y.forwardRef((e,r)=>{const t=b("MenuDivider",Oa,e),{children:n,className:o}=t,a=ha(t,["children","className"]),{classNames:s,styles:i,unstyled:c,variant:d}=G(),{classes:f,cx:l}=va(null,{name:"Menu",classNames:s,styles:i,unstyled:c,variant:d});return m.createElement(T,ya({className:l(f.divider,o),ref:r},a))});dt.displayName="@mantine/core/MenuDivider";var $a=Object.defineProperty,ge=Object.getOwnPropertySymbols,ft=Object.prototype.hasOwnProperty,pt=Object.prototype.propertyIsEnumerable,nr=(e,r,t)=>r in e?$a(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,wa=(e,r)=>{for(var t in r||(r={}))ft.call(r,t)&&nr(e,t,r[t]);if(ge)for(var t of ge(r))pt.call(r,t)&&nr(e,t,r[t]);return e},Pa=(e,r)=>{var t={};for(var n in e)ft.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&ge)for(var n of ge(e))r.indexOf(n)<0&&pt.call(e,n)&&(t[n]=e[n]);return t};const ba={};function ut(e){const r=b("MenuDropdown",ba,e),{children:t,onMouseEnter:n,onMouseLeave:o}=r,a=Pa(r,["children","onMouseEnter","onMouseLeave"]),s=y.useRef(),i=G(),c=l=>{var v;(l.key==="ArrowUp"||l.key==="ArrowDown")&&(l.preventDefault(),(v=s.current.querySelectorAll("[data-menu-item]:not(:disabled)")[0])==null||v.focus())},d=R(n,()=>i.trigger==="hover"&&i.openDropdown()),f=R(o,()=>i.trigger==="hover"&&i.closeDropdown());return m.createElement(be.Dropdown,wa({onMouseEnter:d,onMouseLeave:f,role:"menu","aria-orientation":"vertical"},a),m.createElement("div",{tabIndex:-1,"data-menu-dropdown":!0,"data-autofocus":!0,onKeyDown:c,ref:s,style:{outline:0}},t))}ut.displayName="@mantine/core/MenuDropdown";var xa=Object.defineProperty,Sa=Object.defineProperties,ja=Object.getOwnPropertyDescriptors,or=Object.getOwnPropertySymbols,Ia=Object.prototype.hasOwnProperty,Ca=Object.prototype.propertyIsEnumerable,ar=(e,r,t)=>r in e?xa(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,Ea=(e,r)=>{for(var t in r||(r={}))Ia.call(r,t)&&ar(e,t,r[t]);if(or)for(var t of or(r))Ca.call(r,t)&&ar(e,t,r[t]);return e},Na=(e,r)=>Sa(e,ja(r)),Da=j((e,{color:r,radius:t})=>({item:Na(Ea({},e.fn.fontStyles()),{WebkitTapHighlightColor:"transparent",fontSize:e.fontSizes.sm,border:0,backgroundColor:"transparent",outline:0,width:"100%",textAlign:"left",textDecoration:"none",boxSizing:"border-box",padding:`${e.spacing.xs} ${e.spacing.sm}`,cursor:"pointer",borderRadius:e.fn.radius(t),color:r?e.fn.variant({variant:"filled",primaryFallback:!1,color:r}).background:e.colorScheme==="dark"?e.colors.dark[0]:e.black,display:"flex",alignItems:"center","&:disabled":{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5],pointerEvents:"none",userSelect:"none"},"&[data-hovered]":{backgroundColor:r?e.fn.variant({variant:"light",color:r}).background:e.colorScheme==="dark"?e.fn.rgba(e.colors.dark[3],.35):e.colors.gray[1]}}),itemLabel:{flex:1},itemIcon:{display:"flex",justifyContent:"center",alignItems:"center",marginRight:e.spacing.xs},itemRightSection:{}})),Ta=Object.defineProperty,Ra=Object.defineProperties,Ma=Object.getOwnPropertyDescriptors,ve=Object.getOwnPropertySymbols,mt=Object.prototype.hasOwnProperty,gt=Object.prototype.propertyIsEnumerable,sr=(e,r,t)=>r in e?Ta(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,Aa=(e,r)=>{for(var t in r||(r={}))mt.call(r,t)&&sr(e,t,r[t]);if(ve)for(var t of ve(r))gt.call(r,t)&&sr(e,t,r[t]);return e},La=(e,r)=>Ra(e,Ma(r)),ka=(e,r)=>{var t={};for(var n in e)mt.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&ve)for(var n of ve(e))r.indexOf(n)<0&>.call(e,n)&&(t[n]=e[n]);return t};const Ba={},vt=y.forwardRef((e,r)=>{const t=b("MenuItem",Ba,e),{children:n,className:o,color:a,closeMenuOnClick:s,icon:i,rightSection:c}=t,d=ka(t,["children","className","color","closeMenuOnClick","icon","rightSection"]),f=G(),{classes:l,cx:v,theme:_}=Da({radius:f.radius,color:a},{name:"Menu",classNames:f.classNames,styles:f.styles,unstyled:f.unstyled,variant:f.variant}),p=y.useRef(),g=f.getItemIndex(p.current),h=d,O=R(h.onMouseLeave,()=>f.setHovered(-1)),$=R(h.onMouseEnter,()=>f.setHovered(f.getItemIndex(p.current))),w=R(h.onClick,()=>{typeof s=="boolean"?s&&f.closeDropdownImmediately():f.closeOnItemClick&&f.closeDropdownImmediately()}),N=R(h.onFocus,()=>f.setHovered(f.getItemIndex(p.current)));return m.createElement(T,La(Aa({component:"button",type:"button"},d),{tabIndex:-1,onFocus:N,className:v(l.item,o),ref:zt(p,r),role:"menuitem","data-menu-item":!0,"data-hovered":f.hovered===g?!0:void 0,onMouseEnter:$,onMouseLeave:O,onClick:w,onKeyDown:hr({siblingSelector:"[data-menu-item]",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:f.loop,dir:_.dir,orientation:"vertical",onKeyDown:h.onKeydown})}),i&&m.createElement("div",{className:l.itemIcon},i),n&&m.createElement("div",{className:l.itemLabel},n),c&&m.createElement("div",{className:l.itemRightSection},c))});vt.displayName="@mantine/core/MenuItem";const za=Pe(vt);var Ha=j(e=>({label:{color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6],fontWeight:500,fontSize:e.fontSizes.xs,padding:`calc(${e.spacing.xs} / 2) ${e.spacing.sm}`,cursor:"default"}})),Va=Object.defineProperty,_e=Object.getOwnPropertySymbols,_t=Object.prototype.hasOwnProperty,yt=Object.prototype.propertyIsEnumerable,ir=(e,r,t)=>r in e?Va(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,Fa=(e,r)=>{for(var t in r||(r={}))_t.call(r,t)&&ir(e,t,r[t]);if(_e)for(var t of _e(r))yt.call(r,t)&&ir(e,t,r[t]);return e},Ua=(e,r)=>{var t={};for(var n in e)_t.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&_e)for(var n of _e(e))r.indexOf(n)<0&&yt.call(e,n)&&(t[n]=e[n]);return t};const Xa={},ht=y.forwardRef((e,r)=>{const t=b("MenuLabel",Xa,e),{children:n,className:o}=t,a=Ua(t,["children","className"]),{classNames:s,styles:i,unstyled:c,variant:d}=G(),{classes:f,cx:l}=Ha(null,{name:"Menu",classNames:s,styles:i,unstyled:c,variant:d});return m.createElement(E,Fa({className:l(f.label,o),ref:r},a),n)});ht.displayName="@mantine/core/MenuLabel";var Ga=Object.defineProperty,ye=Object.getOwnPropertySymbols,Ot=Object.prototype.hasOwnProperty,$t=Object.prototype.propertyIsEnumerable,lr=(e,r,t)=>r in e?Ga(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,Wa=(e,r)=>{for(var t in r||(r={}))Ot.call(r,t)&&lr(e,t,r[t]);if(ye)for(var t of ye(r))$t.call(r,t)&&lr(e,t,r[t]);return e},Ka=(e,r)=>{var t={};for(var n in e)Ot.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&ye)for(var n of ye(e))r.indexOf(n)<0&&$t.call(e,n)&&(t[n]=e[n]);return t};const qa={refProp:"ref"},wt=y.forwardRef((e,r)=>{const t=b("MenuTarget",qa,e),{children:n,refProp:o}=t,a=Ka(t,["children","refProp"]);if(!Ht(n))throw new Error(it.children);const s=G(),i=R(n.props.onClick,()=>s.trigger==="click"&&s.toggleDropdown()),c=R(n.props.onMouseEnter,()=>s.trigger==="hover"&&s.openDropdown()),d=R(n.props.onMouseLeave,()=>s.trigger==="hover"&&s.closeDropdown());return m.createElement(be.Target,Wa({refProp:o,popupType:"menu",ref:r},a),y.cloneElement(n,{onClick:i,onMouseEnter:c,onMouseLeave:d,"data-expanded":s.opened?!0:void 0}))});wt.displayName="@mantine/core/MenuTarget";var Ya=j({dropdown:{padding:P(4)}}),Ja=Object.defineProperty,Qa=Object.defineProperties,Za=Object.getOwnPropertyDescriptors,he=Object.getOwnPropertySymbols,Pt=Object.prototype.hasOwnProperty,bt=Object.prototype.propertyIsEnumerable,cr=(e,r,t)=>r in e?Ja(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,dr=(e,r)=>{for(var t in r||(r={}))Pt.call(r,t)&&cr(e,t,r[t]);if(he)for(var t of he(r))bt.call(r,t)&&cr(e,t,r[t]);return e},fr=(e,r)=>Qa(e,Za(r)),es=(e,r)=>{var t={};for(var n in e)Pt.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&he)for(var n of he(e))r.indexOf(n)<0&&bt.call(e,n)&&(t[n]=e[n]);return t};const rs={closeOnItemClick:!0,loop:!0,trigger:"click",openDelay:0,closeDelay:100};function D(e){const r=b("Menu",rs,e),{children:t,onOpen:n,onClose:o,opened:a,defaultOpened:s,onChange:i,closeOnItemClick:c,loop:d,closeOnEscape:f,trigger:l,openDelay:v,closeDelay:_,classNames:p,styles:g,unstyled:h,radius:O,variant:$}=r,w=es(r,["children","onOpen","onClose","opened","defaultOpened","onChange","closeOnItemClick","loop","closeOnEscape","trigger","openDelay","closeDelay","classNames","styles","unstyled","radius","variant"]),{classes:N,cx:A}=Ya(),[L,{setHovered:S,resetHovered:k}]=on(),[I,x]=pr({value:a,defaultValue:s,finalValue:!1,onChange:i}),M=()=>{x(!1),I&&o?.()},V=()=>{x(!0),!I&&n?.()},W=()=>I?M():V(),{openDropdown:xt,closeDropdown:St}=qo({open:V,close:M,closeDelay:_,openDelay:v}),jt=It=>nn("[data-menu-item]","[data-menu-dropdown]",It);return mr(()=>{k()},[I]),m.createElement(ga,{value:{opened:I,toggleDropdown:W,getItemIndex:jt,hovered:L,setHovered:S,closeOnItemClick:c,closeDropdown:l==="click"?M:St,openDropdown:l==="click"?V:xt,closeDropdownImmediately:M,loop:d,trigger:l,radius:O,classNames:p,styles:g,unstyled:h,variant:$}},m.createElement(be,fr(dr({},w),{radius:O,opened:I,onChange:W,defaultOpened:s,trapFocus:l==="click"&&I,closeOnEscape:f&&l==="click",__staticSelector:"Menu",classNames:fr(dr({},p),{dropdown:A(N.dropdown,p?.dropdown)}),styles:g,unstyled:h,variant:$}),t))}D.displayName="@mantine/core/Menu";D.Item=za;D.Label=ht;D.Dropdown=ut;D.Target=wt;D.Divider=dt;const ts="updateBusinessTripAccountantApproval",ns=()=>{const[{fetching:e},r]=_r(Vt),t=y.useCallback(async n=>{const o=`Error toggling accountant approval for trip [${n.businessTripId}]`,a=`${ts}-${n.businessTripId}`;H.loading("Updating accountant approval status",{id:a});try{const s=await r(n),i=yr(s,o,a);if(i)return H.success("Success",{id:a,description:"Accountant approval status updated"}),i.updateBusinessTripAccountantApproval}catch(s){console.error(`${o}: ${s}`),H.error("Error",{id:a,description:o,duration:1e5,closeButton:!0})}},[r]);return{fetching:e,updateBusinessTripAccountantApproval:t}};function os({data:e,onChange:r}){const t=xe(Ut,e),[n,o]=y.useState(t.accountantApproval),{updateBusinessTripAccountantApproval:a}=ns();return y.useEffect(()=>{n==null&&t.accountantApproval!=null&&o(t.accountantApproval)},[n,t.accountantApproval]),u.jsx(Ft,{value:n,onChange:s=>a({businessTripId:t.id,status:s}).then(r)})}const as="creditShareholdersBusinessTripTravelAndSubsistence",ss=()=>{const[{fetching:e},r]=_r(Xt),t=y.useCallback(async n=>{const o=`Error crediting shareholders for trip ID ${n.businessTripId}`,a=`${as}-${n.businessTripId}`;H.loading("Crediting Shareholders",{id:a});try{const s=await r(n),i=yr(s,o,a);i&&H.success("Shareholders Credited",{id:a,description:`${i.creditShareholdersBusinessTripTravelAndSubsistence.length} Corresponding charges were successfully generated`})}catch(s){console.error(`${o}: ${s}`),H.error("Error",{id:a,description:o,duration:1e5,closeButton:!0})}},[r]);return{fetching:e,creditShareholders:t}};function is({businessTripId:e}){const[r,t]=y.useState(!1),{creditShareholders:n}=ss();return u.jsxs(D,{shadow:"md",width:200,opened:r,children:[u.jsx(D.Target,{children:u.jsx(Br,{opened:r,onClick:o=>{o.stopPropagation(),t(a=>!a)}})}),u.jsxs(D.Dropdown,{children:[u.jsx(D.Label,{children:"Summarize Trip"}),u.jsx(Gt,{onConfirm:()=>{n({businessTripId:e})},title:"Credit shareholders with travel and subsistence surplus?",children:u.jsx(D.Item,{icon:u.jsx(Wt,{size:14}),children:"Credit surplus T&S"})})]})]})}const gs=({data:e,onChange:r})=>{const t=xe(Yt,e),{name:n,dates:o,purpose:a,destination:s}=t;return u.jsxs(C,{children:[u.jsxs(C.Col,{span:12,className:"flex flex-row justify-between items-center",children:[u.jsx(E,{fz:"xl",children:n}),u.jsxs("div",{className:"flex flex-row gap-2",children:[u.jsx(os,{data:t,onChange:r}),u.jsx(Kt,{isLink:!0,content:`${window.location.origin}${qt.BUSINESS_TRIPS.DETAIL(t.id)}`}),u.jsx(is,{businessTripId:t.id})]})]}),u.jsxs(C.Col,{xl:2,lg:3,md:6,children:["From Date:",u.jsx(E,{fz:"lg",children:o?.start?Ce(new Date(o.start),"dd/MM/yy"):"Missing"})]}),u.jsxs(C.Col,{xl:2,lg:3,md:6,children:["To Date:",u.jsx(E,{fz:"lg",children:o?.end?Ce(new Date(o.end),"dd/MM/yy"):"Missing"})]}),u.jsxs(C.Col,{xl:2,lg:3,md:6,children:["Destination:",u.jsx(E,{fz:"lg",children:s?.name})]}),u.jsxs(C.Col,{xl:4,lg:6,md:12,orderMd:6,children:["Description:",u.jsx(E,{fz:"lg",children:a})]}),u.jsxs(C.Col,{xl:2,lg:3,md:6,children:["Total Days:",u.jsx(E,{fz:"lg",children:o?ls(o.start,o.end):"Missing"})]})]})};function ls(e,r){return Zt(Ne(new Date(r),22),Ne(new Date(e),6))+1}function cs(e){return e.split("_").map(ds).join(" ")}function ds(e){return e.slice(0,1).toUpperCase()+e.slice(1,e.length).toLowerCase()}const vs=({data:e})=>{const{summary:r}=xe(Jt,e);return r?u.jsxs("div",{className:"flex flex-col gap-2 mt-5",children:[r.errors?.length&&u.jsxs(gr,{shadow:"xs",p:"md",children:[u.jsx(E,{c:"red",children:"Errors:"}),u.jsx(ue,{size:"sm",withPadding:!0,children:r.errors.map((t,n)=>u.jsx(ue.Item,{children:u.jsx(E,{c:"red",children:t})},n))})]}),u.jsxs(Qt,{highlightOnHover:!0,withBorder:!0,children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{children:"Expense Type"}),u.jsxs("th",{children:["Total ",F(U.Usd)]}),u.jsxs("th",{children:["Total ",F(U.Ils)]}),u.jsxs("th",{children:["Max Taxable ",F(U.Usd)]}),u.jsxs("th",{children:["Taxable ",F(U.Usd)]}),u.jsxs("th",{children:["Taxable ",F(U.Ils)]}),u.jsx("th",{children:"Excess Expenditure"})]})}),u.jsx("tbody",{children:r.rows.map(t=>u.jsxs("tr",{children:[u.jsx("td",{children:cs(t.type)}),u.jsx("td",{children:t.totalForeignCurrency?.formatted}),u.jsx("td",{children:t.totalLocalCurrency?.formatted}),u.jsx("td",{children:t.maxTaxableForeignCurrency?.formatted}),u.jsx("td",{children:t.taxableForeignCurrency?.formatted}),u.jsx("td",{children:t.taxableLocalCurrency?.formatted}),u.jsx("td",{children:t.excessExpenditure?.formatted})]},t.type))})]}),u.jsxs(C,{justify:"flex-end",children:[u.jsxs(C.Col,{lg:2,md:4,children:["Excess Expenditure Tax:",u.jsxs(E,{fz:"lg",children:[r.excessTax??"0","%"]})]}),u.jsx(C.Col,{lg:2,md:3,className:"flex flex-col justify-end",children:u.jsx(E,{fz:"lg",children:r.excessExpenditure?.formatted??"0.00"})})]})]}):u.jsx(E,{children:"Loading..."})};export{Oe as A,Br as B,ms as C,C as G,ue as L,D as M,gs as R,vs as S,Nr as a};
|
package/dist/assets/{toggle-expansion-button-BzVlE1kb.js → toggle-expansion-button-DPcDIe-2.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s,T as l,B as p}from"./index-
|
|
1
|
+
import{j as s,T as l,B as p}from"./index-BdnLryTF.js";import{P as r,a as x}from"./panel-top-open-BApXXBMD.js";function u(n){const{toggleExpansion:e,isExpanded:t,onClickAction:o}=n;return s.jsx(l,{label:"Expand info",children:s.jsx(p,{variant:"default",onClick:i=>{i.stopPropagation(),e(a=>(o&&o(a),!a))},className:"size-7.5",children:t?s.jsx(r,{className:"size-5"}):s.jsx(x,{className:"size-5"})})})}export{u as T};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as o,gT as t,df as e,dg as l,dh as n}from"./index-BdnLryTF.js";function p({children:i,content:r,...s}){return o.jsx(t,{children:o.jsxs(e,{children:[o.jsx(l,{asChild:!0,children:i}),o.jsx(n,{...s,children:r})]})})}export{p as T};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{hw as a,r as s}from"./index-BdnLryTF.js";function c(){const{search:n}=a(),t=s.useMemo(()=>new URLSearchParams(n),[n]),r=s.useCallback(()=>{if(window.history.pushState){const o=t.keys().next().done?"":`?${t.toString()}`,e=window.location.protocol+"//"+window.location.host+window.location.pathname+o;window.history.pushState({path:e},"",e)}},[t]);return{query:t,queryString:()=>t.toString(),get:o=>t?.get(o),set:(o,e)=>{e==null?t.delete(o):t.set(o,e),r()}}}export{c as u};
|
package/dist/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<link rel="icon" href="/icons/accounter-logo.svg" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<title>Accounter</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-BdnLryTF.js"></script>
|
|
9
9
|
<link rel="stylesheet" crossorigin href="/assets/index-DWXHJxFq.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|
package/package.json
CHANGED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card.js';
|
|
2
|
+
import { BusinessExtendedInfo } from '../business-ledger/business-extended-info';
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
businessId: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export function BalanceSection({ businessId }: Props) {
|
|
9
|
+
return (
|
|
10
|
+
<Card>
|
|
11
|
+
<CardHeader className="flex w-full justify-between items-center">
|
|
12
|
+
<div className="flex items-center justify-between">
|
|
13
|
+
<div>
|
|
14
|
+
<CardTitle>Balance</CardTitle>
|
|
15
|
+
<CardDescription>Business balance overview</CardDescription>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
</CardHeader>
|
|
19
|
+
<CardContent>
|
|
20
|
+
<div className="rounded-md border">
|
|
21
|
+
<BusinessExtendedInfo businessID={businessId} filter={{}} />
|
|
22
|
+
</div>
|
|
23
|
+
</CardContent>
|
|
24
|
+
</Card>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { useContext, type ReactElement } from 'react';
|
|
2
2
|
import {
|
|
3
3
|
ArrowLeftRight,
|
|
4
4
|
Building2,
|
|
5
|
+
ChartLine,
|
|
5
6
|
DollarSign,
|
|
6
7
|
FileCheck,
|
|
7
8
|
FileText,
|
|
9
|
+
Notebook,
|
|
8
10
|
Plug,
|
|
9
11
|
Settings,
|
|
10
12
|
Shield,
|
|
@@ -13,8 +15,10 @@ import {
|
|
|
13
15
|
import { useSearchParams } from 'react-router-dom';
|
|
14
16
|
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs.js';
|
|
15
17
|
import { getFragmentData, type FragmentType } from '@/gql/index.js';
|
|
18
|
+
import { FiltersContext } from '@/providers/filters-context.js';
|
|
16
19
|
import { BusinessPageFragmentDoc } from '../../gql/graphql.js';
|
|
17
20
|
import { AdminBusinessSection } from './admin-business-section.js';
|
|
21
|
+
import { BalanceSection } from './balance-section.js';
|
|
18
22
|
import { BusinessHeader } from './business-header.js';
|
|
19
23
|
import { ChargesSection } from './charges-section.jsx';
|
|
20
24
|
import { ChartsSection } from './charts-section.jsx';
|
|
@@ -23,6 +27,7 @@ import { ContactInfoSection } from './contact-info-section.jsx';
|
|
|
23
27
|
import { ContractsSection } from './contracts-section.jsx';
|
|
24
28
|
import { DocumentsSection } from './documents-section.jsx';
|
|
25
29
|
import { IntegrationsSection } from './integrations-section.jsx';
|
|
30
|
+
import { LedgerSection } from './ledger-section.js';
|
|
26
31
|
import { TransactionsSection } from './transactions-section.js';
|
|
27
32
|
|
|
28
33
|
// eslint-disable-next-line @typescript-eslint/no-unused-expressions -- used by codegen
|
|
@@ -53,6 +58,9 @@ interface Props {
|
|
|
53
58
|
export default function Business({ data, refetchBusiness }: Props): ReactElement {
|
|
54
59
|
const business = getFragmentData(BusinessPageFragmentDoc, data);
|
|
55
60
|
const [searchParams, setSearchParams] = useSearchParams();
|
|
61
|
+
const { setFiltersContext } = useContext(FiltersContext);
|
|
62
|
+
|
|
63
|
+
setFiltersContext(null);
|
|
56
64
|
|
|
57
65
|
const activeTab = searchParams.get('tab') || 'contact';
|
|
58
66
|
|
|
@@ -109,6 +117,20 @@ export default function Business({ data, refetchBusiness }: Props): ReactElement
|
|
|
109
117
|
<FileText className="h-4 w-4" />
|
|
110
118
|
<span className="hidden sm:inline">Documents</span>
|
|
111
119
|
</TabsTrigger>
|
|
120
|
+
<TabsTrigger
|
|
121
|
+
value="ledger"
|
|
122
|
+
className="flex items-center gap-2 data-[state=active]:bg-background"
|
|
123
|
+
>
|
|
124
|
+
<Notebook className="h-4 w-4" />
|
|
125
|
+
<span className="hidden sm:inline">Ledger</span>
|
|
126
|
+
</TabsTrigger>
|
|
127
|
+
<TabsTrigger
|
|
128
|
+
value="balance"
|
|
129
|
+
className="flex items-center gap-2 data-[state=active]:bg-background"
|
|
130
|
+
>
|
|
131
|
+
<ChartLine className="h-4 w-4" />
|
|
132
|
+
<span className="hidden sm:inline">Balance</span>
|
|
133
|
+
</TabsTrigger>
|
|
112
134
|
{isClient && (
|
|
113
135
|
<>
|
|
114
136
|
<TabsTrigger
|
|
@@ -165,6 +187,14 @@ export default function Business({ data, refetchBusiness }: Props): ReactElement
|
|
|
165
187
|
<DocumentsSection businessId={business.id} />
|
|
166
188
|
</TabsContent>
|
|
167
189
|
|
|
190
|
+
<TabsContent value="ledger" className="mt-0">
|
|
191
|
+
<LedgerSection businessId={business.id} />
|
|
192
|
+
</TabsContent>
|
|
193
|
+
|
|
194
|
+
<TabsContent value="balance" className="mt-0">
|
|
195
|
+
<BalanceSection businessId={business.id} />
|
|
196
|
+
</TabsContent>
|
|
197
|
+
|
|
168
198
|
{isClient && (
|
|
169
199
|
<>
|
|
170
200
|
<TabsContent value="contracts" className="mt-0">
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { useQuery } from 'urql';
|
|
2
|
+
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card.js';
|
|
3
|
+
import { BusinessLedgerSectionDocument } from '@/gql/graphql.js';
|
|
4
|
+
import { LedgerTable } from '../ledger-table';
|
|
5
|
+
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions -- used by codegen
|
|
7
|
+
/* GraphQL */ `
|
|
8
|
+
query BusinessLedgerSection($businessId: UUID!) {
|
|
9
|
+
ledgerRecordsByFinancialEntity(financialEntityId: $businessId) {
|
|
10
|
+
id
|
|
11
|
+
...LedgerRecordsTableFields
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
`;
|
|
15
|
+
|
|
16
|
+
interface Props {
|
|
17
|
+
businessId: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function LedgerSection({ businessId }: Props) {
|
|
21
|
+
const [{ data, fetching }] = useQuery({
|
|
22
|
+
query: BusinessLedgerSectionDocument,
|
|
23
|
+
variables: {
|
|
24
|
+
businessId,
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
if (fetching) {
|
|
29
|
+
return <div>Loading ledger records...</div>;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<Card>
|
|
34
|
+
<CardHeader className="flex w-full justify-between items-center">
|
|
35
|
+
<div className="flex items-center justify-between">
|
|
36
|
+
<div>
|
|
37
|
+
<CardTitle>Ledger Records</CardTitle>
|
|
38
|
+
<CardDescription>Complete ledger history for this business</CardDescription>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
</CardHeader>
|
|
42
|
+
<CardContent>
|
|
43
|
+
<div className="rounded-md border">
|
|
44
|
+
<LedgerTable ledgerRecordsData={data?.ledgerRecordsByFinancialEntity ?? []} />
|
|
45
|
+
</div>
|
|
46
|
+
</CardContent>
|
|
47
|
+
</Card>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
@@ -1,11 +1,33 @@
|
|
|
1
|
+
import { useQuery } from 'urql';
|
|
1
2
|
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card.js';
|
|
2
|
-
import {
|
|
3
|
+
import { BusinessTransactionsSectionDocument } from '@/gql/graphql.js';
|
|
4
|
+
import { TransactionsTable } from '../transactions-table';
|
|
3
5
|
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions -- used by codegen
|
|
7
|
+
/* GraphQL */ `
|
|
8
|
+
query BusinessTransactionsSection($businessId: UUID!) {
|
|
9
|
+
transactionsByFinancialEntity(financialEntityID: $businessId) {
|
|
10
|
+
id
|
|
11
|
+
...TransactionForTransactionsTableFields
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
`;
|
|
4
15
|
interface Props {
|
|
5
16
|
businessId: string;
|
|
6
17
|
}
|
|
7
18
|
|
|
8
19
|
export function TransactionsSection({ businessId }: Props) {
|
|
20
|
+
const [{ data, fetching }] = useQuery({
|
|
21
|
+
query: BusinessTransactionsSectionDocument,
|
|
22
|
+
variables: {
|
|
23
|
+
businessId,
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
if (fetching) {
|
|
28
|
+
return <div>Loading transactions...</div>;
|
|
29
|
+
}
|
|
30
|
+
|
|
9
31
|
return (
|
|
10
32
|
<Card>
|
|
11
33
|
<CardHeader className="flex w-full justify-between items-center">
|
|
@@ -18,7 +40,7 @@ export function TransactionsSection({ businessId }: Props) {
|
|
|
18
40
|
</CardHeader>
|
|
19
41
|
<CardContent>
|
|
20
42
|
<div className="rounded-md border">
|
|
21
|
-
<
|
|
43
|
+
<TransactionsTable transactionsProps={data?.transactionsByFinancialEntity ?? []} />
|
|
22
44
|
</div>
|
|
23
45
|
</CardContent>
|
|
24
46
|
</Card>
|
|
@@ -6,10 +6,10 @@ import { useQuery } from 'urql';
|
|
|
6
6
|
import { ROUTES } from '@/router/routes.js';
|
|
7
7
|
import { Mark, Table, Tooltip } from '@mantine/core';
|
|
8
8
|
import {
|
|
9
|
-
|
|
9
|
+
BusinessLedgerInfoDocument,
|
|
10
10
|
Currency,
|
|
11
|
+
type BusinessLedgerInfoQuery,
|
|
11
12
|
type BusinessTransactionsFilter,
|
|
12
|
-
type BusinessTransactionsInfoQuery,
|
|
13
13
|
} from '../../gql/graphql.js';
|
|
14
14
|
import { FIAT_CURRENCIES, formatAmountWithCurrency } from '../../helpers/index.js';
|
|
15
15
|
import { AccounterLoader } from '../common/index.js';
|
|
@@ -18,7 +18,7 @@ import { DownloadCSV } from './download-csv.js';
|
|
|
18
18
|
|
|
19
19
|
// eslint-disable-next-line @typescript-eslint/no-unused-expressions -- used by codegen
|
|
20
20
|
/* GraphQL */ `
|
|
21
|
-
query
|
|
21
|
+
query BusinessLedgerInfo($filters: BusinessTransactionsFilter) {
|
|
22
22
|
businessTransactionsFromLedgerRecords(filters: $filters) {
|
|
23
23
|
... on BusinessTransactionsFromLedgerRecordsSuccessfulResult {
|
|
24
24
|
businessTransactions {
|
|
@@ -54,8 +54,8 @@ import { DownloadCSV } from './download-csv.js';
|
|
|
54
54
|
}
|
|
55
55
|
`;
|
|
56
56
|
|
|
57
|
-
export type
|
|
58
|
-
|
|
57
|
+
export type ExtendedLedger = Extract<
|
|
58
|
+
BusinessLedgerInfoQuery['businessTransactionsFromLedgerRecords'],
|
|
59
59
|
{ __typename?: 'BusinessTransactionsFromLedgerRecordsSuccessfulResult' }
|
|
60
60
|
>['businessTransactions'][number] & {
|
|
61
61
|
ilsBalance: number;
|
|
@@ -71,7 +71,7 @@ export function BusinessExtendedInfo({ businessID, filter }: Props): ReactElemen
|
|
|
71
71
|
const [isExtendAllCurrencies, setISExtendAllCurrencies] = useState(false);
|
|
72
72
|
const { fromDate, ownerIds, toDate } = filter ?? {};
|
|
73
73
|
const [{ data, fetching }] = useQuery({
|
|
74
|
-
query:
|
|
74
|
+
query: BusinessLedgerInfoDocument,
|
|
75
75
|
variables: {
|
|
76
76
|
filters: {
|
|
77
77
|
fromDate,
|
|
@@ -82,44 +82,42 @@ export function BusinessExtendedInfo({ businessID, filter }: Props): ReactElemen
|
|
|
82
82
|
},
|
|
83
83
|
});
|
|
84
84
|
|
|
85
|
-
const
|
|
85
|
+
const ledgerRecords =
|
|
86
86
|
data?.businessTransactionsFromLedgerRecords.__typename === 'CommonError'
|
|
87
87
|
? []
|
|
88
88
|
: (data?.businessTransactionsFromLedgerRecords.businessTransactions.sort((a, b) =>
|
|
89
89
|
a.invoiceDate > b.invoiceDate ? 1 : -1,
|
|
90
90
|
) ?? []);
|
|
91
91
|
|
|
92
|
-
const
|
|
93
|
-
for (let i = 0; i <
|
|
94
|
-
const { __typename, ...
|
|
92
|
+
const extendedLedgerRecords: Array<ExtendedLedger> = [];
|
|
93
|
+
for (let i = 0; i < ledgerRecords.length; i++) {
|
|
94
|
+
const { __typename, ...coreRecord } = ledgerRecords[i];
|
|
95
95
|
const ilsBalance =
|
|
96
96
|
i === 0
|
|
97
|
-
?
|
|
98
|
-
: (
|
|
97
|
+
? coreRecord.amount.raw
|
|
98
|
+
: (extendedLedgerRecords[i - 1].ilsBalance ?? 0) + coreRecord.amount.raw;
|
|
99
99
|
const foreignCurrenciesBalance: Record<string, number> = {};
|
|
100
100
|
Object.values(Currency).map(currency => {
|
|
101
101
|
if (currency !== Currency.Ils) {
|
|
102
102
|
const key = `${currency.toLowerCase()}Balance`;
|
|
103
103
|
foreignCurrenciesBalance[key] =
|
|
104
104
|
i === 0
|
|
105
|
-
? ((
|
|
106
|
-
?
|
|
105
|
+
? ((coreRecord.foreignAmount?.currency === currency
|
|
106
|
+
? coreRecord.foreignAmount?.raw
|
|
107
107
|
: 0) ?? 0)
|
|
108
|
-
: (
|
|
109
|
-
(
|
|
110
|
-
? coreTransaction.foreignAmount?.raw
|
|
111
|
-
: 0);
|
|
108
|
+
: (extendedLedgerRecords[i - 1]?.[key] ?? 0) +
|
|
109
|
+
(coreRecord.foreignAmount?.currency === currency ? coreRecord.foreignAmount?.raw : 0);
|
|
112
110
|
}
|
|
113
111
|
});
|
|
114
|
-
|
|
115
|
-
...
|
|
112
|
+
extendedLedgerRecords.push({
|
|
113
|
+
...coreRecord,
|
|
116
114
|
ilsBalance,
|
|
117
115
|
...foreignCurrenciesBalance,
|
|
118
|
-
} as (typeof
|
|
116
|
+
} as (typeof extendedLedgerRecords)[number]);
|
|
119
117
|
}
|
|
120
118
|
|
|
121
119
|
const currencies = new Set(
|
|
122
|
-
|
|
120
|
+
ledgerRecords.filter(t => t.foreignAmount?.currency).map(t => t.foreignAmount!.currency),
|
|
123
121
|
);
|
|
124
122
|
const isEur = isExtendAllCurrencies || currencies.has(Currency.Eur);
|
|
125
123
|
const isUsd = isExtendAllCurrencies || currencies.has(Currency.Usd);
|
|
@@ -129,7 +127,7 @@ export function BusinessExtendedInfo({ businessID, filter }: Props): ReactElemen
|
|
|
129
127
|
const isAud = isExtendAllCurrencies || currencies.has(Currency.Aud);
|
|
130
128
|
const isSek = isExtendAllCurrencies || currencies.has(Currency.Sek);
|
|
131
129
|
|
|
132
|
-
const businessName =
|
|
130
|
+
const businessName = ledgerRecords[0]?.business.name ?? 'unknown';
|
|
133
131
|
|
|
134
132
|
return (
|
|
135
133
|
<div className="flex flex-row gap-5">
|
|
@@ -216,7 +214,7 @@ export function BusinessExtendedInfo({ businessID, filter }: Props): ReactElemen
|
|
|
216
214
|
<th>Counter Account</th>
|
|
217
215
|
<th>
|
|
218
216
|
<DownloadCSV
|
|
219
|
-
|
|
217
|
+
ledgerRecords={extendedLedgerRecords}
|
|
220
218
|
businessName={businessName}
|
|
221
219
|
fromDate={filter?.fromDate ?? undefined}
|
|
222
220
|
toDate={filter?.toDate ?? undefined}
|
|
@@ -225,7 +223,7 @@ export function BusinessExtendedInfo({ businessID, filter }: Props): ReactElemen
|
|
|
225
223
|
</tr>
|
|
226
224
|
</thead>
|
|
227
225
|
<tbody>
|
|
228
|
-
{
|
|
226
|
+
{extendedLedgerRecords.map((row, index) => (
|
|
229
227
|
<tr
|
|
230
228
|
key={index}
|
|
231
229
|
className="cursor-pointer"
|
|
@@ -299,7 +297,7 @@ export function CurrencyCells({
|
|
|
299
297
|
data,
|
|
300
298
|
}: {
|
|
301
299
|
currency: Currency;
|
|
302
|
-
data:
|
|
300
|
+
data: ExtendedLedger;
|
|
303
301
|
}): ReactElement {
|
|
304
302
|
const foreignAmount =
|
|
305
303
|
data.foreignAmount && data.foreignAmount.currency === currency ? data.foreignAmount : null;
|
|
@@ -329,7 +327,7 @@ const currenciesToExtend = Object.values(Currency).filter(
|
|
|
329
327
|
currency => !FIAT_CURRENCIES.includes(currency),
|
|
330
328
|
);
|
|
331
329
|
|
|
332
|
-
export function ExtendedCurrencyCells({ data }: { data:
|
|
330
|
+
export function ExtendedCurrencyCells({ data }: { data: ExtendedLedger }): ReactElement {
|
|
333
331
|
return (
|
|
334
332
|
<>
|
|
335
333
|
{currenciesToExtend.map(currency => (
|