@accounter/client 0.0.8-alpha-20251029111239-192c5afd2d66a4d11ea8217039b86666b6fff216 → 0.0.8-alpha-20251029124448-6b4f8bc975a23de63429b68d0806022dbfc5b226
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-BfB2aYmM.js → Checkbox-Ddw01d64.js} +2 -2
- package/dist/assets/{MultiSelect-CGvaXcuH.js → MultiSelect-CBtq6WUv.js} +1 -1
- package/dist/assets/{Pagination-D4fkmYTl.js → Pagination-BM-86UO5.js} +1 -1
- package/dist/assets/{Progress-CQs7EuQ2.js → Progress-Bda-J3ZH.js} +1 -1
- package/dist/assets/{Table-C2EjuqpH.js → Table-CYqAEQfS.js} +1 -1
- package/dist/assets/{Typography-bz4ZX5sI.js → Typography--U0GsZ21.js} +1 -1
- package/dist/assets/{YearPickerInput-CURoIYu6.js → YearPickerInput-CgU-feeq.js} +1 -1
- package/dist/assets/{accordion-DWmBRtUi.js → accordion-B8kebokE.js} +1 -1
- package/dist/assets/{accountant-approvals-C9FCfRoL.js → accountant-approvals-CUluc3sH.js} +1 -1
- package/dist/assets/{accounter-table-C70NKDaW.js → accounter-table-CM6PQ9Aw.js} +1 -1
- package/dist/assets/{addDays-BGYF7FkS.js → addDays-DGlDD_vj.js} +1 -1
- package/dist/assets/{all-charges-CkPb7TjD.js → all-charges-DpQS6Xp3.js} +1 -1
- package/dist/assets/{arrow-up-down-B-KqfJyD.js → arrow-up-down-C61ge4J5.js} +1 -1
- package/dist/assets/{building-2-BAwr8r-2.js → building-2-3KauBrnS.js} +1 -1
- package/dist/assets/{business-DLu0ofgu.js → business-RCuQN-RO.js} +7 -17
- package/dist/assets/business-extended-info-DmQ7B7-Z.js +13 -0
- package/dist/assets/{business-header-B_qcrJW_.js → business-header-B-uHcc1D.js} +1 -1
- package/dist/assets/business-transactions-filters-D-Y8vZwZ.js +1 -0
- package/dist/assets/business-transactions-single-CEE249QN.js +1 -0
- package/dist/assets/business-trip-3kCBQ5MD.js +1 -0
- package/dist/assets/{charge-aBSxCGi3.js → charge-D19rkm2C.js} +1 -1
- package/dist/assets/{charges-filters-BRuJ3XbB.js → charges-filters-BUFmsiTq.js} +1 -1
- package/dist/assets/{charges-ledger-validation-DjuvGES2.js → charges-ledger-validation-OPtbHzXu.js} +1 -1
- package/dist/assets/charges-table-D_GDHvFS.js +62 -0
- package/dist/assets/{chart-BSh0rsm7.js → chart-iyOBgiH0.js} +1 -1
- package/dist/assets/{data-table-pagination-BCuaIseR.js → data-table-pagination-CKN0E29f.js} +1 -1
- package/dist/assets/download-csv-button-DZ5cKqkV.js +1 -0
- package/dist/assets/{editable-business-trip-BLWzKbN3.js → editable-business-trip-CRiuNdbP.js} +1 -1
- package/dist/assets/{funnel-XiON1wPY.js → funnel-BlaCusqP.js} +1 -1
- package/dist/assets/{index-BdnLryTF.js → index-B2_EbsaK.js} +191 -191
- package/dist/assets/index-B8pzYiEH.js +1 -0
- package/dist/assets/{index-DOSLXKPY.js → index-BAGVbiiM.js} +1 -1
- package/dist/assets/{index-D7GKOJU4.js → index-BD86tRnn.js} +2 -2
- package/dist/assets/{index-C_nLGgCr.js → index-BGh0NOfw.js} +1 -1
- package/dist/assets/{index-CtDDVAsw.js → index-BKiLhEyi.js} +1 -1
- package/dist/assets/{index-D9RA6cVt.js → index-BNAjS3Tn.js} +2 -2
- package/dist/assets/{index-DbbPcdZ7.js → index-BRSlJnxd.js} +2 -2
- package/dist/assets/{index-CA6LHUxs.js → index-BoL57v1D.js} +1 -1
- package/dist/assets/{index-C-RIsd1H.js → index-C2GP2DWO.js} +2 -2
- package/dist/assets/{index-CJP0f2Bm.js → index-CM60VmgR.js} +1 -1
- package/dist/assets/index-CRLPoT61.js +6 -0
- package/dist/assets/index-CRooGu6R.js +1 -0
- package/dist/assets/{index-CxE91GPE.js → index-C_OSDuUb.js} +1 -1
- package/dist/assets/{index-CVNgfFi3.js → index-Cc7exUI5.js} +1 -1
- package/dist/assets/{index-BwrF7ixX.js → index-Co66MgF6.js} +2 -2
- package/dist/assets/{index-BPLQ_Cjg.js → index-CyBAoT0l.js} +1 -1
- package/dist/assets/{index-BYCdqffp.js → index-D5tmtR-a.js} +7 -7
- package/dist/assets/{index-3Fyx3NBp.js → index-DINxWoMX.js} +1 -1
- package/dist/assets/{index-BdzdEbUC.js → index-DIiuo0-v.js} +1 -1
- package/dist/assets/{index-Diqx01g3.js → index-DtrRL2jA.js} +1 -1
- package/dist/assets/{index-BVTpNGNk.js → index-EaY6ZYvr.js} +2 -2
- package/dist/assets/{index-DaSx2wiU.js → index-mMqWkzUL.js} +1 -1
- package/dist/assets/{index-pjJUDHWQ.js → index-xLWv_qf6.js} +1 -1
- package/dist/assets/{index-By2sHbGk.js → index-yOhbO3fy.js} +1 -1
- package/dist/assets/{index.es-BWSz-k0E.js → index.es-CaOIcY7v.js} +1 -1
- package/dist/assets/{insert-business-trip-modal-Bk-kugZI.js → insert-business-trip-modal-BwOnvw7X.js} +2 -2
- package/dist/assets/issue-document-CzBtBCCO.js +1 -0
- package/dist/assets/{list-plus-DINtfnSi.js → list-plus-CGvSlslE.js} +1 -1
- package/dist/assets/{login-page-DVwxXAvd.js → login-page-BTcklqv4.js} +1 -1
- package/dist/assets/{match-document-modal--iAusdTp.js → match-document-modal-DcL0siQq.js} +4 -4
- package/dist/assets/{missing-info-charges-CQNTClQ3.js → missing-info-charges-DfwRkzNe.js} +1 -1
- package/dist/assets/{modal-BzwJJ2TM.js → modal-B0uNLang.js} +1 -1
- package/dist/assets/{page-layout-NF77oib6.js → page-layout-C0GJoVTR.js} +1 -1
- package/dist/assets/{page-not-found-Cu_0zp5u.js → page-not-found-9UX5vsGE.js} +1 -1
- package/dist/assets/{panel-top-open-BApXXBMD.js → panel-top-open-BFNhAe3f.js} +1 -1
- package/dist/assets/{pencil-CLaFsm6E.js → pencil-9Th5X-OY.js} +1 -1
- package/dist/assets/{report-commentary-row-BGN_tI-P.js → report-commentary-row-CNIlhboC.js} +1 -1
- package/dist/assets/{save-DsE11_Et.js → save-qtyyZLc5.js} +1 -1
- package/dist/assets/{similar-transactions-modal-CoZU6FU3.js → similar-transactions-modal-nk8VHEtX.js} +1 -1
- package/dist/assets/sub-fkVv9ghZ.js +1 -0
- package/dist/assets/subMonths-5wFmciT1.js +1 -0
- package/dist/assets/{summary-BasZ3QlN.js → summary-DuWhfNdL.js} +1 -1
- package/dist/assets/{toggle-expansion-button-DPcDIe-2.js → toggle-expansion-button-41Ejffq3.js} +1 -1
- package/dist/assets/tooltip-lhMCop8U.js +1 -0
- package/dist/assets/{use-url-query-Bp_LkJaa.js → use-url-query-BPzyQB93.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/src/app.tsx +108 -0
- package/src/components/business/index.tsx +1 -31
- package/src/components/business/transactions-section.tsx +2 -24
- package/src/components/{business-ledger → business-transactions}/business-extended-info.tsx +27 -25
- package/src/components/{business-ledger/business-ledger-filters.tsx → business-transactions/business-transactions-filters.tsx} +12 -12
- package/src/components/{business-ledger/business-ledger-single.tsx → business-transactions/business-transactions-single.tsx} +13 -13
- package/src/components/{business-ledger → business-transactions}/download-csv.tsx +25 -25
- package/src/components/{business-ledger → business-transactions}/index.tsx +15 -15
- package/src/components/charges/charge-extended-info.tsx +4 -45
- package/src/components/layout/sidelinks.tsx +2 -2
- package/src/components/ledger-table/columns.tsx +4 -4
- package/src/components/ledger-table/index.tsx +181 -152
- 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 +21 -56
- package/src/gql/gql.ts +12 -30
- package/src/gql/graphql.ts +406 -181
- package/src/providers/index.ts +4 -0
- package/src/router/config.tsx +14 -14
- package/src/router/routes.ts +2 -2
- package/dist/assets/business-extended-info-vAiMQKwm.js +0 -13
- package/dist/assets/business-ledger-filters-CNjRVS0K.js +0 -1
- package/dist/assets/business-ledger-single-BrattJvc.js +0 -1
- package/dist/assets/business-trip-DZqft86E.js +0 -1
- package/dist/assets/charges-table--gOKotyF.js +0 -62
- package/dist/assets/download-csv-button-B0eh9bzg.js +0 -1
- package/dist/assets/index-B05N38w4.js +0 -6
- package/dist/assets/index-BS5IhG6A.js +0 -1
- package/dist/assets/index-Ci8Rcu9T.js +0 -1
- package/dist/assets/issue-document-BcWeUsrG.js +0 -1
- package/dist/assets/sub-DLRNYZyc.js +0 -1
- package/dist/assets/subMonths-Bc9skHhr.js +0 -1
- package/dist/assets/tooltip-CICdw5IX.js +0 -1
- package/src/components/business/balance-section.tsx +0 -26
- package/src/components/business/ledger-section.tsx +0 -49
- package/src/providers/index.tsx +0 -56
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{v as fn,gp as te,fG as R,fE as ye,gq as Re,gr as hn,j as i,T as ut,bS as ft,R as ht,B as H,m as E,bQ as mn,gs as yn,e6 as gn,u as mt,gt as pn,G as yt,r as S,cO as gt,d as vn,V as pt,e7 as xn,X as se,Y as re,Z as oe,am as bn,_ as he,an as Dn,ao as kn,ap as Mn,ar as wn,a0 as ie,bq as vt,x as le,ah as Cn,a5 as Sn,g as On,gu as Nn,t as Te,i as jn,L as Tn,al as Qe,bp as Je,bK as Wn,br as En,gv as _n,I as xt,gw as In,gx as Fn,fF as Yn,gy as Bn,gz as Pn,gA as An,gB as Rn,gC as zn,gD as qn,gE as Hn,gF as bt,ab as m,gG as $n,gH as Zn,dn as ne,gI as Xe,gJ as Un,gK as Kn,a_ as Ln,gL as Gn,dv as Vn,ec as Qn,ed as Jn,gM as Xn,D as es,aO as ts,z as ns,aP as ss,aQ as rs,cu as os,bo as as,cp as is,q as cs,e as ls,dm as ae,fB as ds,J as us,fo as fs,cQ as hs,d3 as ms,d5 as ys,cT as gs,cU as ps,cV as We,cW as vs,cX as et,cY as xs,cZ as tt}from"./index-B2_EbsaK.js";import{u as qe,S as bs}from"./similar-transactions-modal-nk8VHEtX.js";import{a as Dt}from"./addDays-DGlDD_vj.js";import{L as Ds}from"./list-plus-CGvSlslE.js";import{T as ks}from"./tooltip-lhMCop8U.js";/**
|
|
2
|
+
* @license lucide-react v0.548.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const Ms=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],ws=fn("external-link",Ms);function Cs(e,t,s){return Dt(e,t*7,s)}function Ss(e,t){let s,n=t?.in;return e.forEach(r=>{!n&&typeof r=="object"&&(n=te.bind(null,r));const a=R(r,n);(!s||s<a||isNaN(+a))&&(s=a)}),te(n,s||NaN)}function Os(e,t){let s,n=t?.in;return e.forEach(r=>{!n&&typeof r=="object"&&(n=te.bind(null,r));const a=R(r,n);(!s||s>a||isNaN(+a))&&(s=a)}),te(n,s||NaN)}function Ns(e,t,s){const[n,r]=ye(s?.in,e,t);return+Re(n)==+Re(r)}function js(e,t,s){const[n,r]=ye(s?.in,e,t),a=n.getFullYear()-r.getFullYear(),c=n.getMonth()-r.getMonth();return a*12+c}function Ts(e,t){const s=R(e,t?.in),n=s.getMonth();return s.setFullYear(s.getFullYear(),n+1,0),s.setHours(23,59,59,999),s}function kt(e,t){const[s,n]=ye(e,t.start,t.end);return{start:s,end:n}}function Ws(e,t){const{start:s,end:n}=kt(t?.in,e);let r=+s>+n;const a=r?+s:+n,c=r?n:s;c.setHours(0,0,0,0),c.setDate(1);let o=1;const l=[];for(;+c<=a;)l.push(te(s,c)),c.setMonth(c.getMonth()+o);return r?l.reverse():l}function Es(e,t){const s=R(e,t?.in);return s.setDate(1),s.setHours(0,0,0,0),s}function _s(e,t){const{start:s,end:n}=kt(t?.in,e);let r=+s>+n;const a=r?+s:+n,c=r?n:s;c.setHours(0,0,0,0),c.setMonth(0,1);let o=1;const l=[];for(;+c<=a;)l.push(te(s,c)),c.setFullYear(c.getFullYear()+o);return r?l.reverse():l}function Mt(e,t){const s=hn(),n=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??s.weekStartsOn??s.locale?.options?.weekStartsOn??0,r=R(e,t?.in),a=r.getDay(),c=(a<n?-7:0)+6-(a-n);return r.setDate(r.getDate()+c),r.setHours(23,59,59,999),r}function Is(e,t){return Mt(e,{...t,weekStartsOn:1})}function Fs(e,t){const s=R(e,t?.in),n=s.getFullYear(),r=s.getMonth(),a=te(s,0);return a.setFullYear(n,r+1,0),a.setHours(0,0,0,0),a.getDate()}function Ys(e,t){return R(e,t?.in).getMonth()}function Bs(e,t){return R(e,t?.in).getFullYear()}function Ps(e,t){return+R(e)>+R(t)}function As(e,t){return+R(e)<+R(t)}function Rs(e,t,s){const[n,r]=ye(s?.in,e,t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function zs(e,t,s){const[n,r]=ye(s?.in,e,t);return n.getFullYear()===r.getFullYear()}function qs(e,t,s){const n=R(e,s?.in),r=n.getFullYear(),a=n.getDate(),c=te(e,0);c.setFullYear(r,t,15),c.setHours(0,0,0,0);const o=Fs(c);return n.setMonth(t,Math.min(a,o)),n}function Hs(e,t,s){const n=R(e,s?.in);return isNaN(+n)?te(e,NaN):(n.setFullYear(t),n)}function $s(e){return i.jsx(ut,{label:"To Charge",children:i.jsx(ft,{to:ht.CHARGES.DETAIL(e.chargeId),target:"_blank",rel:"noreferrer",onClick:t=>t.stopPropagation(),className:"inline-block",children:i.jsx(H,{...e,className:E("size-7.5",e.className),variant:"ghost",children:i.jsx(ws,{className:"size-5"})})})})}function Zs({transactionId:e}){const{updateTransaction:t}=qe();function s(){t({transactionId:e,fields:{chargeId:gn}})}return i.jsx(mn,{onConfirm:s,title:"Are you sure you want to unlink this transaction from the charge?",children:i.jsx(H,{variant:"ghost",size:"icon",className:"size-7.5",children:i.jsx(yn,{className:"size-5"})})})}const Us=({transactionID:e,onDone:t,onChange:s})=>{const[{data:n,fetching:r}]=mt({query:pn,variables:{transactionIDs:[e]}}),a=n?.transactionsByIDs?.[0],c=yt({defaultValues:a??{}});S.useEffect(()=>{a&&c.reset(a)},[a,c]);const{control:o,handleSubmit:l,formState:{dirtyFields:d}}=c,{updateTransaction:f,fetching:u}=qe(),h=x=>{if(!a)return;const g=Sn(x,d);t?.(),g&&Object.keys(g).length>0&&f({transactionId:a.id,fields:g}).then(s)},{selectableFinancialEntities:y,fetching:C}=gt();return i.jsxs(i.Fragment,{children:[r&&i.jsx(vn,{className:"flex self-center my-5",color:"dark",size:"xl",variant:"dots"}),!r&&a&&i.jsx(pt,{...c,children:i.jsxs("form",{onSubmit:l(h),children:[i.jsx("div",{className:"flex-row px-10 h-max justify-start block",children:i.jsxs(xn,{cols:3,children:[i.jsx(se,{name:"counterpartyId",control:o,defaultValue:a.counterparty?.id,rules:{minLength:{value:2,message:"Minimum 2 characters"}},render:({field:x})=>i.jsxs(re,{children:[i.jsx(oe,{children:"Counterparty"}),i.jsxs(bn,{onValueChange:x.onChange,value:x.value??void 0,disabled:C,children:[i.jsx(he,{children:i.jsx(Dn,{className:"w-full truncate",children:i.jsx(kn,{placeholder:"Scroll to see all options"})})}),i.jsx(Mn,{onClick:g=>g.stopPropagation(),children:y.map(({value:g,label:k})=>i.jsx(wn,{value:g,children:k},g))})]}),i.jsx(ie,{})]})}),a?.account.__typename==="CardFinancialAccount"?i.jsx(se,{name:"effectiveDate",control:o,rules:{pattern:{value:vt,message:"Date must be im format yyyy-mm-dd"}},render:({field:x})=>i.jsxs(re,{children:[i.jsx(oe,{children:"Effective Date"}),i.jsx(he,{children:i.jsx(Bo,{...x,onChange:g=>{const k=g?le(g,"yyyy-MM-dd"):void 0;k!==x.value&&x.onChange(k)},value:x.value?new Date(x.value):void 0})}),i.jsx(ie,{})]})}):i.jsx(i.Fragment,{}),i.jsx(se,{name:"isFee",control:o,defaultValue:a.isFee,render:({field:x})=>i.jsxs(re,{className:"flex flex-row items-center justify-between rounded-lg border p-3 shadow-sm",children:[i.jsx("div",{className:"space-y-0.5",children:i.jsx(oe,{children:"Fee Transaction"})}),i.jsx(he,{children:i.jsx(Cn,{checked:x.value===!0,onCheckedChange:x.onChange})})]})})]})}),i.jsxs("div",{className:"mt-10 mb-5 flex justify-center gap-5",children:[i.jsx("button",{type:"submit",onClick:()=>l(h),className:"mt-8 text-white bg-indigo-500 border-0 py-2 px-8 focus:outline-hidden hover:bg-indigo-600 rounded-sm text-lg",disabled:u||Object.keys(d).length===0,children:"Accept"}),i.jsx("button",{type:"button",className:"mt-8 text-white bg-rose-500 border-0 py-2 px-8 focus:outline-hidden hover:bg-rose-600 rounded-sm text-lg",onClick:t,children:"Cancel"})]})]})})]})},Ks="insertMiscExpense",Ls=()=>{const[{fetching:e},t]=On(Nn),s=S.useCallback(async n=>{const r="Error creating misc expense",a=`${Ks}-${n.chargeId}`;Te.loading("Creating misc expense",{id:a});try{const c=await t(n),o=jn(c,r,a);if(o)return Te.success("Success",{id:a,description:"Misc expense was created"}),o.insertMiscExpense}catch(c){console.error(`${r}: ${c}`),Te.error("Error",{id:a,description:r,duration:1e5,closeButton:!0})}},[t]);return{fetching:e,insertMiscExpense:s}},Gs=({onDone:e,defaultValues:t={},chargeId:s})=>{const{insertMiscExpense:n,fetching:r}=Ls(),a=S.useCallback(async c=>{await n({chargeId:s,fields:c}),e()},[n,s,e]);return i.jsx(Vs,{defaultValues:t,onInsertDone:a,fetching:r})},Vs=({onInsertDone:e,defaultValues:t,fetching:s})=>{const n=o=>{o&&Object.keys(o).length>0&&e(o)},r=yt({defaultValues:{...t}}),{handleSubmit:a,formState:{dirtyFields:c}}=r;return i.jsx(pt,{...r,children:i.jsx("form",{onSubmit:a(n),noValidate:!0,children:i.jsxs("div",{className:"px-5 flex flex-col gap-5 relative",children:[s&&i.jsx("div",{className:"absolute bg-white/60 z-10 h-full w-full flex items-center justify-center",children:i.jsx("div",{className:"flex items-center",children:i.jsx("span",{className:"text-3xl mr-4",children:i.jsx(Tn,{className:"h-10 w-10 animate-spin mr-2 self-center"})})})}),i.jsx(Qs,{formManager:r,isInsert:!0}),i.jsx("div",{className:"flex justify-right gap-5 mt-5",children:i.jsx("button",{type:"submit",className:"text-white bg-indigo-500 border-0 py-2 px-8 focus:outline-hidden hover:bg-indigo-600 rounded-sm text-lg",disabled:s||Object.keys(c).length===0,children:"Accept"})})]})})})},Qs=({formManager:e,isInsert:t})=>{const{control:s,setValue:n}=e,{selectableFinancialEntities:r,fetching:a}=gt();return i.jsxs(i.Fragment,{children:[i.jsx(se,{name:"creditorId",control:s,rules:{required:t?"Required":void 0},render:({field:c})=>i.jsxs(re,{children:[i.jsx(oe,{children:"Creditor"}),i.jsx(Qe,{...c,data:r,value:c.value??void 0,disabled:a,placeholder:"Select creditor",formPart:!0}),i.jsx(ie,{})]})}),i.jsx(se,{name:"debtorId",control:s,rules:{required:t?"Required":void 0},render:({field:c})=>i.jsxs(re,{children:[i.jsx(oe,{children:"Debtor"}),i.jsx(Qe,{...c,data:r,value:c.value??void 0,disabled:a,placeholder:"Select debtor",formPart:!0}),i.jsx(ie,{})]})}),i.jsx(Je,{name:"amount",control:s,rules:{required:t?"Required":void 0},render:({field:c,fieldState:o})=>i.jsx(Je,{name:"currency",control:s,rules:{required:t?"Required":void 0},render:({field:l,fieldState:d})=>i.jsx(Wn,{...c,required:t,value:c.value??void 0,error:o.error?.message||d.error?.message,label:"Amount",currencyCodeProps:{...l,required:t,label:"Currency"}})})}),i.jsx(se,{name:"invoiceDate",control:s,rules:{...t?{required:"Required"}:{},pattern:{value:vt,message:"Date must be im format yyyy-mm-dd"}},render:({field:c})=>{const o=c.value?new Date(c.value):void 0;return i.jsxs(re,{children:[i.jsx(oe,{children:"Invoice Date"}),i.jsx(he,{children:i.jsx(En,{...c,required:t,onChange:l=>{const d=l?typeof l=="string"?l:le(l,"yyyy-MM-dd"):void 0;d!==c.value&&(n("invoiceDate",d),c.onChange(d))},value:o,valueFormat:"DD/MM/YYYY"})}),i.jsx(ie,{})]})}}),i.jsx(se,{name:"valueDate",control:s,rules:{...t?{required:"Required"}:{},validate:c=>c?!Number.isNaN(c.getTime())||"Invalid date and time format":!0},render:({field:c})=>i.jsxs(re,{children:[i.jsx(oe,{children:"Value Date"}),i.jsx(he,{children:i.jsx(_n,{...c,onChange:o=>{n("valueDate",o),c.onChange(o)},onPointerEnterCapture:()=>{},onPointerLeaveCapture:()=>{},required:t,placeholder:"Pick date and time",valueFormat:"DD/MM/YYYY HH:mm:ss",withSeconds:!0})}),i.jsx(ie,{})]})}),i.jsx(se,{name:"description",control:s,rules:{required:t?"Required":void 0},render:({field:c})=>i.jsxs(re,{children:[i.jsx(oe,{children:"Description"}),i.jsx(he,{children:i.jsx(xt,{...c,required:t,value:c.value??void 0})}),i.jsx(ie,{})]})})]})};function Js(e,t,s="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:e,timeZoneName:s}).format(t).split(/\s/g).slice(2).join(" ")}const Xs={},me={};function ce(e,t){try{const n=(Xs[e]||=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format)(t).split("GMT")[1];return n in me?me[n]:nt(n,n.split(":"))}catch{if(e in me)return me[e];const s=e?.match(er);return s?nt(e,s.slice(1)):NaN}}const er=/([+-]\d\d):?(\d\d)?/;function nt(e,t){const s=+(t[0]||0),n=+(t[1]||0),r=+(t[2]||0)/60;return me[e]=s*60+n>0?s*60+n+r:s*60-n-r}class V extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(ce(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),wt(this),ze(this)):this.setTime(Date.now())}static tz(t,...s){return s.length?new V(...s,t):new V(Date.now(),t)}withTimeZone(t){return new V(+this,t)}getTimezoneOffset(){const t=-ce(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),ze(this),+this}[Symbol.for("constructDateFrom")](t){return new V(+new Date(t),this.timeZone)}}const st=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!st.test(e))return;const t=e.replace(st,"$1UTC");V.prototype[t]&&(e.startsWith("get")?V.prototype[e]=function(){return this.internal[t]()}:(V.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),tr(this),+this},V.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),ze(this),+this}))});function ze(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-ce(e.timeZone,e)*60))}function tr(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),wt(e)}function wt(e){const t=ce(e.timeZone,e),s=t>0?Math.floor(t):Math.ceil(t),n=new Date(+e);n.setUTCHours(n.getUTCHours()-1);const r=-new Date(+e).getTimezoneOffset(),a=-new Date(+n).getTimezoneOffset(),c=r-a,o=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();c&&o&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+c);const l=r-s;l&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+l);const d=new Date(+e);d.setUTCSeconds(0);const f=r>0?d.getSeconds():(d.getSeconds()-60)%60,u=Math.round(-(ce(e.timeZone,e)*60))%60;(u||f)&&(e.internal.setUTCSeconds(e.internal.getUTCSeconds()+u),Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+u+f));const h=ce(e.timeZone,e),y=h>0?Math.floor(h):Math.ceil(h),x=-new Date(+e).getTimezoneOffset()-y,g=y!==s,k=x-l;if(g&&k){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+k);const T=ce(e.timeZone,e),b=T>0?Math.floor(T):Math.ceil(T),j=y-b;j&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+j),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+j))}}class B extends V{static tz(t,...s){return s.length?new B(...s,t):new B(Date.now(),t)}toISOString(){const[t,s,n]=this.tzComponents(),r=`${t}${s}:${n}`;return this.internal.toISOString().slice(0,-1)+r}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,s,n,r]=this.internal.toUTCString().split(" ");return`${t?.slice(0,-1)} ${n} ${s} ${r}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[s,n,r]=this.tzComponents();return`${t} GMT${s}${n}${r} (${Js(this.timeZone,this)})`}toLocaleString(t,s){return Date.prototype.toLocaleString.call(this,t,{...s,timeZone:s?.timeZone||this.timeZone})}toLocaleDateString(t,s){return Date.prototype.toLocaleDateString.call(this,t,{...s,timeZone:s?.timeZone||this.timeZone})}toLocaleTimeString(t,s){return Date.prototype.toLocaleTimeString.call(this,t,{...s,timeZone:s?.timeZone||this.timeZone})}tzComponents(){const t=this.getTimezoneOffset(),s=t>0?"-":"+",n=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),r=String(Math.abs(t)%60).padStart(2,"0");return[s,n,r]}withTimeZone(t){return new B(+this,t)}[Symbol.for("constructDateFrom")](t){return new B(+new Date(t),this.timeZone)}}const rt=5,nr=4;function sr(e,t){const s=t.startOfMonth(e),n=s.getDay()>0?s.getDay():7,r=t.addDays(e,-n+1),a=t.addDays(r,rt*7-1);return t.getMonth(e)===t.getMonth(a)?rt:nr}function Ct(e,t){const s=t.startOfMonth(e),n=s.getDay();return n===1?s:n===0?t.addDays(s,-6):t.addDays(s,-1*(n-1))}function rr(e,t){const s=Ct(e,t),n=sr(e,t);return t.addDays(s,n*7-1)}class ${constructor(t,s){this.Date=Date,this.today=()=>this.overrides?.today?this.overrides.today():this.options.timeZone?B.tz(this.options.timeZone):new this.Date,this.newDate=(n,r,a)=>this.overrides?.newDate?this.overrides.newDate(n,r,a):this.options.timeZone?new B(n,r,a,this.options.timeZone):new Date(n,r,a),this.addDays=(n,r)=>this.overrides?.addDays?this.overrides.addDays(n,r):Dt(n,r),this.addMonths=(n,r)=>this.overrides?.addMonths?this.overrides.addMonths(n,r):In(n,r),this.addWeeks=(n,r)=>this.overrides?.addWeeks?this.overrides.addWeeks(n,r):Cs(n,r),this.addYears=(n,r)=>this.overrides?.addYears?this.overrides.addYears(n,r):Fn(n,r),this.differenceInCalendarDays=(n,r)=>this.overrides?.differenceInCalendarDays?this.overrides.differenceInCalendarDays(n,r):Yn(n,r),this.differenceInCalendarMonths=(n,r)=>this.overrides?.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(n,r):js(n,r),this.eachMonthOfInterval=n=>this.overrides?.eachMonthOfInterval?this.overrides.eachMonthOfInterval(n):Ws(n),this.eachYearOfInterval=n=>{const r=this.overrides?.eachYearOfInterval?this.overrides.eachYearOfInterval(n):_s(n),a=new Set(r.map(o=>this.getYear(o)));if(a.size===r.length)return r;const c=[];return a.forEach(o=>{c.push(new Date(o,0,1))}),c},this.endOfBroadcastWeek=n=>this.overrides?.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(n):rr(n,this),this.endOfISOWeek=n=>this.overrides?.endOfISOWeek?this.overrides.endOfISOWeek(n):Is(n),this.endOfMonth=n=>this.overrides?.endOfMonth?this.overrides.endOfMonth(n):Ts(n),this.endOfWeek=(n,r)=>this.overrides?.endOfWeek?this.overrides.endOfWeek(n,r):Mt(n,this.options),this.endOfYear=n=>this.overrides?.endOfYear?this.overrides.endOfYear(n):Bn(n),this.format=(n,r,a)=>{const c=this.overrides?.format?this.overrides.format(n,r,this.options):le(n,r,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(c):c},this.getISOWeek=n=>this.overrides?.getISOWeek?this.overrides.getISOWeek(n):Pn(n),this.getMonth=(n,r)=>this.overrides?.getMonth?this.overrides.getMonth(n,this.options):Ys(n,this.options),this.getYear=(n,r)=>this.overrides?.getYear?this.overrides.getYear(n,this.options):Bs(n,this.options),this.getWeek=(n,r)=>this.overrides?.getWeek?this.overrides.getWeek(n,this.options):An(n,this.options),this.isAfter=(n,r)=>this.overrides?.isAfter?this.overrides.isAfter(n,r):Ps(n,r),this.isBefore=(n,r)=>this.overrides?.isBefore?this.overrides.isBefore(n,r):As(n,r),this.isDate=n=>this.overrides?.isDate?this.overrides.isDate(n):Rn(n),this.isSameDay=(n,r)=>this.overrides?.isSameDay?this.overrides.isSameDay(n,r):Ns(n,r),this.isSameMonth=(n,r)=>this.overrides?.isSameMonth?this.overrides.isSameMonth(n,r):Rs(n,r),this.isSameYear=(n,r)=>this.overrides?.isSameYear?this.overrides.isSameYear(n,r):zs(n,r),this.max=n=>this.overrides?.max?this.overrides.max(n):Ss(n),this.min=n=>this.overrides?.min?this.overrides.min(n):Os(n),this.setMonth=(n,r)=>this.overrides?.setMonth?this.overrides.setMonth(n,r):qs(n,r),this.setYear=(n,r)=>this.overrides?.setYear?this.overrides.setYear(n,r):Hs(n,r),this.startOfBroadcastWeek=(n,r)=>this.overrides?.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(n,this):Ct(n,this),this.startOfDay=n=>this.overrides?.startOfDay?this.overrides.startOfDay(n):Re(n),this.startOfISOWeek=n=>this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(n):zn(n),this.startOfMonth=n=>this.overrides?.startOfMonth?this.overrides.startOfMonth(n):Es(n),this.startOfWeek=(n,r)=>this.overrides?.startOfWeek?this.overrides.startOfWeek(n,this.options):qn(n,this.options),this.startOfYear=n=>this.overrides?.startOfYear?this.overrides.startOfYear(n):Hn(n),this.options={locale:bt,...t},this.overrides=s}getDigitMap(){const{numerals:t="latn"}=this.options,s=new Intl.NumberFormat("en-US",{numberingSystem:t}),n={};for(let r=0;r<10;r++)n[r.toString()]=s.format(r);return n}replaceDigits(t){const s=this.getDigitMap();return t.replace(/\d/g,n=>s[n]||n)}formatNumber(t){return this.replaceDigits(t.toString())}getMonthYearOrder(){const t=this.options.locale?.code;return t&&$.yearFirstLocales.has(t)?"year-first":"month-first"}formatMonthYear(t){const{locale:s,timeZone:n,numerals:r}=this.options,a=s?.code;if(a&&$.yearFirstLocales.has(a))try{return new Intl.DateTimeFormat(a,{month:"long",year:"numeric",timeZone:n,numberingSystem:r}).format(t)}catch{}const c=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(t,c)}}$.yearFirstLocales=new Set(["eu","hu","ja","ja-Hira","ja-JP","ko","ko-KR","lt","lt-LT","lv","lv-LV","mn","mn-MN","zh","zh-CN","zh-HK","zh-TW"]);const Q=new $;class St{constructor(t,s,n=Q){this.date=t,this.displayMonth=s,this.outside=!!(s&&!n.isSameMonth(t,s)),this.dateLib=n}isEqualTo(t){return this.dateLib.isSameDay(t.date,this.date)&&this.dateLib.isSameMonth(t.displayMonth,this.displayMonth)}}class or{constructor(t,s){this.date=t,this.weeks=s}}class ar{constructor(t,s){this.days=s,this.weekNumber=t}}function ir(e){return m.createElement("button",{...e})}function cr(e){return m.createElement("span",{...e})}function lr(e){const{size:t=24,orientation:s="left",className:n}=e;return m.createElement("svg",{className:n,width:t,height:t,viewBox:"0 0 24 24"},s==="up"&&m.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),s==="down"&&m.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),s==="left"&&m.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),s==="right"&&m.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function dr(e){const{day:t,modifiers:s,...n}=e;return m.createElement("td",{...n})}function ur(e){const{day:t,modifiers:s,...n}=e,r=m.useRef(null);return m.useEffect(()=>{s.focused&&r.current?.focus()},[s.focused]),m.createElement("button",{ref:r,...n})}var p;(function(e){e.Root="root",e.Chevron="chevron",e.Day="day",e.DayButton="day_button",e.CaptionLabel="caption_label",e.Dropdowns="dropdowns",e.Dropdown="dropdown",e.DropdownRoot="dropdown_root",e.Footer="footer",e.MonthGrid="month_grid",e.MonthCaption="month_caption",e.MonthsDropdown="months_dropdown",e.Month="month",e.Months="months",e.Nav="nav",e.NextMonthButton="button_next",e.PreviousMonthButton="button_previous",e.Week="week",e.Weeks="weeks",e.Weekday="weekday",e.Weekdays="weekdays",e.WeekNumber="week_number",e.WeekNumberHeader="week_number_header",e.YearsDropdown="years_dropdown"})(p||(p={}));var F;(function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"})(F||(F={}));var L;(function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"})(L||(L={}));var q;(function(e){e.weeks_before_enter="weeks_before_enter",e.weeks_before_exit="weeks_before_exit",e.weeks_after_enter="weeks_after_enter",e.weeks_after_exit="weeks_after_exit",e.caption_after_enter="caption_after_enter",e.caption_after_exit="caption_after_exit",e.caption_before_enter="caption_before_enter",e.caption_before_exit="caption_before_exit"})(q||(q={}));function fr(e){const{options:t,className:s,components:n,classNames:r,...a}=e,c=[r[p.Dropdown],s].join(" "),o=t?.find(({value:l})=>l===a.value);return m.createElement("span",{"data-disabled":a.disabled,className:r[p.DropdownRoot]},m.createElement(n.Select,{className:c,...a},t?.map(({value:l,label:d,disabled:f})=>m.createElement(n.Option,{key:l,value:l,disabled:f},d))),m.createElement("span",{className:r[p.CaptionLabel],"aria-hidden":!0},o?.label,m.createElement(n.Chevron,{orientation:"down",size:18,className:r[p.Chevron]})))}function hr(e){return m.createElement("div",{...e})}function mr(e){return m.createElement("div",{...e})}function yr(e){const{calendarMonth:t,displayIndex:s,...n}=e;return m.createElement("div",{...n},e.children)}function gr(e){const{calendarMonth:t,displayIndex:s,...n}=e;return m.createElement("div",{...n})}function pr(e){return m.createElement("table",{...e})}function vr(e){return m.createElement("div",{...e})}const Ot=S.createContext(void 0);function ge(){const e=S.useContext(Ot);if(e===void 0)throw new Error("useDayPicker() must be used within a custom component.");return e}function xr(e){const{components:t}=ge();return m.createElement(t.Dropdown,{...e})}function br(e){const{onPreviousClick:t,onNextClick:s,previousMonth:n,nextMonth:r,...a}=e,{components:c,classNames:o,labels:{labelPrevious:l,labelNext:d}}=ge(),f=S.useCallback(h=>{r&&s?.(h)},[r,s]),u=S.useCallback(h=>{n&&t?.(h)},[n,t]);return m.createElement("nav",{...a},m.createElement(c.PreviousMonthButton,{type:"button",className:o[p.PreviousMonthButton],tabIndex:n?void 0:-1,"aria-disabled":n?void 0:!0,"aria-label":l(n),onClick:u},m.createElement(c.Chevron,{disabled:n?void 0:!0,className:o[p.Chevron],orientation:"left"})),m.createElement(c.NextMonthButton,{type:"button",className:o[p.NextMonthButton],tabIndex:r?void 0:-1,"aria-disabled":r?void 0:!0,"aria-label":d(r),onClick:f},m.createElement(c.Chevron,{disabled:r?void 0:!0,orientation:"right",className:o[p.Chevron]})))}function Dr(e){const{components:t}=ge();return m.createElement(t.Button,{...e})}function kr(e){return m.createElement("option",{...e})}function Mr(e){const{components:t}=ge();return m.createElement(t.Button,{...e})}function wr(e){const{rootRef:t,...s}=e;return m.createElement("div",{...s,ref:t})}function Cr(e){return m.createElement("select",{...e})}function Sr(e){const{week:t,...s}=e;return m.createElement("tr",{...s})}function Or(e){return m.createElement("th",{...e})}function Nr(e){return m.createElement("thead",{"aria-hidden":!0},m.createElement("tr",{...e}))}function jr(e){const{week:t,...s}=e;return m.createElement("th",{...s})}function Tr(e){return m.createElement("th",{...e})}function Wr(e){return m.createElement("tbody",{...e})}function Er(e){const{components:t}=ge();return m.createElement(t.Dropdown,{...e})}const _r=Object.freeze(Object.defineProperty({__proto__:null,Button:ir,CaptionLabel:cr,Chevron:lr,Day:dr,DayButton:ur,Dropdown:fr,DropdownNav:hr,Footer:mr,Month:yr,MonthCaption:gr,MonthGrid:pr,Months:vr,MonthsDropdown:xr,Nav:br,NextMonthButton:Dr,Option:kr,PreviousMonthButton:Mr,Root:wr,Select:Cr,Week:Sr,WeekNumber:jr,WeekNumberHeader:Tr,Weekday:Or,Weekdays:Nr,Weeks:Wr,YearsDropdown:Er},Symbol.toStringTag,{value:"Module"}));function X(e,t,s=!1,n=Q){let{from:r,to:a}=e;const{differenceInCalendarDays:c,isSameDay:o}=n;return r&&a?(c(a,r)<0&&([r,a]=[a,r]),c(t,r)>=(s?1:0)&&c(a,t)>=(s?1:0)):!s&&a?o(a,t):!s&&r?o(r,t):!1}function Nt(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function He(e){return!!(e&&typeof e=="object"&&"from"in e)}function jt(e){return!!(e&&typeof e=="object"&&"after"in e)}function Tt(e){return!!(e&&typeof e=="object"&&"before"in e)}function Wt(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function Et(e,t){return Array.isArray(e)&&e.every(t.isDate)}function ee(e,t,s=Q){const n=Array.isArray(t)?t:[t],{isSameDay:r,differenceInCalendarDays:a,isAfter:c}=s;return n.some(o=>{if(typeof o=="boolean")return o;if(s.isDate(o))return r(e,o);if(Et(o,s))return o.includes(e);if(He(o))return X(o,e,!1,s);if(Wt(o))return Array.isArray(o.dayOfWeek)?o.dayOfWeek.includes(e.getDay()):o.dayOfWeek===e.getDay();if(Nt(o)){const l=a(o.before,e),d=a(o.after,e),f=l>0,u=d<0;return c(o.before,o.after)?u&&f:f||u}return jt(o)?a(e,o.after)>0:Tt(o)?a(o.before,e)>0:typeof o=="function"?o(e):!1})}function Ir(e,t,s,n,r){const{disabled:a,hidden:c,modifiers:o,showOutsideDays:l,broadcastCalendar:d,today:f}=t,{isSameDay:u,isSameMonth:h,startOfMonth:y,isBefore:C,endOfMonth:x,isAfter:g}=r,k=s&&y(s),T=n&&x(n),b={[F.focused]:[],[F.outside]:[],[F.disabled]:[],[F.hidden]:[],[F.today]:[]},j={};for(const v of e){const{date:D,displayMonth:M}=v,N=!!(M&&!h(D,M)),Y=!!(k&&C(D,k)),P=!!(T&&g(D,T)),A=!!(a&&ee(D,a,r)),Z=!!(c&&ee(D,c,r))||Y||P||!d&&!l&&N||d&&l===!1&&N,de=u(D,f??r.today());N&&b.outside.push(v),A&&b.disabled.push(v),Z&&b.hidden.push(v),de&&b.today.push(v),o&&Object.keys(o).forEach(ue=>{const fe=o?.[ue];fe&&ee(D,fe,r)&&(j[ue]?j[ue].push(v):j[ue]=[v])})}return v=>{const D={[F.focused]:!1,[F.disabled]:!1,[F.hidden]:!1,[F.outside]:!1,[F.today]:!1},M={};for(const N in b){const Y=b[N];D[N]=Y.some(P=>P===v)}for(const N in j)M[N]=j[N].some(Y=>Y===v);return{...D,...M}}}function Fr(e,t,s={}){return Object.entries(e).filter(([,r])=>r===!0).reduce((r,[a])=>(s[a]?r.push(s[a]):t[F[a]]?r.push(t[F[a]]):t[L[a]]&&r.push(t[L[a]]),r),[t[p.Day]])}function Yr(e){return{..._r,...e}}function Br(e){const t={"data-mode":e.mode??void 0,"data-required":"required"in e?e.required:void 0,"data-multiple-months":e.numberOfMonths&&e.numberOfMonths>1||void 0,"data-week-numbers":e.showWeekNumber||void 0,"data-broadcast-calendar":e.broadcastCalendar||void 0,"data-nav-layout":e.navLayout||void 0};return Object.entries(e).forEach(([s,n])=>{s.startsWith("data-")&&(t[s]=n)}),t}function $e(){const e={};for(const t in p)e[p[t]]=`rdp-${p[t]}`;for(const t in F)e[F[t]]=`rdp-${F[t]}`;for(const t in L)e[L[t]]=`rdp-${L[t]}`;for(const t in q)e[q[t]]=`rdp-${q[t]}`;return e}function _t(e,t,s){return(s??new $(t)).formatMonthYear(e)}const Pr=_t;function Ar(e,t,s){return(s??new $(t)).format(e,"d")}function Rr(e,t=Q){return t.format(e,"LLLL")}function zr(e,t,s){return(s??new $(t)).format(e,"cccccc")}function qr(e,t=Q){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function Hr(){return""}function It(e,t=Q){return t.format(e,"yyyy")}const $r=It,Zr=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:_t,formatDay:Ar,formatMonthCaption:Pr,formatMonthDropdown:Rr,formatWeekNumber:qr,formatWeekNumberHeader:Hr,formatWeekdayName:zr,formatYearCaption:$r,formatYearDropdown:It},Symbol.toStringTag,{value:"Module"}));function Ur(e){return e?.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e?.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{...Zr,...e}}function Kr(e,t,s,n,r){const{startOfMonth:a,startOfYear:c,endOfYear:o,eachMonthOfInterval:l,getMonth:d}=r;return l({start:c(e),end:o(e)}).map(h=>{const y=n.formatMonthDropdown(h,r),C=d(h),x=t&&h<a(t)||s&&h>a(s)||!1;return{value:C,label:y,disabled:x}})}function Lr(e,t={},s={}){let n={...t?.[p.Day]};return Object.entries(e).filter(([,r])=>r===!0).forEach(([r])=>{n={...n,...s?.[r]}}),n}function Gr(e,t,s){const n=e.today(),r=t?e.startOfISOWeek(n):e.startOfWeek(n),a=[];for(let c=0;c<7;c++){const o=e.addDays(r,c);a.push(o)}return a}function Vr(e,t,s,n,r=!1){if(!e||!t)return;const{startOfYear:a,endOfYear:c,eachYearOfInterval:o,getYear:l}=n,d=a(e),f=c(t),u=o({start:d,end:f});return r&&u.reverse(),u.map(h=>{const y=s.formatYearDropdown(h,n);return{value:l(h),label:y,disabled:!1}})}function Ft(e,t,s,n){let r=(n??new $(s)).format(e,"PPPP");return t.today&&(r=`Today, ${r}`),t.selected&&(r=`${r}, selected`),r}const Qr=Ft;function Yt(e,t,s){return(s??new $(t)).formatMonthYear(e)}const Jr=Yt;function Xr(e,t,s,n){let r=(n??new $(s)).format(e,"PPPP");return t?.today&&(r=`Today, ${r}`),r}function eo(e){return"Choose the Month"}function to(){return""}function no(e){return"Go to the Next Month"}function so(e){return"Go to the Previous Month"}function ro(e,t,s){return(s??new $(t)).format(e,"cccc")}function oo(e,t){return`Week ${e}`}function ao(e){return"Week Number"}function io(e){return"Choose the Year"}const co=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:Jr,labelDay:Qr,labelDayButton:Ft,labelGrid:Yt,labelGridcell:Xr,labelMonthDropdown:eo,labelNav:to,labelNext:no,labelPrevious:so,labelWeekNumber:oo,labelWeekNumberHeader:ao,labelWeekday:ro,labelYearDropdown:io},Symbol.toStringTag,{value:"Module"})),pe=e=>e instanceof HTMLElement?e:null,Ee=e=>[...e.querySelectorAll("[data-animated-month]")??[]],lo=e=>pe(e.querySelector("[data-animated-month]")),_e=e=>pe(e.querySelector("[data-animated-caption]")),Ie=e=>pe(e.querySelector("[data-animated-weeks]")),uo=e=>pe(e.querySelector("[data-animated-nav]")),fo=e=>pe(e.querySelector("[data-animated-weekdays]"));function ho(e,t,{classNames:s,months:n,focused:r,dateLib:a}){const c=S.useRef(null),o=S.useRef(n),l=S.useRef(!1);S.useLayoutEffect(()=>{const d=o.current;if(o.current=n,!t||!e.current||!(e.current instanceof HTMLElement)||n.length===0||d.length===0||n.length!==d.length)return;const f=a.isSameMonth(n[0].date,d[0].date),u=a.isAfter(n[0].date,d[0].date),h=u?s[q.caption_after_enter]:s[q.caption_before_enter],y=u?s[q.weeks_after_enter]:s[q.weeks_before_enter],C=c.current,x=e.current.cloneNode(!0);if(x instanceof HTMLElement?(Ee(x).forEach(b=>{if(!(b instanceof HTMLElement))return;const j=lo(b);j&&b.contains(j)&&b.removeChild(j);const v=_e(b);v&&v.classList.remove(h);const D=Ie(b);D&&D.classList.remove(y)}),c.current=x):c.current=null,l.current||f||r)return;const g=C instanceof HTMLElement?Ee(C):[],k=Ee(e.current);if(k?.every(T=>T instanceof HTMLElement)&&g&&g.every(T=>T instanceof HTMLElement)){l.current=!0,e.current.style.isolation="isolate";const T=uo(e.current);T&&(T.style.zIndex="1"),k.forEach((b,j)=>{const v=g[j];if(!v)return;b.style.position="relative",b.style.overflow="hidden";const D=_e(b);D&&D.classList.add(h);const M=Ie(b);M&&M.classList.add(y);const N=()=>{l.current=!1,e.current&&(e.current.style.isolation=""),T&&(T.style.zIndex=""),D&&D.classList.remove(h),M&&M.classList.remove(y),b.style.position="",b.style.overflow="",b.contains(v)&&b.removeChild(v)};v.style.pointerEvents="none",v.style.position="absolute",v.style.overflow="hidden",v.setAttribute("aria-hidden","true");const Y=fo(v);Y&&(Y.style.opacity="0");const P=_e(v);P&&(P.classList.add(u?s[q.caption_before_exit]:s[q.caption_after_exit]),P.addEventListener("animationend",N));const A=Ie(v);A&&A.classList.add(u?s[q.weeks_before_exit]:s[q.weeks_after_exit]),b.insertBefore(v,b.firstChild)})}})}function mo(e,t,s,n){const r=e[0],a=e[e.length-1],{ISOWeek:c,fixedWeeks:o,broadcastCalendar:l}=s??{},{addDays:d,differenceInCalendarDays:f,differenceInCalendarMonths:u,endOfBroadcastWeek:h,endOfISOWeek:y,endOfMonth:C,endOfWeek:x,isAfter:g,startOfBroadcastWeek:k,startOfISOWeek:T,startOfWeek:b}=n,j=l?k(r,n):c?T(r):b(r),v=l?h(a):c?y(C(a)):x(C(a)),D=f(v,j),M=u(a,r)+1,N=[];for(let A=0;A<=D;A++){const Z=d(j,A);if(t&&g(Z,t))break;N.push(Z)}const P=(l?35:42)*M;if(o&&N.length<P){const A=P-N.length;for(let Z=0;Z<A;Z++){const de=d(N[N.length-1],1);N.push(de)}}return N}function yo(e){const t=[];return e.reduce((s,n)=>{const r=n.weeks.reduce((a,c)=>a.concat(c.days.slice()),t.slice());return s.concat(r.slice())},t.slice())}function go(e,t,s,n){const{numberOfMonths:r=1}=s,a=[];for(let c=0;c<r;c++){const o=n.addMonths(e,c);if(t&&o>t)break;a.push(o)}return a}function ot(e,t,s,n){const{month:r,defaultMonth:a,today:c=n.today(),numberOfMonths:o=1}=e;let l=r||a||c;const{differenceInCalendarMonths:d,addMonths:f,startOfMonth:u}=n;if(s&&d(s,l)<o-1){const h=-1*(o-1);l=f(s,h)}return t&&d(l,t)<0&&(l=t),u(l)}function po(e,t,s,n){const{addDays:r,endOfBroadcastWeek:a,endOfISOWeek:c,endOfMonth:o,endOfWeek:l,getISOWeek:d,getWeek:f,startOfBroadcastWeek:u,startOfISOWeek:h,startOfWeek:y}=n,C=e.reduce((x,g)=>{const k=s.broadcastCalendar?u(g,n):s.ISOWeek?h(g):y(g),T=s.broadcastCalendar?a(g):s.ISOWeek?c(o(g)):l(o(g)),b=t.filter(M=>M>=k&&M<=T),j=s.broadcastCalendar?35:42;if(s.fixedWeeks&&b.length<j){const M=t.filter(N=>{const Y=j-b.length;return N>T&&N<=r(T,Y)});b.push(...M)}const v=b.reduce((M,N)=>{const Y=s.ISOWeek?d(N):f(N),P=M.find(Z=>Z.weekNumber===Y),A=new St(N,g,n);return P?P.days.push(A):M.push(new ar(Y,[A])),M},[]),D=new or(g,v);return x.push(D),x},[]);return s.reverseMonths?C.reverse():C}function vo(e,t){let{startMonth:s,endMonth:n}=e;const{startOfYear:r,startOfDay:a,startOfMonth:c,endOfMonth:o,addYears:l,endOfYear:d,newDate:f,today:u}=t,{fromYear:h,toYear:y,fromMonth:C,toMonth:x}=e;!s&&C&&(s=C),!s&&h&&(s=t.newDate(h,0,1)),!n&&x&&(n=x),!n&&y&&(n=f(y,11,31));const g=e.captionLayout==="dropdown"||e.captionLayout==="dropdown-years";return s?s=c(s):h?s=f(h,0,1):!s&&g&&(s=r(l(e.today??u(),-100))),n?n=o(n):y?n=f(y,11,31):!n&&g&&(n=d(e.today??u())),[s&&a(s),n&&a(n)]}function xo(e,t,s,n){if(s.disableNavigation)return;const{pagedNavigation:r,numberOfMonths:a=1}=s,{startOfMonth:c,addMonths:o,differenceInCalendarMonths:l}=n,d=r?a:1,f=c(e);if(!t)return o(f,d);if(!(l(t,e)<a))return o(f,d)}function bo(e,t,s,n){if(s.disableNavigation)return;const{pagedNavigation:r,numberOfMonths:a}=s,{startOfMonth:c,addMonths:o,differenceInCalendarMonths:l}=n,d=r?a??1:1,f=c(e);if(!t)return o(f,-d);if(!(l(f,t)<=0))return o(f,-d)}function Do(e){const t=[];return e.reduce((s,n)=>s.concat(n.weeks.slice()),t.slice())}function De(e,t){const[s,n]=S.useState(e);return[t===void 0?s:t,n]}function ko(e,t){const[s,n]=vo(e,t),{startOfMonth:r,endOfMonth:a}=t,c=ot(e,s,n,t),[o,l]=De(c,e.month?c:void 0);S.useEffect(()=>{const D=ot(e,s,n,t);l(D)},[e.timeZone]);const d=go(o,n,e,t),f=mo(d,e.endMonth?a(e.endMonth):void 0,e,t),u=po(d,f,e,t),h=Do(u),y=yo(u),C=bo(o,s,e,t),x=xo(o,n,e,t),{disableNavigation:g,onMonthChange:k}=e,T=D=>h.some(M=>M.days.some(N=>N.isEqualTo(D))),b=D=>{if(g)return;let M=r(D);s&&M<r(s)&&(M=r(s)),n&&M>r(n)&&(M=r(n)),l(M),k?.(M)};return{months:u,weeks:h,days:y,navStart:s,navEnd:n,previousMonth:C,nextMonth:x,goToMonth:b,goToDay:D=>{T(D)||b(D.date)}}}var G;(function(e){e[e.Today=0]="Today",e[e.Selected=1]="Selected",e[e.LastFocused=2]="LastFocused",e[e.FocusedModifier=3]="FocusedModifier"})(G||(G={}));function at(e){return!e[F.disabled]&&!e[F.hidden]&&!e[F.outside]}function Mo(e,t,s,n){let r,a=-1;for(const c of e){const o=t(c);at(o)&&(o[F.focused]&&a<G.FocusedModifier?(r=c,a=G.FocusedModifier):n?.isEqualTo(c)&&a<G.LastFocused?(r=c,a=G.LastFocused):s(c.date)&&a<G.Selected?(r=c,a=G.Selected):o[F.today]&&a<G.Today&&(r=c,a=G.Today))}return r||(r=e.find(c=>at(t(c)))),r}function wo(e,t,s,n,r,a,c){const{ISOWeek:o,broadcastCalendar:l}=a,{addDays:d,addMonths:f,addWeeks:u,addYears:h,endOfBroadcastWeek:y,endOfISOWeek:C,endOfWeek:x,max:g,min:k,startOfBroadcastWeek:T,startOfISOWeek:b,startOfWeek:j}=c;let D={day:d,week:u,month:f,year:h,startOfWeek:M=>l?T(M,c):o?b(M):j(M),endOfWeek:M=>l?y(M):o?C(M):x(M)}[e](s,t==="after"?1:-1);return t==="before"&&n?D=g([n,D]):t==="after"&&r&&(D=k([r,D])),D}function Bt(e,t,s,n,r,a,c,o=0){if(o>365)return;const l=wo(e,t,s.date,n,r,a,c),d=!!(a.disabled&&ee(l,a.disabled,c)),f=!!(a.hidden&&ee(l,a.hidden,c)),u=l,h=new St(l,u,c);return!d&&!f?h:Bt(e,t,h,n,r,a,c,o+1)}function Co(e,t,s,n,r){const{autoFocus:a}=e,[c,o]=S.useState(),l=Mo(t.days,s,n||(()=>!1),c),[d,f]=S.useState(a?l:void 0);return{isFocusTarget:x=>!!l?.isEqualTo(x),setFocused:f,focused:d,blur:()=>{o(d),f(void 0)},moveFocus:(x,g)=>{if(!d)return;const k=Bt(x,g,d,t.navStart,t.navEnd,e,r);k&&(e.disableNavigation&&!t.days.some(b=>b.isEqualTo(k))||(t.goToDay(k),f(k)))}}}function So(e,t){const{selected:s,required:n,onSelect:r}=e,[a,c]=De(s,r?s:void 0),o=r?s:a,{isSameDay:l}=t,d=y=>o?.some(C=>l(C,y))??!1,{min:f,max:u}=e;return{selected:o,select:(y,C,x)=>{let g=[...o??[]];if(d(y)){if(o?.length===f||n&&o?.length===1)return;g=o?.filter(k=>!l(k,y))}else o?.length===u?g=[y]:g=[...g,y];return r||c(g),r?.(g,y,C,x),g},isSelected:d}}function Oo(e,t,s=0,n=0,r=!1,a=Q){const{from:c,to:o}=t||{},{isSameDay:l,isAfter:d,isBefore:f}=a;let u;if(!c&&!o)u={from:e,to:s>0?void 0:e};else if(c&&!o)l(c,e)?s===0?u={from:c,to:e}:r?u={from:c,to:void 0}:u=void 0:f(e,c)?u={from:e,to:c}:u={from:c,to:e};else if(c&&o)if(l(c,e)&&l(o,e))r?u={from:c,to:o}:u=void 0;else if(l(c,e))u={from:c,to:s>0?void 0:e};else if(l(o,e))u={from:e,to:s>0?void 0:e};else if(f(e,c))u={from:e,to:o};else if(d(e,c))u={from:c,to:e};else if(d(e,o))u={from:c,to:e};else throw new Error("Invalid range");if(u?.from&&u?.to){const h=a.differenceInCalendarDays(u.to,u.from);n>0&&h>n?u={from:e,to:void 0}:s>1&&h<s&&(u={from:e,to:void 0})}return u}function No(e,t,s=Q){const n=Array.isArray(t)?t:[t];let r=e.from;const a=s.differenceInCalendarDays(e.to,e.from),c=Math.min(a,6);for(let o=0;o<=c;o++){if(n.includes(r.getDay()))return!0;r=s.addDays(r,1)}return!1}function it(e,t,s=Q){return X(e,t.from,!1,s)||X(e,t.to,!1,s)||X(t,e.from,!1,s)||X(t,e.to,!1,s)}function jo(e,t,s=Q){const n=Array.isArray(t)?t:[t];if(n.filter(o=>typeof o!="function").some(o=>typeof o=="boolean"?o:s.isDate(o)?X(e,o,!1,s):Et(o,s)?o.some(l=>X(e,l,!1,s)):He(o)?o.from&&o.to?it(e,{from:o.from,to:o.to},s):!1:Wt(o)?No(e,o.dayOfWeek,s):Nt(o)?s.isAfter(o.before,o.after)?it(e,{from:s.addDays(o.after,1),to:s.addDays(o.before,-1)},s):ee(e.from,o,s)||ee(e.to,o,s):jt(o)||Tt(o)?ee(e.from,o,s)||ee(e.to,o,s):!1))return!0;const c=n.filter(o=>typeof o=="function");if(c.length){let o=e.from;const l=s.differenceInCalendarDays(e.to,e.from);for(let d=0;d<=l;d++){if(c.some(f=>f(o)))return!0;o=s.addDays(o,1)}}return!1}function To(e,t){const{disabled:s,excludeDisabled:n,selected:r,required:a,onSelect:c}=e,[o,l]=De(r,c?r:void 0),d=c?r:o;return{selected:d,select:(h,y,C)=>{const{min:x,max:g}=e,k=h?Oo(h,d,x,g,a,t):void 0;return n&&s&&k?.from&&k.to&&jo({from:k.from,to:k.to},s,t)&&(k.from=h,k.to=void 0),c||l(k),c?.(k,h,y,C),k},isSelected:h=>d&&X(d,h,!1,t)}}function Wo(e,t){const{selected:s,required:n,onSelect:r}=e,[a,c]=De(s,r?s:void 0),o=r?s:a,{isSameDay:l}=t;return{selected:o,select:(u,h,y)=>{let C=u;return!n&&o&&o&&l(u,o)&&(C=void 0),r||c(C),r?.(C,u,h,y),C},isSelected:u=>o?l(o,u):!1}}function Eo(e,t){const s=Wo(e,t),n=So(e,t),r=To(e,t);switch(e.mode){case"single":return s;case"multiple":return n;case"range":return r;default:return}}function _o(e){let t=e;t.timeZone&&(t={...e},t.today&&(t.today=new B(t.today,t.timeZone)),t.month&&(t.month=new B(t.month,t.timeZone)),t.defaultMonth&&(t.defaultMonth=new B(t.defaultMonth,t.timeZone)),t.startMonth&&(t.startMonth=new B(t.startMonth,t.timeZone)),t.endMonth&&(t.endMonth=new B(t.endMonth,t.timeZone)),t.mode==="single"&&t.selected?t.selected=new B(t.selected,t.timeZone):t.mode==="multiple"&&t.selected?t.selected=t.selected?.map(O=>new B(O,t.timeZone)):t.mode==="range"&&t.selected&&(t.selected={from:t.selected.from?new B(t.selected.from,t.timeZone):void 0,to:t.selected.to?new B(t.selected.to,t.timeZone):void 0}));const{components:s,formatters:n,labels:r,dateLib:a,locale:c,classNames:o}=S.useMemo(()=>{const O={...bt,...t.locale};return{dateLib:new $({locale:O,weekStartsOn:t.broadcastCalendar?1:t.weekStartsOn,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},t.dateLib),components:Yr(t.components),formatters:Ur(t.formatters),labels:{...co,...t.labels},locale:O,classNames:{...$e(),...t.classNames}}},[t.locale,t.broadcastCalendar,t.weekStartsOn,t.firstWeekContainsDate,t.useAdditionalWeekYearTokens,t.useAdditionalDayOfYearTokens,t.timeZone,t.numerals,t.dateLib,t.components,t.formatters,t.labels,t.classNames]),{captionLayout:l,mode:d,navLayout:f,numberOfMonths:u=1,onDayBlur:h,onDayClick:y,onDayFocus:C,onDayKeyDown:x,onDayMouseEnter:g,onDayMouseLeave:k,onNextClick:T,onPrevClick:b,showWeekNumber:j,styles:v}=t,{formatCaption:D,formatDay:M,formatMonthDropdown:N,formatWeekNumber:Y,formatWeekNumberHeader:P,formatWeekdayName:A,formatYearDropdown:Z}=n,de=ko(t,a),{days:ue,months:fe,navStart:ve,navEnd:ke,previousMonth:U,nextMonth:K,goToMonth:J}=de,Me=Ir(ue,t,ve,ke,a),{isSelected:we,select:Ce,selected:xe}=Eo(t,a)??{},{blur:Ze,focused:Ue,isFocusTarget:Pt,moveFocus:Ke,setFocused:be}=Co(t,de,Me,we??(()=>!1),a),{labelDayButton:At,labelGridcell:Rt,labelGrid:zt,labelMonthDropdown:qt,labelNav:Le,labelPrevious:Ht,labelNext:$t,labelWeekday:Zt,labelWeekNumber:Ut,labelWeekNumberHeader:Kt,labelYearDropdown:Lt}=r,Gt=S.useMemo(()=>Gr(a,t.ISOWeek),[a,t.ISOWeek]),Ge=d!==void 0||y!==void 0,Se=S.useCallback(()=>{U&&(J(U),b?.(U))},[U,J,b]),Oe=S.useCallback(()=>{K&&(J(K),T?.(K))},[J,K,T]),Vt=S.useCallback((O,I)=>w=>{w.preventDefault(),w.stopPropagation(),be(O),Ce?.(O.date,I,w),y?.(O.date,I,w)},[Ce,y,be]),Qt=S.useCallback((O,I)=>w=>{be(O),C?.(O.date,I,w)},[C,be]),Jt=S.useCallback((O,I)=>w=>{Ze(),h?.(O.date,I,w)},[Ze,h]),Xt=S.useCallback((O,I)=>w=>{const _={ArrowLeft:[w.shiftKey?"month":"day",t.dir==="rtl"?"after":"before"],ArrowRight:[w.shiftKey?"month":"day",t.dir==="rtl"?"before":"after"],ArrowDown:[w.shiftKey?"year":"week","after"],ArrowUp:[w.shiftKey?"year":"week","before"],PageUp:[w.shiftKey?"year":"month","before"],PageDown:[w.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(_[w.key]){w.preventDefault(),w.stopPropagation();const[z,W]=_[w.key];Ke(z,W)}x?.(O.date,I,w)},[Ke,x,t.dir]),en=S.useCallback((O,I)=>w=>{g?.(O.date,I,w)},[g]),tn=S.useCallback((O,I)=>w=>{k?.(O.date,I,w)},[k]),nn=S.useCallback(O=>I=>{const w=Number(I.target.value),_=a.setMonth(a.startOfMonth(O),w);J(_)},[a,J]),sn=S.useCallback(O=>I=>{const w=Number(I.target.value),_=a.setYear(a.startOfMonth(O),w);J(_)},[a,J]),{className:rn,style:on}=S.useMemo(()=>({className:[o[p.Root],t.className].filter(Boolean).join(" "),style:{...v?.[p.Root],...t.style}}),[o,t.className,t.style,v]),an=Br(t),Ve=S.useRef(null);ho(Ve,!!t.animate,{classNames:o,months:fe,focused:Ue,dateLib:a});const cn={dayPickerProps:t,selected:xe,select:Ce,isSelected:we,months:fe,nextMonth:K,previousMonth:U,goToMonth:J,getModifiers:Me,components:s,classNames:o,styles:v,labels:r,formatters:n};return m.createElement(Ot.Provider,{value:cn},m.createElement(s.Root,{rootRef:t.animate?Ve:void 0,className:rn,style:on,dir:t.dir,id:t.id,lang:t.lang,nonce:t.nonce,title:t.title,role:t.role,"aria-label":t["aria-label"],"aria-labelledby":t["aria-labelledby"],...an},m.createElement(s.Months,{className:o[p.Months],style:v?.[p.Months]},!t.hideNavigation&&!f&&m.createElement(s.Nav,{"data-animated-nav":t.animate?"true":void 0,className:o[p.Nav],style:v?.[p.Nav],"aria-label":Le(),onPreviousClick:Se,onNextClick:Oe,previousMonth:U,nextMonth:K}),fe.map((O,I)=>m.createElement(s.Month,{"data-animated-month":t.animate?"true":void 0,className:o[p.Month],style:v?.[p.Month],key:I,displayIndex:I,calendarMonth:O},f==="around"&&!t.hideNavigation&&I===0&&m.createElement(s.PreviousMonthButton,{type:"button",className:o[p.PreviousMonthButton],tabIndex:U?void 0:-1,"aria-disabled":U?void 0:!0,"aria-label":Ht(U),onClick:Se,"data-animated-button":t.animate?"true":void 0},m.createElement(s.Chevron,{disabled:U?void 0:!0,className:o[p.Chevron],orientation:t.dir==="rtl"?"right":"left"})),m.createElement(s.MonthCaption,{"data-animated-caption":t.animate?"true":void 0,className:o[p.MonthCaption],style:v?.[p.MonthCaption],calendarMonth:O,displayIndex:I},l?.startsWith("dropdown")?m.createElement(s.DropdownNav,{className:o[p.Dropdowns],style:v?.[p.Dropdowns]},(()=>{const w=l==="dropdown"||l==="dropdown-months"?m.createElement(s.MonthsDropdown,{key:"month",className:o[p.MonthsDropdown],"aria-label":qt(),classNames:o,components:s,disabled:!!t.disableNavigation,onChange:nn(O.date),options:Kr(O.date,ve,ke,n,a),style:v?.[p.Dropdown],value:a.getMonth(O.date)}):m.createElement("span",{key:"month"},N(O.date,a)),_=l==="dropdown"||l==="dropdown-years"?m.createElement(s.YearsDropdown,{key:"year",className:o[p.YearsDropdown],"aria-label":Lt(a.options),classNames:o,components:s,disabled:!!t.disableNavigation,onChange:sn(O.date),options:Vr(ve,ke,n,a,!!t.reverseYears),style:v?.[p.Dropdown],value:a.getYear(O.date)}):m.createElement("span",{key:"year"},Z(O.date,a));return a.getMonthYearOrder()==="year-first"?[_,w]:[w,_]})(),m.createElement("span",{role:"status","aria-live":"polite",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},D(O.date,a.options,a))):m.createElement(s.CaptionLabel,{className:o[p.CaptionLabel],role:"status","aria-live":"polite"},D(O.date,a.options,a))),f==="around"&&!t.hideNavigation&&I===u-1&&m.createElement(s.NextMonthButton,{type:"button",className:o[p.NextMonthButton],tabIndex:K?void 0:-1,"aria-disabled":K?void 0:!0,"aria-label":$t(K),onClick:Oe,"data-animated-button":t.animate?"true":void 0},m.createElement(s.Chevron,{disabled:K?void 0:!0,className:o[p.Chevron],orientation:t.dir==="rtl"?"left":"right"})),I===u-1&&f==="after"&&!t.hideNavigation&&m.createElement(s.Nav,{"data-animated-nav":t.animate?"true":void 0,className:o[p.Nav],style:v?.[p.Nav],"aria-label":Le(),onPreviousClick:Se,onNextClick:Oe,previousMonth:U,nextMonth:K}),m.createElement(s.MonthGrid,{role:"grid","aria-multiselectable":d==="multiple"||d==="range","aria-label":zt(O.date,a.options,a)||void 0,className:o[p.MonthGrid],style:v?.[p.MonthGrid]},!t.hideWeekdays&&m.createElement(s.Weekdays,{"data-animated-weekdays":t.animate?"true":void 0,className:o[p.Weekdays],style:v?.[p.Weekdays]},j&&m.createElement(s.WeekNumberHeader,{"aria-label":Kt(a.options),className:o[p.WeekNumberHeader],style:v?.[p.WeekNumberHeader],scope:"col"},P()),Gt.map(w=>m.createElement(s.Weekday,{"aria-label":Zt(w,a.options,a),className:o[p.Weekday],key:String(w),style:v?.[p.Weekday],scope:"col"},A(w,a.options,a)))),m.createElement(s.Weeks,{"data-animated-weeks":t.animate?"true":void 0,className:o[p.Weeks],style:v?.[p.Weeks]},O.weeks.map(w=>m.createElement(s.Week,{className:o[p.Week],key:w.weekNumber,style:v?.[p.Week],week:w},j&&m.createElement(s.WeekNumber,{week:w,style:v?.[p.WeekNumber],"aria-label":Ut(w.weekNumber,{locale:c}),className:o[p.WeekNumber],scope:"row",role:"rowheader"},Y(w.weekNumber,a)),w.days.map(_=>{const{date:z}=_,W=Me(_);if(W[F.focused]=!W.hidden&&!!Ue?.isEqualTo(_),W[L.selected]=we?.(z)||W.selected,He(xe)){const{from:Ne,to:je}=xe;W[L.range_start]=!!(Ne&&je&&a.isSameDay(z,Ne)),W[L.range_end]=!!(Ne&&je&&a.isSameDay(z,je)),W[L.range_middle]=X(xe,z,!0,a)}const ln=Lr(W,v,t.modifiersStyles),dn=Fr(W,o,t.modifiersClassNames),un=!Ge&&!W.hidden?Rt(z,W,a.options,a):void 0;return m.createElement(s.Day,{key:`${a.format(z,"yyyy-MM-dd")}_${a.format(_.displayMonth,"yyyy-MM")}`,day:_,modifiers:W,className:dn.join(" "),style:ln,role:"gridcell","aria-selected":W.selected||void 0,"aria-label":un,"data-day":a.format(z,"yyyy-MM-dd"),"data-month":_.outside?a.format(z,"yyyy-MM"):void 0,"data-selected":W.selected||void 0,"data-disabled":W.disabled||void 0,"data-hidden":W.hidden||void 0,"data-outside":_.outside||void 0,"data-focused":W.focused||void 0,"data-today":W.today||void 0},!W.hidden&&Ge?m.createElement(s.DayButton,{className:o[p.DayButton],style:v?.[p.DayButton],type:"button",day:_,modifiers:W,disabled:W.disabled||void 0,tabIndex:Pt(_)?0:-1,"aria-label":At(z,W,a.options,a),onClick:Vt(_,W),onBlur:Jt(_,W),onFocus:Qt(_,W),onKeyDown:Xt(_,W),onMouseEnter:en(_,W),onMouseLeave:tn(_,W)},M(z,a.options,a)):!W.hidden&&M(_.date,a.options,a))})))))))),t.footer&&m.createElement(s.Footer,{className:o[p.Footer],style:v?.[p.Footer],role:"status","aria-live":"polite"},t.footer)))}function Io({className:e,classNames:t,showOutsideDays:s=!0,captionLayout:n="label",buttonVariant:r="ghost",formatters:a,components:c,...o}){const l=$e();return i.jsx(_o,{showOutsideDays:s,className:E("bg-white group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent dark:bg-gray-950",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,e),captionLayout:n,formatters:{formatMonthDropdown:d=>d.toLocaleString("default",{month:"short"}),...a},classNames:{root:E("w-fit",l.root),months:E("flex gap-4 flex-col md:flex-row relative",l.months),month:E("flex flex-col w-full gap-4",l.month),nav:E("flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between",l.nav),button_previous:E(Xe({variant:r}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",l.button_previous),button_next:E(Xe({variant:r}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",l.button_next),month_caption:E("flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)",l.month_caption),dropdowns:E("w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5",l.dropdowns),dropdown_root:E("relative has-focus:border-gray-950 border border-gray-200 shadow-xs has-focus:ring-gray-950/50 has-focus:ring-[3px] rounded-md dark:has-focus:border-gray-300 dark:border-gray-800 dark:has-focus:ring-gray-300/50",l.dropdown_root),dropdown:E("absolute bg-white inset-0 opacity-0 dark:bg-gray-950",l.dropdown),caption_label:E("select-none font-medium",n==="label"?"text-sm":"rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-gray-500 [&>svg]:size-3.5 dark:[&>svg]:text-gray-400",l.caption_label),table:"w-full border-collapse",weekdays:E("flex",l.weekdays),weekday:E("text-gray-500 rounded-md flex-1 font-normal text-[0.8rem] select-none dark:text-gray-400",l.weekday),week:E("flex w-full mt-2",l.week),week_number_header:E("select-none w-(--cell-size)",l.week_number_header),week_number:E("text-[0.8rem] select-none text-gray-500 dark:text-gray-400",l.week_number),day:E("relative w-full h-full p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none",l.day),range_start:E("rounded-l-md bg-gray-100 dark:bg-gray-800",l.range_start),range_middle:E("rounded-none",l.range_middle),range_end:E("rounded-r-md bg-gray-100 dark:bg-gray-800",l.range_end),today:E("bg-gray-100 text-gray-900 rounded-md data-[selected=true]:rounded-none dark:bg-gray-800 dark:text-gray-50",l.today),outside:E("text-gray-500 aria-selected:text-gray-500 dark:text-gray-400 dark:aria-selected:text-gray-400",l.outside),disabled:E("text-gray-500 opacity-50 dark:text-gray-400",l.disabled),hidden:E("invisible",l.hidden),...t},components:{Root:({className:d,rootRef:f,...u})=>i.jsx("div",{"data-slot":"calendar",ref:f,className:E(d),...u}),Chevron:({className:d,orientation:f,...u})=>f==="left"?i.jsx($n,{className:E("size-4",d),...u}):f==="right"?i.jsx(Zn,{className:E("size-4",d),...u}):i.jsx(ne,{className:E("size-4",d),...u}),DayButton:Fo,WeekNumber:({children:d,...f})=>i.jsx("td",{...f,children:i.jsx("div",{className:"flex size-(--cell-size) items-center justify-center text-center",children:d})}),...c},...o})}function Fo({className:e,day:t,modifiers:s,...n}){const r=$e(),a=m.useRef(null);return m.useEffect(()=>{s.focused&&a.current?.focus()},[s.focused]),i.jsx(H,{ref:a,variant:"ghost",size:"icon","data-day":t.date.toLocaleDateString(),"data-selected-single":s.selected&&!s.range_start&&!s.range_end&&!s.range_middle,"data-range-start":s.range_start,"data-range-end":s.range_end,"data-range-middle":s.range_middle,className:E("data-[selected-single=true]:bg-gray-900 data-[selected-single=true]:text-gray-50 data-[range-middle=true]:bg-gray-100 data-[range-middle=true]:text-gray-900 data-[range-start=true]:bg-gray-900 data-[range-start=true]:text-gray-50 data-[range-end=true]:bg-gray-900 data-[range-end=true]:text-gray-50 group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-gray-900 flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70 dark:data-[selected-single=true]:bg-gray-50 dark:data-[selected-single=true]:text-gray-900 dark:data-[range-middle=true]:bg-gray-800 dark:data-[range-middle=true]:text-gray-50 dark:data-[range-start=true]:bg-gray-50 dark:data-[range-start=true]:text-gray-900 dark:data-[range-end=true]:bg-gray-50 dark:data-[range-end=true]:text-gray-900 dark:dark:hover:text-gray-50",r.day,e),...n})}function Fe(e){return e?le(e,"yyyy-MM-dd"):""}function Yo(e){return e?!Number.isNaN(e.getTime()):!1}function Bo({value:e,onChange:t,disabled:s,...n}){const[r,a]=m.useState(!1),[c,o]=m.useState(e),[l,d]=m.useState(Fe(e));return S.useEffect(()=>{e&&d(Fe(e))},[e]),i.jsxs("div",{className:"relative flex gap-2",children:[i.jsx(xt,{...n,disabled:s,value:l,onChange:f=>{d(f.target.value);const u=f.target.value?new Date(f.target.value):void 0;Yo(u)&&(t?.(u),o(u))},onKeyDown:f=>{f.key==="ArrowDown"&&(f.preventDefault(),a(!0))}}),i.jsxs(Un,{open:r,onOpenChange:a,children:[i.jsx(Kn,{asChild:!0,children:i.jsxs(H,{id:"date-picker",variant:"ghost",className:"absolute top-1/2 right-2 size-6 -translate-y-1/2",disabled:s,children:[i.jsx(Ln,{className:"size-3.5"}),i.jsx("span",{className:"sr-only",children:"Select date"})]})}),i.jsx(Gn,{className:"w-auto overflow-hidden p-0",align:"end",alignOffset:-8,sideOffset:10,children:i.jsx(Io,{mode:"single",selected:e,captionLayout:"dropdown",month:c,onMonthChange:o,onSelect:f=>{t?.(f),d(Fe(f??void 0)),a(!1)}})})]})]})}var Ye={exports:{}},Be,ct;function Po(){if(ct)return Be;ct=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Be=e,Be}var Pe,lt;function Ao(){if(lt)return Pe;lt=1;var e=Po();function t(){}function s(){}return s.resetWarningCache=t,Pe=function(){function n(c,o,l,d,f,u){if(u!==e){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}n.isRequired=n;function r(){return n}var a={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:r,element:n,elementType:n,instanceOf:r,node:n,objectOf:r,oneOf:r,oneOfType:r,shape:r,exact:r,checkPropTypes:s,resetWarningCache:t};return a.PropTypes=a,a},Pe}var dt;function Ro(){return dt||(dt=1,Ye.exports=Ao()()),Ye.exports}var zo=Ro();const sa=Vn(zo),qo=({close:e,transactionID:t,onChange:s})=>t?i.jsx(Qn,{modalSize:"fit-content",position:"bottom",title:i.jsxs("div",{className:"flex flex-row mx-3 pt-3 sm:text-1xl gap-10",children:[i.jsx("h1",{className:"sm:text-2xl font-small text-gray-900",children:"Edit Transaction:"}),i.jsxs("div",{className:"flex flex-row gap-2",children:["ID: ",t,i.jsx(Jn,{content:t}),i.jsx(Zs,{transactionId:t})]})]}),opened:!!t,onClose:e,children:i.jsx(Us,{transactionID:t,onDone:e,onChange:s})}):null,Ho=({onDone:e,transactionId:t,chargeId:s})=>{const[n,r]=S.useState(!1),[{data:a,fetching:c}]=mt({query:Xn,pause:!t,variables:{transactionId:t}}),o=a?.transactionsByIDs[0];function l(){r(!1),e?.()}return i.jsxs(es,{open:n,onOpenChange:r,children:[i.jsx(ts,{asChild:!0,children:i.jsx(ut,{label:"Insert Related Misc Expense",children:i.jsx(H,{variant:"ghost",size:"icon",className:"size-7.5",disabled:c,children:i.jsx(Ds,{className:"size-5"})})})}),i.jsxs(ns,{className:"sm:max-w-[425px]",children:[i.jsx(ss,{children:i.jsx(rs,{children:"Insert Misc Expense"})}),o&&i.jsx(Gs,{onDone:l,chargeId:s,defaultValues:{amount:o?.amount.raw?Math.abs(o?.amount.raw):void 0,currency:o?.amount.currency,invoiceDate:o?.eventDate,valueDate:o?.exactEffectiveDate||o?.effectiveDate?new Date(o.exactEffectiveDate??o.effectiveDate):void 0,creditorId:(o?.amount.raw??0)>0?o?.counterparty?.id:void 0,debtorId:(o?.amount.raw??0)<0?o?.counterparty?.id:void 0}})]})]})},$o=({transaction:e})=>{const t="effectiveDate"in e?e.effectiveDate:void 0;return i.jsxs("div",{className:"flex flex-col justify-center",children:[i.jsx("div",{children:t&&le(new Date(t),"dd/MM/yy")}),e.sourceEffectiveDate&&i.jsxs("div",{className:"text-xs text-gray-500",children:["(Originally ",le(new Date(e.sourceEffectiveDate),"dd/MM/yy"),")"]})]})},Zo=({transaction:e})=>{const t="eventDate"in e?e.eventDate:void 0;return i.jsx("div",{className:"flex flex-col justify-center",children:t&&le(new Date(t),"dd/MM/yy")})},Uo=({transaction:e})=>{const t="amount"in e?e.amount:void 0;return i.jsxs("div",{style:{color:Number(t?.raw)>0?"green":"red",whiteSpace:"nowrap"},children:[t?.formatted,i.jsx("br",{}),e.cryptoExchangeRate&&i.jsxs("span",{style:{color:"gray",marginLeft:"0.5rem"},children:[`(Rate: ${e.cryptoExchangeRate.rate})`,i.jsx("br",{}),t?.raw?`${os(t.raw*e.cryptoExchangeRate.rate)}$`:null]})]})},Ko=({transaction:e})=>{const{account:t}=e,s=t.type,n=t.name;return i.jsxs("div",{className:"flex flex-col justify-center",children:[i.jsx("p",{children:s}),i.jsx("p",{children:n})]})},Lo=({transaction:e})=>{const t="sourceDescription"in e?e.sourceDescription:"Missing";return i.jsx("div",{className:"flex flex-wrap",children:i.jsx("div",{className:"flex flex-col justify-center",children:t})})},Go=({transaction:e})=>i.jsx("div",{className:"flex flex-wrap",children:i.jsx("div",{className:"flex flex-col justify-center",children:e.referenceKey})});function Vo({transaction:e,onChange:t}){const{id:s,counterparty:n,missingInfoSuggestions:r,id:a,sourceDescription:c,enableEdit:o}=e,l=!!r?.business&&o,d=l?r?.business?.name:"Missing",f=l?r?.business?.id:null,u=n?.name??d,[h,y]=S.useState(!1),{updateTransaction:C,fetching:x}=qe(),g=S.useCallback(async N=>{await C({transactionId:a,fields:{counterpartyId:N}}),y(!0)},[a,C]),k=S.useCallback(async N=>{await g(N),t?.()},[g,t]),{selectableBusinesses:T,fetching:b}=as(),[j,v]=S.useState(f??null),[D,M]=S.useState(c);return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"flex flex-wrap flex-col justify-center",children:n?.id?i.jsx(ft,{to:ht.BUSINESSES.DETAIL(n.id),target:"_blank",rel:"noreferrer",onClick:N=>N.stopPropagation(),className:"inline-flex items-center font-semibold",children:u}):i.jsxs(i.Fragment,{children:[i.jsx(is,{options:T,value:j,onChange:v,search:D,onSearchChange:M,placeholder:"Choose or create a business",empty:D?i.jsx(cs,{description:D,onAdd:k}):null}),i.jsx(ks,{content:"Approve",children:i.jsx(H,{variant:"outline",size:"icon",onClick:()=>j&&g(j),disabled:x||b||!j,children:i.jsx(ls,{className:"size-4"})})})]})}),i.jsx(bs,{transactionId:s,counterpartyId:n?.id??j,open:h,onOpenChange:y,onClose:t})]})}const Ae=[{accessorKey:"counterparty.name",header:({column:e})=>i.jsxs(H,{variant:"ghost",children:["Counterparty",e.getIsSorted()&&(e.getIsSorted()==="asc"?i.jsx(ae,{className:"ml-2 h-4 w-4"}):i.jsx(ne,{className:"ml-2 h-4 w-4"}))]}),cell:({row:e})=>i.jsx(Vo,{transaction:e.original})},{accessorKey:"eventDate",sortingFn:e=>"eventDate"in e.original&&e.original.eventDate?new Date(e.original.eventDate).getTime():0,header:({column:e})=>i.jsxs(H,{variant:"ghost",children:["Event Date",e.getIsSorted()&&(e.getIsSorted()==="asc"?i.jsx(ae,{className:"ml-2 h-4 w-4"}):i.jsx(ne,{className:"ml-2 h-4 w-4"}))]}),cell:({row:e})=>i.jsx(Zo,{transaction:e.original})},{accessorKey:"effectiveDate",sortingFn:e=>"effectiveDate"in e.original&&e.original.effectiveDate?new Date(e.original.effectiveDate).getTime():0,header:({column:e})=>i.jsxs(H,{variant:"ghost",children:["Debit Date",e.getIsSorted()&&(e.getIsSorted()==="asc"?i.jsx(ae,{className:"ml-2 h-4 w-4"}):i.jsx(ne,{className:"ml-2 h-4 w-4"}))]}),cell:({row:e})=>i.jsx($o,{transaction:e.original})},{accessorKey:"amount.raw",header:({column:e})=>i.jsxs(H,{variant:"ghost",children:["Amount",e.getIsSorted()&&(e.getIsSorted()==="asc"?i.jsx(ae,{className:"ml-2 h-4 w-4"}):i.jsx(ne,{className:"ml-2 h-4 w-4"}))]}),cell:({row:e})=>i.jsx(Uo,{transaction:e.original})},{accessorKey:"account.name",header:({column:e})=>i.jsxs(H,{variant:"ghost",children:["Account",e.getIsSorted()&&(e.getIsSorted()==="asc"?i.jsx(ae,{className:"ml-2 h-4 w-4"}):i.jsx(ne,{className:"ml-2 h-4 w-4"}))]}),cell:({row:e})=>i.jsx(Ko,{transaction:e.original})},{accessorKey:"sourceDescription",header:({column:e})=>i.jsxs(H,{variant:"ghost",children:["Description",e.getIsSorted()&&(e.getIsSorted()==="asc"?i.jsx(ae,{className:"ml-2 h-4 w-4"}):i.jsx(ne,{className:"ml-2 h-4 w-4"}))]}),cell:({row:e})=>i.jsx(Lo,{transaction:e.original})},{accessorKey:"referenceKey",header:({column:e})=>i.jsxs(H,{variant:"ghost",children:["Reference#",e.getIsSorted()&&(e.getIsSorted()==="asc"?i.jsx(ae,{className:"ml-2 h-4 w-4"}):i.jsx(ne,{className:"ml-2 h-4 w-4"}))]}),cell:({row:e})=>i.jsx(Go,{transaction:e.original})}],Qo={accessorKey:"id",header:"Actions",cell:({row:e})=>e.original.enableEdit?i.jsxs(i.Fragment,{children:[i.jsx(ds,{onClick:e.original.editTransaction}),i.jsx(Ho,{chargeId:e.original.chargeId,transactionId:e.original.id,onDone:e.original.onUpdate})]}):e.original.enableChargeLink?i.jsx($s,{chargeId:e.original.chargeId}):null},ra=({transactionsProps:e,onChange:t=()=>{},enableEdit:s,enableChargeLink:n})=>{const[r,a]=S.useState(void 0),[c,o]=S.useState([]),l=S.useMemo(()=>e.map(h=>us(fs,h)),[e]),d=S.useMemo(()=>l?.map(h=>({...h,editTransaction:()=>a(h.id),onUpdate:t,enableEdit:s,enableChargeLink:n})),[l,t,s,n]),f=S.useMemo(()=>s||n?[...Ae,Qo]:Ae,[s,n]),u=hs({data:d,columns:f,getCoreRowModel:ys(),onSortingChange:o,getSortedRowModel:ms(),state:{sorting:c}});return i.jsxs(i.Fragment,{children:[i.jsxs(gs,{children:[i.jsx(ps,{children:u.getHeaderGroups().map(h=>i.jsx(We,{children:h.headers.map(y=>i.jsx(vs,{colSpan:y.colSpan,children:y.isPlaceholder?null:et(y.column.columnDef.header,y.getContext())},y.id))},h.id))}),i.jsx(xs,{children:u.getRowModel().rows?.length?u.getRowModel().rows.map(h=>i.jsx(We,{children:h.getVisibleCells().map(y=>i.jsx(tt,{children:et(y.column.columnDef.cell,y.getContext())},y.id))},h.id)):i.jsx(We,{children:i.jsx(tt,{colSpan:Ae.length,className:"h-24 text-center",children:"No results."})})})]}),i.jsx(qo,{transactionID:r,close:()=>a(void 0),onChange:t})]})};export{Uo as A,Vo as C,$o as D,ws as E,Gs as I,Qs as M,sa as P,Go as S,ra as T,Zo as a,Ko as b,Lo as c,$s as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as x,bu as h,J as T,r,j as s,bn as g,bv as j,F as B,T as w,ah as C,L as b,au as v,bw as E}from"./index-B2_EbsaK.js";import{E as P,P as y,C as L}from"./editable-business-trip-CRiuNdbP.js";import{I as F}from"./insert-business-trip-modal-BwOnvw7X.js";import{P as I}from"./page-layout-C0GJoVTR.js";import{A as m}from"./summary-DuWhfNdL.js";import"./list-plus-CGvSlslE.js";import"./Table-CYqAEQfS.js";import"./toggle-expansion-button-41Ejffq3.js";import"./panel-top-open-BFNhAe3f.js";import"./MultiSelect-CBtq6WUv.js";import"./similar-transactions-modal-nk8VHEtX.js";import"./tooltip-lhMCop8U.js";import"./create-event-handler-BiA-1lGu.js";const S=({data:u,isOpened:o,shouldValidate:l})=>{const e=T(j,u),[{data:i,fetching:a}]=x({pause:!l,query:h,variables:{id:e.id}}),d=r.useMemo(()=>l?i?.businessTrip&&(i.businessTrip.uncategorizedTransactions?.length||i?.businessTrip.summary?.errors?.length):!1,[i]),c=d||e?.accountantApproval!=="APPROVED";return s.jsxs(m.Item,{value:e.id,children:[s.jsx(m.Control,{children:s.jsx(g,{inline:!0,size:12,processing:a,disabled:!c,color:d?"red":"yellow",zIndex:"auto",children:e.name})}),s.jsx(m.Panel,{children:o&&s.jsx(P,{tripId:e.id,isExtended:!0},e.id)})]})},_=()=>{const{setFiltersContext:u}=r.useContext(B),[o,l]=r.useState([]),[e,i]=r.useState(!1),[{data:a,fetching:d}]=x({query:E});r.useEffect(()=>{if(!a?.allBusinessTrips?.length){l([]);return}const t=a.allBusinessTrips.sort((n,p)=>n.dates?.start&&p.dates?.start?n.dates.start<p.dates.start?1:-1:n.dates?.start?-1:p.dates?.start?1:n.name.toLocaleLowerCase()<p.name.toLocaleLowerCase()?-1:1);l(t)},[a?.allBusinessTrips]);const[c,f]=r.useState([]);return r.useEffect(()=>{u(s.jsxs("div",{className:"flex flex-row gap-x-5",children:[s.jsx(F,{}),s.jsx(w,{label:"Toggle business trips validation",children:s.jsxs("div",{className:"flex flex-row items-center gap-x-2",children:[s.jsx(C,{checked:e??!1,onCheckedChange:t=>i(t)}),s.jsx("span",{className:"text-sm text-gray-500",children:"Validate"})]})}),s.jsx(y,{filename:"business_trips"})]}))},[a,d,u,e]),s.jsx(I,{title:"Business Trips",description:"Manage business trips",children:o.length===0&&d?s.jsx(b,{className:"h-10 w-10 animate-spin mr-2 self-center"}):s.jsx(L,{children:s.jsx(m,{className:"w-full",multiple:!0,value:c,onChange:f,chevron:s.jsx(v,{size:"1rem"}),styles:{chevron:{"&[data-rotate]":{transform:"rotate(45deg)"}}},children:o?.map(t=>s.jsx(S,{data:o.find(n=>n.id===t.id),shouldValidate:e,isOpened:c.includes(t.id)},t.id))})})})};export{_ as BusinessTrips};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as v,
|
|
1
|
+
import{g as v,hB as B,r as u,t as h,i as F,aj as H,j as e,X as C,Y as j,Z as f,_ as p,I as L,$ as y,a0 as S,bp as V,bs as z,as as Q,ah as _,D,aO as E,B as m,z as M,aP as R,aQ as A,G as O,V as P,hC as G,bU as K,u as $,hD as X,L as k,F as Y,cQ as Z,cT as W,cU as J,cV as T,cW as ee,cX as b,cY as se,cZ as w,hE as te,d3 as ae,d4 as re,d5 as oe}from"./index-B2_EbsaK.js";import{D as ne}from"./data-table-pagination-CKN0E29f.js";import{P as ie}from"./page-layout-C0GJoVTR.js";import{A as N}from"./arrow-up-down-C61ge4J5.js";const de="insertTaxCategory",ce=()=>{const[{fetching:s},n]=v(B),t=u.useCallback(async a=>{const d="Error creating tax category",r=de;h.loading("Adding Tax Category",{id:r});try{const i=await n(a),l=F(i,d,r);if(l)return h.success("Success",{id:r,description:`${l.insertTaxCategory.name} was created`}),l.insertTaxCategory}catch(i){console.error(`${d}: ${i}`),h.error("Error",{id:r,description:d,duration:1e5,closeButton:!0})}},[n]);return{fetching:s,insertTaxCategory:t}};function U({formManager:s,setFetching:n,isInsert:t}){const{control:a,watch:d,setValue:r}=s,{selectableSortCodes:i,fetching:l,sortCodes:x}=H();u.useEffect(()=>{n(l)},[n,l]);const c=d("sortCode");return u.useEffect(()=>{if(c){const o=x.find(g=>g.key===c);o?.defaultIrsCode&&r("irsCode",o.defaultIrsCode,{shouldDirty:!0})}},[c,x,r]),e.jsxs(e.Fragment,{children:[e.jsx(C,{name:"name",control:a,rules:{required:"Required",minLength:{value:2,message:"Must be at least 2 characters"}},render:({field:o,fieldState:g})=>e.jsxs(j,{children:[e.jsx(f,{children:"Name"}),e.jsx(p,{children:e.jsx(L,{...o,value:o.value??void 0,required:!0,className:t?"":y(g)})}),e.jsx(S,{})]})}),e.jsx(V,{name:"sortCode",control:a,render:({field:o,fieldState:g})=>e.jsx(z,{...o,onChange:q=>{o.onChange(Number(q))},data:i,value:o.value?.toString(),disabled:l,label:"Sort Code",placeholder:"Scroll to see all options",maxDropdownHeight:160,searchable:!0,className:t?"":y(g)})}),e.jsx(C,{name:"irsCode",control:a,render:({field:o,fieldState:g})=>e.jsxs(j,{children:[e.jsx(f,{children:"IRS Code"}),e.jsx(p,{children:e.jsx(Q,{...o,className:t?"":y(g),value:o.value??void 0,hideControls:!0,decimalScale:0})}),e.jsx(S,{})]})}),e.jsx(C,{control:a,name:"taxExcluded",render:({field:o})=>e.jsxs(j,{className:"flex flex-row items-center justify-between",children:[e.jsx("div",{className:"space-y-0.5",children:e.jsx(f,{children:"Tax excluded category"})}),e.jsx(p,{children:e.jsx(_,{onCheckedChange:o.onChange,checked:o.value??void 0})})]})})]})}function le({onAdd:s}){const[n,t]=u.useState(!1);return e.jsxs(D,{open:n,onOpenChange:t,children:[e.jsx(E,{asChild:!0,children:e.jsx(m,{children:"Add Tax Category"})}),e.jsxs(M,{className:"w-[90vw] max-w-screen-md",children:[e.jsx(R,{children:e.jsx(A,{children:"Add New Tax Category"})}),e.jsx(xe,{close:()=>t(!1),onAdd:s})]})]})}function xe({close:s,onAdd:n}){const t=O({}),{handleSubmit:a}=t,[d,r]=u.useState(!1),{insertTaxCategory:i,fetching:l}=ce(),x=c=>{c.sortCode&&=parseInt(c.sortCode.toString()),i({fields:c}).then(o=>{o?.id&&(n?.(o.id),s())})};return e.jsx(P,{...t,children:e.jsxs("form",{onSubmit:a(x),children:[e.jsx("div",{className:"flex flex-col gap-4 my-4",children:e.jsx(U,{isInsert:!0,formManager:t,setFetching:r})}),e.jsx("div",{className:"flex justify-end mt-4",children:e.jsx(m,{type:"submit",disabled:l||d,children:"Add Tax Category"})})]})})}const ue="updateTaxCategory",ge=()=>{const[{fetching:s},n]=v(G),t=u.useCallback(async a=>{const d="Error updating tax category",r=`${ue}-${a.taxCategoryId}`;h.loading("Uploading Tax Category",{id:r});try{const i=await n(a),l=F(i,d,r,"updateTaxCategory");if(l)return h.success("Success",{id:r,description:`${l.updateTaxCategory.name} was updated`}),l.updateTaxCategory}catch(i){console.error(`${d}: ${i}`),h.error("Error",{id:r,description:d,duration:1e5,closeButton:!0})}},[n]);return{fetching:s,updateTaxCategory:t}};function he({taxCategoryId:s,onAdd:n}){const[t,a]=u.useState(!1);return e.jsxs(D,{open:t,onOpenChange:a,children:[e.jsx(E,{asChild:!0,children:e.jsx(m,{variant:"outline",size:"icon",children:e.jsx(K,{})})}),e.jsxs(M,{className:"w-[400px] max-w-screen-md",children:[e.jsx(R,{children:e.jsx(A,{children:"Edit Tax Category"})}),e.jsx(me,{taxCategoryId:s,close:()=>a(!1),onAdd:n})]})]})}function me({taxCategoryId:s,close:n,onAdd:t}){const[{data:a,fetching:d}]=$({query:X,variables:{id:s}}),r=a?.taxCategory;return!r&&!d&&h.error("Error",{description:"Couldn'nt find tax category"}),d?e.jsx(k,{className:"h-10 w-10 animate-spin"}):e.jsx(Ce,{taxCategory:r,close:n,onAdd:t})}function Ce({taxCategory:s,close:n,onAdd:t}){const a=O({defaultValues:{sortCode:s.sortCode?.key,name:s.name,irsCode:s.irsCode}}),{handleSubmit:d}=a,[r,i]=u.useState(!1),{updateTaxCategory:l,fetching:x}=ge(),c=o=>{o.sortCode&&=parseInt(o.sortCode.toString()),l({fields:o,taxCategoryId:s.id}).then(g=>{g?.id&&(t?.(g.id),n())})};return e.jsx(P,{...a,children:e.jsxs("form",{onSubmit:d(c),children:[e.jsx("div",{className:"flex flex-col gap-4 my-4",children:e.jsx(U,{isInsert:!1,formManager:a,setFetching:i})}),e.jsx("div",{className:"flex justify-end mt-4",children:e.jsx(m,{type:"submit",disabled:x||r,children:"Update"})})]})})}const je=({data:s})=>e.jsx("td",{children:s.name}),fe=({data:s})=>e.jsx("td",{children:s.sortCode?e.jsxs("span",{children:[s.sortCode?.name," (",s.sortCode?.id,")"]}):"N/A"}),I=[{id:"name",accessorKey:"name",cell:({row:s})=>e.jsx(je,{data:s.original}),header:({column:s})=>e.jsxs(m,{variant:"ghost",onClick:()=>s.toggleSorting(s.getIsSorted()==="asc"),children:["Name",e.jsx(N,{})]})},{id:"sortCode",accessorKey:"sortCode.key",cell:({row:s})=>e.jsx(fe,{data:s.original}),header:({column:s})=>e.jsxs(m,{variant:"ghost",onClick:()=>s.toggleSorting(s.getIsSorted()==="asc"),children:["Sort Code",e.jsx(N,{})]})},{id:"edit",cell:({row:s})=>e.jsx(he,{taxCategoryId:s.original.id})}],be=()=>{const[{data:s,fetching:n,error:t},a]=$({query:te}),{setFiltersContext:d}=u.useContext(Y),r=s?.taxCategories??[],i=Z({data:r,columns:I,getCoreRowModel:oe(),getPaginationRowModel:re(),getSortedRowModel:ae(),initialState:{pagination:{pageSize:30}}}),l=i.getPageOptions();return u.useEffect(()=>{d(e.jsx("div",{className:"flex items-center justify-end gap-10 space-x-2 py-4",children:e.jsx("div",{className:"flex items-center justify-between px-2",children:e.jsx(ne,{table:i})})}))},[d,i,l]),u.useEffect(()=>{t&&h.error("Error",{description:"Error fetching tax categories"})},[t]),e.jsx(ie,{title:`Tax Categories (${r.length})`,description:"All tax categories",headerActions:e.jsx(le,{onAdd:()=>a()}),children:n?e.jsx("div",{className:"flex flex-row justify-center",children:e.jsx(k,{className:"h-10 w-10 animate-spin mr-2"})}):e.jsx("div",{className:"flex flex-col gap-4 rounded-md border",children:e.jsxs(W,{children:[e.jsx(J,{children:i.getHeaderGroups().map(x=>e.jsx(T,{children:x.headers.map(c=>e.jsx(ee,{children:c.isPlaceholder?null:b(c.column.columnDef.header,c.getContext())},c.id))},x.id))}),e.jsx(se,{children:i.getRowModel().rows.length===0?e.jsx(T,{children:e.jsx(w,{colSpan:I.length,className:"text-center py-8",children:"No tax categories found"})}):i.getRowModel().rows.map(x=>e.jsx(T,{children:x.getVisibleCells().map(c=>e.jsx(w,{children:b(c.column.columnDef.cell,c.getContext())},c.id))},x.id))})]})})})};export{be as TaxCategories};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{cy as fr,ac as gr,ab as ge,j as F,r as kt,bm as pr,B as mr,G as br,x as le,bp as Pn,bq as Dn,br as An,bt as xr,F as _r,u as yr,bl as wr,aN as it,L as vr,cz as Mr}from"./index-B2_EbsaK.js";import{u as io}from"./use-url-query-BPzyQB93.js";import{P as Sr}from"./page-layout-C0GJoVTR.js";import{P as kr}from"./modal-B0uNLang.js";import{F as Cr}from"./funnel-BlaCusqP.js";/*!
|
|
2
2
|
* decimal.js v10.6.0
|
|
3
3
|
* An arbitrary-precision Decimal type for JavaScript.
|
|
4
4
|
* https://github.com/MikeMcl/decimal.js
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{v as z,r as b,
|
|
1
|
+
import{v as z,r as b,bo as Q,j as e,D as U,aO as W,B as g,z as G,aP as J,aQ as K,b8 as T,al as Z,a_ as R,am as A,an as O,ao as k,ap as E,ar as D,cu as X,J as j,bf as w,fZ as M,f_ as ee,f$ as S,g0 as se,g1 as I,g2 as L,g3 as P,g4 as N,g5 as p,g6 as B,g7 as _,dh as re,g8 as te,ba as ae,bb as le,bc as v,g9 as $,F as de,u as ne,K as oe,N as ce,W as ie,ga as me}from"./index-B2_EbsaK.js";import{F as V}from"./funnel-BlaCusqP.js";import{B as ue}from"./building-2-3KauBrnS.js";import{S as xe}from"./save-qtyyZLc5.js";/**
|
|
2
2
|
* @license lucide-react v0.548.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const he=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],be=z("eye-off",he),C=["2020","2021","2022","2023"];function je({selectedBusiness:t,setSelectedBusiness:d,selectedYear:s,setSelectedYear:c,referenceYear:l,setReferenceYear:o}){const[n,r]=b.useState(!s||!t),{selectableBusinesses:a,fetching:i}=Q(),h=b.useMemo(()=>t?a.find(f=>f.value===t)?.label??"":"",[a,t]);return e.jsxs(U,{open:n,onOpenChange:r,children:[e.jsx(W,{asChild:!0,children:e.jsxs(g,{variant:"outline",className:"flex items-center gap-2",children:[e.jsx(_,{className:"h-4 w-4"}),"מסננים",e.jsxs("span",{className:"text-xs bg-blue-100 text-blue-800 px-2 py-0.5 rounded-full",children:[h," • ",s]})]})}),e.jsxs(G,{className:"sm:max-w-md",dir:"rtl",children:[e.jsx(J,{children:e.jsxs(K,{className:"flex items-center gap-2",children:[e.jsx(_,{className:"h-5 w-5"}),"מסנני דוח"]})}),e.jsxs("div",{className:"space-y-6 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(T,{htmlFor:"business-select",className:"flex items-center gap-2",children:[e.jsx(ue,{className:"h-4 w-4"}),"בחירת עסק"]}),e.jsx(X,{onChange:x=>d(x??void 0),data:a,value:t,disabled:i,placeholder:"Scroll to see all options",triggerProps:{className:"w-full"}})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(T,{htmlFor:"year-select",className:"flex items-center gap-2",children:[e.jsx(R,{className:"h-4 w-4"}),"שנת דיווח"]}),e.jsxs(A,{value:s,onValueChange:c,children:[e.jsx(O,{id:"year-select",children:e.jsx(k,{})}),e.jsx(E,{children:C.map(x=>e.jsx(D,{value:x,children:x},x))})]}),e.jsxs("p",{className:"text-xs text-gray-500",children:["זמינות נתונים: ",C.join(", ")]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(T,{htmlFor:"reference-year-select",className:"flex items-center gap-2",children:[e.jsx(R,{className:"h-4 w-4"}),"שנת השוואה"]}),e.jsxs(A,{value:l,onValueChange:x=>o(x==="none"?void 0:x),children:[e.jsx(O,{id:"reference-year-select",children:e.jsx(k,{})}),e.jsxs(E,{children:[e.jsx(D,{value:"none",children:"ללא"},"none"),C.map(x=>e.jsx(D,{value:x,children:x},x))]})]}),e.jsxs("p",{className:"text-xs text-gray-500",children:["זמינות נתונים: ",C.join(", ")]})]}),e.jsxs("div",{className:"flex justify-end gap-2 pt-4",children:[e.jsx(g,{variant:"outline",onClick:()=>r(!1),children:"ביטול"}),e.jsx(g,{onClick:()=>r(!1),children:"אישור"})]})]})]})]})}const m=({label:t,value:d,code:s,referenceValue:c,showEmptyFields:l,showChange:o=!1})=>{const n=h=>l?!0:!r(h),r=h=>!h||h.trim()===""||h==="0"||h==="0.00",a=(h,x)=>{if(!x)return null;const f=H=>Number.parseFloat(H.replace(/[,\s₪]/g,""))||0,q=f(h),F=f(x);return F===0?null:(q-F)/F*100};if(!n(d))return null;const i=o?a(d,c):null;return e.jsxs("div",{className:"flex justify-between items-center py-2 border-b border-gray-200",dir:"rtl",children:[e.jsxs("span",{className:"text-sm text-gray-600",children:[t," ",s&&`(${s})`]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:`font-medium ${r(d)?"text-gray-400":""}`,children:r(d)?"0":d}),i!==null&&e.jsxs("span",{className:`text-xs px-1 py-0.5 rounded ${i>0?"text-green-700 bg-green-100":i<0?"text-red-700 bg-red-100":"text-gray-700 bg-gray-100"}`,children:[i>0?"+":"",i.toFixed(1),"%"]})]})]})},u=({codes:t,referenceCodes:d,code:s,showEmptyFields:c})=>{const{value:l,label:o}=b.useMemo(()=>{const r=t.find(a=>a.code===s);return{value:r?.amount||0,label:r?.label||"לא זוהה קוד"}},[t,s]),n=b.useMemo(()=>d?.find(r=>r.code===s)?.amount.toString()||"",[d,s]);return e.jsx(m,{label:o,value:Z(l,0),code:String(s),showChange:!0,showEmptyFields:c,referenceValue:n})},pe=[{title:"מזומנים ושווי מזומנים",codes:[7110,7120,7150],sumCode:7100},{title:"ניירות ערך",codes:[7215,7225,7230,7290,7295],sumCode:7200},{title:"לקוחות",codes:[7310,7320,7330,7350,7360,7380,7390],sumCode:7300},{title:"חייבים ויתרות חובה",codes:[7410,7420,7430,7440,7450,7461,7462,7470,7490],sumCode:7400},{title:"מסים נדחים לזמן קצר",codes:[7610,7620,7690],sumCode:7600},{title:"הלוואות לזמן קצר",codes:[7711,7712,7720],sumCode:7700},{title:"מלאי",codes:[7805,7810,7815,7820,7825,7830,7840,7850,7860,7870,7890],sumCode:7800}],ge=[{title:"רכוש קבוע",codes:[8010,8020,8025,8030,8040,8050,8060,8080,8090,8095,8100,8105,8110,8120,8130,8140,8150,8160,8170,8180,8190],sumCode:8e3},{title:"נכסים לא שוטפים מוחזקים למכירה",codes:[8710],sumCode:8700},{title:"הוצאות מראש לזמן ארוך",codes:[8210,8220,8290],sumCode:8200},{title:"השקעות בחברות מוחזקות כלולות ומאוחדות",codes:[8315,8325,8335,8340,8350],sumCode:8300},{title:'השקעות בחברות אחרות כולל ני"ע סחירים מוחזקים לזמן ארוך',codes:[8410,8420,8440,8450,8460,8490],sumCode:8400},{title:"מסים נדחים לזמן ארוך",codes:[8510,8520,8590],sumCode:8500},{title:"הוצאות נדחות ורכוש אחר",codes:[8610,8620,8630,8640,8690],sumCode:8600}],fe=[{title:"בנקים והלואות לזמן קצר",codes:[9110,9120,9130,9140,9151,9152,9190],sumCode:9100},{title:"ספקים ונותני שירותים",codes:[9210,9220,9230,9290],sumCode:9200},{title:"זכאים ויתרות זכות",codes:[9310,9320,9330,9340,9350,9360,9370,9410,9420,9431,9432,9435,9440,9450,9460,9470,9480,9490],sumCode:9400},{title:"עתודה למסים נדחים לזמן קצר",codes:[9510,9520,9530],sumCode:9500}],Ne=[{title:"התחייבויות לזמן ארוך",codes:[9605,9610,9620,9631,9632,9640,9650,9660,9670,9690],sumCode:9600},{title:"התחייבויות בשל סיום יחסי עובד-מעביד",codes:[9710,9720,9790],sumCode:9700},{title:"עתודה למסים נדחים לזמן ארוך",codes:[9810,9820,9890],sumCode:9800}],ve=[{title:"הון עצמי",codes:[9910,9920,9930,9940,9950,9960,9980],sumCode:9900}];function Ce({data:t,referenceData:d,showEmptyFields:s=!1}){const l=j(M,t).balanceSheet||[],n=j(M,d)?.balanceSheet||[];return e.jsx(w,{value:"balanceSheet",className:"border rounded-md p-4",children:e.jsxs("div",{className:"space-y-6",dir:"rtl",children:[e.jsx("h3",{className:"text-lg font-bold border-b pb-2",children:"נתוני המאזן"}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx("h4",{className:"text-lg font-bold text-blue-800 border-b pb-2",children:"נכסים"}),e.jsx("div",{className:"bg-blue-100 p-4 rounded-md border-2 border-blue-300",children:e.jsx("h5",{className:"font-bold",children:"רכוש שוטף"})}),pe.map(r=>e.jsxs("div",{className:"bg-blue-50 p-4 rounded-md",children:[e.jsx("h6",{className:"font-bold mb-3",children:r.title}),e.jsxs("div",{className:"space-y-2",children:[r.codes.map(a=>e.jsx(u,{codes:l,referenceCodes:n,code:a,showEmptyFields:s},a)),e.jsx("div",{className:"border-2 rounded-md border-gray-300",children:e.jsx(u,{codes:l,referenceCodes:n,code:r.sumCode,showEmptyFields:s})})]})]},r.title)),e.jsx("div",{className:"bg-blue-100 p-4 rounded-md border-2 border-blue-300",children:e.jsx(u,{codes:l,code:7e3,showEmptyFields:s})}),ge.map(r=>e.jsxs("div",{className:"bg-blue-50 p-4 rounded-md",children:[e.jsx("h6",{className:"font-bold mb-3",children:r.title}),e.jsxs("div",{className:"space-y-2",children:[r.codes.map(a=>e.jsx(u,{codes:l,referenceCodes:n,code:a,showEmptyFields:s},a)),e.jsx("div",{className:"border-2 rounded-md border-gray-300",children:e.jsx(u,{codes:l,referenceCodes:n,code:r.sumCode,showEmptyFields:s})})]})]},r.title)),e.jsx("div",{className:"bg-blue-100 p-4 rounded-md border-2 border-blue-300",children:e.jsx(u,{codes:l,code:8888,showEmptyFields:s})})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h4",{className:"text-lg font-bold text-red-800 border-b pb-2",children:"התחייבויות והון"}),e.jsx("div",{className:"bg-red-100 p-4 rounded-md border-2 border-red-300",children:e.jsx("h5",{className:"font-bold",children:"התחייבויות שוטפות"})}),fe.map(r=>e.jsxs("div",{className:"bg-red-50 p-4 rounded-md",children:[e.jsx("h6",{className:"font-bold mb-3",children:r.title}),e.jsxs("div",{className:"space-y-2",children:[r.codes.map(a=>e.jsx(u,{codes:l,referenceCodes:n,code:a,showEmptyFields:s},a)),e.jsx("div",{className:"border-2 rounded-md border-gray-300",children:e.jsx(u,{codes:l,referenceCodes:n,code:r.sumCode,showEmptyFields:s})})]})]},r.title)),e.jsx("div",{className:"bg-red-100 p-4 rounded-md border-2 border-red-300",children:e.jsx(u,{codes:l,code:9e3,showEmptyFields:s})}),Ne.map(r=>e.jsxs("div",{className:"bg-red-50 p-4 rounded-md",children:[e.jsx("h6",{className:"font-bold mb-3",children:r.title}),e.jsxs("div",{className:"space-y-2",children:[r.codes.map(a=>e.jsx(u,{codes:l,referenceCodes:n,code:a,showEmptyFields:s},a)),e.jsx("div",{className:"border-2 rounded-md border-gray-300",children:e.jsx(u,{codes:l,referenceCodes:n,code:r.sumCode,showEmptyFields:s})})]})]},r.title)),ve.map(r=>e.jsxs("div",{className:"bg-green-50 p-4 rounded-md",children:[e.jsx("h5",{className:"font-bold mb-3",children:r.title}),e.jsx("div",{className:"space-y-2",children:r.codes.map(a=>e.jsx(u,{codes:l,referenceCodes:n,code:a,showEmptyFields:s},a))})]},r.title)),e.jsx("div",{className:"bg-red-100 p-4 rounded-md border-2 border-red-300",children:e.jsx(u,{codes:l,code:9999,showEmptyFields:s})})]})]})]})})}const ye=t=>{switch(t){case"1":return"תעשייתי";case"2":return"מסחרי";case"3":return"נותני שירותים";case"99":return"הדיווח כולל יותר מעסק אחד";default:return""}},Se=t=>{switch(t){case S.Cash:return"מזומן";case S.Accrual:return"מצטבר";case S.DollarRegulations:return"לפי תקנות דולריות";default:return""}},we=t=>{switch(t){case I.Shekels:return"שקלים";case I.Dollars:return"דולרים";default:return""}},Fe=t=>{switch(t){case L.DoubleEntry:return"כפולה";case L.SingleEntry:return"חד-צידית";default:return""}},Te=t=>{switch(t){case P.Computerized:return"ממוחשב";case P.Manual:return"ידני";default:return""}},De=t=>{switch(t){case N.Option_1:return"חלופה 1";case N.Option_2Adjustments:return"התאמות חשבונאיות למי שיישם את חלופה 2 בהוראת ביצוע 7/2010";case N.Option_3Adjustments:return"התאמות חשבונאיות למי שיישם את חלופה 3 בהוראת ביצוע 7/2010";case N.None:return"ללא חלופה";default:return""}},Re=t=>{switch(t){case p.Unqualified:return"נוסח אחיד (בלתי מסוייג)";case p.UnqualifiedWithGoingConcern:return"בנוסח אחיד עם הפניית תשומת לב להערת עסק חי";case p.UnqualifiedWithOtherEmphases:return"בנוסח אחיד עם הפניות תשומת לב אחרת";case p.Qualified:return"הסתייגות";case p.Adverse:return"שלילית";case p.Disclaimer:return"המנעות";case p.None:return"אין חוות דעת";default:return""}},y=t=>t==null?"":t?"כן":"לא";function Ae({data:t,businessInfo:d}){const{header:s}=j(ee,t),c=j(se,d);return e.jsx(w,{value:"header",className:"border rounded-md p-4",children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",dir:"rtl",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"text-lg font-bold border-b pb-2",children:"פרטים מזהים"}),e.jsx(m,{label:"השם הרשום",value:c.name,showEmptyFields:!0}),e.jsx(m,{label:"תיאור העיסוק המדווח",value:s.businessDescription??"",showEmptyFields:!0}),e.jsx(m,{label:"מספר זהות",value:s.idNumber,showEmptyFields:!0}),e.jsx(m,{label:"מספר תיק",value:s.taxFileNumber,showEmptyFields:!0}),e.jsx(m,{label:'תיק מדווח למע"מ',value:s.vatFileNumber??"",showEmptyFields:!0}),e.jsx(m,{label:"מספר תיק ניכויים",value:s.withholdingTaxFileNumber??"",showEmptyFields:!0})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"text-lg font-bold border-b pb-2",children:"פרטי העסק"}),e.jsx(m,{value:ye(s.businessType),label:"סוג העסק המדווח",showEmptyFields:!0}),e.jsx(m,{label:"שיטת דיווח",value:Se(s.reportingMethod),showEmptyFields:!0}),s.reportingMethod===S.DollarRegulations&&e.jsx(m,{label:"מטבע הסכומים",value:we(s.currencyType),showEmptyFields:!0}),e.jsx(m,{label:"הסכום באלפים",value:y(s.amountsInThousands),showEmptyFields:!0}),e.jsx(m,{label:"שיטת חשבונאות",value:Fe(s.accountingMethod),showEmptyFields:!0}),e.jsx(m,{label:"הנהלת חשבונות",value:Te(s.accountingSystem),showEmptyFields:!0}),e.jsx(m,{label:"חייב ברישום תוכנה",value:y(!!s.softwareRegistrationNumber),showEmptyFields:!0}),s.softwareRegistrationNumber&&e.jsx(m,{label:"מספר תעודת רישום",value:s.softwareRegistrationNumber,showEmptyFields:!0}),e.jsx(m,{label:"דוח בגין שותפות",value:y(!!s.isPartnership),showEmptyFields:!0}),s.isPartnership&&e.jsxs(e.Fragment,{children:[e.jsx(m,{label:"מספר שותפים",value:s.partnershipCount?.toString()??"",showEmptyFields:!0}),e.jsx(m,{label:"חלקי ברווחי השותפות",value:`${s.partnershipProfitShare}%`,showEmptyFields:!0})]}),e.jsx(m,{label:"יישום תקני חשבונאות (IFRS)",value:y(!!s.ifrsImplementationYear||!!s.ifrsReportingOption),showEmptyFields:!0}),(!!s.ifrsImplementationYear||!!s.ifrsReportingOption)&&e.jsxs(e.Fragment,{children:[e.jsx(m,{label:"החל משנת המס",value:s.ifrsImplementationYear??"",showEmptyFields:!0}),e.jsx(m,{label:"דווח בחלופה",value:De(s.ifrsReportingOption),showEmptyFields:!0})]}),e.jsx(m,{label:"מספר ענף כלכלי של המדווח",value:s.industryCode,showEmptyFields:!0}),e.jsx(m,{label:"חוות דעת המבקר",value:Re(s.auditOpinionType),showEmptyFields:!0})]})]})})}const Oe=[{title:"הכנסות ממכירות ומתן שירותים",color:"text-blue-700",codes:[1010,1015,1020,1025,1030,1040,1051,1052,1090],sumCode:1e3},{title:"עלות המכירות ומתן השירותים וביצוע עבודות",color:"text-purple-700",codes:[1306,1308,1307,1310,1320,1330,1340,1350,1360,1371,1372,1390,1400,1450],sumCode:1300},{title:"עלויות ייצור ועלויות אצל קבלן בונה",color:"text-rose-700",codes:[2005,2006,2011,2012,2015,2020,2025,2030,2035,2040,2045,2050,2060,2066,2067,2068,2070,2075,2080,2085,2090,2095],sumCode:2e3},{title:"הוצאות מחקר ופיתוח",color:"text-amber-700",codes:[2510,2520,2530,2540,2550,2560,2570,2590],sumCode:2500},{title:"הוצאות מכירה",color:"text-green-700",codes:[3011,3013,3012,3015,3020,3025,3030,3040,3045,3050,3060,3066,3067,3068,3070,3075,3080,3085,3090,3100,3120,3190],sumCode:3e3},{title:"הוצאות הנהלה וכלליות",color:"text-cyan-700",codes:[3511,3513,3512,3515,3520,3530,3535,3540,3545,3550,3560,3566,3567,3568,3570,3575,3580,3590,3595,3600,3610,3620,3625,3631,3632,3640,3650,3660,3665,3680,3685,3690],sumCode:3500},{title:"הוצאות מימון",color:"text-indigo-700",codes:[5010,5020,5025,5030,5040,5050,5051,5090],sumCode:5e3},{title:"הכנסות מימון",color:"text-fuchsia-700",codes:[5110,5121,5122,5130,5150,5160,5190],sumCode:5100},{title:"הכנסות אחרות",color:"text-red-700",codes:[5210,5220,5230,5236,5237,5240,5250,5260,5270,5290],sumCode:5200},{title:"הוצאות אחרות",color:"text-yellow-700",codes:[5310,5320,5330,5390],sumCode:5300}],ke=[{title:"מסים על הכנסה",color:"text-sky-700",codes:[5610,5620,5630],sumCode:5600},{title:"ייעוד הרווחים",color:"text-violet-700",codes:[5710],sumCode:5700},{title:"רווח/הפסד אקויטי",color:"text-pink-700",codes:[5810],sumCode:5800}];function Ee({selectedYear:t,referenceYear:d,data:s,referenceData:c,showEmptyFields:l=!1}){const{profitAndLoss:o}=j(B,s),r=j(B,c)?.profitAndLoss||[];return e.jsx(w,{value:"profitLoss",className:"border rounded-md p-4",children:e.jsxs("div",{className:"space-y-6",dir:"rtl",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("h3",{className:"text-lg font-bold border-b pb-2",children:"נתוני רווח והפסד"}),d&&t!==d&&e.jsxs("span",{className:"text-sm text-blue-600 bg-blue-50 px-2 py-1 rounded",children:["מציג שינויים לעומת ",d]})]}),Oe.map(a=>e.jsxs("div",{className:"bg-gray-50 p-4 rounded-md",children:[e.jsx("h4",{className:`font-bold mb-4 ${a.color}`,children:a.title}),e.jsxs("div",{className:"space-y-2",children:[a.codes.map(i=>e.jsx(u,{codes:o,referenceCodes:r,code:i,showEmptyFields:l},i)),e.jsx("div",{className:"border-2 rounded-md border-gray-300",children:e.jsx(u,{codes:o,referenceCodes:r,code:a.sumCode,showEmptyFields:l})})]})]},a.title)),e.jsx("div",{className:"bg-emerald-50 p-4 rounded-md border-2 border-emerald-200",children:e.jsx(u,{codes:o,referenceCodes:r,code:6666,showEmptyFields:l})}),ke.map(a=>e.jsxs("div",{className:"bg-gray-50 p-4 rounded-md",children:[e.jsx("h4",{className:`font-bold mb-4 ${a.color}`,children:a.title}),e.jsxs("div",{className:"space-y-2",children:[a.codes.map(i=>e.jsx(u,{codes:o,referenceCodes:r,code:i,showEmptyFields:l},i)),e.jsx("div",{className:"border-2 rounded-md border-gray-300",children:e.jsx(u,{codes:o,referenceCodes:r,code:a.sumCode,showEmptyFields:l})})]})]},a.title))]})})}const Me=[{title:"התאמות חשבונאיות למי שיישם את חלופה 2 בהוראת ביצוע 7/2010 בנושא IFRS",color:"red",codes:[103,104]},{title:"התאמות נדרשות לצרכי מס (הוסף/הפחת)",color:"yellow",codes:[110,120,130,135,140,150,160,170,180,181,182,183,184,190,200,300,310,320,330,350,360],sumCode:370},{title:"התאמות חשבונאיות למי שיישם את חלופה 3 בהוראת ביצוע 7/2010 בנושא IFRS שלא מצאו את ביטויין בהתאמות הנדרשות לצרכי מס",color:"emerald",codes:[383],sumCode:400},{title:"יישום הוראות חוקי מס נוספים",color:"sky",codes:[430,480,490],sumCode:500},{title:"נתונים נוספים",color:"violet",codes:[510,520,530,540,550,570,575,580,585,590]},{title:"בשותפות",color:"pink",codes:[600]}],$={red:{header:"text-red-700",sum:"bg-red-50 border-red-200"},yellow:{header:"text-yellow-700",sum:"bg-yellow-50 border-yellow-200"},emerald:{header:"text-emerald-700",sum:"bg-emerald-50 border-emerald-200"},sky:{header:"text-sky-700",sum:"bg-sky-50 border-sky-200"},violet:{header:"text-violet-700",sum:"bg-violet-50 border-violet-200"},pink:{header:"text-pink-700",sum:"bg-pink-50 border-pink-200"}};function Ie({data:t,referenceData:d,showEmptyFields:s=!1}){const{taxAdjustment:c}=j(V,t),o=j(V,d)?.taxAdjustment||[];return e.jsx(w,{value:"taxAdjustment",className:"border rounded-md p-4",children:e.jsxs("div",{className:"space-y-6",dir:"rtl",children:[e.jsx("h3",{className:"text-lg font-bold border-b pb-2",children:'נתוני דו"ח התאמה למס'}),e.jsx("div",{className:"bg-emerald-50 p-4 rounded-md border-2 border-emerald-200",children:e.jsx(u,{codes:c,referenceCodes:o,code:100,showEmptyFields:s})}),Me.map(n=>{const{header:r,sum:a}=$[n.color]||$.red;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"bg-gray-50 p-4 rounded-md",children:[e.jsx("h4",{className:"font-bold mb-4 "+r,children:n.title}),e.jsx("div",{className:"space-y-2",children:n.codes.map(i=>e.jsx(u,{codes:c,referenceCodes:o,code:i,showEmptyFields:s},i))})]}),n.sumCode&&e.jsx("div",{className:"p-4 rounded-md border-2 "+a,children:e.jsx(u,{codes:c,referenceCodes:o,code:n.sumCode,showEmptyFields:s})})]},n.title)})]})})}function Le({data:t,referenceData:d,businessInfo:s,selectedYear:c,referenceYear:l}){const o=j(Y,t),n=j(Y,d),[r,a]=b.useState("header"),[i,h]=b.useState(!0);return e.jsxs("div",{className:"p-4 border-gray-300",dir:"rtl",children:[e.jsxs("div",{className:"flex justify-between items-center mb-4",children:[e.jsx("div",{className:"flex items-center gap-4",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(g,{variant:i?"outline":"default",size:"sm",onClick:()=>h(!i),className:"flex items-center gap-2",children:[i?e.jsx(be,{className:"h-4 w-4"}):e.jsx(re,{className:"h-4 w-4"}),i?"הסתר שדות ריקים":"הצג שדות ריקים"]}),e.jsx("span",{className:"text-sm text-gray-500",children:i?"מציג את כל השדות":"מציג רק שדות עם נתונים"})]})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(g,{variant:"outline",className:"flex items-center gap-2",children:[e.jsx(te,{className:"h-4 w-4"}),"הורד"]}),e.jsxs(g,{variant:"outline",className:"flex items-center gap-2",children:[e.jsx(xe,{className:"h-4 w-4"}),"שמור"]})]})]}),e.jsxs(ae,{value:r,onValueChange:a,className:"w-full",children:[e.jsxs(le,{className:"grid grid-cols-4 w-full",dir:"rtl",children:[e.jsx(v,{value:"header",children:"פרטים מזהים"}),e.jsx(v,{value:"profitLoss",children:"רווח והפסד"}),e.jsx(v,{value:"taxAdjustment",children:"התאמה למס"}),e.jsx(v,{value:"balanceSheet",children:"מאזן"})]}),e.jsx(Ae,{data:o,businessInfo:s}),e.jsx(Ee,{selectedYear:c,referenceYear:l,data:o,referenceData:n,showEmptyFields:i}),e.jsx(Ie,{data:o,referenceData:n,showEmptyFields:i}),e.jsx(Ce,{data:o,referenceData:n,showEmptyFields:i})]})]})}function qe(){const{setFiltersContext:t}=b.useContext(de),[d,s]=b.useState(void 0),[c,l]=b.useState(void 0),[o,n]=b.useState(void 0),[{data:r,fetching:a}]=ne({query:me,variables:{year:c?Number.parseInt(c,10):0,businessId:d},pause:!c||!d});return b.useEffect(()=>{t(e.jsx("div",{className:"flex flex-row gap-x-5",dir:"rtl",children:e.jsx(je,{selectedBusiness:d,setSelectedBusiness:s,selectedYear:c,setSelectedYear:l,referenceYear:o,setReferenceYear:n})}))},[t,d,c,o]),e.jsx("div",{className:"container mx-auto",dir:"rtl",children:e.jsxs(oe,{className:"border-2 border-gray-300",children:[e.jsx(ce,{className:"bg-gray-100 border-b-2 border-gray-300 flex flex-row justify-between items-center",children:e.jsxs("div",{className:"text-center w-full",children:[e.jsx("h1",{className:"text-2xl font-bold",children:'נספח לטופס הדו"ח השנתי ליחיד ולחבר בני אדם'}),e.jsxs("h2",{className:"text-xl",children:["לשנת המס ",c]}),e.jsx("p",{className:"text-sm",children:'נתוני הדוחות הכספיים, מאזן, רווח והפסד ודו"ח ההתאמה למס'})]})}),e.jsx(ie,{className:"p-0",children:e.jsx(Pe,{fetching:a,data:r,selectedBusiness:d,selectedYear:c,referenceYear:o})})]})})}function Pe({fetching:t,data:d,selectedBusiness:s,selectedYear:c,referenceYear:l}){if(t)return e.jsx("div",{className:"container mx-auto p-8 text-center",dir:"rtl",children:e.jsx("p",{className:"text-lg text-gray-600",children:"טוען נתונים..."})});if(!c||!s)return e.jsx("div",{className:"container mx-auto p-8 text-center",dir:"rtl",children:e.jsx("p",{className:"text-lg text-gray-600",children:"יש לבחור עסק ושנת דיווח"})});const o=d?.shaam6111.data;return o?e.jsx(Le,{data:o,businessInfo:d.shaam6111.business,selectedBusiness:s,selectedYear:c,referenceYear:l}):e.jsx("div",{className:"container mx-auto p-8 text-center",dir:"rtl",children:e.jsx("p",{className:"text-lg text-gray-600",children:"אין נתונים זמינים עבור העסק והשנה שנבחרו"})})}export{qe as Shaam6111Report};
|
|
6
|
+
*/const he=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],be=z("eye-off",he),C=["2020","2021","2022","2023"];function je({selectedBusiness:t,setSelectedBusiness:d,selectedYear:s,setSelectedYear:c,referenceYear:l,setReferenceYear:o}){const[n,r]=b.useState(!s||!t),{selectableBusinesses:a,fetching:i}=Q(),h=b.useMemo(()=>t?a.find(f=>f.value===t)?.label??"":"",[a,t]);return e.jsxs(U,{open:n,onOpenChange:r,children:[e.jsx(W,{asChild:!0,children:e.jsxs(g,{variant:"outline",className:"flex items-center gap-2",children:[e.jsx(V,{className:"h-4 w-4"}),"מסננים",e.jsxs("span",{className:"text-xs bg-blue-100 text-blue-800 px-2 py-0.5 rounded-full",children:[h," • ",s]})]})}),e.jsxs(G,{className:"sm:max-w-md",dir:"rtl",children:[e.jsx(J,{children:e.jsxs(K,{className:"flex items-center gap-2",children:[e.jsx(V,{className:"h-5 w-5"}),"מסנני דוח"]})}),e.jsxs("div",{className:"space-y-6 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(T,{htmlFor:"business-select",className:"flex items-center gap-2",children:[e.jsx(ue,{className:"h-4 w-4"}),"בחירת עסק"]}),e.jsx(Z,{onChange:x=>d(x??void 0),data:a,value:t,disabled:i,placeholder:"Scroll to see all options",triggerProps:{className:"w-full"}})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(T,{htmlFor:"year-select",className:"flex items-center gap-2",children:[e.jsx(R,{className:"h-4 w-4"}),"שנת דיווח"]}),e.jsxs(A,{value:s,onValueChange:c,children:[e.jsx(O,{id:"year-select",children:e.jsx(k,{})}),e.jsx(E,{children:C.map(x=>e.jsx(D,{value:x,children:x},x))})]}),e.jsxs("p",{className:"text-xs text-gray-500",children:["זמינות נתונים: ",C.join(", ")]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(T,{htmlFor:"reference-year-select",className:"flex items-center gap-2",children:[e.jsx(R,{className:"h-4 w-4"}),"שנת השוואה"]}),e.jsxs(A,{value:l,onValueChange:x=>o(x==="none"?void 0:x),children:[e.jsx(O,{id:"reference-year-select",children:e.jsx(k,{})}),e.jsxs(E,{children:[e.jsx(D,{value:"none",children:"ללא"},"none"),C.map(x=>e.jsx(D,{value:x,children:x},x))]})]}),e.jsxs("p",{className:"text-xs text-gray-500",children:["זמינות נתונים: ",C.join(", ")]})]}),e.jsxs("div",{className:"flex justify-end gap-2 pt-4",children:[e.jsx(g,{variant:"outline",onClick:()=>r(!1),children:"ביטול"}),e.jsx(g,{onClick:()=>r(!1),children:"אישור"})]})]})]})]})}const m=({label:t,value:d,code:s,referenceValue:c,showEmptyFields:l,showChange:o=!1})=>{const n=h=>l?!0:!r(h),r=h=>!h||h.trim()===""||h==="0"||h==="0.00",a=(h,x)=>{if(!x)return null;const f=q=>Number.parseFloat(q.replace(/[,\s₪]/g,""))||0,H=f(h),F=f(x);return F===0?null:(H-F)/F*100};if(!n(d))return null;const i=o?a(d,c):null;return e.jsxs("div",{className:"flex justify-between items-center py-2 border-b border-gray-200",dir:"rtl",children:[e.jsxs("span",{className:"text-sm text-gray-600",children:[t," ",s&&`(${s})`]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:`font-medium ${r(d)?"text-gray-400":""}`,children:r(d)?"0":d}),i!==null&&e.jsxs("span",{className:`text-xs px-1 py-0.5 rounded ${i>0?"text-green-700 bg-green-100":i<0?"text-red-700 bg-red-100":"text-gray-700 bg-gray-100"}`,children:[i>0?"+":"",i.toFixed(1),"%"]})]})]})},u=({codes:t,referenceCodes:d,code:s,showEmptyFields:c})=>{const{value:l,label:o}=b.useMemo(()=>{const r=t.find(a=>a.code===s);return{value:r?.amount||0,label:r?.label||"לא זוהה קוד"}},[t,s]),n=b.useMemo(()=>d?.find(r=>r.code===s)?.amount.toString()||"",[d,s]);return e.jsx(m,{label:o,value:X(l,0),code:String(s),showChange:!0,showEmptyFields:c,referenceValue:n})},pe=[{title:"מזומנים ושווי מזומנים",codes:[7110,7120,7150],sumCode:7100},{title:"ניירות ערך",codes:[7215,7225,7230,7290,7295],sumCode:7200},{title:"לקוחות",codes:[7310,7320,7330,7350,7360,7380,7390],sumCode:7300},{title:"חייבים ויתרות חובה",codes:[7410,7420,7430,7440,7450,7461,7462,7470,7490],sumCode:7400},{title:"מסים נדחים לזמן קצר",codes:[7610,7620,7690],sumCode:7600},{title:"הלוואות לזמן קצר",codes:[7711,7712,7720],sumCode:7700},{title:"מלאי",codes:[7805,7810,7815,7820,7825,7830,7840,7850,7860,7870,7890],sumCode:7800}],ge=[{title:"רכוש קבוע",codes:[8010,8020,8025,8030,8040,8050,8060,8080,8090,8095,8100,8105,8110,8120,8130,8140,8150,8160,8170,8180,8190],sumCode:8e3},{title:"נכסים לא שוטפים מוחזקים למכירה",codes:[8710],sumCode:8700},{title:"הוצאות מראש לזמן ארוך",codes:[8210,8220,8290],sumCode:8200},{title:"השקעות בחברות מוחזקות כלולות ומאוחדות",codes:[8315,8325,8335,8340,8350],sumCode:8300},{title:'השקעות בחברות אחרות כולל ני"ע סחירים מוחזקים לזמן ארוך',codes:[8410,8420,8440,8450,8460,8490],sumCode:8400},{title:"מסים נדחים לזמן ארוך",codes:[8510,8520,8590],sumCode:8500},{title:"הוצאות נדחות ורכוש אחר",codes:[8610,8620,8630,8640,8690],sumCode:8600}],fe=[{title:"בנקים והלואות לזמן קצר",codes:[9110,9120,9130,9140,9151,9152,9190],sumCode:9100},{title:"ספקים ונותני שירותים",codes:[9210,9220,9230,9290],sumCode:9200},{title:"זכאים ויתרות זכות",codes:[9310,9320,9330,9340,9350,9360,9370,9410,9420,9431,9432,9435,9440,9450,9460,9470,9480,9490],sumCode:9400},{title:"עתודה למסים נדחים לזמן קצר",codes:[9510,9520,9530],sumCode:9500}],Ne=[{title:"התחייבויות לזמן ארוך",codes:[9605,9610,9620,9631,9632,9640,9650,9660,9670,9690],sumCode:9600},{title:"התחייבויות בשל סיום יחסי עובד-מעביד",codes:[9710,9720,9790],sumCode:9700},{title:"עתודה למסים נדחים לזמן ארוך",codes:[9810,9820,9890],sumCode:9800}],ve=[{title:"הון עצמי",codes:[9910,9920,9930,9940,9950,9960,9980],sumCode:9900}];function Ce({data:t,referenceData:d,showEmptyFields:s=!1}){const l=j(M,t).balanceSheet||[],n=j(M,d)?.balanceSheet||[];return e.jsx(w,{value:"balanceSheet",className:"border rounded-md p-4",children:e.jsxs("div",{className:"space-y-6",dir:"rtl",children:[e.jsx("h3",{className:"text-lg font-bold border-b pb-2",children:"נתוני המאזן"}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx("h4",{className:"text-lg font-bold text-blue-800 border-b pb-2",children:"נכסים"}),e.jsx("div",{className:"bg-blue-100 p-4 rounded-md border-2 border-blue-300",children:e.jsx("h5",{className:"font-bold",children:"רכוש שוטף"})}),pe.map(r=>e.jsxs("div",{className:"bg-blue-50 p-4 rounded-md",children:[e.jsx("h6",{className:"font-bold mb-3",children:r.title}),e.jsxs("div",{className:"space-y-2",children:[r.codes.map(a=>e.jsx(u,{codes:l,referenceCodes:n,code:a,showEmptyFields:s},a)),e.jsx("div",{className:"border-2 rounded-md border-gray-300",children:e.jsx(u,{codes:l,referenceCodes:n,code:r.sumCode,showEmptyFields:s})})]})]},r.title)),e.jsx("div",{className:"bg-blue-100 p-4 rounded-md border-2 border-blue-300",children:e.jsx(u,{codes:l,code:7e3,showEmptyFields:s})}),ge.map(r=>e.jsxs("div",{className:"bg-blue-50 p-4 rounded-md",children:[e.jsx("h6",{className:"font-bold mb-3",children:r.title}),e.jsxs("div",{className:"space-y-2",children:[r.codes.map(a=>e.jsx(u,{codes:l,referenceCodes:n,code:a,showEmptyFields:s},a)),e.jsx("div",{className:"border-2 rounded-md border-gray-300",children:e.jsx(u,{codes:l,referenceCodes:n,code:r.sumCode,showEmptyFields:s})})]})]},r.title)),e.jsx("div",{className:"bg-blue-100 p-4 rounded-md border-2 border-blue-300",children:e.jsx(u,{codes:l,code:8888,showEmptyFields:s})})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h4",{className:"text-lg font-bold text-red-800 border-b pb-2",children:"התחייבויות והון"}),e.jsx("div",{className:"bg-red-100 p-4 rounded-md border-2 border-red-300",children:e.jsx("h5",{className:"font-bold",children:"התחייבויות שוטפות"})}),fe.map(r=>e.jsxs("div",{className:"bg-red-50 p-4 rounded-md",children:[e.jsx("h6",{className:"font-bold mb-3",children:r.title}),e.jsxs("div",{className:"space-y-2",children:[r.codes.map(a=>e.jsx(u,{codes:l,referenceCodes:n,code:a,showEmptyFields:s},a)),e.jsx("div",{className:"border-2 rounded-md border-gray-300",children:e.jsx(u,{codes:l,referenceCodes:n,code:r.sumCode,showEmptyFields:s})})]})]},r.title)),e.jsx("div",{className:"bg-red-100 p-4 rounded-md border-2 border-red-300",children:e.jsx(u,{codes:l,code:9e3,showEmptyFields:s})}),Ne.map(r=>e.jsxs("div",{className:"bg-red-50 p-4 rounded-md",children:[e.jsx("h6",{className:"font-bold mb-3",children:r.title}),e.jsxs("div",{className:"space-y-2",children:[r.codes.map(a=>e.jsx(u,{codes:l,referenceCodes:n,code:a,showEmptyFields:s},a)),e.jsx("div",{className:"border-2 rounded-md border-gray-300",children:e.jsx(u,{codes:l,referenceCodes:n,code:r.sumCode,showEmptyFields:s})})]})]},r.title)),ve.map(r=>e.jsxs("div",{className:"bg-green-50 p-4 rounded-md",children:[e.jsx("h5",{className:"font-bold mb-3",children:r.title}),e.jsx("div",{className:"space-y-2",children:r.codes.map(a=>e.jsx(u,{codes:l,referenceCodes:n,code:a,showEmptyFields:s},a))})]},r.title)),e.jsx("div",{className:"bg-red-100 p-4 rounded-md border-2 border-red-300",children:e.jsx(u,{codes:l,code:9999,showEmptyFields:s})})]})]})]})})}const ye=t=>{switch(t){case"1":return"תעשייתי";case"2":return"מסחרי";case"3":return"נותני שירותים";case"99":return"הדיווח כולל יותר מעסק אחד";default:return""}},Se=t=>{switch(t){case S.Cash:return"מזומן";case S.Accrual:return"מצטבר";case S.DollarRegulations:return"לפי תקנות דולריות";default:return""}},we=t=>{switch(t){case I.Shekels:return"שקלים";case I.Dollars:return"דולרים";default:return""}},Fe=t=>{switch(t){case L.DoubleEntry:return"כפולה";case L.SingleEntry:return"חד-צידית";default:return""}},Te=t=>{switch(t){case P.Computerized:return"ממוחשב";case P.Manual:return"ידני";default:return""}},De=t=>{switch(t){case N.Option_1:return"חלופה 1";case N.Option_2Adjustments:return"התאמות חשבונאיות למי שיישם את חלופה 2 בהוראת ביצוע 7/2010";case N.Option_3Adjustments:return"התאמות חשבונאיות למי שיישם את חלופה 3 בהוראת ביצוע 7/2010";case N.None:return"ללא חלופה";default:return""}},Re=t=>{switch(t){case p.Unqualified:return"נוסח אחיד (בלתי מסוייג)";case p.UnqualifiedWithGoingConcern:return"בנוסח אחיד עם הפניית תשומת לב להערת עסק חי";case p.UnqualifiedWithOtherEmphases:return"בנוסח אחיד עם הפניות תשומת לב אחרת";case p.Qualified:return"הסתייגות";case p.Adverse:return"שלילית";case p.Disclaimer:return"המנעות";case p.None:return"אין חוות דעת";default:return""}},y=t=>t==null?"":t?"כן":"לא";function Ae({data:t,businessInfo:d}){const{header:s}=j(ee,t),c=j(se,d);return e.jsx(w,{value:"header",className:"border rounded-md p-4",children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",dir:"rtl",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"text-lg font-bold border-b pb-2",children:"פרטים מזהים"}),e.jsx(m,{label:"השם הרשום",value:c.name,showEmptyFields:!0}),e.jsx(m,{label:"תיאור העיסוק המדווח",value:s.businessDescription??"",showEmptyFields:!0}),e.jsx(m,{label:"מספר זהות",value:s.idNumber,showEmptyFields:!0}),e.jsx(m,{label:"מספר תיק",value:s.taxFileNumber,showEmptyFields:!0}),e.jsx(m,{label:'תיק מדווח למע"מ',value:s.vatFileNumber??"",showEmptyFields:!0}),e.jsx(m,{label:"מספר תיק ניכויים",value:s.withholdingTaxFileNumber??"",showEmptyFields:!0})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"text-lg font-bold border-b pb-2",children:"פרטי העסק"}),e.jsx(m,{value:ye(s.businessType),label:"סוג העסק המדווח",showEmptyFields:!0}),e.jsx(m,{label:"שיטת דיווח",value:Se(s.reportingMethod),showEmptyFields:!0}),s.reportingMethod===S.DollarRegulations&&e.jsx(m,{label:"מטבע הסכומים",value:we(s.currencyType),showEmptyFields:!0}),e.jsx(m,{label:"הסכום באלפים",value:y(s.amountsInThousands),showEmptyFields:!0}),e.jsx(m,{label:"שיטת חשבונאות",value:Fe(s.accountingMethod),showEmptyFields:!0}),e.jsx(m,{label:"הנהלת חשבונות",value:Te(s.accountingSystem),showEmptyFields:!0}),e.jsx(m,{label:"חייב ברישום תוכנה",value:y(!!s.softwareRegistrationNumber),showEmptyFields:!0}),s.softwareRegistrationNumber&&e.jsx(m,{label:"מספר תעודת רישום",value:s.softwareRegistrationNumber,showEmptyFields:!0}),e.jsx(m,{label:"דוח בגין שותפות",value:y(!!s.isPartnership),showEmptyFields:!0}),s.isPartnership&&e.jsxs(e.Fragment,{children:[e.jsx(m,{label:"מספר שותפים",value:s.partnershipCount?.toString()??"",showEmptyFields:!0}),e.jsx(m,{label:"חלקי ברווחי השותפות",value:`${s.partnershipProfitShare}%`,showEmptyFields:!0})]}),e.jsx(m,{label:"יישום תקני חשבונאות (IFRS)",value:y(!!s.ifrsImplementationYear||!!s.ifrsReportingOption),showEmptyFields:!0}),(!!s.ifrsImplementationYear||!!s.ifrsReportingOption)&&e.jsxs(e.Fragment,{children:[e.jsx(m,{label:"החל משנת המס",value:s.ifrsImplementationYear??"",showEmptyFields:!0}),e.jsx(m,{label:"דווח בחלופה",value:De(s.ifrsReportingOption),showEmptyFields:!0})]}),e.jsx(m,{label:"מספר ענף כלכלי של המדווח",value:s.industryCode,showEmptyFields:!0}),e.jsx(m,{label:"חוות דעת המבקר",value:Re(s.auditOpinionType),showEmptyFields:!0})]})]})})}const Oe=[{title:"הכנסות ממכירות ומתן שירותים",color:"text-blue-700",codes:[1010,1015,1020,1025,1030,1040,1051,1052,1090],sumCode:1e3},{title:"עלות המכירות ומתן השירותים וביצוע עבודות",color:"text-purple-700",codes:[1306,1308,1307,1310,1320,1330,1340,1350,1360,1371,1372,1390,1400,1450],sumCode:1300},{title:"עלויות ייצור ועלויות אצל קבלן בונה",color:"text-rose-700",codes:[2005,2006,2011,2012,2015,2020,2025,2030,2035,2040,2045,2050,2060,2066,2067,2068,2070,2075,2080,2085,2090,2095],sumCode:2e3},{title:"הוצאות מחקר ופיתוח",color:"text-amber-700",codes:[2510,2520,2530,2540,2550,2560,2570,2590],sumCode:2500},{title:"הוצאות מכירה",color:"text-green-700",codes:[3011,3013,3012,3015,3020,3025,3030,3040,3045,3050,3060,3066,3067,3068,3070,3075,3080,3085,3090,3100,3120,3190],sumCode:3e3},{title:"הוצאות הנהלה וכלליות",color:"text-cyan-700",codes:[3511,3513,3512,3515,3520,3530,3535,3540,3545,3550,3560,3566,3567,3568,3570,3575,3580,3590,3595,3600,3610,3620,3625,3631,3632,3640,3650,3660,3665,3680,3685,3690],sumCode:3500},{title:"הוצאות מימון",color:"text-indigo-700",codes:[5010,5020,5025,5030,5040,5050,5051,5090],sumCode:5e3},{title:"הכנסות מימון",color:"text-fuchsia-700",codes:[5110,5121,5122,5130,5150,5160,5190],sumCode:5100},{title:"הכנסות אחרות",color:"text-red-700",codes:[5210,5220,5230,5236,5237,5240,5250,5260,5270,5290],sumCode:5200},{title:"הוצאות אחרות",color:"text-yellow-700",codes:[5310,5320,5330,5390],sumCode:5300}],ke=[{title:"מסים על הכנסה",color:"text-sky-700",codes:[5610,5620,5630],sumCode:5600},{title:"ייעוד הרווחים",color:"text-violet-700",codes:[5710],sumCode:5700},{title:"רווח/הפסד אקויטי",color:"text-pink-700",codes:[5810],sumCode:5800}];function Ee({selectedYear:t,referenceYear:d,data:s,referenceData:c,showEmptyFields:l=!1}){const{profitAndLoss:o}=j(B,s),r=j(B,c)?.profitAndLoss||[];return e.jsx(w,{value:"profitLoss",className:"border rounded-md p-4",children:e.jsxs("div",{className:"space-y-6",dir:"rtl",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("h3",{className:"text-lg font-bold border-b pb-2",children:"נתוני רווח והפסד"}),d&&t!==d&&e.jsxs("span",{className:"text-sm text-blue-600 bg-blue-50 px-2 py-1 rounded",children:["מציג שינויים לעומת ",d]})]}),Oe.map(a=>e.jsxs("div",{className:"bg-gray-50 p-4 rounded-md",children:[e.jsx("h4",{className:`font-bold mb-4 ${a.color}`,children:a.title}),e.jsxs("div",{className:"space-y-2",children:[a.codes.map(i=>e.jsx(u,{codes:o,referenceCodes:r,code:i,showEmptyFields:l},i)),e.jsx("div",{className:"border-2 rounded-md border-gray-300",children:e.jsx(u,{codes:o,referenceCodes:r,code:a.sumCode,showEmptyFields:l})})]})]},a.title)),e.jsx("div",{className:"bg-emerald-50 p-4 rounded-md border-2 border-emerald-200",children:e.jsx(u,{codes:o,referenceCodes:r,code:6666,showEmptyFields:l})}),ke.map(a=>e.jsxs("div",{className:"bg-gray-50 p-4 rounded-md",children:[e.jsx("h4",{className:`font-bold mb-4 ${a.color}`,children:a.title}),e.jsxs("div",{className:"space-y-2",children:[a.codes.map(i=>e.jsx(u,{codes:o,referenceCodes:r,code:i,showEmptyFields:l},i)),e.jsx("div",{className:"border-2 rounded-md border-gray-300",children:e.jsx(u,{codes:o,referenceCodes:r,code:a.sumCode,showEmptyFields:l})})]})]},a.title))]})})}const Me=[{title:"התאמות חשבונאיות למי שיישם את חלופה 2 בהוראת ביצוע 7/2010 בנושא IFRS",color:"red",codes:[103,104]},{title:"התאמות נדרשות לצרכי מס (הוסף/הפחת)",color:"yellow",codes:[110,120,130,135,140,150,160,170,180,181,182,183,184,190,200,300,310,320,330,350,360],sumCode:370},{title:"התאמות חשבונאיות למי שיישם את חלופה 3 בהוראת ביצוע 7/2010 בנושא IFRS שלא מצאו את ביטויין בהתאמות הנדרשות לצרכי מס",color:"emerald",codes:[383],sumCode:400},{title:"יישום הוראות חוקי מס נוספים",color:"sky",codes:[430,480,490],sumCode:500},{title:"נתונים נוספים",color:"violet",codes:[510,520,530,540,550,570,575,580,585,590]},{title:"בשותפות",color:"pink",codes:[600]}],Y={red:{header:"text-red-700",sum:"bg-red-50 border-red-200"},yellow:{header:"text-yellow-700",sum:"bg-yellow-50 border-yellow-200"},emerald:{header:"text-emerald-700",sum:"bg-emerald-50 border-emerald-200"},sky:{header:"text-sky-700",sum:"bg-sky-50 border-sky-200"},violet:{header:"text-violet-700",sum:"bg-violet-50 border-violet-200"},pink:{header:"text-pink-700",sum:"bg-pink-50 border-pink-200"}};function Ie({data:t,referenceData:d,showEmptyFields:s=!1}){const{taxAdjustment:c}=j(_,t),o=j(_,d)?.taxAdjustment||[];return e.jsx(w,{value:"taxAdjustment",className:"border rounded-md p-4",children:e.jsxs("div",{className:"space-y-6",dir:"rtl",children:[e.jsx("h3",{className:"text-lg font-bold border-b pb-2",children:'נתוני דו"ח התאמה למס'}),e.jsx("div",{className:"bg-emerald-50 p-4 rounded-md border-2 border-emerald-200",children:e.jsx(u,{codes:c,referenceCodes:o,code:100,showEmptyFields:s})}),Me.map(n=>{const{header:r,sum:a}=Y[n.color]||Y.red;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"bg-gray-50 p-4 rounded-md",children:[e.jsx("h4",{className:"font-bold mb-4 "+r,children:n.title}),e.jsx("div",{className:"space-y-2",children:n.codes.map(i=>e.jsx(u,{codes:c,referenceCodes:o,code:i,showEmptyFields:s},i))})]}),n.sumCode&&e.jsx("div",{className:"p-4 rounded-md border-2 "+a,children:e.jsx(u,{codes:c,referenceCodes:o,code:n.sumCode,showEmptyFields:s})})]},n.title)})]})})}function Le({data:t,referenceData:d,businessInfo:s,selectedYear:c,referenceYear:l}){const o=j($,t),n=j($,d),[r,a]=b.useState("header"),[i,h]=b.useState(!0);return e.jsxs("div",{className:"p-4 border-gray-300",dir:"rtl",children:[e.jsxs("div",{className:"flex justify-between items-center mb-4",children:[e.jsx("div",{className:"flex items-center gap-4",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(g,{variant:i?"outline":"default",size:"sm",onClick:()=>h(!i),className:"flex items-center gap-2",children:[i?e.jsx(be,{className:"h-4 w-4"}):e.jsx(re,{className:"h-4 w-4"}),i?"הסתר שדות ריקים":"הצג שדות ריקים"]}),e.jsx("span",{className:"text-sm text-gray-500",children:i?"מציג את כל השדות":"מציג רק שדות עם נתונים"})]})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(g,{variant:"outline",className:"flex items-center gap-2",children:[e.jsx(te,{className:"h-4 w-4"}),"הורד"]}),e.jsxs(g,{variant:"outline",className:"flex items-center gap-2",children:[e.jsx(xe,{className:"h-4 w-4"}),"שמור"]})]})]}),e.jsxs(ae,{value:r,onValueChange:a,className:"w-full",children:[e.jsxs(le,{className:"grid grid-cols-4 w-full",dir:"rtl",children:[e.jsx(v,{value:"header",children:"פרטים מזהים"}),e.jsx(v,{value:"profitLoss",children:"רווח והפסד"}),e.jsx(v,{value:"taxAdjustment",children:"התאמה למס"}),e.jsx(v,{value:"balanceSheet",children:"מאזן"})]}),e.jsx(Ae,{data:o,businessInfo:s}),e.jsx(Ee,{selectedYear:c,referenceYear:l,data:o,referenceData:n,showEmptyFields:i}),e.jsx(Ie,{data:o,referenceData:n,showEmptyFields:i}),e.jsx(Ce,{data:o,referenceData:n,showEmptyFields:i})]})]})}function He(){const{setFiltersContext:t}=b.useContext(de),[d,s]=b.useState(void 0),[c,l]=b.useState(void 0),[o,n]=b.useState(void 0),[{data:r,fetching:a}]=ne({query:me,variables:{year:c?Number.parseInt(c,10):0,businessId:d},pause:!c||!d});return b.useEffect(()=>{t(e.jsx("div",{className:"flex flex-row gap-x-5",dir:"rtl",children:e.jsx(je,{selectedBusiness:d,setSelectedBusiness:s,selectedYear:c,setSelectedYear:l,referenceYear:o,setReferenceYear:n})}))},[t,d,c,o]),e.jsx("div",{className:"container mx-auto",dir:"rtl",children:e.jsxs(oe,{className:"border-2 border-gray-300",children:[e.jsx(ce,{className:"bg-gray-100 border-b-2 border-gray-300 flex flex-row justify-between items-center",children:e.jsxs("div",{className:"text-center w-full",children:[e.jsx("h1",{className:"text-2xl font-bold",children:'נספח לטופס הדו"ח השנתי ליחיד ולחבר בני אדם'}),e.jsxs("h2",{className:"text-xl",children:["לשנת המס ",c]}),e.jsx("p",{className:"text-sm",children:'נתוני הדוחות הכספיים, מאזן, רווח והפסד ודו"ח ההתאמה למס'})]})}),e.jsx(ie,{className:"p-0",children:e.jsx(Pe,{fetching:a,data:r,selectedBusiness:d,selectedYear:c,referenceYear:o})})]})})}function Pe({fetching:t,data:d,selectedBusiness:s,selectedYear:c,referenceYear:l}){if(t)return e.jsx("div",{className:"container mx-auto p-8 text-center",dir:"rtl",children:e.jsx("p",{className:"text-lg text-gray-600",children:"טוען נתונים..."})});if(!c||!s)return e.jsx("div",{className:"container mx-auto p-8 text-center",dir:"rtl",children:e.jsx("p",{className:"text-lg text-gray-600",children:"יש לבחור עסק ושנת דיווח"})});const o=d?.shaam6111.data;return o?e.jsx(Le,{data:o,businessInfo:d.shaam6111.business,selectedBusiness:s,selectedYear:c,referenceYear:l}):e.jsx("div",{className:"container mx-auto p-8 text-center",dir:"rtl",children:e.jsx("p",{className:"text-lg text-gray-600",children:"אין נתונים זמינים עבור העסק והשנה שנבחרו"})})}export{He as Shaam6111Report};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as m,j as e,B as u,a as y,F as R,u as T,L as D,
|
|
1
|
+
import{r as m,j as e,B as u,a as y,F as R,u as T,L as D,fU as E}from"./index-B2_EbsaK.js";import{d as b}from"./graphql-document-dedupe-fragments-ByT8-wlV.js";import{P as w}from"./page-layout-C0GJoVTR.js";import{R as d}from"./report-commentary-row-CNIlhboC.js";import{P as F}from"./modal-B0uNLang.js";import{Y as f}from"./YearPickerInput-CgU-feeq.js";import{F as g}from"./funnel-BlaCusqP.js";import{T as v}from"./Table-CYqAEQfS.js";import"./toggle-expansion-button-41Ejffq3.js";import"./panel-top-open-BFNhAe3f.js";function B({year:i,setYear:h,referenceYears:x,setReferenceYears:j}){const[l,c]=m.useState(!1);return e.jsxs(e.Fragment,{children:[e.jsx(F,{opened:l,onClose:()=>c(!1),withCloseButton:!0,content:e.jsxs(e.Fragment,{children:[e.jsx(f,{label:"Change report year",value:new Date(i,0,1),onChange:n=>n&&h(n?.getFullYear()),popoverProps:{withinPortal:!0},minDate:new Date(2010,0,1),maxDate:new Date}),e.jsx(f,{type:"multiple",label:"Pick reference years",value:x?.map(n=>new Date(n,0,1)),onChange:n=>j(n.map(o=>o.getFullYear()).filter(o=>i!==o)),popoverProps:{withinPortal:!0},minDate:new Date(2010,0,1),maxDate:new Date})]})}),e.jsx(u,{variant:"outline",size:"icon",className:"size-7.5",onClick:()=>c(!0),children:e.jsx(g,{className:"size-5"})})]})}const G=()=>{const{year:i}=y(),{setFiltersContext:h}=m.useContext(R),[x,j]=m.useState(i?Number(i):new Date().getFullYear()),[l,c]=m.useState([]),[{data:n,fetching:o}]=T({query:b(E),variables:{reportYear:x,referenceYears:l}});m.useEffect(()=>{h(e.jsx("div",{className:"flex flex-row gap-2",children:e.jsx(B,{year:x,setYear:j,referenceYears:l,setReferenceYears:c})}))},[x,o,h,l,c]);const p=n?.taxReport,s=p?.report,r=p?.reference??[];return e.jsx(w,{title:"Tax Report",children:o?e.jsx(D,{className:"h-10 w-10 animate-spin mr-2 self-center"}):e.jsx("div",{className:"flex flex-col gap-4",children:s&&e.jsxs(v,{highlightOnHover:!0,fontSize:"md",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{}),e.jsx("th",{children:x},x),e.jsx("th",{}),r.map(t=>e.jsx("th",{children:t.year},t.year))]})}),e.jsxs("tbody",{children:[e.jsx(d,{dataRow:t=>e.jsxs("tr",{children:[e.jsx("th",{children:"Profit Before Tax"}),e.jsx("th",{children:s.profitBeforeTax.amount.formatted}),e.jsx("th",{children:t}),r.map(a=>e.jsx("th",{children:a.profitBeforeTax.amount.formatted},a.year))]}),commentaryData:s.profitBeforeTax}),e.jsx(d,{dataRow:t=>e.jsxs("tr",{children:[e.jsx("td",{children:"R&D Expenses By Records"}),e.jsx("td",{children:s.researchAndDevelopmentExpensesByRecords.amount.formatted}),e.jsx("th",{children:t}),r.map(a=>e.jsx("td",{children:a.researchAndDevelopmentExpensesByRecords.amount.formatted},a.year))]}),commentaryData:s.researchAndDevelopmentExpensesByRecords}),e.jsxs("tr",{children:[e.jsx("td",{children:"R&D Expenses For Tax"}),e.jsx("td",{children:s.researchAndDevelopmentExpensesForTax.formatted}),e.jsx("td",{}),r.map(t=>e.jsx("td",{children:t.researchAndDevelopmentExpensesForTax.formatted},t.year)),e.jsx("td",{})]}),e.jsx(d,{dataRow:t=>e.jsxs("tr",{children:[e.jsx("td",{children:"Fines"}),e.jsx("td",{children:s.fines.amount.formatted}),e.jsx("th",{children:t}),r.map(a=>e.jsx("td",{children:a.fines.amount.formatted},a.year))]}),commentaryData:s.fines}),e.jsx(d,{dataRow:t=>e.jsxs("tr",{children:[e.jsx("td",{children:"Untaxable Gifts"}),e.jsx("td",{children:s.untaxableGifts.amount.formatted}),e.jsx("th",{children:t}),r.map(a=>e.jsx("td",{children:a.untaxableGifts.amount.formatted},a.year))]}),commentaryData:s.untaxableGifts}),e.jsxs("tr",{children:[e.jsx("td",{children:"Business Trips Excess Expenses"}),e.jsx("td",{children:s.businessTripsExcessExpensesAmount.formatted}),e.jsx("td",{}),r.map(t=>e.jsx("td",{children:t.businessTripsExcessExpensesAmount.formatted},t.year)),e.jsx("td",{})]}),e.jsxs("tr",{children:[e.jsx("td",{children:"Salary Excess Expenses"}),e.jsx("td",{children:s.salaryExcessExpensesAmount.formatted}),e.jsx("td",{}),r.map(t=>e.jsx("td",{children:t.salaryExcessExpensesAmount.formatted},t.year)),e.jsx("td",{})]}),e.jsx(d,{dataRow:t=>e.jsxs("tr",{children:[e.jsx("td",{children:"Reserves"}),e.jsx("td",{children:s.reserves.amount.formatted}),e.jsx("th",{children:t}),r.map(a=>e.jsx("td",{children:a.reserves.amount.formatted},a.year))]}),commentaryData:s.reserves}),e.jsx(d,{dataRow:t=>e.jsxs("tr",{children:[e.jsx("td",{children:"Nontaxable Linkage"}),e.jsx("td",{children:s.nontaxableLinkage.amount.formatted}),e.jsx("th",{children:t}),r.map(a=>e.jsx("td",{children:a.nontaxableLinkage.amount.formatted},a.year))]}),commentaryData:s.nontaxableLinkage}),e.jsxs("tr",{children:[e.jsx("th",{children:"Taxable Income"}),e.jsx("th",{children:s.taxableIncome.formatted}),e.jsx("th",{}),r.map(t=>e.jsx("th",{children:t.taxableIncome.formatted},t.year)),e.jsx("td",{})]}),e.jsxs("tr",{children:[e.jsx("td",{children:"Tax Rate"}),e.jsxs("td",{children:[(s.taxRate*100).toFixed(1),"%"]}),e.jsx("td",{}),r.map(t=>e.jsxs("td",{children:[(t.taxRate*100).toFixed(1),"%"]},t.year)),e.jsx("td",{})]}),e.jsx(d,{dataRow:t=>e.jsxs("tr",{children:[e.jsx("td",{children:"Income with Special Tax Rate"}),e.jsx("td",{children:s.specialTaxableIncome.amount.formatted}),e.jsx("th",{children:t}),r.map(a=>e.jsx("td",{children:a.specialTaxableIncome.amount.formatted},a.year))]}),commentaryData:s.specialTaxableIncome}),e.jsxs("tr",{children:[e.jsx("td",{children:"Special Tax Rate"}),e.jsxs("td",{children:[(s.specialTaxRate*100).toFixed(1),"%"]}),e.jsx("td",{}),r.map(t=>e.jsxs("td",{children:[(t.specialTaxRate*100).toFixed(1),"%"]},t.year)),e.jsx("td",{})]})]}),e.jsx("tfoot",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Annual Tax Expense"}),e.jsx("th",{children:s.annualTaxExpense.formatted}),e.jsx("th",{}),r.map(t=>e.jsx("th",{children:t.annualTaxExpense.formatted},t.year)),e.jsx("td",{})]})})]})})})};export{G as TaxReport};
|