@accounter/client 0.0.11-alpha-20260125180828-ba6265251b2d2e84e3355b96352f5bf83918317f → 0.0.11-alpha-20260126094406-5e339d8e89f94400c777170c689d55bd9dd5f95c
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-DWmOT4mx.js → Checkbox-Dmuz3t7B.js} +1 -1
- package/dist/assets/{MultiSelect-DhEZHYxn.js → MultiSelect-DBeIExB5.js} +1 -1
- package/dist/assets/{Progress-DE13gAJ5.js → Progress---sZILQb.js} +1 -1
- package/dist/assets/{Table-rNmO5bBI.js → Table-BQv3frL8.js} +1 -1
- package/dist/assets/{Typography-C1pdNNG8.js → Typography-B8Kph7eR.js} +1 -1
- package/dist/assets/accordion-Bn08_4fN.js +1 -0
- package/dist/assets/{accountant-approvals-DXUA4Z8R.js → accountant-approvals-DuNl7y6H.js} +1 -1
- package/dist/assets/{accounter-table-CGncq_73.js → accounter-table-DTsgtq5M.js} +1 -1
- package/dist/assets/{addDays-DpkzPtfc.js → addDays-DTiBTTns.js} +1 -1
- package/dist/assets/{all-charges-CAf5Sz2_.js → all-charges-DPyM-a74.js} +1 -1
- package/dist/assets/{arrow-up-down-MrfN0fhR.js → arrow-up-down-VY6mkkTR.js} +1 -1
- package/dist/assets/{building-2-CWrl-iq9.js → building-2-CMKd_bU8.js} +1 -1
- package/dist/assets/{business-CnobDfUp.js → business-BVMKhHFx.js} +1 -1
- package/dist/assets/{business-extended-info-6Ykvm7VT.js → business-extended-info-B94y5ZK6.js} +1 -1
- package/dist/assets/business-header-BC86M-9m.js +1 -0
- package/dist/assets/{business-ledger-filters-Bi9mwcxM.js → business-ledger-filters-es3H4rPK.js} +1 -1
- package/dist/assets/{business-ledger-single-SwmnJ5M-.js → business-ledger-single-U3zkqgW2.js} +1 -1
- package/dist/assets/business-trip-BUKYnQkG.js +1 -0
- package/dist/assets/charge-DuqIMfNm.js +1 -0
- package/dist/assets/charges-filters-CFCAP-bP.js +1 -0
- package/dist/assets/{charges-ledger-validation-ClbJGvF9.js → charges-ledger-validation-CCTNRpCE.js} +1 -1
- package/dist/assets/{charges-table-zGkVW5or.js → charges-table-BJtpvXfL.js} +3 -3
- package/dist/assets/contracts-ljjcB_x7.js +1 -0
- package/dist/assets/{data-table-column-header-DDRUwuwC.js → data-table-column-header-CZ1dXiU0.js} +1 -1
- package/dist/assets/{data-table-pagination-DxOcd13P.js → data-table-pagination-XAlQIbO9.js} +1 -1
- package/dist/assets/deposits-transactions-table-2rtRFZgK.js +1 -0
- package/dist/assets/{download-csv-BmamqJJW.js → download-csv-BSGaUZsM.js} +1 -1
- package/dist/assets/{download-csv-button-BFfxSTjQ.js → download-csv-button-CMQBUQeX.js} +1 -1
- package/dist/assets/{editable-business-trip-CPfdEl45.js → editable-business-trip-CED1Su3d.js} +1 -1
- package/dist/assets/{eye-off-DtXkBVx1.js → eye-off-Buv7eciz.js} +1 -1
- package/dist/assets/{funnel-B1ZA9LM9.js → funnel-Cfb9Pxmr.js} +1 -1
- package/dist/assets/index-3ev2Q3E9.js +1 -0
- package/dist/assets/{index-Cs7XgdTM.js → index-7gCTV42h.js} +2 -2
- package/dist/assets/{index-Bsnch-zI.js → index-8fdLByFg.js} +1 -1
- package/dist/assets/index-B0hZ0TDG.js +1 -0
- package/dist/assets/{index-DCmEMj8e.js → index-B4OP8iL7.js} +3 -3
- package/dist/assets/{index-DKmgIoB5.js → index-BN-I0GSO.js} +2 -2
- package/dist/assets/index-BhFsGqUx.js +1 -0
- package/dist/assets/{index-Chao5nQb.js → index-Bui9zV-z.js} +1 -1
- package/dist/assets/{index-ciP7vurq.js → index-C7p19nIa.js} +1 -1
- package/dist/assets/{index-DwGxsIkH.js → index-CPMJQkvw.js} +1 -1
- package/dist/assets/{index-BBOAkvDK.js → index-CSdQtH7c.js} +1 -1
- package/dist/assets/index-CcZll7L2.js +1 -0
- package/dist/assets/index-CjG9JDZB.js +2 -0
- package/dist/assets/{index-DqoPYGJE.js → index-DGAT1KYx.js} +1 -1
- package/dist/assets/index-DIrLsKod.js +1 -0
- package/dist/assets/{index-DfBrqs5_.js → index-DJY6AKiM.js} +2 -2
- package/dist/assets/{index-Bv5ZyMGd.js → index-DOy0Yf1i.js} +1 -1
- package/dist/assets/{index-CywvUChw.js → index-DRBzHdu9.js} +1 -1
- package/dist/assets/index-Dal_ULkA.js +1 -0
- package/dist/assets/{index-DJQjDgkB.js → index-DokXNUuN.js} +1 -1
- package/dist/assets/{index-DjsqV-Fn.js → index-Dq33WQoi.js} +1 -1
- package/dist/assets/{index-C60AFYOu.js → index-DzzUoyj4.js} +1 -1
- package/dist/assets/{index-Vxd58TOQ.js → index-GlUqZUgQ.js} +1 -1
- package/dist/assets/index-X3RoQQa9.js +1 -0
- package/dist/assets/index-X9rrwleE.js +1 -0
- package/dist/assets/{index-DRqooPz9.js → index-rI994S3C.js} +4 -4
- package/dist/assets/{index.es-C6H8Q1nD.js → index.es-C2YDJ0AL.js} +1 -1
- package/dist/assets/issue-document-zNxGzRkY.js +1 -0
- package/dist/assets/login-page-BimTSmTC.js +1 -0
- package/dist/assets/{missing-info-charges-Dr8TvB2G.js → missing-info-charges-CVhY60ZL.js} +1 -1
- package/dist/assets/{modal-CPrQ9jQu.js → modal-BXR_xgUm.js} +1 -1
- package/dist/assets/modify-contract-dialog-flMl2p_T.js +1 -0
- package/dist/assets/{page-layout-Dp9Tr43G.js → page-layout-DMGj5xhW.js} +1 -1
- package/dist/assets/{page-not-found-BIERJkiT.js → page-not-found-B_GB5ntj.js} +1 -1
- package/dist/assets/{panel-top-open-lnF5tdL1.js → panel-top-open-Bf39HBrp.js} +1 -1
- package/dist/assets/report-commentary-row-BMyeQR9J.js +1 -0
- package/dist/assets/{save-BaXyzRSW.js → save-jkuyCWyY.js} +1 -1
- package/dist/assets/{similar-transactions-modal-DilkLkpx.js → similar-transactions-modal-DX3CPrMo.js} +1 -1
- package/dist/assets/{sub-764RJPt0.js → sub-CEXBz_OW.js} +1 -1
- package/dist/assets/subMonths-DY4HlBVa.js +1 -0
- package/dist/assets/summary-CPKS_69D.js +1 -0
- package/dist/assets/{toggle-expansion-button-BquTpOYj.js → toggle-expansion-button-Y2eS7nqg.js} +1 -1
- package/dist/assets/{update-accountant-status-Btcm95Uc.js → update-accountant-status-zL6vnwU9.js} +1 -1
- package/dist/assets/use-issue-monthly-documents-D9vQpbaZ.js +1 -0
- package/dist/assets/{use-url-query-A8PE3FMA.js → use-url-query-CqWra6gD.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/accordion-Air1oXnF.js +0 -1
- package/dist/assets/business-header-CAJaQahQ.js +0 -1
- package/dist/assets/business-trip-ADSYpFTM.js +0 -1
- package/dist/assets/charge-CLyQ-8f8.js +0 -1
- package/dist/assets/charges-filters-CYR6-jcu.js +0 -1
- package/dist/assets/contracts-DCd159UE.js +0 -1
- package/dist/assets/deposits-transactions-table-Dhm74qLm.js +0 -1
- package/dist/assets/index-5Ht40D_c.js +0 -1
- package/dist/assets/index-BL8siR4m.js +0 -1
- package/dist/assets/index-C0Bd8nM_.js +0 -1
- package/dist/assets/index-CFLkhm3K.js +0 -1
- package/dist/assets/index-CXZphjyK.js +0 -1
- package/dist/assets/index-Cd9YArsS.js +0 -1
- package/dist/assets/index-DynC0Vxq.js +0 -1
- package/dist/assets/index-cd89pXq_.js +0 -1
- package/dist/assets/index-d-FcvOUD.js +0 -2
- package/dist/assets/issue-document-B8SLRY9w.js +0 -1
- package/dist/assets/login-page-DF0c_Pay.js +0 -1
- package/dist/assets/modify-contract-dialog-BMTCgQ3i.js +0 -1
- package/dist/assets/report-commentary-row-BsA3JSzG.js +0 -1
- package/dist/assets/subMonths-CZ2djAnO.js +0 -1
- package/dist/assets/summary-BvHHpnIR.js +0 -1
- package/dist/assets/use-issue-monthly-documents-Dx6_0gyN.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{dd as so,de as Ds,df as Fs,dg as zs,r as v,aG as Ie,dh as $e,di as Ns,j as x,dj as or,dk as io,bB as oo,B as ao,E as lo,bE as In,bF as Br,bN as Vr,w as Le,bH as co,ay as En,bI as uo,dl as b,dm as Bs,H as fo,dn as ho,F as po,u as mo,dp as go,L as xo,dq as yo}from"./index-DRqooPz9.js";import{u as Vs}from"./use-url-query-A8PE3FMA.js";import{P as vo}from"./page-layout-Dp9Tr43G.js";import{P as bo}from"./modal-CPrQ9jQu.js";import{F as wo}from"./funnel-B1ZA9LM9.js";import{u as Pt,g as De,a as Fe,c as je,s as W,_ as X,b as Ao,T as Mn}from"./Typography-C1pdNNG8.js";import{c as Ue,t as jn,a as Co,d as hn,b as Po,e as ko,f as So,g as Io,h as Hs,o as Hr,i as Eo,s as Mo,l as jo,u as Ro,j as Us,k as Oo,p as To,m as _o,n as $o,q as Lo,r as Do,v as Fo,w as zo}from"./sequential-CjOfRLtc.js";import{s as Gs}from"./sub-764RJPt0.js";import"./addDays-DpkzPtfc.js";import"./subMonths-CZ2djAnO.js";function No(e){const{theme:t,name:n,props:r}=e;return!t||!t.components||!t.components[n]||!t.components[n].defaultProps?r:so(t.components[n].defaultProps,r)}function Bo({props:e,name:t,defaultTheme:n,themeId:r}){let s=Ds(n);return s=s[r]||s,No({theme:s,name:t,props:e})}function Lt(){const e=Ds(Fs);return e[zs]||e}function ze({props:e,name:t}){return Bo({props:e,name:t,defaultTheme:Fs,themeId:zs})}function Un(e){return e&&e.ownerDocument||document}function Vo(e){return Un(e).defaultView||window}function Ur(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function Ho(e){const{controlled:t,default:n}=e,{current:r}=v.useRef(t!==void 0),[s,i]=v.useState(n),o=r?t:s,a=v.useCallback(c=>{r||i(c)},[]);return[o,a]}function Uo(e){return typeof e=="string"}function Go(e,t,n){return e===void 0||Uo(e)?t:{...t,ownerState:{...t.ownerState,...n}}}function Xo(e,t,n){return typeof e=="function"?e(t,n):e}function Wo(e,t=[]){if(e===void 0)return{};const n={};return Object.keys(e).filter(r=>r.match(/^on[A-Z]/)&&typeof e[r]=="function"&&!t.includes(r)).forEach(r=>{n[r]=e[r]}),n}function Gr(e){if(e===void 0)return{};const t={};return Object.keys(e).filter(n=>!(n.match(/^on[A-Z]/)&&typeof e[n]=="function")).forEach(n=>{t[n]=e[n]}),t}function Yo(e){const{getSlotProps:t,additionalProps:n,externalSlotProps:r,externalForwardedProps:s,className:i}=e;if(!t){const h=Ie(n?.className,i,s?.className,r?.className),m={...n?.style,...s?.style,...r?.style},p={...n,...s,...r};return h.length>0&&(p.className=h),Object.keys(m).length>0&&(p.style=m),{props:p,internalRef:void 0}}const o=Wo({...s,...r}),a=Gr(r),c=Gr(s),l=t(o),u=Ie(l?.className,n?.className,i,s?.className,r?.className),d={...l?.style,...n?.style,...s?.style,...r?.style},f={...l,...n,...c,...a};return u.length>0&&(f.className=u),Object.keys(d).length>0&&(f.style=d),{props:f,internalRef:l.ref}}var re="top",fe="bottom",he="right",se="left",ar="auto",Dt=[re,fe,he,se],nt="start",kt="end",qo="clippingParents",Xs="viewport",ht="popper",Ko="reference",Xr=Dt.reduce(function(e,t){return e.concat([t+"-"+nt,t+"-"+kt])},[]),Ws=[].concat(Dt,[ar]).reduce(function(e,t){return e.concat([t,t+"-"+nt,t+"-"+kt])},[]),Qo="beforeRead",Zo="read",Jo="afterRead",ea="beforeMain",ta="main",na="afterMain",ra="beforeWrite",sa="write",ia="afterWrite",oa=[Qo,Zo,Jo,ea,ta,na,ra,sa,ia];function Ae(e){return e?(e.nodeName||"").toLowerCase():null}function ae(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function qe(e){var t=ae(e).Element;return e instanceof t||e instanceof Element}function ue(e){var t=ae(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function lr(e){if(typeof ShadowRoot>"u")return!1;var t=ae(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function aa(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},s=t.attributes[n]||{},i=t.elements[n];!ue(i)||!Ae(i)||(Object.assign(i.style,r),Object.keys(s).forEach(function(o){var a=s[o];a===!1?i.removeAttribute(o):i.setAttribute(o,a===!0?"":a)}))})}function la(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var s=t.elements[r],i=t.attributes[r]||{},o=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),a=o.reduce(function(c,l){return c[l]="",c},{});!ue(s)||!Ae(s)||(Object.assign(s.style,a),Object.keys(i).forEach(function(c){s.removeAttribute(c)}))})}}const ca={name:"applyStyles",enabled:!0,phase:"write",fn:aa,effect:la,requires:["computeStyles"]};function we(e){return e.split("-")[0]}var Ye=Math.max,sn=Math.min,rt=Math.round;function Gn(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function Ys(){return!/^((?!chrome|android).)*safari/i.test(Gn())}function st(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),s=1,i=1;t&&ue(e)&&(s=e.offsetWidth>0&&rt(r.width)/e.offsetWidth||1,i=e.offsetHeight>0&&rt(r.height)/e.offsetHeight||1);var o=qe(e)?ae(e):window,a=o.visualViewport,c=!Ys()&&n,l=(r.left+(c&&a?a.offsetLeft:0))/s,u=(r.top+(c&&a?a.offsetTop:0))/i,d=r.width/s,f=r.height/i;return{width:d,height:f,top:u,right:l+d,bottom:u+f,left:l,x:l,y:u}}function cr(e){var t=st(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function qs(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&lr(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Me(e){return ae(e).getComputedStyle(e)}function ua(e){return["table","td","th"].indexOf(Ae(e))>=0}function Ne(e){return((qe(e)?e.ownerDocument:e.document)||window.document).documentElement}function pn(e){return Ae(e)==="html"?e:e.assignedSlot||e.parentNode||(lr(e)?e.host:null)||Ne(e)}function Wr(e){return!ue(e)||Me(e).position==="fixed"?null:e.offsetParent}function da(e){var t=/firefox/i.test(Gn()),n=/Trident/i.test(Gn());if(n&&ue(e)){var r=Me(e);if(r.position==="fixed")return null}var s=pn(e);for(lr(s)&&(s=s.host);ue(s)&&["html","body"].indexOf(Ae(s))<0;){var i=Me(s);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||t&&i.willChange==="filter"||t&&i.filter&&i.filter!=="none")return s;s=s.parentNode}return null}function Ft(e){for(var t=ae(e),n=Wr(e);n&&ua(n)&&Me(n).position==="static";)n=Wr(n);return n&&(Ae(n)==="html"||Ae(n)==="body"&&Me(n).position==="static")?t:n||da(e)||t}function ur(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function yt(e,t,n){return Ye(e,sn(t,n))}function fa(e,t,n){var r=yt(e,t,n);return r>n?n:r}function Ks(){return{top:0,right:0,bottom:0,left:0}}function Qs(e){return Object.assign({},Ks(),e)}function Zs(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var ha=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,Qs(typeof t!="number"?t:Zs(t,Dt))};function pa(e){var t,n=e.state,r=e.name,s=e.options,i=n.elements.arrow,o=n.modifiersData.popperOffsets,a=we(n.placement),c=ur(a),l=[se,he].indexOf(a)>=0,u=l?"height":"width";if(!(!i||!o)){var d=ha(s.padding,n),f=cr(i),h=c==="y"?re:se,m=c==="y"?fe:he,p=n.rects.reference[u]+n.rects.reference[c]-o[c]-n.rects.popper[u],g=o[c]-n.rects.reference[c],y=Ft(i),w=y?c==="y"?y.clientHeight||0:y.clientWidth||0:0,A=p/2-g/2,C=d[h],P=w-f[u]-d[m],k=w/2-f[u]/2+A,E=yt(C,k,P),O=c;n.modifiersData[r]=(t={},t[O]=E,t.centerOffset=E-k,t)}}function ma(e){var t=e.state,n=e.options,r=n.element,s=r===void 0?"[data-popper-arrow]":r;s!=null&&(typeof s=="string"&&(s=t.elements.popper.querySelector(s),!s)||qs(t.elements.popper,s)&&(t.elements.arrow=s))}const ga={name:"arrow",enabled:!0,phase:"main",fn:pa,effect:ma,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function it(e){return e.split("-")[1]}var xa={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ya(e,t){var n=e.x,r=e.y,s=t.devicePixelRatio||1;return{x:rt(n*s)/s||0,y:rt(r*s)/s||0}}function Yr(e){var t,n=e.popper,r=e.popperRect,s=e.placement,i=e.variation,o=e.offsets,a=e.position,c=e.gpuAcceleration,l=e.adaptive,u=e.roundOffsets,d=e.isFixed,f=o.x,h=f===void 0?0:f,m=o.y,p=m===void 0?0:m,g=typeof u=="function"?u({x:h,y:p}):{x:h,y:p};h=g.x,p=g.y;var y=o.hasOwnProperty("x"),w=o.hasOwnProperty("y"),A=se,C=re,P=window;if(l){var k=Ft(n),E="clientHeight",O="clientWidth";if(k===ae(n)&&(k=Ne(n),Me(k).position!=="static"&&a==="absolute"&&(E="scrollHeight",O="scrollWidth")),k=k,s===re||(s===se||s===he)&&i===kt){C=fe;var R=d&&k===P&&P.visualViewport?P.visualViewport.height:k[E];p-=R-r.height,p*=c?1:-1}if(s===se||(s===re||s===fe)&&i===kt){A=he;var j=d&&k===P&&P.visualViewport?P.visualViewport.width:k[O];h-=j-r.width,h*=c?1:-1}}var T=Object.assign({position:a},l&&xa),L=u===!0?ya({x:h,y:p},ae(n)):{x:h,y:p};if(h=L.x,p=L.y,c){var $;return Object.assign({},T,($={},$[C]=w?"0":"",$[A]=y?"0":"",$.transform=(P.devicePixelRatio||1)<=1?"translate("+h+"px, "+p+"px)":"translate3d("+h+"px, "+p+"px, 0)",$))}return Object.assign({},T,(t={},t[C]=w?p+"px":"",t[A]=y?h+"px":"",t.transform="",t))}function va(e){var t=e.state,n=e.options,r=n.gpuAcceleration,s=r===void 0?!0:r,i=n.adaptive,o=i===void 0?!0:i,a=n.roundOffsets,c=a===void 0?!0:a,l={placement:we(t.placement),variation:it(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:s,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Yr(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:c})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Yr(Object.assign({},l,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const ba={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:va,data:{}};var Ut={passive:!0};function wa(e){var t=e.state,n=e.instance,r=e.options,s=r.scroll,i=s===void 0?!0:s,o=r.resize,a=o===void 0?!0:o,c=ae(t.elements.popper),l=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&l.forEach(function(u){u.addEventListener("scroll",n.update,Ut)}),a&&c.addEventListener("resize",n.update,Ut),function(){i&&l.forEach(function(u){u.removeEventListener("scroll",n.update,Ut)}),a&&c.removeEventListener("resize",n.update,Ut)}}const Aa={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:wa,data:{}};var Ca={left:"right",right:"left",bottom:"top",top:"bottom"};function en(e){return e.replace(/left|right|bottom|top/g,function(t){return Ca[t]})}var Pa={start:"end",end:"start"};function qr(e){return e.replace(/start|end/g,function(t){return Pa[t]})}function dr(e){var t=ae(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function fr(e){return st(Ne(e)).left+dr(e).scrollLeft}function ka(e,t){var n=ae(e),r=Ne(e),s=n.visualViewport,i=r.clientWidth,o=r.clientHeight,a=0,c=0;if(s){i=s.width,o=s.height;var l=Ys();(l||!l&&t==="fixed")&&(a=s.offsetLeft,c=s.offsetTop)}return{width:i,height:o,x:a+fr(e),y:c}}function Sa(e){var t,n=Ne(e),r=dr(e),s=(t=e.ownerDocument)==null?void 0:t.body,i=Ye(n.scrollWidth,n.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),o=Ye(n.scrollHeight,n.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),a=-r.scrollLeft+fr(e),c=-r.scrollTop;return Me(s||n).direction==="rtl"&&(a+=Ye(n.clientWidth,s?s.clientWidth:0)-i),{width:i,height:o,x:a,y:c}}function hr(e){var t=Me(e),n=t.overflow,r=t.overflowX,s=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+s+r)}function Js(e){return["html","body","#document"].indexOf(Ae(e))>=0?e.ownerDocument.body:ue(e)&&hr(e)?e:Js(pn(e))}function vt(e,t){var n;t===void 0&&(t=[]);var r=Js(e),s=r===((n=e.ownerDocument)==null?void 0:n.body),i=ae(r),o=s?[i].concat(i.visualViewport||[],hr(r)?r:[]):r,a=t.concat(o);return s?a:a.concat(vt(pn(o)))}function Xn(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Ia(e,t){var n=st(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function Kr(e,t,n){return t===Xs?Xn(ka(e,n)):qe(t)?Ia(t,n):Xn(Sa(Ne(e)))}function Ea(e){var t=vt(pn(e)),n=["absolute","fixed"].indexOf(Me(e).position)>=0,r=n&&ue(e)?Ft(e):e;return qe(r)?t.filter(function(s){return qe(s)&&qs(s,r)&&Ae(s)!=="body"}):[]}function Ma(e,t,n,r){var s=t==="clippingParents"?Ea(e):[].concat(t),i=[].concat(s,[n]),o=i[0],a=i.reduce(function(c,l){var u=Kr(e,l,r);return c.top=Ye(u.top,c.top),c.right=sn(u.right,c.right),c.bottom=sn(u.bottom,c.bottom),c.left=Ye(u.left,c.left),c},Kr(e,o,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function ei(e){var t=e.reference,n=e.element,r=e.placement,s=r?we(r):null,i=r?it(r):null,o=t.x+t.width/2-n.width/2,a=t.y+t.height/2-n.height/2,c;switch(s){case re:c={x:o,y:t.y-n.height};break;case fe:c={x:o,y:t.y+t.height};break;case he:c={x:t.x+t.width,y:a};break;case se:c={x:t.x-n.width,y:a};break;default:c={x:t.x,y:t.y}}var l=s?ur(s):null;if(l!=null){var u=l==="y"?"height":"width";switch(i){case nt:c[l]=c[l]-(t[u]/2-n[u]/2);break;case kt:c[l]=c[l]+(t[u]/2-n[u]/2);break}}return c}function St(e,t){t===void 0&&(t={});var n=t,r=n.placement,s=r===void 0?e.placement:r,i=n.strategy,o=i===void 0?e.strategy:i,a=n.boundary,c=a===void 0?qo:a,l=n.rootBoundary,u=l===void 0?Xs:l,d=n.elementContext,f=d===void 0?ht:d,h=n.altBoundary,m=h===void 0?!1:h,p=n.padding,g=p===void 0?0:p,y=Qs(typeof g!="number"?g:Zs(g,Dt)),w=f===ht?Ko:ht,A=e.rects.popper,C=e.elements[m?w:f],P=Ma(qe(C)?C:C.contextElement||Ne(e.elements.popper),c,u,o),k=st(e.elements.reference),E=ei({reference:k,element:A,placement:s}),O=Xn(Object.assign({},A,E)),R=f===ht?O:k,j={top:P.top-R.top+y.top,bottom:R.bottom-P.bottom+y.bottom,left:P.left-R.left+y.left,right:R.right-P.right+y.right},T=e.modifiersData.offset;if(f===ht&&T){var L=T[s];Object.keys(j).forEach(function($){var I=[he,fe].indexOf($)>=0?1:-1,M=[re,fe].indexOf($)>=0?"y":"x";j[$]+=L[M]*I})}return j}function ja(e,t){t===void 0&&(t={});var n=t,r=n.placement,s=n.boundary,i=n.rootBoundary,o=n.padding,a=n.flipVariations,c=n.allowedAutoPlacements,l=c===void 0?Ws:c,u=it(r),d=u?a?Xr:Xr.filter(function(m){return it(m)===u}):Dt,f=d.filter(function(m){return l.indexOf(m)>=0});f.length===0&&(f=d);var h=f.reduce(function(m,p){return m[p]=St(e,{placement:p,boundary:s,rootBoundary:i,padding:o})[we(p)],m},{});return Object.keys(h).sort(function(m,p){return h[m]-h[p]})}function Ra(e){if(we(e)===ar)return[];var t=en(e);return[qr(e),t,qr(t)]}function Oa(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var s=n.mainAxis,i=s===void 0?!0:s,o=n.altAxis,a=o===void 0?!0:o,c=n.fallbackPlacements,l=n.padding,u=n.boundary,d=n.rootBoundary,f=n.altBoundary,h=n.flipVariations,m=h===void 0?!0:h,p=n.allowedAutoPlacements,g=t.options.placement,y=we(g),w=y===g,A=c||(w||!m?[en(g)]:Ra(g)),C=[g].concat(A).reduce(function(K,H){return K.concat(we(H)===ar?ja(t,{placement:H,boundary:u,rootBoundary:d,padding:l,flipVariations:m,allowedAutoPlacements:p}):H)},[]),P=t.rects.reference,k=t.rects.popper,E=new Map,O=!0,R=C[0],j=0;j<C.length;j++){var T=C[j],L=we(T),$=it(T)===nt,I=[re,fe].indexOf(L)>=0,M=I?"width":"height",_=St(t,{placement:T,boundary:u,rootBoundary:d,altBoundary:f,padding:l}),D=I?$?he:se:$?fe:re;P[M]>k[M]&&(D=en(D));var F=en(D),V=[];if(i&&V.push(_[L]<=0),a&&V.push(_[D]<=0,_[F]<=0),V.every(function(K){return K})){R=T,O=!1;break}E.set(T,V)}if(O)for(var N=m?3:1,U=function(H){var Q=C.find(function(Y){var q=E.get(Y);if(q)return q.slice(0,H).every(function(Z){return Z})});if(Q)return R=Q,"break"},G=N;G>0;G--){var ie=U(G);if(ie==="break")break}t.placement!==R&&(t.modifiersData[r]._skip=!0,t.placement=R,t.reset=!0)}}const Ta={name:"flip",enabled:!0,phase:"main",fn:Oa,requiresIfExists:["offset"],data:{_skip:!1}};function Qr(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Zr(e){return[re,he,fe,se].some(function(t){return e[t]>=0})}function _a(e){var t=e.state,n=e.name,r=t.rects.reference,s=t.rects.popper,i=t.modifiersData.preventOverflow,o=St(t,{elementContext:"reference"}),a=St(t,{altBoundary:!0}),c=Qr(o,r),l=Qr(a,s,i),u=Zr(c),d=Zr(l);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}const $a={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:_a};function La(e,t,n){var r=we(e),s=[se,re].indexOf(r)>=0?-1:1,i=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,o=i[0],a=i[1];return o=o||0,a=(a||0)*s,[se,he].indexOf(r)>=0?{x:a,y:o}:{x:o,y:a}}function Da(e){var t=e.state,n=e.options,r=e.name,s=n.offset,i=s===void 0?[0,0]:s,o=Ws.reduce(function(u,d){return u[d]=La(d,t.rects,i),u},{}),a=o[t.placement],c=a.x,l=a.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=l),t.modifiersData[r]=o}const Fa={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Da};function za(e){var t=e.state,n=e.name;t.modifiersData[n]=ei({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})}const Na={name:"popperOffsets",enabled:!0,phase:"read",fn:za,data:{}};function Ba(e){return e==="x"?"y":"x"}function Va(e){var t=e.state,n=e.options,r=e.name,s=n.mainAxis,i=s===void 0?!0:s,o=n.altAxis,a=o===void 0?!1:o,c=n.boundary,l=n.rootBoundary,u=n.altBoundary,d=n.padding,f=n.tether,h=f===void 0?!0:f,m=n.tetherOffset,p=m===void 0?0:m,g=St(t,{boundary:c,rootBoundary:l,padding:d,altBoundary:u}),y=we(t.placement),w=it(t.placement),A=!w,C=ur(y),P=Ba(C),k=t.modifiersData.popperOffsets,E=t.rects.reference,O=t.rects.popper,R=typeof p=="function"?p(Object.assign({},t.rects,{placement:t.placement})):p,j=typeof R=="number"?{mainAxis:R,altAxis:R}:Object.assign({mainAxis:0,altAxis:0},R),T=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,L={x:0,y:0};if(k){if(i){var $,I=C==="y"?re:se,M=C==="y"?fe:he,_=C==="y"?"height":"width",D=k[C],F=D+g[I],V=D-g[M],N=h?-O[_]/2:0,U=w===nt?E[_]:O[_],G=w===nt?-O[_]:-E[_],ie=t.elements.arrow,K=h&&ie?cr(ie):{width:0,height:0},H=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Ks(),Q=H[I],Y=H[M],q=yt(0,E[_],K[_]),Z=A?E[_]/2-N-q-Q-j.mainAxis:U-q-Q-j.mainAxis,oe=A?-E[_]/2+N+q+Y+j.mainAxis:G+q+Y+j.mainAxis,J=t.elements.arrow&&Ft(t.elements.arrow),Pe=J?C==="y"?J.clientTop||0:J.clientLeft||0:0,ke=($=T?.[C])!=null?$:0,ct=D+Z-ke-Pe,ut=D+oe-ke,Ve=yt(h?sn(F,ct):F,D,h?Ye(V,ut):V);k[C]=Ve,L[C]=Ve-D}if(a){var He,dt=C==="x"?re:se,ft=C==="x"?fe:he,ve=k[P],Ht=P==="y"?"height":"width",$r=ve+g[dt],Lr=ve-g[ft],Sn=[re,se].indexOf(y)!==-1,Dr=(He=T?.[P])!=null?He:0,Fr=Sn?$r:ve-E[Ht]-O[Ht]-Dr+j.altAxis,zr=Sn?ve+E[Ht]+O[Ht]-Dr-j.altAxis:Lr,Nr=h&&Sn?fa(Fr,ve,zr):yt(h?Fr:$r,ve,h?zr:Lr);k[P]=Nr,L[P]=Nr-ve}t.modifiersData[r]=L}}const Ha={name:"preventOverflow",enabled:!0,phase:"main",fn:Va,requiresIfExists:["offset"]};function Ua(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function Ga(e){return e===ae(e)||!ue(e)?dr(e):Ua(e)}function Xa(e){var t=e.getBoundingClientRect(),n=rt(t.width)/e.offsetWidth||1,r=rt(t.height)/e.offsetHeight||1;return n!==1||r!==1}function Wa(e,t,n){n===void 0&&(n=!1);var r=ue(t),s=ue(t)&&Xa(t),i=Ne(t),o=st(e,s,n),a={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!n)&&((Ae(t)!=="body"||hr(i))&&(a=Ga(t)),ue(t)?(c=st(t,!0),c.x+=t.clientLeft,c.y+=t.clientTop):i&&(c.x=fr(i))),{x:o.left+a.scrollLeft-c.x,y:o.top+a.scrollTop-c.y,width:o.width,height:o.height}}function Ya(e){var t=new Map,n=new Set,r=[];e.forEach(function(i){t.set(i.name,i)});function s(i){n.add(i.name);var o=[].concat(i.requires||[],i.requiresIfExists||[]);o.forEach(function(a){if(!n.has(a)){var c=t.get(a);c&&s(c)}}),r.push(i)}return e.forEach(function(i){n.has(i.name)||s(i)}),r}function qa(e){var t=Ya(e);return oa.reduce(function(n,r){return n.concat(t.filter(function(s){return s.phase===r}))},[])}function Ka(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function Qa(e){var t=e.reduce(function(n,r){var s=n[r.name];return n[r.name]=s?Object.assign({},s,r,{options:Object.assign({},s.options,r.options),data:Object.assign({},s.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var Jr={placement:"bottom",modifiers:[],strategy:"absolute"};function es(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function Za(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,s=t.defaultOptions,i=s===void 0?Jr:s;return function(a,c,l){l===void 0&&(l=i);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},Jr,i),modifiersData:{},elements:{reference:a,popper:c},attributes:{},styles:{}},d=[],f=!1,h={state:u,setOptions:function(y){var w=typeof y=="function"?y(u.options):y;p(),u.options=Object.assign({},i,u.options,w),u.scrollParents={reference:qe(a)?vt(a):a.contextElement?vt(a.contextElement):[],popper:vt(c)};var A=qa(Qa([].concat(r,u.options.modifiers)));return u.orderedModifiers=A.filter(function(C){return C.enabled}),m(),h.update()},forceUpdate:function(){if(!f){var y=u.elements,w=y.reference,A=y.popper;if(es(w,A)){u.rects={reference:Wa(w,Ft(A),u.options.strategy==="fixed"),popper:cr(A)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(j){return u.modifiersData[j.name]=Object.assign({},j.data)});for(var C=0;C<u.orderedModifiers.length;C++){if(u.reset===!0){u.reset=!1,C=-1;continue}var P=u.orderedModifiers[C],k=P.fn,E=P.options,O=E===void 0?{}:E,R=P.name;typeof k=="function"&&(u=k({state:u,options:O,name:R,instance:h})||u)}}}},update:Ka(function(){return new Promise(function(g){h.forceUpdate(),g(u)})}),destroy:function(){p(),f=!0}};if(!es(a,c))return h;h.setOptions(l).then(function(g){!f&&l.onFirstUpdate&&l.onFirstUpdate(g)});function m(){u.orderedModifiers.forEach(function(g){var y=g.name,w=g.options,A=w===void 0?{}:w,C=g.effect;if(typeof C=="function"){var P=C({state:u,name:y,instance:h,options:A}),k=function(){};d.push(P||k)}})}function p(){d.forEach(function(g){return g()}),d=[]}return h}}var Ja=[Aa,Na,ba,ca,Fa,Ta,Ha,ga,$a],el=Za({defaultModifiers:Ja});function de(e){const{elementType:t,externalSlotProps:n,ownerState:r,skipResolvingSlotProps:s=!1,...i}=e,o=s?{}:Xo(n,r),{props:a,internalRef:c}=Yo({...i,externalSlotProps:o}),l=Pt(c,o?.ref,e.additionalProps?.ref);return Go(t,{...a,ref:l},r)}function tl(e){return parseInt(v.version,10)>=19?e?.props?.ref||null:e?.ref||null}function nl(e){return typeof e=="function"?e():e}const rl=v.forwardRef(function(t,n){const{children:r,container:s,disablePortal:i=!1}=t,[o,a]=v.useState(null),c=Pt(v.isValidElement(r)?tl(r):null,n);if($e(()=>{i||a(nl(s)||document.body)},[s,i]),$e(()=>{if(o&&!i)return Ur(n,o),()=>{Ur(n,null)}},[n,o,i]),i){if(v.isValidElement(r)){const l={ref:c};return v.cloneElement(r,l)}return r}return o&&Ns.createPortal(r,o)});function sl(e){return De("MuiPopper",e)}Fe("MuiPopper",["root"]);function il(e,t){if(t==="ltr")return e;switch(e){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return e}}function Wn(e){return typeof e=="function"?e():e}function ol(e){return e.nodeType!==void 0}const al=e=>{const{classes:t}=e;return je({root:["root"]},sl,t)},ll={},cl=v.forwardRef(function(t,n){const{anchorEl:r,children:s,direction:i,disablePortal:o,modifiers:a,open:c,placement:l,popperOptions:u,popperRef:d,slotProps:f={},slots:h={},TransitionProps:m,ownerState:p,...g}=t,y=v.useRef(null),w=Pt(y,n),A=v.useRef(null),C=Pt(A,d),P=v.useRef(C);$e(()=>{P.current=C},[C]),v.useImperativeHandle(d,()=>A.current,[]);const k=il(l,i),[E,O]=v.useState(k),[R,j]=v.useState(Wn(r));v.useEffect(()=>{A.current&&A.current.forceUpdate()}),v.useEffect(()=>{r&&j(Wn(r))},[r]),$e(()=>{if(!R||!c)return;const M=F=>{O(F.placement)};let _=[{name:"preventOverflow",options:{altBoundary:o}},{name:"flip",options:{altBoundary:o}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:F})=>{M(F)}}];a!=null&&(_=_.concat(a)),u&&u.modifiers!=null&&(_=_.concat(u.modifiers));const D=el(R,y.current,{placement:k,...u,modifiers:_});return P.current(D),()=>{D.destroy(),P.current(null)}},[R,o,a,c,u,k]);const T={placement:E};m!==null&&(T.TransitionProps=m);const L=al(t),$=h.root??"div",I=de({elementType:$,externalSlotProps:f.root,externalForwardedProps:g,additionalProps:{role:"tooltip",ref:w},ownerState:t,className:L.root});return x.jsx($,{...I,children:typeof s=="function"?s(T):s})}),ul=v.forwardRef(function(t,n){const{anchorEl:r,children:s,container:i,direction:o="ltr",disablePortal:a=!1,keepMounted:c=!1,modifiers:l,open:u,placement:d="bottom",popperOptions:f=ll,popperRef:h,style:m,transition:p=!1,slotProps:g={},slots:y={},...w}=t,[A,C]=v.useState(!0),P=()=>{C(!1)},k=()=>{C(!0)};if(!c&&!u&&(!p||A))return null;let E;if(i)E=i;else if(r){const j=Wn(r);E=j&&ol(j)?Un(j).body:Un(null).body}const O=!u&&c&&(!p||A)?"none":void 0,R=p?{in:u,onEnter:P,onExited:k}:void 0;return x.jsx(rl,{disablePortal:a,container:E,children:x.jsx(cl,{anchorEl:r,direction:o,disablePortal:a,modifiers:l,ref:n,open:p?!A:u,placement:d,popperOptions:f,popperRef:h,slotProps:g,slots:y,...w,style:{position:"fixed",top:0,left:0,display:O,...m},TransitionProps:R,children:s})})}),dl=W(ul,{name:"MuiPopper",slot:"Root"})({}),fl=v.forwardRef(function(t,n){const r=or(),s=io({props:t,name:"MuiPopper"}),{anchorEl:i,component:o,components:a,componentsProps:c,container:l,disablePortal:u,keepMounted:d,modifiers:f,open:h,placement:m,popperOptions:p,popperRef:g,transition:y,slots:w,slotProps:A,...C}=s,P=w?.root??a?.Root,k={anchorEl:i,container:l,disablePortal:u,keepMounted:d,modifiers:f,open:h,placement:m,popperOptions:p,popperRef:g,transition:y,...C};return x.jsx(dl,{as:o,direction:r?"rtl":"ltr",slots:{root:P},slotProps:A??c,...k,ref:n})});function ti(e){const{children:t,defer:n=!1,fallback:r=null}=e,[s,i]=v.useState(!1);return $e(()=>{n||i(!0)},[n]),v.useEffect(()=>{n&&i(!0)},[n]),s?t:r}function hl(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function pl(e){return e}function ml(){var e=pl,t=hl,n=null,r=Ue(0),s=Ue(jn),i=Ue(0);function o(a){var c,l=(a=Co(a)).length,u,d,f=0,h=new Array(l),m=new Array(l),p=+r.apply(this,arguments),g=Math.min(jn,Math.max(-jn,s.apply(this,arguments)-p)),y,w=Math.min(Math.abs(g)/l,i.apply(this,arguments)),A=w*(g<0?-1:1),C;for(c=0;c<l;++c)(C=m[h[c]=c]=+e(a[c],c,a))>0&&(f+=C);for(t!=null?h.sort(function(P,k){return t(m[P],m[k])}):n!=null&&h.sort(function(P,k){return n(a[P],a[k])}),c=0,d=f?(g-l*A)/f:0;c<l;++c,p=y)u=h[c],C=m[u],y=p+(C>0?C*d:0)+A,m[u]={data:a[u],index:c,value:C,startAngle:p,endAngle:y,padAngle:w};return m}return o.value=function(a){return arguments.length?(e=typeof a=="function"?a:Ue(+a),o):e},o.sortValues=function(a){return arguments.length?(t=a,n=null,o):t},o.sort=function(a){return arguments.length?(n=a,t=null,o):n},o.startAngle=function(a){return arguments.length?(r=typeof a=="function"?a:Ue(+a),o):r},o.endAngle=function(a){return arguments.length?(s=typeof a=="function"?a:Ue(+a),o):s},o.padAngle=function(a){return arguments.length?(i=typeof a=="function"?a:Ue(+a),o):i},o}function gl(e,t){if((c=e.length)>0)for(var n,r=0,s,i,o,a,c,l=e[t[0]].length;r<l;++r)for(o=a=0,n=0;n<c;++n)(i=(s=e[t[n]][r])[1]-s[0])>0?(s[0]=o,s[1]=o+=i):i<0?(s[1]=a,s[0]=a+=i):(s[0]=0,s[1]=i)}function ni(e){var t=e.map(xl);return hn(e).sort(function(n,r){return t[n]-t[r]})}function xl(e){for(var t=-1,n=0,r=e.length,s,i=-1/0;++t<r;)(s=+e[t][1])>i&&(i=s,n=t);return n}function ri(e){var t=e.map(si);return hn(e).sort(function(n,r){return t[n]-t[r]})}function si(e){for(var t=0,n=-1,r=e.length,s;++n<r;)(s=+e[n][1])&&(t+=s);return t}function yl(e){return ri(e).reverse()}function vl(e){var t=e.length,n,r,s=e.map(si),i=ni(e),o=0,a=0,c=[],l=[];for(n=0;n<t;++n)r=i[n],o<a?(o+=s[r],c.push(r)):(a+=s[r],l.push(r));return l.reverse().concat(c)}function bl(e){return hn(e).reverse()}function wl({filter:e,setFilter:t,closeModal:n}){const{handleSubmit:r,control:s,trigger:i}=lo({defaultValues:{...e}}),o=a=>{t(a),n()};return x.jsxs("form",{onSubmit:r(o),children:[x.jsx(In,{name:"fromDate",control:s,rules:{pattern:{value:Br,message:"Date must be im format yyyy-mm-dd"}},render:({field:a,fieldState:c})=>x.jsx(Vr,{...a,label:"From Date",value:a.value?new Date(a.value):null,onChange:l=>{i("fromDate"),a.onChange(l?Le(l,"yyyy-MM-dd"):void 0)},error:c.error?.message,popoverProps:{withinPortal:!0}})}),x.jsx(In,{name:"toDate",control:s,rules:{pattern:{value:Br,message:"Date must be im format yyyy-mm-dd"}},render:({field:a,fieldState:c})=>x.jsx(Vr,{...a,label:"To Date",value:a.value?new Date(a.value):null,onChange:l=>{i("toDate"),a.onChange(l?Le(l,"yyyy-MM-dd"):void 0)},error:c.error?.message,popoverProps:{withinPortal:!0}})}),x.jsx(In,{name:"currency",control:s,render:({field:a,fieldState:c})=>x.jsx(co,{...a,label:"Currency",defaultValue:En.Usd,error:c.error?.message,data:Object.keys(En).map(l=>En[l])})}),x.jsxs("div",{className:"flex justify-center mt-5 gap-3",children:[x.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",children:"Filter"}),x.jsx("button",{type:"button",className:"text-white bg-rose-500 border-0 py-2 px-8 focus:outline-hidden hover:bg-rose-600 rounded-sm text-lg",onClick:n,children:"Cancel"})]})]})}function Al({filter:e,setFilter:t}){const[n,r]=v.useState(!1),{get:s,set:i}=Vs();function o(a){a||={fromDate:Le(new Date,"yyyy-MM-DD"),toDate:Le(new Date,"yyyy-MM-DD")},uo(a,e)||t(a)}return v.useEffect(()=>{const a=oo(e??{})?null:encodeURIComponent(JSON.stringify(e)),c=s("MonthlyIncomeExpenseChartFilters");a!==c&&i("MonthlyIncomeExpenseChartFilters",a)},[e,s,i]),x.jsxs(x.Fragment,{children:[x.jsx(bo,{opened:n,onClose:()=>r(!1),content:x.jsx(wl,{filter:e,setFilter:o,closeModal:()=>r(!1)})}),x.jsx(ao,{variant:"outline",size:"icon",className:"size-7.5",onClick:()=>r(!0),children:x.jsx(wo,{className:"size-5"})})]})}const pr="DEFAULT_X_AXIS_KEY",mr="DEFAULT_Y_AXIS_KEY",Cl={top:50,bottom:50,left:50,right:50},ii=v.createContext({isInitialized:!1,data:{highlightedItem:null,setHighlighted:()=>{},clearHighlighted:()=>{},isHighlighted:()=>!1,isFaded:()=>!1}}),Pl=(e,t)=>n=>e?e.fade==="series"?n.seriesId===t?.seriesId&&n.dataIndex!==t?.dataIndex:e.fade==="global"?n.seriesId!==t?.seriesId||n.dataIndex!==t?.dataIndex:!1:!1,kl=(e,t)=>n=>e?e.highlight==="series"?n.seriesId===t?.seriesId:e.highlight==="item"?n.dataIndex===t?.dataIndex&&n.seriesId===t?.seriesId:!1:!1,Sl=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"];function Il(e,t,n=Sl){return e.type==="pie"?b({},e,{data:e.data.map((r,s)=>b({color:n[s%n.length]},r))}):b({color:n[t%n.length]},e)}const El=({series:e,colors:t,seriesFormatters:n,dataset:r})=>{const s={};e.forEach((o,a)=>{const{id:c=`auto-generated-id-${a}`,type:l}=o;if(s[l]===void 0&&(s[l]={series:{},seriesOrder:[]}),s[l]?.series[c]!==void 0)throw new Error(`MUI X: series' id "${c}" is not unique.`);s[l].series[c]=b({id:c},Il(o,a,t)),s[l].seriesOrder.push(c)});const i={};return Object.keys(n).forEach(o=>{const a=s[o];a!==void 0&&(i[o]=n[o]?.(a,r)??s[o])}),i},Ml=["#02B2AF","#2E96FF","#B800D8","#60009B","#2731C8","#03008D"],jl=["#02B2AF","#72CCFF","#DA00FF","#9001CB","#2E96FF","#3B48E0"],Rl=e=>e==="dark"?jl:Ml,oi=v.createContext({isInitialized:!1,data:{}}),zt=v.createContext({isInitialized:!1,data:{colorProcessors:{},seriesFormatters:{},xExtremumGetters:{},yExtremumGetters:{},rotationExtremumGetters:{},radiusExtremumGetters:{}}}),ts=(e,t)=>t==="x"?{x:e,y:null}:{x:null,y:e},ai=e=>{const{axis:t,getFilters:n,isDefaultAxis:r}=e,s=n?.({currentAxisId:t.id,isDefaultAxis:r}),i=s?t.data?.filter((c,l)=>s({x:null,y:null},l)):t.data,o=Math.min(...i??[]),a=Math.max(...i??[]);return[o,a]},li=e=>t=>{const{series:n,axis:r,getFilters:s,isDefaultAxis:i}=t;return Object.keys(n).filter(o=>{const a=n[o].yAxisId??n[o].yAxisKey;return a===r.id||i&&a===void 0}).reduce((o,a)=>{const{stackedData:c}=n[a],l=s?.({currentAxisId:r.id,isDefaultAxis:i,seriesXAxisId:n[a].xAxisId??n[a].xAxisKey,seriesYAxisId:n[a].yAxisId??n[a].yAxisKey}),[u,d]=c?.reduce((f,h,m)=>l&&(!l(ts(h[0],e),m)||!l(ts(h[1],e),m))?f:[Math.min(...h,f[0]),Math.max(...h,f[1])],[1/0,-1/0])??[1/0,-1/0];return[Math.min(u,o[0]),Math.max(d,o[1])]},[1/0,-1/0])},Ol=e=>Object.keys(e.series).some(n=>e.series[n].layout==="horizontal")?li("x")(e):ai(e),Tl=e=>Object.keys(e.series).some(n=>e.series[n].layout==="horizontal")?ai(e):li("y")(e),Rn={appearance:ni,ascending:ri,descending:yl,insideOut:vl,none:hn,reverse:bl},On={expand:Io,diverging:gl,none:Po,silhouette:So,wiggle:ko},ci=e=>{const{series:t,seriesOrder:n,defaultStrategy:r}=e,s=[],i={};return n.forEach(o=>{const{stack:a,stackOrder:c,stackOffset:l}=t[o];a===void 0?s.push({ids:[o],stackingOrder:Rn.none,stackingOffset:On.none}):i[a]===void 0?(i[a]=s.length,s.push({ids:[o],stackingOrder:Rn[c??r?.stackOrder??"none"],stackingOffset:On[l??r?.stackOffset??"diverging"]})):(s[i[a]].ids.push(o),c!==void 0&&(s[i[a]].stackingOrder=Rn[c]),l!==void 0&&(s[i[a]].stackingOffset=On[l]))}),s};function ui(e,t){const n={};return Object.keys(e).forEach(r=>{n[r]=b({},e[r],{valueFormatter:e[r].valueFormatter??t})}),n}const _l=(e,t)=>{const{seriesOrder:n,series:r}=e,s=ci(e),i=t??[];n.forEach(a=>{const c=r[a].data;if(c!==void 0)c.forEach((l,u)=>{i.length<=u?i.push({[a]:l}):i[u][a]=l});else if(t===void 0)throw new Error([`MUI X: bar series with id='${a}' has no data.`,"Either provide a data property to the series or use the dataset prop."].join(`
|
|
1
|
+
import{dd as so,de as Ds,df as Fs,dg as zs,r as v,aG as Ie,dh as $e,di as Ns,j as x,dj as or,dk as io,bB as oo,B as ao,E as lo,bE as In,bF as Br,bN as Vr,w as Le,bH as co,ay as En,bI as uo,dl as b,dm as Bs,a6 as fo,dn as ho,F as po,u as mo,dp as go,L as xo,dq as yo}from"./index-rI994S3C.js";import{u as Vs}from"./use-url-query-CqWra6gD.js";import{P as vo}from"./page-layout-DMGj5xhW.js";import{P as bo}from"./modal-BXR_xgUm.js";import{F as wo}from"./funnel-Cfb9Pxmr.js";import{u as Pt,g as De,a as Fe,c as je,s as W,_ as X,b as Ao,T as Mn}from"./Typography-B8Kph7eR.js";import{c as Ue,t as jn,a as Co,d as hn,b as Po,e as ko,f as So,g as Io,h as Hs,o as Hr,i as Eo,s as Mo,l as jo,u as Ro,j as Us,k as Oo,p as To,m as _o,n as $o,q as Lo,r as Do,v as Fo,w as zo}from"./sequential-CjOfRLtc.js";import{s as Gs}from"./sub-CEXBz_OW.js";import"./addDays-DTiBTTns.js";import"./subMonths-DY4HlBVa.js";function No(e){const{theme:t,name:n,props:r}=e;return!t||!t.components||!t.components[n]||!t.components[n].defaultProps?r:so(t.components[n].defaultProps,r)}function Bo({props:e,name:t,defaultTheme:n,themeId:r}){let s=Ds(n);return s=s[r]||s,No({theme:s,name:t,props:e})}function Lt(){const e=Ds(Fs);return e[zs]||e}function ze({props:e,name:t}){return Bo({props:e,name:t,defaultTheme:Fs,themeId:zs})}function Un(e){return e&&e.ownerDocument||document}function Vo(e){return Un(e).defaultView||window}function Ur(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function Ho(e){const{controlled:t,default:n}=e,{current:r}=v.useRef(t!==void 0),[s,i]=v.useState(n),o=r?t:s,a=v.useCallback(c=>{r||i(c)},[]);return[o,a]}function Uo(e){return typeof e=="string"}function Go(e,t,n){return e===void 0||Uo(e)?t:{...t,ownerState:{...t.ownerState,...n}}}function Xo(e,t,n){return typeof e=="function"?e(t,n):e}function Wo(e,t=[]){if(e===void 0)return{};const n={};return Object.keys(e).filter(r=>r.match(/^on[A-Z]/)&&typeof e[r]=="function"&&!t.includes(r)).forEach(r=>{n[r]=e[r]}),n}function Gr(e){if(e===void 0)return{};const t={};return Object.keys(e).filter(n=>!(n.match(/^on[A-Z]/)&&typeof e[n]=="function")).forEach(n=>{t[n]=e[n]}),t}function Yo(e){const{getSlotProps:t,additionalProps:n,externalSlotProps:r,externalForwardedProps:s,className:i}=e;if(!t){const h=Ie(n?.className,i,s?.className,r?.className),m={...n?.style,...s?.style,...r?.style},p={...n,...s,...r};return h.length>0&&(p.className=h),Object.keys(m).length>0&&(p.style=m),{props:p,internalRef:void 0}}const o=Wo({...s,...r}),a=Gr(r),c=Gr(s),l=t(o),u=Ie(l?.className,n?.className,i,s?.className,r?.className),d={...l?.style,...n?.style,...s?.style,...r?.style},f={...l,...n,...c,...a};return u.length>0&&(f.className=u),Object.keys(d).length>0&&(f.style=d),{props:f,internalRef:l.ref}}var re="top",fe="bottom",he="right",se="left",ar="auto",Dt=[re,fe,he,se],nt="start",kt="end",qo="clippingParents",Xs="viewport",ht="popper",Ko="reference",Xr=Dt.reduce(function(e,t){return e.concat([t+"-"+nt,t+"-"+kt])},[]),Ws=[].concat(Dt,[ar]).reduce(function(e,t){return e.concat([t,t+"-"+nt,t+"-"+kt])},[]),Qo="beforeRead",Zo="read",Jo="afterRead",ea="beforeMain",ta="main",na="afterMain",ra="beforeWrite",sa="write",ia="afterWrite",oa=[Qo,Zo,Jo,ea,ta,na,ra,sa,ia];function Ae(e){return e?(e.nodeName||"").toLowerCase():null}function ae(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function qe(e){var t=ae(e).Element;return e instanceof t||e instanceof Element}function ue(e){var t=ae(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function lr(e){if(typeof ShadowRoot>"u")return!1;var t=ae(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function aa(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},s=t.attributes[n]||{},i=t.elements[n];!ue(i)||!Ae(i)||(Object.assign(i.style,r),Object.keys(s).forEach(function(o){var a=s[o];a===!1?i.removeAttribute(o):i.setAttribute(o,a===!0?"":a)}))})}function la(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var s=t.elements[r],i=t.attributes[r]||{},o=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),a=o.reduce(function(c,l){return c[l]="",c},{});!ue(s)||!Ae(s)||(Object.assign(s.style,a),Object.keys(i).forEach(function(c){s.removeAttribute(c)}))})}}const ca={name:"applyStyles",enabled:!0,phase:"write",fn:aa,effect:la,requires:["computeStyles"]};function we(e){return e.split("-")[0]}var Ye=Math.max,sn=Math.min,rt=Math.round;function Gn(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function Ys(){return!/^((?!chrome|android).)*safari/i.test(Gn())}function st(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),s=1,i=1;t&&ue(e)&&(s=e.offsetWidth>0&&rt(r.width)/e.offsetWidth||1,i=e.offsetHeight>0&&rt(r.height)/e.offsetHeight||1);var o=qe(e)?ae(e):window,a=o.visualViewport,c=!Ys()&&n,l=(r.left+(c&&a?a.offsetLeft:0))/s,u=(r.top+(c&&a?a.offsetTop:0))/i,d=r.width/s,f=r.height/i;return{width:d,height:f,top:u,right:l+d,bottom:u+f,left:l,x:l,y:u}}function cr(e){var t=st(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function qs(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&lr(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Me(e){return ae(e).getComputedStyle(e)}function ua(e){return["table","td","th"].indexOf(Ae(e))>=0}function Ne(e){return((qe(e)?e.ownerDocument:e.document)||window.document).documentElement}function pn(e){return Ae(e)==="html"?e:e.assignedSlot||e.parentNode||(lr(e)?e.host:null)||Ne(e)}function Wr(e){return!ue(e)||Me(e).position==="fixed"?null:e.offsetParent}function da(e){var t=/firefox/i.test(Gn()),n=/Trident/i.test(Gn());if(n&&ue(e)){var r=Me(e);if(r.position==="fixed")return null}var s=pn(e);for(lr(s)&&(s=s.host);ue(s)&&["html","body"].indexOf(Ae(s))<0;){var i=Me(s);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||t&&i.willChange==="filter"||t&&i.filter&&i.filter!=="none")return s;s=s.parentNode}return null}function Ft(e){for(var t=ae(e),n=Wr(e);n&&ua(n)&&Me(n).position==="static";)n=Wr(n);return n&&(Ae(n)==="html"||Ae(n)==="body"&&Me(n).position==="static")?t:n||da(e)||t}function ur(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function yt(e,t,n){return Ye(e,sn(t,n))}function fa(e,t,n){var r=yt(e,t,n);return r>n?n:r}function Ks(){return{top:0,right:0,bottom:0,left:0}}function Qs(e){return Object.assign({},Ks(),e)}function Zs(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var ha=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,Qs(typeof t!="number"?t:Zs(t,Dt))};function pa(e){var t,n=e.state,r=e.name,s=e.options,i=n.elements.arrow,o=n.modifiersData.popperOffsets,a=we(n.placement),c=ur(a),l=[se,he].indexOf(a)>=0,u=l?"height":"width";if(!(!i||!o)){var d=ha(s.padding,n),f=cr(i),h=c==="y"?re:se,m=c==="y"?fe:he,p=n.rects.reference[u]+n.rects.reference[c]-o[c]-n.rects.popper[u],g=o[c]-n.rects.reference[c],y=Ft(i),w=y?c==="y"?y.clientHeight||0:y.clientWidth||0:0,A=p/2-g/2,C=d[h],P=w-f[u]-d[m],k=w/2-f[u]/2+A,E=yt(C,k,P),O=c;n.modifiersData[r]=(t={},t[O]=E,t.centerOffset=E-k,t)}}function ma(e){var t=e.state,n=e.options,r=n.element,s=r===void 0?"[data-popper-arrow]":r;s!=null&&(typeof s=="string"&&(s=t.elements.popper.querySelector(s),!s)||qs(t.elements.popper,s)&&(t.elements.arrow=s))}const ga={name:"arrow",enabled:!0,phase:"main",fn:pa,effect:ma,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function it(e){return e.split("-")[1]}var xa={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ya(e,t){var n=e.x,r=e.y,s=t.devicePixelRatio||1;return{x:rt(n*s)/s||0,y:rt(r*s)/s||0}}function Yr(e){var t,n=e.popper,r=e.popperRect,s=e.placement,i=e.variation,o=e.offsets,a=e.position,c=e.gpuAcceleration,l=e.adaptive,u=e.roundOffsets,d=e.isFixed,f=o.x,h=f===void 0?0:f,m=o.y,p=m===void 0?0:m,g=typeof u=="function"?u({x:h,y:p}):{x:h,y:p};h=g.x,p=g.y;var y=o.hasOwnProperty("x"),w=o.hasOwnProperty("y"),A=se,C=re,P=window;if(l){var k=Ft(n),E="clientHeight",O="clientWidth";if(k===ae(n)&&(k=Ne(n),Me(k).position!=="static"&&a==="absolute"&&(E="scrollHeight",O="scrollWidth")),k=k,s===re||(s===se||s===he)&&i===kt){C=fe;var R=d&&k===P&&P.visualViewport?P.visualViewport.height:k[E];p-=R-r.height,p*=c?1:-1}if(s===se||(s===re||s===fe)&&i===kt){A=he;var j=d&&k===P&&P.visualViewport?P.visualViewport.width:k[O];h-=j-r.width,h*=c?1:-1}}var T=Object.assign({position:a},l&&xa),L=u===!0?ya({x:h,y:p},ae(n)):{x:h,y:p};if(h=L.x,p=L.y,c){var $;return Object.assign({},T,($={},$[C]=w?"0":"",$[A]=y?"0":"",$.transform=(P.devicePixelRatio||1)<=1?"translate("+h+"px, "+p+"px)":"translate3d("+h+"px, "+p+"px, 0)",$))}return Object.assign({},T,(t={},t[C]=w?p+"px":"",t[A]=y?h+"px":"",t.transform="",t))}function va(e){var t=e.state,n=e.options,r=n.gpuAcceleration,s=r===void 0?!0:r,i=n.adaptive,o=i===void 0?!0:i,a=n.roundOffsets,c=a===void 0?!0:a,l={placement:we(t.placement),variation:it(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:s,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Yr(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:c})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Yr(Object.assign({},l,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const ba={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:va,data:{}};var Ut={passive:!0};function wa(e){var t=e.state,n=e.instance,r=e.options,s=r.scroll,i=s===void 0?!0:s,o=r.resize,a=o===void 0?!0:o,c=ae(t.elements.popper),l=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&l.forEach(function(u){u.addEventListener("scroll",n.update,Ut)}),a&&c.addEventListener("resize",n.update,Ut),function(){i&&l.forEach(function(u){u.removeEventListener("scroll",n.update,Ut)}),a&&c.removeEventListener("resize",n.update,Ut)}}const Aa={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:wa,data:{}};var Ca={left:"right",right:"left",bottom:"top",top:"bottom"};function en(e){return e.replace(/left|right|bottom|top/g,function(t){return Ca[t]})}var Pa={start:"end",end:"start"};function qr(e){return e.replace(/start|end/g,function(t){return Pa[t]})}function dr(e){var t=ae(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function fr(e){return st(Ne(e)).left+dr(e).scrollLeft}function ka(e,t){var n=ae(e),r=Ne(e),s=n.visualViewport,i=r.clientWidth,o=r.clientHeight,a=0,c=0;if(s){i=s.width,o=s.height;var l=Ys();(l||!l&&t==="fixed")&&(a=s.offsetLeft,c=s.offsetTop)}return{width:i,height:o,x:a+fr(e),y:c}}function Sa(e){var t,n=Ne(e),r=dr(e),s=(t=e.ownerDocument)==null?void 0:t.body,i=Ye(n.scrollWidth,n.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),o=Ye(n.scrollHeight,n.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),a=-r.scrollLeft+fr(e),c=-r.scrollTop;return Me(s||n).direction==="rtl"&&(a+=Ye(n.clientWidth,s?s.clientWidth:0)-i),{width:i,height:o,x:a,y:c}}function hr(e){var t=Me(e),n=t.overflow,r=t.overflowX,s=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+s+r)}function Js(e){return["html","body","#document"].indexOf(Ae(e))>=0?e.ownerDocument.body:ue(e)&&hr(e)?e:Js(pn(e))}function vt(e,t){var n;t===void 0&&(t=[]);var r=Js(e),s=r===((n=e.ownerDocument)==null?void 0:n.body),i=ae(r),o=s?[i].concat(i.visualViewport||[],hr(r)?r:[]):r,a=t.concat(o);return s?a:a.concat(vt(pn(o)))}function Xn(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Ia(e,t){var n=st(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function Kr(e,t,n){return t===Xs?Xn(ka(e,n)):qe(t)?Ia(t,n):Xn(Sa(Ne(e)))}function Ea(e){var t=vt(pn(e)),n=["absolute","fixed"].indexOf(Me(e).position)>=0,r=n&&ue(e)?Ft(e):e;return qe(r)?t.filter(function(s){return qe(s)&&qs(s,r)&&Ae(s)!=="body"}):[]}function Ma(e,t,n,r){var s=t==="clippingParents"?Ea(e):[].concat(t),i=[].concat(s,[n]),o=i[0],a=i.reduce(function(c,l){var u=Kr(e,l,r);return c.top=Ye(u.top,c.top),c.right=sn(u.right,c.right),c.bottom=sn(u.bottom,c.bottom),c.left=Ye(u.left,c.left),c},Kr(e,o,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function ei(e){var t=e.reference,n=e.element,r=e.placement,s=r?we(r):null,i=r?it(r):null,o=t.x+t.width/2-n.width/2,a=t.y+t.height/2-n.height/2,c;switch(s){case re:c={x:o,y:t.y-n.height};break;case fe:c={x:o,y:t.y+t.height};break;case he:c={x:t.x+t.width,y:a};break;case se:c={x:t.x-n.width,y:a};break;default:c={x:t.x,y:t.y}}var l=s?ur(s):null;if(l!=null){var u=l==="y"?"height":"width";switch(i){case nt:c[l]=c[l]-(t[u]/2-n[u]/2);break;case kt:c[l]=c[l]+(t[u]/2-n[u]/2);break}}return c}function St(e,t){t===void 0&&(t={});var n=t,r=n.placement,s=r===void 0?e.placement:r,i=n.strategy,o=i===void 0?e.strategy:i,a=n.boundary,c=a===void 0?qo:a,l=n.rootBoundary,u=l===void 0?Xs:l,d=n.elementContext,f=d===void 0?ht:d,h=n.altBoundary,m=h===void 0?!1:h,p=n.padding,g=p===void 0?0:p,y=Qs(typeof g!="number"?g:Zs(g,Dt)),w=f===ht?Ko:ht,A=e.rects.popper,C=e.elements[m?w:f],P=Ma(qe(C)?C:C.contextElement||Ne(e.elements.popper),c,u,o),k=st(e.elements.reference),E=ei({reference:k,element:A,placement:s}),O=Xn(Object.assign({},A,E)),R=f===ht?O:k,j={top:P.top-R.top+y.top,bottom:R.bottom-P.bottom+y.bottom,left:P.left-R.left+y.left,right:R.right-P.right+y.right},T=e.modifiersData.offset;if(f===ht&&T){var L=T[s];Object.keys(j).forEach(function($){var I=[he,fe].indexOf($)>=0?1:-1,M=[re,fe].indexOf($)>=0?"y":"x";j[$]+=L[M]*I})}return j}function ja(e,t){t===void 0&&(t={});var n=t,r=n.placement,s=n.boundary,i=n.rootBoundary,o=n.padding,a=n.flipVariations,c=n.allowedAutoPlacements,l=c===void 0?Ws:c,u=it(r),d=u?a?Xr:Xr.filter(function(m){return it(m)===u}):Dt,f=d.filter(function(m){return l.indexOf(m)>=0});f.length===0&&(f=d);var h=f.reduce(function(m,p){return m[p]=St(e,{placement:p,boundary:s,rootBoundary:i,padding:o})[we(p)],m},{});return Object.keys(h).sort(function(m,p){return h[m]-h[p]})}function Ra(e){if(we(e)===ar)return[];var t=en(e);return[qr(e),t,qr(t)]}function Oa(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var s=n.mainAxis,i=s===void 0?!0:s,o=n.altAxis,a=o===void 0?!0:o,c=n.fallbackPlacements,l=n.padding,u=n.boundary,d=n.rootBoundary,f=n.altBoundary,h=n.flipVariations,m=h===void 0?!0:h,p=n.allowedAutoPlacements,g=t.options.placement,y=we(g),w=y===g,A=c||(w||!m?[en(g)]:Ra(g)),C=[g].concat(A).reduce(function(K,H){return K.concat(we(H)===ar?ja(t,{placement:H,boundary:u,rootBoundary:d,padding:l,flipVariations:m,allowedAutoPlacements:p}):H)},[]),P=t.rects.reference,k=t.rects.popper,E=new Map,O=!0,R=C[0],j=0;j<C.length;j++){var T=C[j],L=we(T),$=it(T)===nt,I=[re,fe].indexOf(L)>=0,M=I?"width":"height",_=St(t,{placement:T,boundary:u,rootBoundary:d,altBoundary:f,padding:l}),D=I?$?he:se:$?fe:re;P[M]>k[M]&&(D=en(D));var F=en(D),V=[];if(i&&V.push(_[L]<=0),a&&V.push(_[D]<=0,_[F]<=0),V.every(function(K){return K})){R=T,O=!1;break}E.set(T,V)}if(O)for(var N=m?3:1,U=function(H){var Q=C.find(function(Y){var q=E.get(Y);if(q)return q.slice(0,H).every(function(Z){return Z})});if(Q)return R=Q,"break"},G=N;G>0;G--){var ie=U(G);if(ie==="break")break}t.placement!==R&&(t.modifiersData[r]._skip=!0,t.placement=R,t.reset=!0)}}const Ta={name:"flip",enabled:!0,phase:"main",fn:Oa,requiresIfExists:["offset"],data:{_skip:!1}};function Qr(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Zr(e){return[re,he,fe,se].some(function(t){return e[t]>=0})}function _a(e){var t=e.state,n=e.name,r=t.rects.reference,s=t.rects.popper,i=t.modifiersData.preventOverflow,o=St(t,{elementContext:"reference"}),a=St(t,{altBoundary:!0}),c=Qr(o,r),l=Qr(a,s,i),u=Zr(c),d=Zr(l);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}const $a={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:_a};function La(e,t,n){var r=we(e),s=[se,re].indexOf(r)>=0?-1:1,i=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,o=i[0],a=i[1];return o=o||0,a=(a||0)*s,[se,he].indexOf(r)>=0?{x:a,y:o}:{x:o,y:a}}function Da(e){var t=e.state,n=e.options,r=e.name,s=n.offset,i=s===void 0?[0,0]:s,o=Ws.reduce(function(u,d){return u[d]=La(d,t.rects,i),u},{}),a=o[t.placement],c=a.x,l=a.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=l),t.modifiersData[r]=o}const Fa={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Da};function za(e){var t=e.state,n=e.name;t.modifiersData[n]=ei({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})}const Na={name:"popperOffsets",enabled:!0,phase:"read",fn:za,data:{}};function Ba(e){return e==="x"?"y":"x"}function Va(e){var t=e.state,n=e.options,r=e.name,s=n.mainAxis,i=s===void 0?!0:s,o=n.altAxis,a=o===void 0?!1:o,c=n.boundary,l=n.rootBoundary,u=n.altBoundary,d=n.padding,f=n.tether,h=f===void 0?!0:f,m=n.tetherOffset,p=m===void 0?0:m,g=St(t,{boundary:c,rootBoundary:l,padding:d,altBoundary:u}),y=we(t.placement),w=it(t.placement),A=!w,C=ur(y),P=Ba(C),k=t.modifiersData.popperOffsets,E=t.rects.reference,O=t.rects.popper,R=typeof p=="function"?p(Object.assign({},t.rects,{placement:t.placement})):p,j=typeof R=="number"?{mainAxis:R,altAxis:R}:Object.assign({mainAxis:0,altAxis:0},R),T=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,L={x:0,y:0};if(k){if(i){var $,I=C==="y"?re:se,M=C==="y"?fe:he,_=C==="y"?"height":"width",D=k[C],F=D+g[I],V=D-g[M],N=h?-O[_]/2:0,U=w===nt?E[_]:O[_],G=w===nt?-O[_]:-E[_],ie=t.elements.arrow,K=h&&ie?cr(ie):{width:0,height:0},H=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Ks(),Q=H[I],Y=H[M],q=yt(0,E[_],K[_]),Z=A?E[_]/2-N-q-Q-j.mainAxis:U-q-Q-j.mainAxis,oe=A?-E[_]/2+N+q+Y+j.mainAxis:G+q+Y+j.mainAxis,J=t.elements.arrow&&Ft(t.elements.arrow),Pe=J?C==="y"?J.clientTop||0:J.clientLeft||0:0,ke=($=T?.[C])!=null?$:0,ct=D+Z-ke-Pe,ut=D+oe-ke,Ve=yt(h?sn(F,ct):F,D,h?Ye(V,ut):V);k[C]=Ve,L[C]=Ve-D}if(a){var He,dt=C==="x"?re:se,ft=C==="x"?fe:he,ve=k[P],Ht=P==="y"?"height":"width",$r=ve+g[dt],Lr=ve-g[ft],Sn=[re,se].indexOf(y)!==-1,Dr=(He=T?.[P])!=null?He:0,Fr=Sn?$r:ve-E[Ht]-O[Ht]-Dr+j.altAxis,zr=Sn?ve+E[Ht]+O[Ht]-Dr-j.altAxis:Lr,Nr=h&&Sn?fa(Fr,ve,zr):yt(h?Fr:$r,ve,h?zr:Lr);k[P]=Nr,L[P]=Nr-ve}t.modifiersData[r]=L}}const Ha={name:"preventOverflow",enabled:!0,phase:"main",fn:Va,requiresIfExists:["offset"]};function Ua(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function Ga(e){return e===ae(e)||!ue(e)?dr(e):Ua(e)}function Xa(e){var t=e.getBoundingClientRect(),n=rt(t.width)/e.offsetWidth||1,r=rt(t.height)/e.offsetHeight||1;return n!==1||r!==1}function Wa(e,t,n){n===void 0&&(n=!1);var r=ue(t),s=ue(t)&&Xa(t),i=Ne(t),o=st(e,s,n),a={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!n)&&((Ae(t)!=="body"||hr(i))&&(a=Ga(t)),ue(t)?(c=st(t,!0),c.x+=t.clientLeft,c.y+=t.clientTop):i&&(c.x=fr(i))),{x:o.left+a.scrollLeft-c.x,y:o.top+a.scrollTop-c.y,width:o.width,height:o.height}}function Ya(e){var t=new Map,n=new Set,r=[];e.forEach(function(i){t.set(i.name,i)});function s(i){n.add(i.name);var o=[].concat(i.requires||[],i.requiresIfExists||[]);o.forEach(function(a){if(!n.has(a)){var c=t.get(a);c&&s(c)}}),r.push(i)}return e.forEach(function(i){n.has(i.name)||s(i)}),r}function qa(e){var t=Ya(e);return oa.reduce(function(n,r){return n.concat(t.filter(function(s){return s.phase===r}))},[])}function Ka(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function Qa(e){var t=e.reduce(function(n,r){var s=n[r.name];return n[r.name]=s?Object.assign({},s,r,{options:Object.assign({},s.options,r.options),data:Object.assign({},s.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var Jr={placement:"bottom",modifiers:[],strategy:"absolute"};function es(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function Za(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,s=t.defaultOptions,i=s===void 0?Jr:s;return function(a,c,l){l===void 0&&(l=i);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},Jr,i),modifiersData:{},elements:{reference:a,popper:c},attributes:{},styles:{}},d=[],f=!1,h={state:u,setOptions:function(y){var w=typeof y=="function"?y(u.options):y;p(),u.options=Object.assign({},i,u.options,w),u.scrollParents={reference:qe(a)?vt(a):a.contextElement?vt(a.contextElement):[],popper:vt(c)};var A=qa(Qa([].concat(r,u.options.modifiers)));return u.orderedModifiers=A.filter(function(C){return C.enabled}),m(),h.update()},forceUpdate:function(){if(!f){var y=u.elements,w=y.reference,A=y.popper;if(es(w,A)){u.rects={reference:Wa(w,Ft(A),u.options.strategy==="fixed"),popper:cr(A)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(j){return u.modifiersData[j.name]=Object.assign({},j.data)});for(var C=0;C<u.orderedModifiers.length;C++){if(u.reset===!0){u.reset=!1,C=-1;continue}var P=u.orderedModifiers[C],k=P.fn,E=P.options,O=E===void 0?{}:E,R=P.name;typeof k=="function"&&(u=k({state:u,options:O,name:R,instance:h})||u)}}}},update:Ka(function(){return new Promise(function(g){h.forceUpdate(),g(u)})}),destroy:function(){p(),f=!0}};if(!es(a,c))return h;h.setOptions(l).then(function(g){!f&&l.onFirstUpdate&&l.onFirstUpdate(g)});function m(){u.orderedModifiers.forEach(function(g){var y=g.name,w=g.options,A=w===void 0?{}:w,C=g.effect;if(typeof C=="function"){var P=C({state:u,name:y,instance:h,options:A}),k=function(){};d.push(P||k)}})}function p(){d.forEach(function(g){return g()}),d=[]}return h}}var Ja=[Aa,Na,ba,ca,Fa,Ta,Ha,ga,$a],el=Za({defaultModifiers:Ja});function de(e){const{elementType:t,externalSlotProps:n,ownerState:r,skipResolvingSlotProps:s=!1,...i}=e,o=s?{}:Xo(n,r),{props:a,internalRef:c}=Yo({...i,externalSlotProps:o}),l=Pt(c,o?.ref,e.additionalProps?.ref);return Go(t,{...a,ref:l},r)}function tl(e){return parseInt(v.version,10)>=19?e?.props?.ref||null:e?.ref||null}function nl(e){return typeof e=="function"?e():e}const rl=v.forwardRef(function(t,n){const{children:r,container:s,disablePortal:i=!1}=t,[o,a]=v.useState(null),c=Pt(v.isValidElement(r)?tl(r):null,n);if($e(()=>{i||a(nl(s)||document.body)},[s,i]),$e(()=>{if(o&&!i)return Ur(n,o),()=>{Ur(n,null)}},[n,o,i]),i){if(v.isValidElement(r)){const l={ref:c};return v.cloneElement(r,l)}return r}return o&&Ns.createPortal(r,o)});function sl(e){return De("MuiPopper",e)}Fe("MuiPopper",["root"]);function il(e,t){if(t==="ltr")return e;switch(e){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return e}}function Wn(e){return typeof e=="function"?e():e}function ol(e){return e.nodeType!==void 0}const al=e=>{const{classes:t}=e;return je({root:["root"]},sl,t)},ll={},cl=v.forwardRef(function(t,n){const{anchorEl:r,children:s,direction:i,disablePortal:o,modifiers:a,open:c,placement:l,popperOptions:u,popperRef:d,slotProps:f={},slots:h={},TransitionProps:m,ownerState:p,...g}=t,y=v.useRef(null),w=Pt(y,n),A=v.useRef(null),C=Pt(A,d),P=v.useRef(C);$e(()=>{P.current=C},[C]),v.useImperativeHandle(d,()=>A.current,[]);const k=il(l,i),[E,O]=v.useState(k),[R,j]=v.useState(Wn(r));v.useEffect(()=>{A.current&&A.current.forceUpdate()}),v.useEffect(()=>{r&&j(Wn(r))},[r]),$e(()=>{if(!R||!c)return;const M=F=>{O(F.placement)};let _=[{name:"preventOverflow",options:{altBoundary:o}},{name:"flip",options:{altBoundary:o}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:F})=>{M(F)}}];a!=null&&(_=_.concat(a)),u&&u.modifiers!=null&&(_=_.concat(u.modifiers));const D=el(R,y.current,{placement:k,...u,modifiers:_});return P.current(D),()=>{D.destroy(),P.current(null)}},[R,o,a,c,u,k]);const T={placement:E};m!==null&&(T.TransitionProps=m);const L=al(t),$=h.root??"div",I=de({elementType:$,externalSlotProps:f.root,externalForwardedProps:g,additionalProps:{role:"tooltip",ref:w},ownerState:t,className:L.root});return x.jsx($,{...I,children:typeof s=="function"?s(T):s})}),ul=v.forwardRef(function(t,n){const{anchorEl:r,children:s,container:i,direction:o="ltr",disablePortal:a=!1,keepMounted:c=!1,modifiers:l,open:u,placement:d="bottom",popperOptions:f=ll,popperRef:h,style:m,transition:p=!1,slotProps:g={},slots:y={},...w}=t,[A,C]=v.useState(!0),P=()=>{C(!1)},k=()=>{C(!0)};if(!c&&!u&&(!p||A))return null;let E;if(i)E=i;else if(r){const j=Wn(r);E=j&&ol(j)?Un(j).body:Un(null).body}const O=!u&&c&&(!p||A)?"none":void 0,R=p?{in:u,onEnter:P,onExited:k}:void 0;return x.jsx(rl,{disablePortal:a,container:E,children:x.jsx(cl,{anchorEl:r,direction:o,disablePortal:a,modifiers:l,ref:n,open:p?!A:u,placement:d,popperOptions:f,popperRef:h,slotProps:g,slots:y,...w,style:{position:"fixed",top:0,left:0,display:O,...m},TransitionProps:R,children:s})})}),dl=W(ul,{name:"MuiPopper",slot:"Root"})({}),fl=v.forwardRef(function(t,n){const r=or(),s=io({props:t,name:"MuiPopper"}),{anchorEl:i,component:o,components:a,componentsProps:c,container:l,disablePortal:u,keepMounted:d,modifiers:f,open:h,placement:m,popperOptions:p,popperRef:g,transition:y,slots:w,slotProps:A,...C}=s,P=w?.root??a?.Root,k={anchorEl:i,container:l,disablePortal:u,keepMounted:d,modifiers:f,open:h,placement:m,popperOptions:p,popperRef:g,transition:y,...C};return x.jsx(dl,{as:o,direction:r?"rtl":"ltr",slots:{root:P},slotProps:A??c,...k,ref:n})});function ti(e){const{children:t,defer:n=!1,fallback:r=null}=e,[s,i]=v.useState(!1);return $e(()=>{n||i(!0)},[n]),v.useEffect(()=>{n&&i(!0)},[n]),s?t:r}function hl(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function pl(e){return e}function ml(){var e=pl,t=hl,n=null,r=Ue(0),s=Ue(jn),i=Ue(0);function o(a){var c,l=(a=Co(a)).length,u,d,f=0,h=new Array(l),m=new Array(l),p=+r.apply(this,arguments),g=Math.min(jn,Math.max(-jn,s.apply(this,arguments)-p)),y,w=Math.min(Math.abs(g)/l,i.apply(this,arguments)),A=w*(g<0?-1:1),C;for(c=0;c<l;++c)(C=m[h[c]=c]=+e(a[c],c,a))>0&&(f+=C);for(t!=null?h.sort(function(P,k){return t(m[P],m[k])}):n!=null&&h.sort(function(P,k){return n(a[P],a[k])}),c=0,d=f?(g-l*A)/f:0;c<l;++c,p=y)u=h[c],C=m[u],y=p+(C>0?C*d:0)+A,m[u]={data:a[u],index:c,value:C,startAngle:p,endAngle:y,padAngle:w};return m}return o.value=function(a){return arguments.length?(e=typeof a=="function"?a:Ue(+a),o):e},o.sortValues=function(a){return arguments.length?(t=a,n=null,o):t},o.sort=function(a){return arguments.length?(n=a,t=null,o):n},o.startAngle=function(a){return arguments.length?(r=typeof a=="function"?a:Ue(+a),o):r},o.endAngle=function(a){return arguments.length?(s=typeof a=="function"?a:Ue(+a),o):s},o.padAngle=function(a){return arguments.length?(i=typeof a=="function"?a:Ue(+a),o):i},o}function gl(e,t){if((c=e.length)>0)for(var n,r=0,s,i,o,a,c,l=e[t[0]].length;r<l;++r)for(o=a=0,n=0;n<c;++n)(i=(s=e[t[n]][r])[1]-s[0])>0?(s[0]=o,s[1]=o+=i):i<0?(s[1]=a,s[0]=a+=i):(s[0]=0,s[1]=i)}function ni(e){var t=e.map(xl);return hn(e).sort(function(n,r){return t[n]-t[r]})}function xl(e){for(var t=-1,n=0,r=e.length,s,i=-1/0;++t<r;)(s=+e[t][1])>i&&(i=s,n=t);return n}function ri(e){var t=e.map(si);return hn(e).sort(function(n,r){return t[n]-t[r]})}function si(e){for(var t=0,n=-1,r=e.length,s;++n<r;)(s=+e[n][1])&&(t+=s);return t}function yl(e){return ri(e).reverse()}function vl(e){var t=e.length,n,r,s=e.map(si),i=ni(e),o=0,a=0,c=[],l=[];for(n=0;n<t;++n)r=i[n],o<a?(o+=s[r],c.push(r)):(a+=s[r],l.push(r));return l.reverse().concat(c)}function bl(e){return hn(e).reverse()}function wl({filter:e,setFilter:t,closeModal:n}){const{handleSubmit:r,control:s,trigger:i}=lo({defaultValues:{...e}}),o=a=>{t(a),n()};return x.jsxs("form",{onSubmit:r(o),children:[x.jsx(In,{name:"fromDate",control:s,rules:{pattern:{value:Br,message:"Date must be im format yyyy-mm-dd"}},render:({field:a,fieldState:c})=>x.jsx(Vr,{...a,label:"From Date",value:a.value?new Date(a.value):null,onChange:l=>{i("fromDate"),a.onChange(l?Le(l,"yyyy-MM-dd"):void 0)},error:c.error?.message,popoverProps:{withinPortal:!0}})}),x.jsx(In,{name:"toDate",control:s,rules:{pattern:{value:Br,message:"Date must be im format yyyy-mm-dd"}},render:({field:a,fieldState:c})=>x.jsx(Vr,{...a,label:"To Date",value:a.value?new Date(a.value):null,onChange:l=>{i("toDate"),a.onChange(l?Le(l,"yyyy-MM-dd"):void 0)},error:c.error?.message,popoverProps:{withinPortal:!0}})}),x.jsx(In,{name:"currency",control:s,render:({field:a,fieldState:c})=>x.jsx(co,{...a,label:"Currency",defaultValue:En.Usd,error:c.error?.message,data:Object.keys(En).map(l=>En[l])})}),x.jsxs("div",{className:"flex justify-center mt-5 gap-3",children:[x.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",children:"Filter"}),x.jsx("button",{type:"button",className:"text-white bg-rose-500 border-0 py-2 px-8 focus:outline-hidden hover:bg-rose-600 rounded-sm text-lg",onClick:n,children:"Cancel"})]})]})}function Al({filter:e,setFilter:t}){const[n,r]=v.useState(!1),{get:s,set:i}=Vs();function o(a){a||={fromDate:Le(new Date,"yyyy-MM-DD"),toDate:Le(new Date,"yyyy-MM-DD")},uo(a,e)||t(a)}return v.useEffect(()=>{const a=oo(e??{})?null:encodeURIComponent(JSON.stringify(e)),c=s("MonthlyIncomeExpenseChartFilters");a!==c&&i("MonthlyIncomeExpenseChartFilters",a)},[e,s,i]),x.jsxs(x.Fragment,{children:[x.jsx(bo,{opened:n,onClose:()=>r(!1),content:x.jsx(wl,{filter:e,setFilter:o,closeModal:()=>r(!1)})}),x.jsx(ao,{variant:"outline",size:"icon",className:"size-7.5",onClick:()=>r(!0),children:x.jsx(wo,{className:"size-5"})})]})}const pr="DEFAULT_X_AXIS_KEY",mr="DEFAULT_Y_AXIS_KEY",Cl={top:50,bottom:50,left:50,right:50},ii=v.createContext({isInitialized:!1,data:{highlightedItem:null,setHighlighted:()=>{},clearHighlighted:()=>{},isHighlighted:()=>!1,isFaded:()=>!1}}),Pl=(e,t)=>n=>e?e.fade==="series"?n.seriesId===t?.seriesId&&n.dataIndex!==t?.dataIndex:e.fade==="global"?n.seriesId!==t?.seriesId||n.dataIndex!==t?.dataIndex:!1:!1,kl=(e,t)=>n=>e?e.highlight==="series"?n.seriesId===t?.seriesId:e.highlight==="item"?n.dataIndex===t?.dataIndex&&n.seriesId===t?.seriesId:!1:!1,Sl=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"];function Il(e,t,n=Sl){return e.type==="pie"?b({},e,{data:e.data.map((r,s)=>b({color:n[s%n.length]},r))}):b({color:n[t%n.length]},e)}const El=({series:e,colors:t,seriesFormatters:n,dataset:r})=>{const s={};e.forEach((o,a)=>{const{id:c=`auto-generated-id-${a}`,type:l}=o;if(s[l]===void 0&&(s[l]={series:{},seriesOrder:[]}),s[l]?.series[c]!==void 0)throw new Error(`MUI X: series' id "${c}" is not unique.`);s[l].series[c]=b({id:c},Il(o,a,t)),s[l].seriesOrder.push(c)});const i={};return Object.keys(n).forEach(o=>{const a=s[o];a!==void 0&&(i[o]=n[o]?.(a,r)??s[o])}),i},Ml=["#02B2AF","#2E96FF","#B800D8","#60009B","#2731C8","#03008D"],jl=["#02B2AF","#72CCFF","#DA00FF","#9001CB","#2E96FF","#3B48E0"],Rl=e=>e==="dark"?jl:Ml,oi=v.createContext({isInitialized:!1,data:{}}),zt=v.createContext({isInitialized:!1,data:{colorProcessors:{},seriesFormatters:{},xExtremumGetters:{},yExtremumGetters:{},rotationExtremumGetters:{},radiusExtremumGetters:{}}}),ts=(e,t)=>t==="x"?{x:e,y:null}:{x:null,y:e},ai=e=>{const{axis:t,getFilters:n,isDefaultAxis:r}=e,s=n?.({currentAxisId:t.id,isDefaultAxis:r}),i=s?t.data?.filter((c,l)=>s({x:null,y:null},l)):t.data,o=Math.min(...i??[]),a=Math.max(...i??[]);return[o,a]},li=e=>t=>{const{series:n,axis:r,getFilters:s,isDefaultAxis:i}=t;return Object.keys(n).filter(o=>{const a=n[o].yAxisId??n[o].yAxisKey;return a===r.id||i&&a===void 0}).reduce((o,a)=>{const{stackedData:c}=n[a],l=s?.({currentAxisId:r.id,isDefaultAxis:i,seriesXAxisId:n[a].xAxisId??n[a].xAxisKey,seriesYAxisId:n[a].yAxisId??n[a].yAxisKey}),[u,d]=c?.reduce((f,h,m)=>l&&(!l(ts(h[0],e),m)||!l(ts(h[1],e),m))?f:[Math.min(...h,f[0]),Math.max(...h,f[1])],[1/0,-1/0])??[1/0,-1/0];return[Math.min(u,o[0]),Math.max(d,o[1])]},[1/0,-1/0])},Ol=e=>Object.keys(e.series).some(n=>e.series[n].layout==="horizontal")?li("x")(e):ai(e),Tl=e=>Object.keys(e.series).some(n=>e.series[n].layout==="horizontal")?ai(e):li("y")(e),Rn={appearance:ni,ascending:ri,descending:yl,insideOut:vl,none:hn,reverse:bl},On={expand:Io,diverging:gl,none:Po,silhouette:So,wiggle:ko},ci=e=>{const{series:t,seriesOrder:n,defaultStrategy:r}=e,s=[],i={};return n.forEach(o=>{const{stack:a,stackOrder:c,stackOffset:l}=t[o];a===void 0?s.push({ids:[o],stackingOrder:Rn.none,stackingOffset:On.none}):i[a]===void 0?(i[a]=s.length,s.push({ids:[o],stackingOrder:Rn[c??r?.stackOrder??"none"],stackingOffset:On[l??r?.stackOffset??"diverging"]})):(s[i[a]].ids.push(o),c!==void 0&&(s[i[a]].stackingOrder=Rn[c]),l!==void 0&&(s[i[a]].stackingOffset=On[l]))}),s};function ui(e,t){const n={};return Object.keys(e).forEach(r=>{n[r]=b({},e[r],{valueFormatter:e[r].valueFormatter??t})}),n}const _l=(e,t)=>{const{seriesOrder:n,series:r}=e,s=ci(e),i=t??[];n.forEach(a=>{const c=r[a].data;if(c!==void 0)c.forEach((l,u)=>{i.length<=u?i.push({[a]:l}):i[u][a]=l});else if(t===void 0)throw new Error([`MUI X: bar series with id='${a}' has no data.`,"Either provide a data property to the series or use the dataset prop."].join(`
|
|
2
2
|
`))});const o={};return s.forEach(a=>{const{ids:c,stackingOffset:l,stackingOrder:u}=a,d=Hs().keys(c.map(f=>{const h=r[f].dataKey;return r[f].data===void 0&&h!==void 0?h:f})).value((f,h)=>f[h]??0).order(u).offset(l)(i);c.forEach((f,h)=>{const m=r[f].dataKey;o[f]=b({layout:"vertical"},r[f],{data:m?t.map(p=>{const g=p[m];return typeof g!="number"?0:g}):r[f].data,stackedData:d[h].map(([p,g])=>[p,g])})})}),{seriesOrder:n,stackingGroups:s,series:ui(o,a=>a==null?"":a.toLocaleString())}},di=(e,t,n)=>{const r=e.layout==="vertical",s=r?t?.colorScale:n?.colorScale,i=r?n?.colorScale:t?.colorScale,o=r?t?.data:n?.data;return i?a=>{const c=e.data[a],l=c===null?e.color:i(c);return l===null?e.color:l}:s&&o?a=>{const c=o[a],l=c===null?e.color:s(c);return l===null?e.color:l}:()=>e.color},$l={seriesType:"bar",seriesFormatter:_l,colorProcessor:di,xExtremumGetter:Ol,yExtremumGetter:Tl},on=(e,t)=>[t[0]===null?e[0]:Math.min(e[0],t[0]),t[1]===null?e[1]:Math.max(e[1],t[1])],Ll=e=>{const{series:t,axis:n,isDefaultAxis:r,getFilters:s}=e;return Object.keys(t).filter(i=>{const o=t[i].xAxisId??t[i].xAxisKey;return o===n.id||o===void 0&&r}).reduce((i,o)=>{const a=s?.({currentAxisId:n.id,isDefaultAxis:r,seriesXAxisId:t[o].xAxisId??t[o].xAxisKey,seriesYAxisId:t[o].yAxisId??t[o].yAxisKey}),c=t[o].data?.reduce((l,u,d)=>a&&!a(u,d)?l:on(l,[u.x,u.x]),[1/0,-1/0]);return on(i,c??[1/0,-1/0])},[1/0,-1/0])},Dl=e=>{const{series:t,axis:n,isDefaultAxis:r,getFilters:s}=e;return Object.keys(t).filter(i=>{const o=t[i].yAxisId??t[i].yAxisKey;return o===n.id||o===void 0&&r}).reduce((i,o)=>{const a=s?.({currentAxisId:n.id,isDefaultAxis:r,seriesXAxisId:t[o].xAxisId??t[o].xAxisKey,seriesYAxisId:t[o].yAxisId??t[o].yAxisKey}),c=t[o].data?.reduce((l,u,d)=>a&&!a(u,d)?l:on(l,[u.y,u.y]),[1/0,-1/0]);return on(i,c??[1/0,-1/0])},[1/0,-1/0])},Fl=({series:e,seriesOrder:t},n)=>({series:Object.fromEntries(Object.entries(e).map(([s,i])=>{const o=i?.datasetKeys,a=["x","y","id"].filter(l=>typeof o?.[l]!="string");if(i?.datasetKeys&&a.length>0)throw new Error([`MUI X: scatter series with id='${s}' has incomplete datasetKeys.`,`Properties ${a.map(l=>`"${l}"`).join(", ")} are missing.`].join(`
|
|
3
3
|
`));const c=o?n?.map(l=>({x:l[o.x]??null,y:l[o.y]??null,z:o.z&&l[o.z],id:l[o.id]}))??[]:i.data??[];return[s,b({},i,{data:c,valueFormatter:i.valueFormatter??(l=>`(${l.x}, ${l.y})`)})]})),seriesOrder:t}),zl=(e,t,n,r)=>{const s=r?.colorScale,i=n?.colorScale,o=t?.colorScale;return s?a=>{if(r?.data?.[a]!==void 0){const u=s(r?.data?.[a]);if(u!==null)return u}const c=e.data[a],l=c===null?e.color:s(c.z);return l===null?e.color:l}:i?a=>{const c=e.data[a],l=c===null?e.color:i(c.y);return l===null?e.color:l}:o?a=>{const c=e.data[a],l=c===null?e.color:o(c.x);return l===null?e.color:l}:()=>e.color},Nl={seriesType:"scatter",seriesFormatter:Fl,colorProcessor:zl,xExtremumGetter:Ll,yExtremumGetter:Dl},Bl=e=>{const{axis:t}=e,n=Math.min(...t.data??[]),r=Math.max(...t.data??[]);return[n,r]};function Vl(e,t,n){return t.reduce((r,s,i)=>{const[o,a]=e(s);return n&&(!n({y:o,x:null},i)||!n({y:a,x:null},i))?r:[Math.min(o,a,r[0]),Math.max(o,a,r[1])]},[1/0,-1/0])}const Hl=e=>{const{series:t,axis:n,isDefaultAxis:r,getFilters:s}=e;return Object.keys(t).filter(i=>{const o=t[i].yAxisId??t[i].yAxisKey;return o===n.id||r&&o===void 0}).reduce((i,o)=>{const{area:a,stackedData:c}=t[o],l=a!==void 0,u=s?.({currentAxisId:n.id,isDefaultAxis:r,seriesXAxisId:t[o].xAxisId??t[o].xAxisKey,seriesYAxisId:t[o].yAxisId??t[o].yAxisKey}),d=l&&n.scaleType!=="log"&&typeof t[o].baseline!="string"?p=>p:p=>[p[1],p[1]],f=Vl(d,c,u),[h,m]=f;return[Math.min(h,i[0]),Math.max(m,i[1])]},[1/0,-1/0])},Ul=(e,t)=>{const{seriesOrder:n,series:r}=e,s=ci(b({},e,{defaultStrategy:{stackOffset:"none"}})),i=t??[];n.forEach(a=>{const c=r[a].data;c!==void 0&&c.forEach((l,u)=>{i.length<=u?i.push({[a]:l}):i[u][a]=l})});const o={};return s.forEach(a=>{const{ids:c,stackingOrder:l,stackingOffset:u}=a,d=Hs().keys(c.map(f=>{const h=r[f].dataKey;return r[f].data===void 0&&h!==void 0?h:f})).value((f,h)=>f[h]??0).order(l).offset(u)(i);c.forEach((f,h)=>{const m=r[f].dataKey;o[f]=b({},r[f],{data:m?t.map(p=>{const g=p[m];return typeof g!="number"?null:g}):r[f].data,stackedData:d[h].map(([p,g])=>[p,g])})})}),{seriesOrder:n,stackingGroups:s,series:ui(o,a=>a==null?"":a.toLocaleString())}},Gl=(e,t,n)=>{const r=n?.colorScale,s=t?.colorScale;return r?i=>{const o=e.data[i],a=o===null?e.color:r(o);return a===null?e.color:a}:s?i=>{const o=t.data?.[i],a=o===null?e.color:s(o);return a===null?e.color:a}:()=>e.color},Xl={seriesType:"line",colorProcessor:Gl,seriesFormatter:Ul,xExtremumGetter:Bl,yExtremumGetter:Hl};function Ee(e,t){return typeof e=="function"?e(t):e}const Wl=(e="none")=>{if(typeof e=="function")return e;switch(e){case"none":return null;case"desc":return(t,n)=>n-t;case"asc":return(t,n)=>t-n;default:return null}},Yl=e=>{const{seriesOrder:t,series:n}=e,r={};return t.forEach(s=>{const i=ml().startAngle(2*Math.PI*(n[s].startAngle??0)/360).endAngle(2*Math.PI*(n[s].endAngle??360)/360).padAngle(2*Math.PI*(n[s].paddingAngle??0)/360).sortValues(Wl(n[s].sortingValues??"none"))(n[s].data.map(o=>o.value));r[s]=b({valueFormatter:o=>o.value.toLocaleString()},n[s],{data:n[s].data.map((o,a)=>b({},o,{id:o.id??`auto-generated-pie-id-${s}-${a}`},i[a])).map((o,a)=>b({},o,{formattedValue:n[s].valueFormatter?.(b({},o,{label:Ee(o.label,"arc")}),{dataIndex:a})??o.value.toLocaleString()}))})}),{seriesOrder:t,series:r}},ql=e=>t=>e.data[t].color,Kl={seriesType:"pie",colorProcessor:ql,seriesFormatter:Yl},Ql=[$l,Nl,Xl,Kl];function Zl(e){const t=e??Ql,n={},r={},s={},i={},o={},a={};for(let c=0;c<t.length;c+=1){const l=t[c],u=l.seriesType;n[u]=l.seriesFormatter,r[u]=l.colorProcessor,l.xExtremumGetter&&(s[u]=l.xExtremumGetter),l.yExtremumGetter&&(i[u]=l.yExtremumGetter),l.rotationExtremumGetter&&(o[u]=l.rotationExtremumGetter),l.radiusExtremumGetter&&(a[u]=l.radiusExtremumGetter)}return{seriesFormatters:n,colorProcessors:r,xExtremumGetters:s,yExtremumGetters:i,rotationExtremumGetters:o,radiusExtremumGetters:a}}function Jl(e){const{children:t,plugins:n}=e,r=v.useMemo(()=>({isInitialized:!0,data:Zl(n)}),[n]);return x.jsx(zt.Provider,{value:r,children:t})}function fi(e){const{isInitialized:t,data:n}=v.useContext(zt);if(!t)throw new Error(["MUI X: Could not find the plugin context.","It looks like you rendered your component outside of a ChartsContainer parent component."].join(`
|
|
4
4
|
`));return n.colorProcessors}function ec(e){const{isInitialized:t,data:n}=v.useContext(zt);if(!t)throw new Error(["MUI X: Could not find the plugin context.","It looks like you rendered your component outside of a ChartsContainer parent component."].join(`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{v as _,r as o,j as e,J as I,B as w,a6 as r,e9 as je,aP as T,ay as V,ea as fe,eb as u,ah as q,R as G,d7 as L,ec as Q,bY as J,ed as Y,c5 as Z,c6 as K,bp as W,bO as X,bP as ee,bQ as S,bR as te,c2 as E,b$ as se,dI as ae,bS as ne,bT as D,dw as re,ee as be,ef as N,eg as Ne,eh as we,ei as ye,u as oe,t as ve,ej as Se,T as Ce,ek as Ae,el as Te,aC as le,bB as Ve,E as De,em as Ie,bE as H,bH as $,en as B,bN as Re,w as P,bI as Me,F as Ee,L as Fe,eo as ze}from"./index-rI994S3C.js";import{d as ce}from"./graphql-document-dedupe-fragments-ByT8-wlV.js";import{u as ie}from"./use-url-query-CqWra6gD.js";import{C as O,a as de,b as me,M as ke}from"./charges-table-BJtpvXfL.js";import{P as Le}from"./page-layout-DMGj5xhW.js";import{P as R,a as M}from"./panel-top-open-Bf39HBrp.js";import{C as ue}from"./index-C7p19nIa.js";import{T as xe}from"./toggle-expansion-button-Y2eS7nqg.js";import{U as Be}from"./update-accountant-status-zL6vnwU9.js";import{c as Pe}from"./charges-filters-CFCAP-bP.js";import{P as Oe}from"./modal-BXR_xgUm.js";import{F as Ue}from"./funnel-Cfb9Pxmr.js";import"./Table-BQv3frL8.js";import"./summary-CPKS_69D.js";import"./accordion-Bn08_4fN.js";import"./deposits-transactions-table-2rtRFZgK.js";import"./Checkbox-Dmuz3t7B.js";import"./data-table-column-header-CZ1dXiU0.js";import"./eye-off-Buv7eciz.js";import"./similar-transactions-modal-DX3CPrMo.js";import"./building-2-CMKd_bU8.js";import"./addDays-DTiBTTns.js";import"./sub-CEXBz_OW.js";import"./subMonths-DY4HlBVa.js";import"./MultiSelect-DBeIExB5.js";const He=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],pe=_("chart-column",He);const $e=[["path",{d:"M4 12V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2",key:"jrl274"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 16h2v6",key:"1bxocy"}],["path",{d:"M10 22h4",key:"ceow96"}],["rect",{x:"2",y:"16",width:"4",height:"6",rx:"2",key:"r45zd0"}]],_e=_("file-digit",$e),qe=({data:t,toggleMergeCharge:s,mergeSelectedCharges:n})=>{const a=r(je,t),[c,l]=o.useState(!0);return e.jsxs(I,{className:"p-6",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs("h2",{className:"text-lg font-semibold flex items-center gap-2",children:[e.jsx(w,{variant:"outline",size:"icon",className:"size-7.5",onClick:()=>l(p=>!p),disabled:!a||a.businessTrips.length===0,children:c?e.jsx(R,{className:"size-5"}):e.jsx(M,{className:"size-5"})}),"Business Trips"]})}),c&&a&&e.jsx(O,{data:a.businessTrips,isAllOpened:!1,toggleMergeCharge:s,mergeSelectedCharges:n})]})};function U(t){switch(t){case"C":case"M":return"Self Invoice";case"H":return"Single Doc By Law";case"I":return"Palestinian Customer";case"K":return"Petty Cash";case"L1":return"Unidentified Customer";case"L2":return"Unidentified Zero or Exempt";case"P":return"Palestinian Supplier";case"R":return"Import";case"S1":case"T":return"Regular";case"S2":return"Zero or Exempt";case"Y":return"Export";default:return"Unknown"}}const Ge=t=>{const s=t.reduce((n,a)=>(n[a.recordType]||={recordType:a.recordType,count:0,vatTotal:0,totalBeforeVat:0},n[a.recordType].count++,n[a.recordType].vatTotal+=a.roundedLocalVatAfterDeduction?.raw??0,n[a.recordType].totalBeforeVat+=a.taxReducedLocalAmount?.raw??0,n),{});return Object.values(s)},he=({records:t})=>{const s=o.useMemo(()=>Ge(t??[]),[t]);return e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border text-left",children:[e.jsx("th",{className:"pb-3 text-sm font-medium text-muted-foreground",children:"Record Type"}),e.jsx("th",{className:"pb-3 text-sm font-medium text-muted-foreground text-right",children:"Count"}),e.jsx("th",{className:"pb-3 text-sm font-medium text-muted-foreground text-right",children:"Total Before VAT"}),e.jsx("th",{className:"pb-3 text-sm font-medium text-muted-foreground text-right",children:"VAT Total"})]})}),e.jsx("tbody",{children:s.map(n=>e.jsxs("tr",{className:"border-b border-border/50",children:[e.jsxs("td",{className:"py-3 text-sm font-medium",children:[U(n.recordType)," (",n.recordType,")"]}),e.jsx("td",{className:"py-3 text-sm text-right",children:n.count}),e.jsx("td",{className:"py-3 text-sm text-right",children:T(n.totalBeforeVat,V.Ils)}),e.jsx("td",{className:"py-3 text-sm text-right",children:T(n.vatTotal,V.Ils)})]},n.recordType))})]})})};function ge({data:t}){const{chargeId:s,chargeAccountantStatus:n}=r(fe,t);return e.jsx("td",{children:e.jsx(Be,{value:n??void 0,chargeId:s})})}const b=Q(),z=[b.accessor(t=>r(u,t.data).recordType,{id:"recordType",header:"Record Type",cell:t=>{const s=t.getValue();return e.jsx("p",{className:"whitespace-wrap",children:`${U(s)} (${s})`})}}),b.accessor(t=>r(u,t.data).business?.name??"",{id:"business",header:"Business",cell:t=>{const s=r(u,t.row.original.data);return e.jsxs("div",{className:"flex flex-col gap-1",children:[s.business?.id?e.jsx(q,{to:G.BUSINESSES.DETAIL(s.business.id),target:"_blank",rel:"noreferrer",onClick:n=>n.stopPropagation(),className:"inline-flex items-center font-semibold",children:s.business.name}):e.jsx("span",{children:s.business?.name}),s.vatNumber&&e.jsx("span",{className:"text-[10px] text-gray-500",children:s.vatNumber})]})}}),b.display({id:"invoice",header:"Invoice",cell:t=>{const s=r(u,t.row.original.data);return s.image?e.jsx("a",{href:s.image,target:"_blank",rel:"noreferrer",children:e.jsx("img",{alt:"missing img",src:s.image,height:80,width:80})}):null}}),b.accessor(t=>r(u,t.data).documentSerial??"",{id:"documentSerial",header:"Invoice Serial#",cell:t=>{const s=r(u,t.row.original.data);return e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{children:t.getValue()}),s.allocationNumber&&e.jsxs("span",{className:"text-xs",children:["(",s.allocationNumber,")"]})]})}}),b.accessor(t=>r(u,t.data).documentDate??"",{id:"documentDate",header:"Invoice Date",cell:t=>t.getValue()}),b.accessor(t=>r(u,t.data).chargeDate??"",{id:"chargeDate",header:"Transaction Date",cell:t=>t.getValue()}),b.accessor(t=>r(u,t.data).amount.raw??0,{id:"amount",header:"Amount",cell:t=>{const s=r(u,t.row.original.data);return e.jsx("span",{className:"whitespace-nowrap",children:s.amount.formatted})}}),b.accessor(t=>r(u,t.data).localAmount?.raw??0,{id:"localAmount",header:"Amount ₪",cell:t=>{const s=r(u,t.row.original.data);return e.jsx("span",{className:"whitespace-nowrap",children:s.localAmount?.formatted})}}),b.accessor(t=>r(u,t.data).localVat?.raw??0,{id:"localVat",header:"VAT",cell:t=>{const s=r(u,t.row.original.data);return e.jsx("span",{className:"whitespace-nowrap",children:s.localVat?.formatted})}}),b.accessor(t=>r(u,t.data).localVatAfterDeduction?.raw??0,{id:"localVatAfterDeduction",header:"VAT ₪",cell:t=>{const s=r(u,t.row.original.data);return e.jsx("span",{className:"whitespace-nowrap",children:s.localVatAfterDeduction?.formatted})}}),b.accessor(t=>r(u,t.data).foreignVatAfterDeduction?.raw??0,{id:"foreignVatAfterDeduction",header:"Actual VAT",cell:t=>{const s=r(u,t.row.original.data);return e.jsx("span",{className:"whitespace-nowrap",children:s.foreignVatAfterDeduction?.formatted})}}),b.accessor(t=>r(u,t.data).roundedLocalVatAfterDeduction?.raw??0,{id:"roundedLocalVatAfterDeduction",header:"Rounded VAT",cell:t=>{const s=r(u,t.row.original.data);return e.jsx("span",{className:"whitespace-nowrap",children:s.roundedLocalVatAfterDeduction?.formatted})}}),b.accessor(t=>t.cumulativeVat,{id:"cumulativeVat",header:"Cumulative VAT",cell:t=>e.jsxs("span",{className:"whitespace-nowrap",children:["₪ ",L(t.getValue(),0)]})}),b.accessor(t=>r(u,t.data).taxReducedLocalAmount?.raw??0,{id:"taxReducedLocalAmount",header:"Amount without VAT ₪",cell:t=>{const s=r(u,t.row.original.data);return e.jsx("span",{className:"whitespace-nowrap",children:s.taxReducedLocalAmount?.formatted})}}),b.accessor(t=>t.cumulativeAmount,{id:"cumulativeAmount",header:"Cumulative Amount without VAT ₪",cell:t=>e.jsxs("span",{className:"whitespace-nowrap",children:["₪ ",L(t.getValue(),0)]})}),b.display({id:"accountantApproval",header:"Accountant Approval",cell:t=>{const s=r(u,t.row.original.data);return e.jsx(ge,{data:s})}}),b.display({id:"actions",header:"Edit",cell:t=>{const s=r(u,t.row.original.data);return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(xe,{toggleExpansion:()=>t.row.toggleExpanded(),isExpanded:t.row.getIsExpanded()}),e.jsx(de,{toggleMergeSelected:()=>t.row.original.toggleMergeCharge(s.chargeId),mergeSelected:t.row.original.mergeSelectedCharges.has(s.chargeId)}),e.jsx(ue,{chargeId:s.chargeId})]})}})],Qe=({data:t,toggleMergeCharge:s,mergeSelectedCharges:n})=>{const{expenses:a}=r(be,t)??{expenses:[]},[c,l]=o.useState(!0),[p,x]=o.useState([]),[j,i]=o.useState({}),[f,h]=o.useState({}),[g,C]=o.useState("detailed"),F=o.useMemo(()=>{let d=0,m=0;return a.map(y=>(d+=y.taxReducedLocalAmount?.raw??0,m+=y.roundedLocalVatAfterDeduction?.raw??0,{data:y,toggleMergeCharge:s,mergeSelectedCharges:n,cumulativeVat:m,cumulativeAmount:d}))},[a,s,n]),A=J({data:F,columns:z,getCoreRowModel:K(),onSortingChange:x,getSortedRowModel:Z(),onColumnVisibilityChange:i,onExpandedChange:h,getExpandedRowModel:Y(),state:{sorting:p,columnVisibility:j,expanded:f}});return e.jsxs(I,{className:"p-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("h2",{className:"text-lg font-semibold flex items-center gap-2",children:[e.jsx(w,{variant:"outline",size:"icon",className:"size-7.5",onClick:()=>l(d=>!d),children:c?e.jsx(R,{className:"size-5"}):e.jsx(M,{className:"size-5"})}),"Expenses"]}),c&&e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(w,{variant:g==="detailed"?"default":"outline",size:"sm",onClick:()=>C("detailed"),children:[e.jsx(W,{className:"h-4 w-4 mr-2"}),"Detailed"]}),e.jsxs(w,{variant:g==="summarized"?"default":"outline",size:"sm",onClick:()=>C("summarized"),children:[e.jsx(pe,{className:"h-4 w-4 mr-2"}),"Summarized"]})]})]}),c&&(g==="detailed"?e.jsxs(X,{children:[e.jsx(ee,{children:A.getHeaderGroups().map(d=>e.jsx(S,{children:d.headers.map(m=>e.jsx(te,{colSpan:m.colSpan,children:m.isPlaceholder?null:e.jsxs(w,{variant:"ghost",onClick:m.column.getToggleSortingHandler(),className:"h-auto p-0 hover:bg-transparent",children:[E(m.column.columnDef.header,m.getContext()),{asc:e.jsx(ae,{className:"size-5"}),desc:e.jsx(se,{className:"size-5"})}[m.column.getIsSorted()]??null]})},m.id))},d.id))}),e.jsx(ne,{children:A.getRowModel().rows?.length?A.getRowModel().rows.map(d=>{const m=r(u,d.original.data);return e.jsxs(o.Fragment,{children:[e.jsx(S,{"data-state":d.getIsSelected()&&"selected",children:d.getVisibleCells().map(y=>e.jsx(D,{children:E(y.column.columnDef.cell,y.getContext())},y.id))}),d.getIsExpanded()&&e.jsx(S,{children:e.jsx(D,{colSpan:z.length,children:e.jsx(re,{style:{width:"100%"},withBorder:!0,shadow:"lg",children:e.jsx(me,{chargeID:m.chargeId,fetching:!!m})})})})]},d.id)}):e.jsx(S,{children:e.jsx(D,{colSpan:z.length,className:"h-24 text-center",children:"No results."})})})]}):e.jsx(he,{records:a}))]})},v=Q(),k=[v.accessor(t=>r(N,t.data).recordType,{id:"recordType",header:"Record Type",cell:t=>{const s=t.getValue();return e.jsx("p",{className:"whitespace-wrap",children:`${U(s)} (${s})`})}}),v.accessor(t=>r(N,t.data).business?.name??"",{id:"business",header:"Business",cell:t=>{const s=r(N,t.row.original.data);return e.jsxs("div",{className:"flex flex-col gap-1",children:[s.business?.id?e.jsx(q,{to:G.BUSINESSES.DETAIL(s.business.id),target:"_blank",rel:"noreferrer",onClick:n=>n.stopPropagation(),className:"inline-flex items-center font-semibold",children:s.business.name}):e.jsx("span",{children:s.business?.name}),s.vatNumber&&e.jsx("span",{className:"text-[10px] text-gray-500",children:s.vatNumber})]})}}),v.display({id:"invoice",header:"Invoice",cell:t=>{const s=r(N,t.row.original.data);return s.image?e.jsx("a",{href:s.image,target:"_blank",rel:"noreferrer",children:e.jsx("img",{alt:"missing img",src:s.image,height:80,width:80})}):null}}),v.accessor(t=>r(N,t.data).documentSerial??"",{id:"documentSerial",header:"Invoice Serial#",cell:t=>{const s=r(N,t.row.original.data);return e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{children:t.getValue()}),s.allocationNumber&&e.jsxs("span",{className:"text-xs",children:["(",s.allocationNumber,")"]})]})}}),v.accessor(t=>r(N,t.data).documentDate??"",{id:"documentDate",header:"Invoice Date",cell:t=>t.getValue()}),v.accessor(t=>r(N,t.data).chargeDate??"",{id:"chargeDate",header:"Transaction Date",cell:t=>t.getValue()}),v.accessor(t=>r(N,t.data).taxReducedForeignAmount?.raw??0,{id:"amount",header:"Amount",cell:t=>r(N,t.row.original.data).taxReducedForeignAmount?.formatted??""}),v.accessor(t=>r(N,t.data).taxReducedLocalAmount?.raw??0,{id:"localAmount",header:"Amount ₪",cell:t=>r(N,t.row.original.data).taxReducedLocalAmount?.formatted??""}),v.accessor(t=>t.cumulativeAmount,{id:"cumulativeAmount",header:"Cumulative Amount ₪",cell:t=>e.jsxs("span",{className:"whitespace-nowrap",children:["₪ ",L(t.getValue(),0)]})}),v.display({id:"accountantApproval",header:"Accountant Approval",cell:t=>{const s=r(N,t.row.original.data);return e.jsx(ge,{data:s})}}),v.display({id:"actions",header:"Edit",cell:t=>{const s=r(N,t.row.original.data);return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(xe,{toggleExpansion:()=>t.row.toggleExpanded(),isExpanded:t.row.getIsExpanded()}),e.jsx(de,{toggleMergeSelected:()=>t.row.original.toggleMergeCharge(s.chargeId),mergeSelected:t.row.original.mergeSelectedCharges.has(s.chargeId)}),e.jsx(ue,{chargeId:s.chargeId})]})}})],Je=({data:t,toggleMergeCharge:s,mergeSelectedCharges:n})=>{const{income:a}=r(Ne,t)??{income:[]},[c,l]=o.useState(!0),[p,x]=o.useState([]),[j,i]=o.useState({}),[f,h]=o.useState({}),[g,C]=o.useState("detailed"),F=o.useMemo(()=>{let d=0;return a.map(m=>(d+=m.taxReducedLocalAmount?.raw??0,{data:m,toggleMergeCharge:s,mergeSelectedCharges:n,cumulativeAmount:d}))},[a,s,n]),A=J({data:F,columns:k,getCoreRowModel:K(),onSortingChange:x,getSortedRowModel:Z(),onColumnVisibilityChange:i,onExpandedChange:h,getExpandedRowModel:Y(),state:{sorting:p,columnVisibility:j,expanded:f}});return e.jsxs(I,{className:"p-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("h2",{className:"text-lg font-semibold flex items-center gap-2",children:[e.jsx(w,{variant:"outline",size:"icon",className:"size-7.5",onClick:()=>l(d=>!d),children:c?e.jsx(R,{className:"size-5"}):e.jsx(M,{className:"size-5"})}),"Income"]}),c&&e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(w,{variant:g==="detailed"?"default":"outline",size:"sm",onClick:()=>C("detailed"),children:[e.jsx(W,{className:"h-4 w-4 mr-2"}),"Detailed"]}),e.jsxs(w,{variant:g==="summarized"?"default":"outline",size:"sm",onClick:()=>C("summarized"),children:[e.jsx(pe,{className:"h-4 w-4 mr-2"}),"Summarized"]})]})]}),c&&(g==="detailed"?e.jsxs(X,{children:[e.jsx(ee,{children:A.getHeaderGroups().map(d=>e.jsx(S,{children:d.headers.map(m=>e.jsx(te,{colSpan:m.colSpan,children:m.isPlaceholder?null:e.jsxs(w,{variant:"ghost",onClick:m.column.getToggleSortingHandler(),className:"h-auto p-0 hover:bg-transparent",children:[E(m.column.columnDef.header,m.getContext()),{asc:e.jsx(ae,{className:"size-5"}),desc:e.jsx(se,{className:"size-5"})}[m.column.getIsSorted()]??null]})},m.id))},d.id))}),e.jsx(ne,{children:A.getRowModel().rows?.length?A.getRowModel().rows.map(d=>{const m=r(N,d.original.data);return e.jsxs(o.Fragment,{children:[e.jsx(S,{"data-state":d.getIsSelected()&&"selected",children:d.getVisibleCells().map(y=>e.jsx(D,{children:E(y.column.columnDef.cell,y.getContext())},y.id))}),d.getIsExpanded()&&e.jsx(S,{children:e.jsx(D,{colSpan:k.length,children:e.jsx(re,{style:{width:"100%"},withBorder:!0,shadow:"lg",children:e.jsx(me,{chargeID:m.chargeId,fetching:!!m})})})})]},d.id)}):e.jsx(S,{children:e.jsx(D,{colSpan:k.length,className:"h-24 text-center",children:"No results."})})})]}):e.jsx(he,{records:a}))]})},Ye=({data:t,toggleMergeCharge:s,mergeSelectedCharges:n})=>{const a=r(we,t),[c,l]=o.useState(!0);return e.jsxs(I,{className:"p-6",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs("h2",{className:"text-lg font-semibold flex items-center gap-2",children:[e.jsx(w,{variant:"outline",size:"icon",className:"size-7.5",onClick:()=>l(p=>!p),disabled:!a||a.differentMonthDoc.length===0,children:c?e.jsx(R,{className:"size-5"}):e.jsx(M,{className:"size-5"})}),"Misc Charges (which are not on the above tables)"]})}),c&&a&&e.jsx(O,{data:a.differentMonthDoc,isAllOpened:!1,toggleMergeCharge:s,mergeSelectedCharges:n})]})},Ze=({data:t,toggleMergeCharge:s,mergeSelectedCharges:n})=>{const a=r(ye,t),[c,l]=o.useState(!0);return e.jsxs(I,{className:"p-6",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs("h2",{className:"text-lg font-semibold flex items-center gap-2",children:[e.jsx(w,{variant:"outline",size:"icon",className:"size-7.5",onClick:()=>l(p=>!p),disabled:!a||a.missingInfo.length===0,children:c?e.jsx(R,{className:"size-5"}):e.jsx(M,{className:"size-5"})}),"Missing Info"]})}),c&&a&&e.jsx(O,{data:a.missingInfo,isAllOpened:!1,toggleMergeCharge:s,mergeSelectedCharges:n})]})},Ke=({filter:{monthDate:t,financialEntityId:s},isLoading:n})=>{const[{data:a,fetching:c,error:l},p]=oe({query:ce(Ae),pause:!0,variables:{monthDate:t,financialEntityId:s}});return o.useEffect(()=>{if(l){const x="Error generating PCN874 file";console.error(`${x}: ${l}`),ve.error("Error",{description:x,duration:5e3,closeButton:!0})}},[l]),o.useEffect(()=>{if(a){const x=new File([a.pcnFile.reportContent],"pcn874.txt",{type:"text/plain"});Se(x)}},[a]),e.jsx(Ce,{content:"Generate and Download PCN874 File",children:e.jsx(w,{disabled:c||n,variant:"outline",size:"icon",className:"size-7.5",onClick:p,children:e.jsx(_e,{className:"size-5"})})})},We=({data:t})=>{const s=r(Te,t),n=o.useMemo(()=>s?.expenses??[],[s?.expenses]),a=o.useMemo(()=>s?.income??[],[s?.income]),c=o.useMemo(()=>a.reduce((i,f)=>i+(f.taxReducedLocalAmount?.raw??0),0),[a]),l=o.useMemo(()=>a.reduce((i,f)=>i+(f.roundedLocalVatAfterDeduction?.raw??0),0),[a]),p=o.useMemo(()=>a.filter(i=>(i.roundedLocalVatAfterDeduction?.raw??0)===0).reduce((i,f)=>i+(f.taxReducedLocalAmount?.raw??0),0),[a]),x=o.useMemo(()=>n.filter(i=>i.isProperty).reduce((i,f)=>i+(f.taxReducedLocalAmount?.raw??0),0),[n]),j=o.useMemo(()=>l-n.reduce((i,f)=>i+(f.roundedLocalVatAfterDeduction?.raw??0),0),[l,n]);return e.jsxs(I,{className:"p-6",children:[e.jsx("h2",{className:"text-lg font-semibold mb-4",children:"Report Summary"}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Taxable Sales Total"}),e.jsx("p",{className:"text-2xl font-bold",children:T(c,V.Ils)})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Taxable Sales VAT"}),e.jsx("p",{className:"text-2xl font-bold",children:T(l,V.Ils)})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Zero / Exempt Sales"}),e.jsx("p",{className:"text-2xl font-bold",children:T(p,V.Ils)})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Equipment Inputs"}),e.jsx("p",{className:"text-2xl font-bold",children:T(x,V.Ils)})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Total VAT Amount"}),e.jsx("p",{className:"text-2xl font-bold",children:T(j,V.Ils)})]})]})]})};function Xe({filter:t,setFilter:s,closeModal:n}){const{control:a,handleSubmit:c,setValue:l}=De({defaultValues:{...t}}),{selectableAdminBusinesses:p,fetching:x}=Ie(),j=h=>{s(h),n()};function i(){s(),n()}function f(h){const g=new Date(h.getFullYear(),h.getMonth(),15);l("monthDate",P(g,"yyyy-MM-dd"))}return e.jsxs(e.Fragment,{children:[x?e.jsx("div",{children:"Loading..."}):e.jsx("div",{}),e.jsxs("form",{onSubmit:c(j),children:[e.jsx(H,{name:"financialEntityId",control:a,defaultValue:void 0,render:({field:h,fieldState:g})=>e.jsx($,{...h,data:p,value:h.value,disabled:x,label:"Report Issuer (Admin Business)",placeholder:"Scroll to see all options",maxDropdownHeight:160,searchable:!0,error:g.error?.message})}),e.jsx(H,{name:"chargesType",control:a,defaultValue:t.chargesType,render:({field:h,fieldState:g})=>e.jsx($,{...h,data:Pe,value:h.value??B.All,label:"Charge Type",placeholder:"Filter income/expense",maxDropdownHeight:160,error:g.error?.message})}),e.jsx(Re,{defaultValue:t?.monthDate?new Date(t.monthDate):new Date,defaultDate:t?.monthDate?new Date(t.monthDate):new Date,onChange:f,popoverProps:{withinPortal:!0}}),e.jsxs("div",{className:"flex justify-center mt-5 gap-3",children:[e.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",children:"Filter"}),e.jsx("button",{type:"button",className:"text-white bg-orange-500 border-0 py-2 px-8 focus:outline-hidden hover:bg-orange-600 rounded-sm text-lg",onClick:i,children:"Clear"}),e.jsx("button",{type:"button",className:"text-white bg-rose-500 border-0 py-2 px-8 focus:outline-hidden hover:bg-rose-600 rounded-sm text-lg",onClick:n,children:"Cancel"})]})]})]})}function et({filter:t,setFilter:s}){const[n,a]=o.useState(!1),{get:c,set:l}=ie(),{userContext:p}=o.useContext(le);function x(j){j||={financialEntityId:p?.context.adminBusinessId??t.financialEntityId,monthDate:P(new Date,"yyyy-MM-15")},Me(j,t)||s(j)}return o.useEffect(()=>{const j=Ve(t??{})?null:encodeURIComponent(JSON.stringify(t)),i=c("vatMonthlyReportFilters");j!==i&&l("vatMonthlyReportFilters",j)},[t,c,l]),e.jsxs(e.Fragment,{children:[e.jsx(Oe,{opened:n,onClose:()=>a(!1),content:e.jsx(Xe,{filter:t,setFilter:x,closeModal:()=>a(!1)})}),e.jsx(w,{variant:"outline",size:"icon",className:"size-7.5",onClick:()=>a(!0),children:e.jsx(Ue,{className:"size-5"})})]})}const At=()=>{const{get:t}=ie(),{setFiltersContext:s}=o.useContext(Ee),{userContext:n}=o.useContext(le),[a,c]=o.useState(t("vatMonthlyReportFilters")?JSON.parse(decodeURIComponent(t("vatMonthlyReportFilters"))):{financialEntityId:n?.context.adminBusinessId??"",monthDate:P(new Date,"yyyy-MM-15")}),[l,p]=o.useState([]);o.useEffect(()=>{(!a.financialEntityId||a.financialEntityId==="")&&n?.context.adminBusinessId&&c({...a,financialEntityId:n.context.adminBusinessId})},[a,n?.context.adminBusinessId]);const[{data:x,fetching:j}]=oe({query:ce(ze),variables:{filters:a},pause:a.financialEntityId===""}),i=o.useCallback(g=>{l.includes(g)?p(l.filter(C=>C!==g)):p([...l,g])},[l]);function f(){p([])}o.useEffect(()=>{s(e.jsxs("div",{className:"flex flex-row gap-2",children:[e.jsx(Ke,{filter:a,isLoading:j}),e.jsx(et,{filter:{...a},setFilter:c}),e.jsx(ke,{selected:l.map(g=>({id:g,onChange:()=>{}})),resetMerge:f})]}))},[x,a,j,s,l]);const h=o.useMemo(()=>new Set(l),[l]);return e.jsx(Le,{title:"VAT Monthly Report",children:j?e.jsx(Fe,{className:"h-10 w-10 animate-spin mr-2 self-center"}):e.jsx("div",{className:"min-h-screen",children:e.jsxs("div",{className:"space-y-4",children:[a.financialEntityId&&a.monthDate&&e.jsx(We,{data:x?.vatReport}),a.chargesType!==B.Expense&&e.jsx(Je,{data:x?.vatReport,toggleMergeCharge:i,mergeSelectedCharges:h}),a.chargesType!==B.Income&&e.jsx(Qe,{data:x?.vatReport,toggleMergeCharge:i,mergeSelectedCharges:h}),e.jsx(Ze,{data:x?.vatReport,toggleMergeCharge:i,mergeSelectedCharges:h}),e.jsx(qe,{data:x?.vatReport,toggleMergeCharge:i,mergeSelectedCharges:h}),e.jsx(Ye,{data:x?.vatReport,toggleMergeCharge:i,mergeSelectedCharges:h})]})})})};export{At as VatMonthlyReport};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{v as Ge,r as m,dh as Nc,aF as V,dl as kc,aG as ae,j as v,dk as vn,dK as It,dL as ge,dM as Ho,dm as Lc,dN as Vc,dO as nn,dP as jc,bB as Fi,D as _r,aL as zr,bC as Fc,B as ee,x as $r,al as Ur,am as Hr,E as Wo,bD as Bc,aC as _c,bE as An,bF as Bi,bG as _i,w as rn,at as Go,
|
|
1
|
+
import{v as Ge,r as m,dh as Nc,aF as V,dl as kc,aG as ae,j as v,dk as vn,dK as It,dL as ge,dM as Ho,dm as Lc,dN as Vc,dO as nn,dP as jc,bB as Fi,D as _r,aL as zr,bC as Fc,B as ee,x as $r,al as Ur,am as Hr,E as Wo,bD as Bc,aC as _c,bE as An,bF as Bi,bG as _i,w as rn,at as Go,a2 as Ko,bI as zc,g as qo,dQ as $c,t as Pe,i as Yo,T as yn,u as rr,dR as Uc,bY as Hc,c3 as Wc,c5 as Gc,c4 as Kc,c6 as qc,L as Xo,I as Wr,bO as Yc,bP as Xc,bQ as Nn,bR as Zc,c2 as zi,bS as Jc,bT as $i,bZ as Zo,b_ as Jo,c0 as Qo,dS as Qc,dT as eu,dU as sn,dV as tu,G as nu,V as ru,Y as iu,Z as su,_ as ou,$ as au,a1 as lu,au as cu,aa as uu,ae as Ui,dW as du,e as hu,a4 as fu,af as Hi,dX as pu,dY as Wi,cw as gu,dZ as mu,ay as vu,F as yu,b3 as bu,d_ as Tu,d$ as xu}from"./index-rI994S3C.js";import{u as ea}from"./use-url-query-CqWra6gD.js";import{A as Gi}from"./arrow-up-down-VY6mkkTR.js";import{D as Su}from"./download-csv-button-CMQBUQeX.js";import{B as wu}from"./business-extended-info-B94y5ZK6.js";import{_ as Du,a as bn,s as we,g as Gr,u as Ki,c as Kr,m as wt,d as ir,T as sr}from"./Typography-B8Kph7eR.js";import{P as Cu,a as Eu}from"./panel-top-open-Bf39HBrp.js";import{F as Ou}from"./funnel-Cfb9Pxmr.js";import{M as Pu}from"./MultiSelect-DBeIExB5.js";import"./data-table-column-header-CZ1dXiU0.js";import"./eye-off-Buv7eciz.js";const Mu=[["path",{d:"m10.852 19.772-.383.924",key:"r7sl7d"}],["path",{d:"m13.148 14.228.383-.923",key:"1d5zpm"}],["path",{d:"M13.148 19.772a3 3 0 1 0-2.296-5.544l-.383-.923",key:"1ydik7"}],["path",{d:"m13.53 20.696-.382-.924a3 3 0 1 1-2.296-5.544",key:"1m1vsf"}],["path",{d:"m14.772 15.852.923-.383",key:"660p6e"}],["path",{d:"m14.772 18.148.923.383",key:"hrcpis"}],["path",{d:"M4.2 15.1a7 7 0 1 1 9.93-9.858A7 7 0 0 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.2",key:"j2q98n"}],["path",{d:"m9.228 15.852-.923-.383",key:"1p9ong"}],["path",{d:"m9.228 18.148-.923.383",key:"6558rz"}]],Iu=Ge("cloud-cog",Mu);const Ru=[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]],Au=Ge("cloud-upload",Ru);const Nu=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],ta=Ge("ellipsis",Nu);const ku=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],Lu=Ge("folder-open",ku);const Vu=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],ju=Ge("folder-plus",Vu);const Fu=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],Bu=Ge("folder",Fu);const _u=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],zu=Ge("pencil",_u);function Gt(t){const e=m.useRef(t);return Nc(()=>{e.current=t}),m.useRef((...n)=>(0,e.current)(...n)).current}function or(t,e){return or=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},or(t,e)}function $u(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,or(t,e)}const qi=V.createContext(null);function Uu(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function qr(t,e){var n=function(s){return e&&m.isValidElement(s)?e(s):s},r=Object.create(null);return t&&m.Children.map(t,function(i){return i}).forEach(function(i){r[i.key]=n(i)}),r}function Hu(t,e){t=t||{},e=e||{};function n(u){return u in e?e[u]:t[u]}var r=Object.create(null),i=[];for(var s in t)s in e?i.length&&(r[s]=i,i=[]):i.push(s);var o,a={};for(var l in e){if(r[l])for(o=0;o<r[l].length;o++){var c=r[l][o];a[r[l][o]]=n(c)}a[l]=n(l)}for(o=0;o<i.length;o++)a[i[o]]=n(i[o]);return a}function _e(t,e,n){return n[e]!=null?n[e]:t.props[e]}function Wu(t,e){return qr(t.children,function(n){return m.cloneElement(n,{onExited:e.bind(null,n),in:!0,appear:_e(n,"appear",t),enter:_e(n,"enter",t),exit:_e(n,"exit",t)})})}function Gu(t,e,n){var r=qr(t.children),i=Hu(e,r);return Object.keys(i).forEach(function(s){var o=i[s];if(m.isValidElement(o)){var a=s in e,l=s in r,c=e[s],u=m.isValidElement(c)&&!c.props.in;l&&(!a||u)?i[s]=m.cloneElement(o,{onExited:n.bind(null,o),in:!0,exit:_e(o,"exit",t),enter:_e(o,"enter",t)}):!l&&a&&!u?i[s]=m.cloneElement(o,{in:!1}):l&&a&&m.isValidElement(c)&&(i[s]=m.cloneElement(o,{onExited:n.bind(null,o),in:c.props.in,exit:_e(o,"exit",t),enter:_e(o,"enter",t)}))}}),i}var Ku=Object.values||function(t){return Object.keys(t).map(function(e){return t[e]})},qu={component:"div",childFactory:function(e){return e}},Yr=(function(t){$u(e,t);function e(r,i){var s;s=t.call(this,r,i)||this;var o=s.handleExited.bind(Uu(s));return s.state={contextValue:{isMounting:!0},handleExited:o,firstRender:!0},s}var n=e.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},e.getDerivedStateFromProps=function(i,s){var o=s.children,a=s.handleExited,l=s.firstRender;return{children:l?Wu(i,a):Gu(i,o,a),firstRender:!1}},n.handleExited=function(i,s){var o=qr(this.props.children);i.key in o||(i.props.onExited&&i.props.onExited(s),this.mounted&&this.setState(function(a){var l=kc({},a.children);return delete l[i.key],{children:l}}))},n.render=function(){var i=this.props,s=i.component,o=i.childFactory,a=Du(i,["component","childFactory"]),l=this.state.contextValue,c=Ku(this.state.children).map(o);return delete a.appear,delete a.enter,delete a.exit,s===null?V.createElement(qi.Provider,{value:l},c):V.createElement(qi.Provider,{value:l},V.createElement(s,a,c))},e})(V.Component);Yr.propTypes={};Yr.defaultProps=qu;const Yi={};function na(t,e){const n=m.useRef(Yi);return n.current===Yi&&(n.current=t(e)),n}const Yu=[];function Xu(t){m.useEffect(t,Yu)}class Xr{static create(){return new Xr}currentId=null;start(e,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,n()},e)}clear=()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)};disposeEffect=()=>this.clear}function Zu(){const t=na(Xr.create).current;return Xu(t.disposeEffect),t}function Xi(t){try{return t.matches(":focus-visible")}catch{}return!1}class on{static create(){return new on}static use(){const e=na(on.create).current,[n,r]=m.useState(!1);return e.shouldMount=n,e.setShouldMount=r,m.useEffect(e.mountEffect,[n]),e}constructor(){this.ref={current:null},this.mounted=null,this.didMount=!1,this.shouldMount=!1,this.setShouldMount=null}mount(){return this.mounted||(this.mounted=Qu(),this.shouldMount=!0,this.setShouldMount(this.shouldMount)),this.mounted}mountEffect=()=>{this.shouldMount&&!this.didMount&&this.ref.current!==null&&(this.didMount=!0,this.mounted.resolve())};start(...e){this.mount().then(()=>this.ref.current?.start(...e))}stop(...e){this.mount().then(()=>this.ref.current?.stop(...e))}pulsate(...e){this.mount().then(()=>this.ref.current?.pulsate(...e))}}function Ju(){return on.use()}function Qu(){let t,e;const n=new Promise((r,i)=>{t=r,e=i});return n.resolve=t,n.reject=e,n}function ed(t){const{className:e,classes:n,pulsate:r=!1,rippleX:i,rippleY:s,rippleSize:o,in:a,onExited:l,timeout:c}=t,[u,d]=m.useState(!1),h=ae(e,n.ripple,n.rippleVisible,r&&n.ripplePulsate),f={width:o,height:o,top:-(o/2)+s,left:-(o/2)+i},p=ae(n.child,u&&n.childLeaving,r&&n.childPulsate);return!a&&!u&&d(!0),m.useEffect(()=>{if(!a&&l!=null){const g=setTimeout(l,c);return()=>{clearTimeout(g)}}},[l,a,c]),v.jsx("span",{className:h,style:f,children:v.jsx("span",{className:p})})}const le=bn("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),ar=550,td=80,nd=It`
|
|
2
2
|
0% {
|
|
3
3
|
transform: scale(0);
|
|
4
4
|
opacity: 0.1;
|
|
@@ -103,5 +103,5 @@ import{v as Ge,r as m,dh as Nc,aF as V,dl as kc,aG as ae,j as v,dk as vn,dK as I
|
|
|
103
103
|
see this guide: https://github.com/louisbrunner/dnd-multi-backend/tree/master/packages/react-dnd-multi-backend#migrating-from-5xx`);if(c&&console.warn(`Deprecation notice: You are using a pipeline which doesn't include backends' 'id'.
|
|
104
104
|
This might be unsupported in the future, please specify 'id' explicitely for every backend.`),O(this,Q)[l])throw new Error(`You must specify a unique 'id' property in your Backend entry:
|
|
105
105
|
${JSON.stringify(o)} (conflicts with: ${JSON.stringify(O(this,Q)[l])})`);return{id:l,instance:a,preview:o.preview??!1,transition:o.transition,skipDispatchOnTransition:o.skipDispatchOnTransition??!1}}),this.setup=()=>{if(!(typeof window>"u")){if(en.isSetUp)throw new Error("Cannot have two MultiBackends at the same time.");en.isSetUp=!0,O(this,Nr).call(this,window),O(this,Q)[O(this,J)].instance.setup()}},this.teardown=()=>{typeof window>"u"||(en.isSetUp=!1,O(this,kr).call(this,window),O(this,Q)[O(this,J)].instance.teardown())},this.connectDragSource=(i,s,o)=>O(this,gt).call(this,"connectDragSource",i,s,o),this.connectDragPreview=(i,s,o)=>O(this,gt).call(this,"connectDragPreview",i,s,o),this.connectDropTarget=(i,s,o)=>O(this,gt).call(this,"connectDropTarget",i,s,o),this.profile=()=>O(this,Q)[O(this,J)].instance.profile(),this.previewEnabled=()=>O(this,Q)[O(this,J)].preview,this.previewsList=()=>O(this,pt),this.backendsList=()=>O(this,be),se(this,Nr,i=>{for(let s of O(this,be))s.transition&&i.addEventListener(s.transition.event,O(this,Jt))}),se(this,kr,i=>{for(let s of O(this,be))s.transition&&i.removeEventListener(s.transition.event,O(this,Jt))}),se(this,Jt,i=>{let s=O(this,J);if(O(this,be).some(o=>o.id!==O(this,J)&&o.transition&&o.transition.check(i)?(Fe(this,J,o.id),!0):!1),O(this,J)!==s){O(this,Q)[s].instance.teardown();for(let[c,u]of Object.entries(O(this,Be)))u.unsubscribe(),u.unsubscribe=O(this,Qt).call(this,u.func,...u.args);O(this,pt).backendChanged(this);let o=O(this,Q)[O(this,J)];if(o.instance.setup(),o.skipDispatchOnTransition)return;let a=i.constructor,l=new a(i.type,i);i.target?.dispatchEvent(l)}}),se(this,Qt,(i,s,o,a)=>O(this,Q)[O(this,J)].instance[i](s,o,a)),se(this,gt,(i,s,o,a)=>{let l=`${i}_${s}`,c=O(this,Qt).call(this,i,s,o,a);return O(this,Be)[l]={func:i,args:[s,o,a],unsubscribe:c},()=>{O(this,Be)[l].unsubscribe(),delete O(this,Be)[l]}}),!r||!r.backends||r.backends.length<1)throw new Error(`You must specify at least one Backend, if you are coming from 2.x.x (or don't understand this error)
|
|
106
|
-
see this guide: https://github.com/louisbrunner/dnd-multi-backend/tree/master/packages/react-dnd-multi-backend#migrating-from-2xx`);Fe(this,pt,new Ly),Fe(this,Q,{}),Fe(this,be,[]);for(let i of r.backends){let s=O(this,Ar).call(this,e,n,i);O(this,Q)[s.id]=s,O(this,be).push(s)}Fe(this,J,O(this,be)[0].id),Fe(this,Be,{})}};J=new WeakMap,pt=new WeakMap,Q=new WeakMap,be=new WeakMap,Be=new WeakMap,Ar=new WeakMap,Nr=new WeakMap,kr=new WeakMap,Jt=new WeakMap,Qt=new WeakMap,gt=new WeakMap,ac.isSetUp=!1;var Vy=ac,jy=(t,e,n)=>new Vy(t,e,n),lc=(t,e)=>({event:t,check:e}),Fy=lc("touchstart",t=>{let e=t;return e.touches!==null&&e.touches!==void 0}),By=lc("pointerdown",t=>t.pointerType==="mouse"),Me;(function(t){t.mouse="mouse",t.touch="touch",t.keyboard="keyboard"})(Me||(Me={}));class _y{get delay(){var e;return(e=this.args.delay)!==null&&e!==void 0?e:0}get scrollAngleRanges(){return this.args.scrollAngleRanges}get getDropTargetElementsAtPoint(){return this.args.getDropTargetElementsAtPoint}get ignoreContextMenu(){var e;return(e=this.args.ignoreContextMenu)!==null&&e!==void 0?e:!1}get enableHoverOutsideTarget(){var e;return(e=this.args.enableHoverOutsideTarget)!==null&&e!==void 0?e:!1}get enableKeyboardEvents(){var e;return(e=this.args.enableKeyboardEvents)!==null&&e!==void 0?e:!1}get enableMouseEvents(){var e;return(e=this.args.enableMouseEvents)!==null&&e!==void 0?e:!1}get enableTouchEvents(){var e;return(e=this.args.enableTouchEvents)!==null&&e!==void 0?e:!0}get touchSlop(){return this.args.touchSlop||0}get delayTouchStart(){var e,n,r,i;return(i=(r=(e=this.args)===null||e===void 0?void 0:e.delayTouchStart)!==null&&r!==void 0?r:(n=this.args)===null||n===void 0?void 0:n.delay)!==null&&i!==void 0?i:0}get delayMouseStart(){var e,n,r,i;return(i=(r=(e=this.args)===null||e===void 0?void 0:e.delayMouseStart)!==null&&r!==void 0?r:(n=this.args)===null||n===void 0?void 0:n.delay)!==null&&i!==void 0?i:0}get window(){if(this.context&&this.context.window)return this.context.window;if(typeof window<"u")return window}get document(){var e;if(!((e=this.context)===null||e===void 0)&&e.document)return this.context.document;if(this.window)return this.window.document}get rootElement(){var e;return((e=this.args)===null||e===void 0?void 0:e.rootElement)||this.document}constructor(e,n){this.args=e,this.context=n}}function zy(t,e,n,r){return Math.sqrt(Math.pow(Math.abs(n-t),2)+Math.pow(Math.abs(r-e),2))}function $y(t,e,n,r,i){if(!i)return!1;const s=Math.atan2(r-e,n-t)*180/Math.PI+180;for(let o=0;o<i.length;++o){const a=i[o];if(a&&(a.start==null||s>=a.start)&&(a.end==null||s<=a.end))return!0}return!1}const Uy={Left:1},Hy={Left:0};function tr(t){return t.button===void 0||t.button===Hy.Left}function Wy(t){return t.buttons===void 0||(t.buttons&Uy.Left)===0}function cc(t){return!!t.targetTouches}const Gy=1;function Ky(t){const e=t.nodeType===Gy?t:t.parentElement;if(!e)return;const{top:n,left:r}=e.getBoundingClientRect();return{x:r,y:n}}function qy(t,e){if(t.targetTouches.length===1)return pn(t.targetTouches[0]);if(e&&t.touches.length===1&&t.touches[0].target===e.target)return pn(t.touches[0])}function pn(t,e){return cc(t)?qy(t,e):{x:t.clientX,y:t.clientY}}const Fo=(()=>{let t=!1;try{addEventListener("test",()=>{},Object.defineProperty({},"passive",{get(){return t=!0,!0}}))}catch{}return t})(),ct={[Me.mouse]:{start:"mousedown",move:"mousemove",end:"mouseup",contextmenu:"contextmenu"},[Me.touch]:{start:"touchstart",move:"touchmove",end:"touchend"},[Me.keyboard]:{keydown:"keydown"}};class St{profile(){var e;return{sourceNodes:this.sourceNodes.size,sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,targetNodes:this.targetNodes.size,dragOverTargetIds:((e=this.dragOverTargetIds)===null||e===void 0?void 0:e.length)||0}}get document(){return this.options.document}setup(){const e=this.options.rootElement;e&&(P(!St.isSetUp,"Cannot have two Touch backends at the same time."),St.isSetUp=!0,this.addEventListener(e,"start",this.getTopMoveStartHandler()),this.addEventListener(e,"start",this.handleTopMoveStartCapture,!0),this.addEventListener(e,"move",this.handleTopMove),this.addEventListener(e,"move",this.handleTopMoveCapture,!0),this.addEventListener(e,"end",this.handleTopMoveEndCapture,!0),this.options.enableMouseEvents&&!this.options.ignoreContextMenu&&this.addEventListener(e,"contextmenu",this.handleTopMoveEndCapture),this.options.enableKeyboardEvents&&this.addEventListener(e,"keydown",this.handleCancelOnEscape,!0))}teardown(){const e=this.options.rootElement;e&&(St.isSetUp=!1,this._mouseClientOffset={},this.removeEventListener(e,"start",this.handleTopMoveStartCapture,!0),this.removeEventListener(e,"start",this.handleTopMoveStart),this.removeEventListener(e,"move",this.handleTopMoveCapture,!0),this.removeEventListener(e,"move",this.handleTopMove),this.removeEventListener(e,"end",this.handleTopMoveEndCapture,!0),this.options.enableMouseEvents&&!this.options.ignoreContextMenu&&this.removeEventListener(e,"contextmenu",this.handleTopMoveEndCapture),this.options.enableKeyboardEvents&&this.removeEventListener(e,"keydown",this.handleCancelOnEscape,!0),this.uninstallSourceNodeRemovalObserver())}addEventListener(e,n,r,i=!1){const s=Fo?{capture:i,passive:!1}:i;this.listenerTypes.forEach(function(o){const a=ct[o][n];a&&e.addEventListener(a,r,s)})}removeEventListener(e,n,r,i=!1){const s=Fo?{capture:i,passive:!1}:i;this.listenerTypes.forEach(function(o){const a=ct[o][n];a&&e.removeEventListener(a,r,s)})}connectDragSource(e,n){const r=this.handleMoveStart.bind(this,e);return this.sourceNodes.set(e,n),this.addEventListener(n,"start",r),()=>{this.sourceNodes.delete(e),this.removeEventListener(n,"start",r)}}connectDragPreview(e,n,r){return this.sourcePreviewNodeOptions.set(e,r),this.sourcePreviewNodes.set(e,n),()=>{this.sourcePreviewNodes.delete(e),this.sourcePreviewNodeOptions.delete(e)}}connectDropTarget(e,n){const r=this.options.rootElement;if(!this.document||!r)return()=>{};const i=s=>{if(!this.document||!r||!this.monitor.isDragging())return;let o;switch(s.type){case ct.mouse.move:o={x:s.clientX,y:s.clientY};break;case ct.touch.move:var a,l;o={x:((a=s.touches[0])===null||a===void 0?void 0:a.clientX)||0,y:((l=s.touches[0])===null||l===void 0?void 0:l.clientY)||0};break}const c=o!=null?this.document.elementFromPoint(o.x,o.y):void 0,u=c&&n.contains(c);if(c===n||u)return this.handleMove(s,e)};return this.addEventListener(this.document.body,"move",i),this.targetNodes.set(e,n),()=>{this.document&&(this.targetNodes.delete(e),this.removeEventListener(this.document.body,"move",i))}}getTopMoveStartHandler(){return!this.options.delayTouchStart&&!this.options.delayMouseStart?this.handleTopMoveStart:this.handleTopMoveStartDelay}installSourceNodeRemovalObserver(e){this.uninstallSourceNodeRemovalObserver(),this.draggedSourceNode=e,this.draggedSourceNodeRemovalObserver=new MutationObserver(()=>{e&&!e.parentElement&&(this.resurrectSourceNode(),this.uninstallSourceNodeRemovalObserver())}),!(!e||!e.parentElement)&&this.draggedSourceNodeRemovalObserver.observe(e.parentElement,{childList:!0})}resurrectSourceNode(){this.document&&this.draggedSourceNode&&(this.draggedSourceNode.style.display="none",this.draggedSourceNode.removeAttribute("data-reactid"),this.document.body.appendChild(this.draggedSourceNode))}uninstallSourceNodeRemovalObserver(){this.draggedSourceNodeRemovalObserver&&this.draggedSourceNodeRemovalObserver.disconnect(),this.draggedSourceNodeRemovalObserver=void 0,this.draggedSourceNode=void 0}constructor(e,n,r){this.getSourceClientOffset=i=>{const s=this.sourceNodes.get(i);return s&&Ky(s)},this.handleTopMoveStartCapture=i=>{tr(i)&&(this.moveStartSourceIds=[])},this.handleMoveStart=i=>{Array.isArray(this.moveStartSourceIds)&&this.moveStartSourceIds.unshift(i)},this.handleTopMoveStart=i=>{if(!tr(i))return;const s=pn(i);s&&(cc(i)&&(this.lastTargetTouchFallback=i.targetTouches[0]),this._mouseClientOffset=s),this.waitingForDelay=!1},this.handleTopMoveStartDelay=i=>{if(!tr(i))return;const s=i.type===ct.touch.start?this.options.delayTouchStart:this.options.delayMouseStart;this.timeout=setTimeout(this.handleTopMoveStart.bind(this,i),s),this.waitingForDelay=!0},this.handleTopMoveCapture=()=>{this.dragOverTargetIds=[]},this.handleMove=(i,s)=>{this.dragOverTargetIds&&this.dragOverTargetIds.unshift(s)},this.handleTopMove=i=>{if(this.timeout&&clearTimeout(this.timeout),!this.document||this.waitingForDelay)return;const{moveStartSourceIds:s,dragOverTargetIds:o}=this,a=this.options.enableHoverOutsideTarget,l=pn(i,this.lastTargetTouchFallback);if(!l)return;if(this._isScrolling||!this.monitor.isDragging()&&$y(this._mouseClientOffset.x||0,this._mouseClientOffset.y||0,l.x,l.y,this.options.scrollAngleRanges)){this._isScrolling=!0;return}if(!this.monitor.isDragging()&&this._mouseClientOffset.hasOwnProperty("x")&&s&&zy(this._mouseClientOffset.x||0,this._mouseClientOffset.y||0,l.x,l.y)>(this.options.touchSlop?this.options.touchSlop:0)&&(this.moveStartSourceIds=void 0,this.actions.beginDrag(s,{clientOffset:this._mouseClientOffset,getSourceClientOffset:this.getSourceClientOffset,publishSource:!1})),!this.monitor.isDragging())return;const c=this.sourceNodes.get(this.monitor.getSourceId());this.installSourceNodeRemovalObserver(c),this.actions.publishDragSource(),i.cancelable&&i.preventDefault();const u=(o||[]).map(p=>this.targetNodes.get(p)).filter(p=>!!p),d=this.options.getDropTargetElementsAtPoint?this.options.getDropTargetElementsAtPoint(l.x,l.y,u):this.document.elementsFromPoint(l.x,l.y),h=[];for(const p in d){if(!d.hasOwnProperty(p))continue;let g=d[p];for(g!=null&&h.push(g);g;)g=g.parentElement,g&&h.indexOf(g)===-1&&h.push(g)}const f=h.filter(p=>u.indexOf(p)>-1).map(p=>this._getDropTargetId(p)).filter(p=>!!p).filter((p,g,b)=>b.indexOf(p)===g);if(a)for(const p in this.targetNodes){const g=this.targetNodes.get(p);if(c&&g&&g.contains(c)&&f.indexOf(p)===-1){f.unshift(p);break}}f.reverse(),this.actions.hover(f,{clientOffset:l})},this._getDropTargetId=i=>{const s=this.targetNodes.keys();let o=s.next();for(;o.done===!1;){const a=o.value;if(i===this.targetNodes.get(a))return a;o=s.next()}},this.handleTopMoveEndCapture=i=>{if(this._isScrolling=!1,this.lastTargetTouchFallback=void 0,!!Wy(i)){if(!this.monitor.isDragging()||this.monitor.didDrop()){this.moveStartSourceIds=void 0;return}i.cancelable&&i.preventDefault(),this._mouseClientOffset={},this.uninstallSourceNodeRemovalObserver(),this.actions.drop(),this.actions.endDrag()}},this.handleCancelOnEscape=i=>{i.key==="Escape"&&this.monitor.isDragging()&&(this._mouseClientOffset={},this.uninstallSourceNodeRemovalObserver(),this.actions.endDrag())},this.options=new _y(r,n),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.sourceNodes=new Map,this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.targetNodes=new Map,this.listenerTypes=[],this._mouseClientOffset={},this._isScrolling=!1,this.options.enableMouseEvents&&this.listenerTypes.push(Me.mouse),this.options.enableTouchEvents&&this.listenerTypes.push(Me.touch),this.options.enableKeyboardEvents&&this.listenerTypes.push(Me.keyboard)}}const Yy=function(e,n={},r={}){return new St(e,n,r)};var ue=function(){return ue=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},ue.apply(this,arguments)};function K(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))}function Xy(t){var e=t.isVisible,n=t.ease,r=n===void 0?"easeIn":n,i=t.duration,s=t.variants,o=s===void 0?{open:{opacity:1,height:"auto"},close:{opacity:0,height:0}}:s,a=t.children,l=Iy({polyfill:rp}),c=l[0],u=l[1].height,d=m.useState(e),h=d[0],f=d[1],p=m.useState(e),g=p[0],b=p[1],y=m.useState(!1),T=y[0],x=y[1],w=function(){x(!1),e||f(!1)};m.useEffect(function(){x(!0),e?f(!0):b(!1)},[e]);var S=u===0;return m.useEffect(function(){h&&b(!0)},[S]),V.createElement(My.div,{style:T?{overflow:"hidden"}:void 0,onAnimationComplete:w,initial:g?"open":"close",animate:g?"open":"close",inherit:!1,variants:o,transition:{ease:r,duration:Zy(u,i)}},V.createElement("div",{ref:c},h&&a))}function Zy(t,e){if(e)return e;if(!t)return 0;var n=t/36;return Math.round((4+10*Math.pow(n,.25)+n/5)*10)/1500}var uc=m.createContext({}),Jy={isLock:!1},Qy=function(t){var e=m.useState(Jy.isLock),n=e[0],r=e[1];return V.createElement(uc.Provider,{value:{isLock:n,lock:function(){return r(!0)},unlock:function(){return r(!1)}}},t.children)},Lt=m.createContext({}),Wt={dropTargetId:void 0,index:void 0},e0=function(t){var e=m.useState(Wt.dropTargetId),n=e[0],r=e[1],i=m.useState(Wt.index),s=i[0],o=i[1],a=function(c,u){r(c),o(u)},l=function(){r(Wt.dropTargetId),o(Wt.index)};return V.createElement(Lt.Provider,{value:{dropTargetId:n,index:s,showPlaceholder:a,hidePlaceholder:l}},t.children)},t0=function(t,e){return t.text>e.text?1:t.text<e.text?-1:0},ut=function(t,e){return t.find(function(n){return n.id===e})},dc=function(t,e,n){if(n===0)return!1;var r=t.find(function(i){return i.id===n});return r===void 0?!1:r.parent===e?!0:dc(t,e,r.parent)},Vi=function(t){return typeof t=="object"&&t!==null&&"id"in t&&"parent"in t&&"text"in t},Ae=function(t,e,n){var r=n.tree,i=n.rootId,s=n.canDrop;if(t===null){if(e===i)return!0;var o=r.find(function(u){return u.id===e});return!!(o&&o.droppable)}else{var a=Vi(t)?t.id:null;if(s){var l=s(a,e);if(l!==void 0)return l}if(a===e)return!1;var c=r.find(function(d){return d.id===a}),o=r.find(function(d){return d.id===e});return c===void 0||a===null?e===i||!!o?.droppable:o===void 0?c.parent!==0:c.parent===e||!o.droppable?!1:!dc(r,a,e)}},n0=function(t,e,n){return t.map(function(r){return r.id===e?ue(ue({},r),{parent:n}):r})},hc=function(t,e,n){if(n===0)return 0;var r=t.filter(function(i){return i.parent===e});return r[n]?t.findIndex(function(i){return i.id===r[n].id}):t.findIndex(function(i){return i.id===r[n-1].id})+1},r0=function(t,e){return t.findIndex(function(n){return n.id===e})},fc=function(t,e,n,r){var i=r0(t,e),s=hc(t,n,r);return s=s>i?s-1:s,[i,s]},i0=function(t,e,n){var r=e<0?t.length+e:e;if(r>=0&&r<t.length){var i=n<0?t.length+n:n,s=t.splice(e,1)[0];t.splice(i,0,s)}},s0=function(t,e,n,r){var i=fc(t,e,n,r),s=i[0],o=i[1],a=K([],t,!0);return i0(a,s,o),a.map(function(l){return l.id===e?ue(ue({},l),{parent:n}):l})},o0=function(t,e){var n=t.getBoundingClientRect(),r=n.top+n.height/2;return e>r?"down":"up"},Lr=function(t,e){var n="",r=0;return t.forEach(function(i,s){var o,a=o0(i,((o=e.getClientOffset())===null||o===void 0?void 0:o.y)||0);n===""?n=a:n!==a&&(n=a,r=s),s===t.length-1&&a==="down"&&(r=s+1)}),r},Bo=function(t,e,n){var r=e.closest('[role="list"]'),i=r?.querySelectorAll(':scope > [role="listitem"]');return i?Lr(i,n):null},a0=function(t,e,n){var r=t.getBoundingClientRect(),i=n.dropTargetOffset;if(i===0)return"middle";var s=r.top+i,o=r.bottom-i;return e>o?"lower":e<s?"upper":"middle"},Vr=function(t,e,n,r){var i;if(!e)return null;if(t===null){var s=e.querySelectorAll(':scope > [role="listitem"]');return{id:r.rootId,index:Lr(s,n)}}var o=n.getItem(),a=e.querySelector('[role="list"]'),l=a0(e,((i=n.getClientOffset())===null||i===void 0?void 0:i.y)||0,r);if(a){if(l==="upper")if(Ae(o,t.parent,r)){var c=Bo(t,e,n);return c===null?null:{id:t.parent,index:c}}else return{id:t.id,index:0};var s=a.querySelectorAll(':scope > [role="listitem"]');return{id:t.id,index:Lr(s,n)}}else{if(l==="middle")return{id:t.id,index:0};if(Ae(o,t.parent,r)){var c=Bo(t,e,n);return c===null?null:{id:t.parent,index:c}}return null}},gn=function(t,e){var n=[],r=function(i,s){var o=i.filter(function(a){return s.includes(a.parent)});o.length>0&&(n=K(K([],n,!0),o,!0),r(i,o.map(function(a){return a.id})))};return r(t,[e]),n},l0=function(t){return t===void 0&&(t={}),{backends:[{id:"html5",backend:Vf,options:t.html5,transition:By},{id:"touch",backend:Yy,options:t.touch||{enableMouseEvents:!0},preview:!0,transition:Fy}]}},tn=function(t,e){return t.some(function(n){return n.parent===e})},pc=m.createContext({}),c0=function(t){var e=m0(t.tree,t.initialOpen),n=e[0],r=e[1],i=r.handleToggle,s=r.handleCloseAll,o=r.handleOpenAll,a=r.handleOpen,l=r.handleClose;m.useImperativeHandle(t.treeRef,function(){return{open:function(f){return a(f,t.onChangeOpen)},close:function(f){return l(f,t.onChangeOpen)},openAll:function(){return o(t.onChangeOpen)},closeAll:function(){return s(t.onChangeOpen)}}});var c=De().getMonitor(),u=t.canDrop,d=t.canDrag,h=ue(ue({extraAcceptTypes:[],listComponent:"ul",listItemComponent:"li",placeholderComponent:"li",sort:!0,insertDroppableFirst:!0,enableAnimateExpand:!1,dropTargetOffset:0,initialOpen:!1},t),{openIds:n,onDrop:function(f,p,g){if(f){var b={dragSourceId:f.id,dropTargetId:p,dragSource:f,dropTarget:ut(t.tree,p),monitor:c},y=t.tree;if(ut(y,f.id)||(y=K(K([],y,!0),[f],!1)),t.sort===!1){var T=fc(y,f.id,p,g),x=T[1];b.destinationIndex=x,b.relativeIndex=g,t.onDrop(s0(y,f.id,p,g),b);return}t.onDrop(n0(y,f.id,p),b)}else{var b={dropTargetId:p,dropTarget:ut(t.tree,p),monitor:c};t.sort===!1&&(b.destinationIndex=hc(t.tree,p,g),b.relativeIndex=g),t.onDrop(t.tree,b)}},canDrop:u?function(f,p){return u(t.tree,{dragSourceId:f??void 0,dropTargetId:p,dragSource:c.getItem(),dropTarget:ut(t.tree,p),monitor:c})}:void 0,canDrag:d?function(f){return d(ut(t.tree,f))}:void 0,onToggle:function(f){return i(f,t.onChangeOpen)}});return V.createElement(pc.Provider,{value:h},t.children)},u0=function(t){return V.createElement(c0,ue({},t),V.createElement(Qy,null,V.createElement(e0,null,t.children)))},d0=function(t){var e=m.useContext(uc);m.useEffect(function(){if(t.current){var n=t.current,r=function(u){var d=u.target;(d instanceof HTMLInputElement||d instanceof HTMLTextAreaElement)&&e.lock()},i=function(u){var d=u.target;(d instanceof HTMLInputElement||d instanceof HTMLTextAreaElement)&&e.unlock()},s=function(u){return r(u)},o=function(u){return i(u)},a=function(u){return r(u)},l=function(u){return i(u)},c=new MutationObserver(function(){document.activeElement===document.body&&e.unlock()});return c.observe(n,{subtree:!0,childList:!0}),n.addEventListener("mouseover",s),n.addEventListener("mouseout",o),n.addEventListener("focusin",a),n.addEventListener("focusout",l),function(){c.disconnect(),n.removeEventListener("mouseover",s),n.removeEventListener("mouseout",o),n.removeEventListener("focusin",a),n.removeEventListener("focusout",l)}}},[t,e]),m.useEffect(function(){var n;(n=t.current)===null||n===void 0||n.setAttribute("draggable",e.isLock?"false":"true")},[t,e.isLock])},In={TREE_ITEM:Symbol()},gc=null,mc=function(t){var e=t.target;if(e instanceof HTMLElement){var n=e.closest('[role="listitem"]');t.currentTarget===n&&(gc=n)}},_o=function(t){return mc(t)},zo=function(t){return mc(t)},h0=function(t,e){var n=ke();m.useEffect(function(){var a=e.current;return a?.addEventListener("dragstart",_o),a?.addEventListener("touchstart",zo,{passive:!0}),function(){a?.removeEventListener("dragstart",_o),a?.removeEventListener("touchstart",zo)}},[e]);var r=ff({type:In.TREE_ITEM,item:function(a){var l=ue({ref:e},t);return n.onDragStart&&n.onDragStart(l,a),l},end:function(a,l){var c=a;n.onDragEnd&&n.onDragEnd(c,l)},canDrag:function(){var a=n.canDrag;return gc!==e.current?!1:a?a(t.id):!0},collect:function(a){return{isDragging:a.isDragging()}}}),i=r[0].isDragging,s=r[1],o=r[2];return[i,s,o]},f0=function(t,e,n){var r=m.useRef(0),i=m.useRef(0),s=function(){r.current+=1,r.current===1&&!e&&(i.current=window.setTimeout(function(){return n(t)},500))},o=function(){r.current-=1,r.current===0&&window.clearTimeout(i.current)},a=function(){i.current>0&&window.clearTimeout(i.current),r.current=0,i.current=0};return{onDragEnter:s,onDragLeave:o,onDrop:a}},p0=function(t){var e=ke(),n=m.useContext(Lt),r=ga({accept:K([In.TREE_ITEM],e.extraAcceptTypes,!0),drop:function(l,c){var u=e.rootId,d=e.onDrop,h=n.dropTargetId,f=n.index;c.isOver({shallow:!0})&&h!==void 0&&f!==void 0&&d(Vi(l)?l:null,u,f),n.hidePlaceholder()},canDrop:function(l,c){var u=e.rootId;return c.isOver({shallow:!0})?l===void 0?!1:Ae(l,u,e):!1},hover:function(l,c){if(c.isOver({shallow:!0})){var u=e.rootId,d=n.dropTargetId,h=n.index,f=n.showPlaceholder,p=n.hidePlaceholder,g=Vr(null,t.current,c,e);if(g===null||!Ae(l,u,e)){p();return}(g.id!==d||g.index!==h)&&f(g.id,g.index)}},collect:function(l){var c=l.getItem();return{isOver:l.isOver({shallow:!0})&&l.canDrop(),dragSource:c}}}),i=r[0],s=i.isOver,o=i.dragSource,a=r[1];return[s,o,a]},g0=function(t,e){var n=ke(),r=m.useContext(Lt),i=ga({accept:K([In.TREE_ITEM],n.extraAcceptTypes,!0),drop:function(c,u){var d=r.dropTargetId,h=r.index;u.isOver({shallow:!0})&&d!==void 0&&h!==void 0&&n.onDrop(Vi(c)?c:null,d,h),r.hidePlaceholder()},canDrop:function(c,u){if(u.isOver({shallow:!0})){var d=Vr(t,e.current,u,n);return d===null?!1:Ae(c,d.id,n)}return!1},hover:function(c,u){if(u.isOver({shallow:!0})){var d=r.dropTargetId,h=r.index,f=r.showPlaceholder,p=r.hidePlaceholder,g=Vr(t,e.current,u,n);if(g===null||!Ae(c,g.id,n)){p();return}(g.id!==d||g.index!==h)&&f(g.id,g.index)}},collect:function(c){var u=c.getItem();return{isOver:c.isOver({shallow:!0})&&c.canDrop(),dragSource:u}}}),s=i[0],o=s.isOver,a=s.dragSource,l=i[1];return[o,a,l]},m0=function(t,e){var n=m.useMemo(function(){return e===!0?t.filter(function(d){return tn(t,d.id)}).map(function(d){return d.id}):Array.isArray(e)?e:[]},[e]),r=m.useState(n),i=r[0],s=r[1];m.useEffect(function(){return s(n)},[n]);var o=function(d,h){var f=i.includes(d)?i.filter(function(p){return p!==d}):K(K([],i,!0),[d],!1);s(f),h&&h(f)},a=function(d){s([]),d&&d([])},l=function(d){var h=t.filter(function(f){return tn(t,f.id)}).map(function(f){return f.id});s(h),d&&d(h)},c=function(d,h){var f=[];if(Array.isArray(d)){var p=t.filter(function(g){return d.includes(g.id)&&tn(t,g.id)});f=K(K([],i,!0),p.map(function(g){return g.id}),!0).filter(function(g,b,y){return y.indexOf(g)===b})}else f=i.includes(d)?i:K(K([],i,!0),[d],!1);s(f),h&&h(f)},u=function(d,h){var f=i.filter(function(p){return Array.isArray(d)?!d.includes(p):p!==d});s(f),h&&h(f)};return[i,{handleToggle:o,handleCloseAll:a,handleOpenAll:l,handleOpen:c,handleClose:u}]},v0=function(){return pf(function(t){var e=t.getItemType();return{item:t.getItem(),clientOffset:t.getClientOffset(),isDragging:t.isDragging()&&e===In.TREE_ITEM}})},ke=function(){var t=m.useContext(pc);if(!t)throw new Error("useTreeContext must be used under TreeProvider");return t},y0=function(t,e){var n=ke(),r=n.rootId,i=n.rootProps,s=n.classes,o=s?.container||"";return e&&s?.dropTarget&&(o="".concat(o," ").concat(s.dropTarget)),t===r&&s?.root&&(o="".concat(o," ").concat(s.root)),t===r&&i?.className&&(o="".concat(o," ").concat(i.className)),o=o.trim(),o},b0=function(t,e,n){e.current?n(e):n(t),m.useEffect(function(){e.current?n(e):n(t)},[e.current])},T0=function(t){var e=ke(),n=m.useContext(Lt),r=m.useRef(null),i=m.useRef(null),s=e.tree.find(function(D){return D.id===t.id}),o=e.openIds,a=e.classes,l=e.enableAnimateExpand,c=o.includes(t.id),u=h0(s,r),d=u[0],h=u[1],f=u[2],p=g0(s,r),g=p[0],b=p[1],y=p[2];b0(r,i,h),Ae(b,t.id,e)&&y(r),m.useEffect(function(){e.dragPreviewRender?f(Lf(),{captureDraggingState:!0}):i.current&&f(r)},[f,e.dragPreviewRender]),d0(r);var T=m.useCallback(function(){e.onToggle(s.id)},[s.id,e]),x=e.listItemComponent,w=e.canDrag?e.canDrag(t.id):!0,S=n.dropTargetId===t.id,C={depth:t.depth,isOpen:c,isDragging:d,isDropTarget:S,draggable:w,hasChild:tn(e.tree,t.id),containerRef:r,handleRef:i,onToggle:T},I="";return a?.listItem&&(I=typeof a.listItem=="string"?a.listItem:a.listItem(s,C)),g&&a?.dropTarget&&(I="".concat(I," ").concat(a.dropTarget)),d&&a?.draggingSource&&(I="".concat(I," ").concat(a.draggingSource)),V.createElement(x,{ref:r,className:I,role:"listitem"},e.render(s,C),l&&C.hasChild&&V.createElement(Xy,{isVisible:c},V.createElement(jr,{parentId:t.id,depth:t.depth+1})),!l&&C.hasChild&&c&&V.createElement(jr,{parentId:t.id,depth:t.depth+1}))},$o=function(t){var e=ke(),n=e.placeholderRender,r=e.placeholderComponent,i=e.classes,s=m.useContext(Lt),o=De(),a=o.getMonitor(),l=a.getItem();if(!n||!l)return null;var c=t.dropTargetId===s.dropTargetId&&(t.index===s.index||t.index===void 0&&t.listCount===s.index),u=a.getTargetIds();return!c||!u.length?null:V.createElement(r,{className:i?.placeholder||""},n(l,{depth:t.depth}))},jr=function(t){var e=ke(),n=m.useRef(null),r=e.tree.filter(function(g){return g.parent===t.parentId}),i=r,s=typeof e.sort=="function"?e.sort:t0;if(e.insertDroppableFirst){var o=r.filter(function(g){return g.droppable}),a=r.filter(function(g){return!g.droppable});e.sort===!1?i=K(K([],o,!0),a,!0):(o=o.sort(s),a=a.sort(s),i=K(K([],o,!0),a,!0))}else e.sort!==!1&&(i=r.sort(s));var l=p0(n),c=l[0],u=l[1],d=l[2];t.parentId===e.rootId&&Ae(u,e.rootId,e)&&d(n);var h=y0(t.parentId,c),f=e.rootProps||{},p=e.listComponent;return V.createElement(p,ue({ref:n,role:"list"},f,{className:h}),i.map(function(g,b){return V.createElement(V.Fragment,{key:g.id},V.createElement($o,{depth:t.depth,listCount:i.length,dropTargetId:t.parentId,index:b}),V.createElement(T0,{id:g.id,depth:t.depth}))}),V.createElement($o,{depth:t.depth,listCount:i.length,dropTargetId:t.parentId}))},x0={height:"100%",left:0,pointerEvents:"none",position:"fixed",top:0,width:"100%",zIndex:100},S0=function(t){var e=t.clientOffset;if(!e)return{};var n=e.x,r=e.y,i="translate(".concat(n,"px, ").concat(r,"px)");return{pointerEvents:"none",transform:i}},w0=function(){var t=ke(),e=v0(),n=e.isDragging,r=e.clientOffset;return!n||!r?null:V.createElement("div",{style:x0},V.createElement("div",{style:S0(e)},t.dragPreviewRender&&t.dragPreviewRender(e)))};function D0(t,e){return V.createElement(u0,ue({},t,{treeRef:e}),t.dragPreviewRender&&V.createElement(w0,null),V.createElement(jr,{parentId:t.rootId,depth:0}))}var C0=m.forwardRef(D0);function E0({filter:t,setFilter:e,closeModal:n}){const[r,i]=m.useState(t.isShowZeroedAccounts??!1),{control:s,handleSubmit:o}=Wo({defaultValues:{...t}}),{selectableBusinesses:a,fetching:l}=Bc(),{userContext:c}=m.useContext(_c),u=h=>{h.isShowZeroedAccounts=r??!1,h.fromDate?.trim()===""&&(h.fromDate=void 0),h.toDate?.trim()===""&&(h.toDate=void 0),e(h),n()};function d(){e({}),n()}return v.jsxs(v.Fragment,{children:[l?v.jsx("div",{children:"Loading..."}):v.jsx("div",{}),v.jsxs("form",{onSubmit:o(u),className:"flex flex-col gap-2",children:[v.jsx(An,{name:"ownerIds",control:s,defaultValue:void 0,render:({field:h,fieldState:f})=>v.jsx(Pu,{...h,data:a,value:h.value??(c?.context.adminBusinessId?[c?.context.adminBusinessId]:void 0),disabled:l,label:"Owners",placeholder:"Scroll to see all options",maxDropdownHeight:160,searchable:!0,error:f.error?.message})}),v.jsx(An,{name:"fromDate",control:s,defaultValue:t.fromDate,rules:{pattern:{value:Bi,message:"Date must be im format yyyy-mm-dd"}},render:({field:h,fieldState:f})=>v.jsx(_i,{...h,onChange:p=>{const g=p?typeof p=="string"?p:rn(p,"yyyy-MM-dd"):void 0;g!==h.value&&h.onChange(g)},value:h.value?new Date(h.value):void 0,label:"From Date",error:f.error?.message})}),v.jsx(An,{name:"toDate",control:s,defaultValue:t.toDate,rules:{pattern:{value:Bi,message:"Date must be im format yyyy-mm-dd"}},render:({field:h,fieldState:f})=>v.jsx(_i,{...h,onChange:p=>{const g=p?typeof p=="string"?p:rn(p,"yyyy-MM-dd"):void 0;g!==h.value&&h.onChange(g)},value:h.value?new Date(h.value):void 0,label:"To Date",error:f.error?.message})}),v.jsxs("div",{className:"flex items-center space-x-2",children:[v.jsx(Go,{checked:r??!1,onCheckedChange:()=>i(h=>!h)}),v.jsx(Ko,{htmlFor:"enable-dnd",children:"Show zeroed accounts"})]}),v.jsxs("div",{className:"flex justify-center mt-5 gap-3",children:[v.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",children:"Filter"}),v.jsx("button",{type:"button",className:"text-white bg-orange-500 border-0 py-2 px-8 focus:outline-hidden hover:bg-orange-600 rounded-sm text-lg",onClick:d,children:"Clear"}),v.jsx("button",{type:"button",className:"text-white bg-rose-500 border-0 py-2 px-8 focus:outline-hidden hover:bg-rose-600 rounded-sm text-lg",onClick:n,children:"Cancel"})]})]})]})}function O0({filter:t,setFilter:e}){const[n,r]=m.useState(!1),[i,s]=m.useState(!Fi(t)),{get:o,set:a}=ea();function l(u){return Object.entries(u??{}).filter(([h,f])=>f!==void 0&&Array.isArray(f)&&f.length>0).length>0}function c(u){zc(u,t)||(e(u),s(l(u)))}return m.useEffect(()=>{const u=Fi(t)?null:encodeURIComponent(JSON.stringify(t)),d=o(mn);u!==d&&a(mn,u)},[t,o,a]),v.jsxs(_r,{open:n,onOpenChange:r,children:[v.jsx(zr,{asChild:!0,children:v.jsx(Fc,{inline:!0,size:16,disabled:!i,children:v.jsx(ee,{variant:"outline",onClick:()=>r(!0),className:"p-2",children:v.jsx(Ou,{size:20})})})}),v.jsxs($r,{className:"w-100 max-w-screen-md",children:[v.jsx(Ur,{children:v.jsx(Hr,{children:"Conto report filters"})}),v.jsx(E0,{filter:t,setFilter:c,closeModal:()=>r(!1)})]})]})}const P0="deleteDynamicReportTemplate",M0=()=>{const[{fetching:t},e]=qo($c),n=m.useCallback(async r=>{const i=`Error deleting report template "${r.name}"`,s=`${P0}-${r.name}`;Pe.loading("Deleting report template",{id:s});try{const o=await e(r),a=Yo(o,i,s);if(a)return Pe.success("Success",{id:s,description:`Report template "${a.deleteDynamicReportTemplate}" deleted`}),a.deleteDynamicReportTemplate}catch(o){console.error(`${i}: ${o}`),Pe.error("Error",{id:s,description:i,duration:1e5,closeButton:!0})}},[e]);return{fetching:t,deleteDynamicReportTemplate:n}};function I0({closeModal:t,setTemplate:e,template:n}){const[r,i]=m.useState([]),[s,o]=m.useState({}),[a,l]=m.useState([]),[{data:c,fetching:u},d]=rr({query:Uc}),{deleteDynamicReportTemplate:h}=M0(),f=m.useCallback(async y=>{await h({name:y}),d()},[h,d]),p=m.useCallback(y=>{e(y),t()},[e,t]),g=m.useMemo(()=>[{accessorKey:"name",header:({column:T})=>v.jsxs(ee,{variant:"ghost",onClick:()=>T.toggleSorting(T.getIsSorted()==="asc"),children:["Name",v.jsx(Gi,{})]}),cell:({row:T})=>v.jsx("div",{className:"lowercase",children:T.getValue("name")})},{accessorKey:"updated",header:({column:T})=>v.jsxs(ee,{variant:"ghost",onClick:()=>T.toggleSorting(T.getIsSorted()==="asc"),children:["Last Updated",v.jsx(Gi,{})]}),cell:({row:T})=>v.jsx("div",{className:"lowercase",children:rn(T.getValue("updated"),"dd/MM/yyyy HH:mm:ss")})},{id:"actions",cell:({row:T})=>{const{name:x}=T.original;return v.jsxs(Zo,{children:[v.jsx(Jo,{asChild:!0,children:v.jsxs(ee,{variant:"ghost",className:"h-8 w-8 p-0",children:[v.jsx("span",{className:"sr-only",children:"Open menu"}),v.jsx(ta,{})]})}),v.jsxs(Qo,{align:"end",children:[v.jsx(Qc,{children:"Actions"}),v.jsx(eu,{}),v.jsx(sn,{onClick:()=>f(x),children:"Delete"}),v.jsx(sn,{onClick:()=>p(x),children:"Select"})]})]})}}],[f,p]),b=Hc({data:c?.allDynamicReports||[],columns:g,onSortingChange:i,getCoreRowModel:qc(),getPaginationRowModel:Kc(),getSortedRowModel:Gc(),onRowSelectionChange:o,onColumnFiltersChange:l,getFilteredRowModel:Wc(),state:{sorting:r,rowSelection:s,columnFilters:a}});return v.jsxs("div",{className:"w-full h-[450px] relative",children:[u&&v.jsx("div",{className:"absolute bg-white/60 z-10 h-full w-full flex items-center justify-center",children:v.jsx("div",{className:"flex items-center",children:v.jsx("span",{className:"text-3xl mr-4",children:v.jsx(Xo,{className:"h-10 w-10 animate-spin mr-2 self-center"})})})}),v.jsx("div",{className:"flex items-center py-4",children:v.jsx(Wr,{placeholder:"Filter templates...",value:b.getColumn("name")?.getFilterValue()??"",onChange:y=>b.getColumn("name")?.setFilterValue(y.target.value),className:"max-w-sm"})}),v.jsx("div",{className:"rounded-md border",children:v.jsxs(Yc,{children:[v.jsx(Xc,{children:b.getHeaderGroups().map(y=>v.jsx(Nn,{children:y.headers.map(T=>v.jsx(Zc,{children:T.isPlaceholder?null:zi(T.column.columnDef.header,T.getContext())},T.id))},y.id))}),v.jsx(Jc,{children:b.getRowModel().rows?.length?b.getRowModel().rows.map(y=>v.jsx(Nn,{"data-state":y.original.name===n&&"selected",children:y.getVisibleCells().map(T=>v.jsx($i,{children:zi(T.column.columnDef.cell,T.getContext())},T.id))},y.id)):v.jsx(Nn,{children:v.jsx($i,{colSpan:g.length,className:"h-24 text-center",children:"No results."})})})]})}),v.jsxs("div",{className:"flex items-center justify-end space-x-2 py-4",children:[v.jsxs("div",{className:"flex-1 text-sm text-muted-foreground",children:[b.getFilteredSelectedRowModel().rows.length," of"," ",b.getFilteredRowModel().rows.length," row(s) selected."]}),v.jsxs("div",{className:"space-x-2",children:[v.jsx(ee,{variant:"outline",size:"sm",onClick:()=>b.previousPage(),disabled:!b.getCanPreviousPage(),children:"Previous"}),v.jsx(ee,{variant:"outline",size:"sm",onClick:()=>b.nextPage(),disabled:!b.getCanNextPage(),children:"Next"})]})]})]})}function R0({template:t,setTemplate:e}){const[n,r]=m.useState(!1);return v.jsxs(_r,{open:n,onOpenChange:r,children:[v.jsx(yn,{content:"Manage templates",children:v.jsx(zr,{asChild:!0,children:v.jsx(ee,{variant:"outline",onClick:()=>r(!0),className:"p-2",children:v.jsx(Iu,{size:20})})})}),v.jsxs($r,{className:"max-w-screen-md",children:[v.jsx(Ur,{children:v.jsx(Hr,{children:"Conto report templates"})}),v.jsx(I0,{closeModal:()=>r(!1),template:t,setTemplate:e})]})]})}const A0="insertDynamicReportTemplate",N0=()=>{const[{fetching:t},e]=qo(tu),n=m.useCallback(async r=>{const i=`Error inserting report template "${r.name}"`,s=`${A0}-${r.name}`;Pe.loading("Saving report template",{id:s});try{const o=await e(r),a=Yo(o,i,s);if(a)return Pe.success("Success",{id:s,description:`Report template "${a.insertDynamicReportTemplate.name}" saved`}),a.insertDynamicReportTemplate}catch(o){console.error(`${i}: ${o}`),Pe.error("Error",{id:s,description:i,duration:1e5,closeButton:!0})}},[e]);return{fetching:t,insertDynamicReportTemplate:n}},k0=ru({name:Ui().min(5,{message:"Name must be at least 5 characters long"}),template:Ui()});function L0({tree:t,setFetching:e,closeModal:n}){const r=m.useMemo(()=>{const l=t.filter(u=>u.data?.sortCode==null&&u.data?.value==null);return JSON.stringify(l.map(u=>({id:u.id,parent:u.parent,text:u.text,droppable:u.droppable??void 0,data:u.data?{hebrewText:u.data.hebrewText??void 0,value:u.data.value,sortCode:u.data.sortCode,isOpen:u.data.isOpen,descendantSortCodes:u.data.descendantSortCodes,descendantFinancialEntities:u.data.descendantFinancialEntities,mergedSortCodes:u.data.mergedSortCodes}:void 0})))},[t]),i=Wo({resolver:nu(k0),defaultValues:{name:`template-${rn(new Date,"yyyy-MM-dd")}`,template:r}}),{insertDynamicReportTemplate:s,fetching:o}=N0(),a=m.useCallback(async l=>{try{await s({...l,template:r}),n()}catch(c){console.error(c),i.setError("root",{message:"Failed to save template"})}},[n,i,s,r]);return m.useEffect(()=>{e(o)},[o,e]),v.jsx(iu,{...i,children:v.jsxs("form",{onSubmit:i.handleSubmit(a),className:"flex flex-col gap-2",children:[v.jsx(su,{control:i.control,name:"name",render:({field:l})=>v.jsxs(ou,{children:[v.jsx(au,{children:"Template Name"}),v.jsx(lu,{children:v.jsx(Wr,{...l,required:!0})}),v.jsx(cu,{})]})}),v.jsxs(uu,{children:[v.jsx(ee,{disabled:o,type:"submit",children:"Save"}),v.jsx(ee,{disabled:o,variant:"outline",onClick:n,children:"Cancel"})]})]})})}function V0({tree:t}){const[e,n]=m.useState(!1),[r,i]=m.useState(!1);return v.jsxs(_r,{open:e,onOpenChange:n,children:[v.jsx(zr,{asChild:!0,children:v.jsx(yn,{content:"Save template",children:v.jsx(ee,{variant:"outline",disabled:r,onClick:()=>n(!0),className:"p-2",children:v.jsx(Au,{size:20})})})}),v.jsxs($r,{className:"w-100 max-w-screen-md",children:[v.jsx(Ur,{children:v.jsx(Hr,{children:"Save Conto report template"})}),v.jsx(L0,{tree:t,setFetching:i,closeModal:()=>n(!1)})]})]})}const j0=({tree:t,filters:e})=>{const n=m.useCallback(async()=>{const r=F0(e.fromDate,e.toDate),i=B0(t),s="conto_report"+r;return{fileContent:i,fileName:s}},[e.fromDate,e.toDate,t]);return t.length?v.jsx(Su,{createFileVariables:n}):v.jsx("div",{})};function F0(t,e){return t&&e?`_${t}_to_${e}`:t?`_since_${t}`:e?`_until_${e}`:""}const B0=t=>{const e=t.filter(s=>s.parent===Br);if(!e.length)return"No Report Data";const n=[{content:"Account",depth:0,amount:"ILS Amount",suffix:"",type:"CATEGORY"}],{rows:r,maxDepth:i}=vc(e,t,0);return n.push(...r),n.map(s=>{const{depth:o}=s;let a=o,l=i-o;switch(s.type){case"SORT_CODE":a=i-1,l=1;break;case"FINANCIAL_ENTITY":a=i,l=0;break}return`${",".repeat(a)}${nr(s.content)},${nr(s.suffix??"")}${",".repeat(l)},${nr(s.amount)}`}).join(`\r
|
|
107
|
-
`)};function vc(t,e,n){if(t.length===0)return{rows:[],maxDepth:n,sum:0};let r=n;const i=[];let s=0;return t.map(o=>{if(o.data?.value!=null){s+=o.data.value;const d={content:o.text,depth:n,amount:o.data.value,suffix:"",type:"FINANCIAL_ENTITY"};i.push(d);return}const a=gn(e,o.id),l=a.filter(d=>d.parent===o.id),c={content:o.text,suffix:o.data?.sortCode??"",depth:n,amount:a.reduce((d,h)=>d+(h.data?.value??0),0),type:o.data?.sortCode?"SORT_CODE":"CATEGORY"};i.push(c);const u=vc(l,e,n+1);i.push(...u.rows),u.maxDepth>r&&(r=u.maxDepth)}),{rows:i,maxDepth:r,sum:s}}function nr(t){return t===""?"":Number.isNaN(Number(t))?t.replace(/"/g,'""').replace(/,/g,"."):Number(t).toFixed(2)}const Fr=t=>t.droppable?t.open?v.jsx(Lu,{size:30}):v.jsx(Bu,{size:30}):v.jsx(du,{}),_0=t=>{const{item:e}=t.monitorProps;return v.jsxs("div",{className:"items-center bg-zinc-600 rounded shadow-[0_12px_24px_-6px_rgba(0,0,0,0.25),0_0_0_1px_rgba(0,0,0,0.08)] text-white text-sm inline-grid grid-cols-[auto_auto] gap-2 py-1 px-2 pointer-events-none",children:[v.jsx("div",{className:"items-center flex",children:v.jsx(Fr,{droppable:e.droppable||!1})}),v.jsx("div",{className:"items-center flex",children:e.text})]})},z0=
|
|
106
|
+
see this guide: https://github.com/louisbrunner/dnd-multi-backend/tree/master/packages/react-dnd-multi-backend#migrating-from-2xx`);Fe(this,pt,new Ly),Fe(this,Q,{}),Fe(this,be,[]);for(let i of r.backends){let s=O(this,Ar).call(this,e,n,i);O(this,Q)[s.id]=s,O(this,be).push(s)}Fe(this,J,O(this,be)[0].id),Fe(this,Be,{})}};J=new WeakMap,pt=new WeakMap,Q=new WeakMap,be=new WeakMap,Be=new WeakMap,Ar=new WeakMap,Nr=new WeakMap,kr=new WeakMap,Jt=new WeakMap,Qt=new WeakMap,gt=new WeakMap,ac.isSetUp=!1;var Vy=ac,jy=(t,e,n)=>new Vy(t,e,n),lc=(t,e)=>({event:t,check:e}),Fy=lc("touchstart",t=>{let e=t;return e.touches!==null&&e.touches!==void 0}),By=lc("pointerdown",t=>t.pointerType==="mouse"),Me;(function(t){t.mouse="mouse",t.touch="touch",t.keyboard="keyboard"})(Me||(Me={}));class _y{get delay(){var e;return(e=this.args.delay)!==null&&e!==void 0?e:0}get scrollAngleRanges(){return this.args.scrollAngleRanges}get getDropTargetElementsAtPoint(){return this.args.getDropTargetElementsAtPoint}get ignoreContextMenu(){var e;return(e=this.args.ignoreContextMenu)!==null&&e!==void 0?e:!1}get enableHoverOutsideTarget(){var e;return(e=this.args.enableHoverOutsideTarget)!==null&&e!==void 0?e:!1}get enableKeyboardEvents(){var e;return(e=this.args.enableKeyboardEvents)!==null&&e!==void 0?e:!1}get enableMouseEvents(){var e;return(e=this.args.enableMouseEvents)!==null&&e!==void 0?e:!1}get enableTouchEvents(){var e;return(e=this.args.enableTouchEvents)!==null&&e!==void 0?e:!0}get touchSlop(){return this.args.touchSlop||0}get delayTouchStart(){var e,n,r,i;return(i=(r=(e=this.args)===null||e===void 0?void 0:e.delayTouchStart)!==null&&r!==void 0?r:(n=this.args)===null||n===void 0?void 0:n.delay)!==null&&i!==void 0?i:0}get delayMouseStart(){var e,n,r,i;return(i=(r=(e=this.args)===null||e===void 0?void 0:e.delayMouseStart)!==null&&r!==void 0?r:(n=this.args)===null||n===void 0?void 0:n.delay)!==null&&i!==void 0?i:0}get window(){if(this.context&&this.context.window)return this.context.window;if(typeof window<"u")return window}get document(){var e;if(!((e=this.context)===null||e===void 0)&&e.document)return this.context.document;if(this.window)return this.window.document}get rootElement(){var e;return((e=this.args)===null||e===void 0?void 0:e.rootElement)||this.document}constructor(e,n){this.args=e,this.context=n}}function zy(t,e,n,r){return Math.sqrt(Math.pow(Math.abs(n-t),2)+Math.pow(Math.abs(r-e),2))}function $y(t,e,n,r,i){if(!i)return!1;const s=Math.atan2(r-e,n-t)*180/Math.PI+180;for(let o=0;o<i.length;++o){const a=i[o];if(a&&(a.start==null||s>=a.start)&&(a.end==null||s<=a.end))return!0}return!1}const Uy={Left:1},Hy={Left:0};function tr(t){return t.button===void 0||t.button===Hy.Left}function Wy(t){return t.buttons===void 0||(t.buttons&Uy.Left)===0}function cc(t){return!!t.targetTouches}const Gy=1;function Ky(t){const e=t.nodeType===Gy?t:t.parentElement;if(!e)return;const{top:n,left:r}=e.getBoundingClientRect();return{x:r,y:n}}function qy(t,e){if(t.targetTouches.length===1)return pn(t.targetTouches[0]);if(e&&t.touches.length===1&&t.touches[0].target===e.target)return pn(t.touches[0])}function pn(t,e){return cc(t)?qy(t,e):{x:t.clientX,y:t.clientY}}const Fo=(()=>{let t=!1;try{addEventListener("test",()=>{},Object.defineProperty({},"passive",{get(){return t=!0,!0}}))}catch{}return t})(),ct={[Me.mouse]:{start:"mousedown",move:"mousemove",end:"mouseup",contextmenu:"contextmenu"},[Me.touch]:{start:"touchstart",move:"touchmove",end:"touchend"},[Me.keyboard]:{keydown:"keydown"}};class St{profile(){var e;return{sourceNodes:this.sourceNodes.size,sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,targetNodes:this.targetNodes.size,dragOverTargetIds:((e=this.dragOverTargetIds)===null||e===void 0?void 0:e.length)||0}}get document(){return this.options.document}setup(){const e=this.options.rootElement;e&&(P(!St.isSetUp,"Cannot have two Touch backends at the same time."),St.isSetUp=!0,this.addEventListener(e,"start",this.getTopMoveStartHandler()),this.addEventListener(e,"start",this.handleTopMoveStartCapture,!0),this.addEventListener(e,"move",this.handleTopMove),this.addEventListener(e,"move",this.handleTopMoveCapture,!0),this.addEventListener(e,"end",this.handleTopMoveEndCapture,!0),this.options.enableMouseEvents&&!this.options.ignoreContextMenu&&this.addEventListener(e,"contextmenu",this.handleTopMoveEndCapture),this.options.enableKeyboardEvents&&this.addEventListener(e,"keydown",this.handleCancelOnEscape,!0))}teardown(){const e=this.options.rootElement;e&&(St.isSetUp=!1,this._mouseClientOffset={},this.removeEventListener(e,"start",this.handleTopMoveStartCapture,!0),this.removeEventListener(e,"start",this.handleTopMoveStart),this.removeEventListener(e,"move",this.handleTopMoveCapture,!0),this.removeEventListener(e,"move",this.handleTopMove),this.removeEventListener(e,"end",this.handleTopMoveEndCapture,!0),this.options.enableMouseEvents&&!this.options.ignoreContextMenu&&this.removeEventListener(e,"contextmenu",this.handleTopMoveEndCapture),this.options.enableKeyboardEvents&&this.removeEventListener(e,"keydown",this.handleCancelOnEscape,!0),this.uninstallSourceNodeRemovalObserver())}addEventListener(e,n,r,i=!1){const s=Fo?{capture:i,passive:!1}:i;this.listenerTypes.forEach(function(o){const a=ct[o][n];a&&e.addEventListener(a,r,s)})}removeEventListener(e,n,r,i=!1){const s=Fo?{capture:i,passive:!1}:i;this.listenerTypes.forEach(function(o){const a=ct[o][n];a&&e.removeEventListener(a,r,s)})}connectDragSource(e,n){const r=this.handleMoveStart.bind(this,e);return this.sourceNodes.set(e,n),this.addEventListener(n,"start",r),()=>{this.sourceNodes.delete(e),this.removeEventListener(n,"start",r)}}connectDragPreview(e,n,r){return this.sourcePreviewNodeOptions.set(e,r),this.sourcePreviewNodes.set(e,n),()=>{this.sourcePreviewNodes.delete(e),this.sourcePreviewNodeOptions.delete(e)}}connectDropTarget(e,n){const r=this.options.rootElement;if(!this.document||!r)return()=>{};const i=s=>{if(!this.document||!r||!this.monitor.isDragging())return;let o;switch(s.type){case ct.mouse.move:o={x:s.clientX,y:s.clientY};break;case ct.touch.move:var a,l;o={x:((a=s.touches[0])===null||a===void 0?void 0:a.clientX)||0,y:((l=s.touches[0])===null||l===void 0?void 0:l.clientY)||0};break}const c=o!=null?this.document.elementFromPoint(o.x,o.y):void 0,u=c&&n.contains(c);if(c===n||u)return this.handleMove(s,e)};return this.addEventListener(this.document.body,"move",i),this.targetNodes.set(e,n),()=>{this.document&&(this.targetNodes.delete(e),this.removeEventListener(this.document.body,"move",i))}}getTopMoveStartHandler(){return!this.options.delayTouchStart&&!this.options.delayMouseStart?this.handleTopMoveStart:this.handleTopMoveStartDelay}installSourceNodeRemovalObserver(e){this.uninstallSourceNodeRemovalObserver(),this.draggedSourceNode=e,this.draggedSourceNodeRemovalObserver=new MutationObserver(()=>{e&&!e.parentElement&&(this.resurrectSourceNode(),this.uninstallSourceNodeRemovalObserver())}),!(!e||!e.parentElement)&&this.draggedSourceNodeRemovalObserver.observe(e.parentElement,{childList:!0})}resurrectSourceNode(){this.document&&this.draggedSourceNode&&(this.draggedSourceNode.style.display="none",this.draggedSourceNode.removeAttribute("data-reactid"),this.document.body.appendChild(this.draggedSourceNode))}uninstallSourceNodeRemovalObserver(){this.draggedSourceNodeRemovalObserver&&this.draggedSourceNodeRemovalObserver.disconnect(),this.draggedSourceNodeRemovalObserver=void 0,this.draggedSourceNode=void 0}constructor(e,n,r){this.getSourceClientOffset=i=>{const s=this.sourceNodes.get(i);return s&&Ky(s)},this.handleTopMoveStartCapture=i=>{tr(i)&&(this.moveStartSourceIds=[])},this.handleMoveStart=i=>{Array.isArray(this.moveStartSourceIds)&&this.moveStartSourceIds.unshift(i)},this.handleTopMoveStart=i=>{if(!tr(i))return;const s=pn(i);s&&(cc(i)&&(this.lastTargetTouchFallback=i.targetTouches[0]),this._mouseClientOffset=s),this.waitingForDelay=!1},this.handleTopMoveStartDelay=i=>{if(!tr(i))return;const s=i.type===ct.touch.start?this.options.delayTouchStart:this.options.delayMouseStart;this.timeout=setTimeout(this.handleTopMoveStart.bind(this,i),s),this.waitingForDelay=!0},this.handleTopMoveCapture=()=>{this.dragOverTargetIds=[]},this.handleMove=(i,s)=>{this.dragOverTargetIds&&this.dragOverTargetIds.unshift(s)},this.handleTopMove=i=>{if(this.timeout&&clearTimeout(this.timeout),!this.document||this.waitingForDelay)return;const{moveStartSourceIds:s,dragOverTargetIds:o}=this,a=this.options.enableHoverOutsideTarget,l=pn(i,this.lastTargetTouchFallback);if(!l)return;if(this._isScrolling||!this.monitor.isDragging()&&$y(this._mouseClientOffset.x||0,this._mouseClientOffset.y||0,l.x,l.y,this.options.scrollAngleRanges)){this._isScrolling=!0;return}if(!this.monitor.isDragging()&&this._mouseClientOffset.hasOwnProperty("x")&&s&&zy(this._mouseClientOffset.x||0,this._mouseClientOffset.y||0,l.x,l.y)>(this.options.touchSlop?this.options.touchSlop:0)&&(this.moveStartSourceIds=void 0,this.actions.beginDrag(s,{clientOffset:this._mouseClientOffset,getSourceClientOffset:this.getSourceClientOffset,publishSource:!1})),!this.monitor.isDragging())return;const c=this.sourceNodes.get(this.monitor.getSourceId());this.installSourceNodeRemovalObserver(c),this.actions.publishDragSource(),i.cancelable&&i.preventDefault();const u=(o||[]).map(p=>this.targetNodes.get(p)).filter(p=>!!p),d=this.options.getDropTargetElementsAtPoint?this.options.getDropTargetElementsAtPoint(l.x,l.y,u):this.document.elementsFromPoint(l.x,l.y),h=[];for(const p in d){if(!d.hasOwnProperty(p))continue;let g=d[p];for(g!=null&&h.push(g);g;)g=g.parentElement,g&&h.indexOf(g)===-1&&h.push(g)}const f=h.filter(p=>u.indexOf(p)>-1).map(p=>this._getDropTargetId(p)).filter(p=>!!p).filter((p,g,b)=>b.indexOf(p)===g);if(a)for(const p in this.targetNodes){const g=this.targetNodes.get(p);if(c&&g&&g.contains(c)&&f.indexOf(p)===-1){f.unshift(p);break}}f.reverse(),this.actions.hover(f,{clientOffset:l})},this._getDropTargetId=i=>{const s=this.targetNodes.keys();let o=s.next();for(;o.done===!1;){const a=o.value;if(i===this.targetNodes.get(a))return a;o=s.next()}},this.handleTopMoveEndCapture=i=>{if(this._isScrolling=!1,this.lastTargetTouchFallback=void 0,!!Wy(i)){if(!this.monitor.isDragging()||this.monitor.didDrop()){this.moveStartSourceIds=void 0;return}i.cancelable&&i.preventDefault(),this._mouseClientOffset={},this.uninstallSourceNodeRemovalObserver(),this.actions.drop(),this.actions.endDrag()}},this.handleCancelOnEscape=i=>{i.key==="Escape"&&this.monitor.isDragging()&&(this._mouseClientOffset={},this.uninstallSourceNodeRemovalObserver(),this.actions.endDrag())},this.options=new _y(r,n),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.sourceNodes=new Map,this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.targetNodes=new Map,this.listenerTypes=[],this._mouseClientOffset={},this._isScrolling=!1,this.options.enableMouseEvents&&this.listenerTypes.push(Me.mouse),this.options.enableTouchEvents&&this.listenerTypes.push(Me.touch),this.options.enableKeyboardEvents&&this.listenerTypes.push(Me.keyboard)}}const Yy=function(e,n={},r={}){return new St(e,n,r)};var ue=function(){return ue=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},ue.apply(this,arguments)};function K(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))}function Xy(t){var e=t.isVisible,n=t.ease,r=n===void 0?"easeIn":n,i=t.duration,s=t.variants,o=s===void 0?{open:{opacity:1,height:"auto"},close:{opacity:0,height:0}}:s,a=t.children,l=Iy({polyfill:rp}),c=l[0],u=l[1].height,d=m.useState(e),h=d[0],f=d[1],p=m.useState(e),g=p[0],b=p[1],y=m.useState(!1),T=y[0],x=y[1],w=function(){x(!1),e||f(!1)};m.useEffect(function(){x(!0),e?f(!0):b(!1)},[e]);var S=u===0;return m.useEffect(function(){h&&b(!0)},[S]),V.createElement(My.div,{style:T?{overflow:"hidden"}:void 0,onAnimationComplete:w,initial:g?"open":"close",animate:g?"open":"close",inherit:!1,variants:o,transition:{ease:r,duration:Zy(u,i)}},V.createElement("div",{ref:c},h&&a))}function Zy(t,e){if(e)return e;if(!t)return 0;var n=t/36;return Math.round((4+10*Math.pow(n,.25)+n/5)*10)/1500}var uc=m.createContext({}),Jy={isLock:!1},Qy=function(t){var e=m.useState(Jy.isLock),n=e[0],r=e[1];return V.createElement(uc.Provider,{value:{isLock:n,lock:function(){return r(!0)},unlock:function(){return r(!1)}}},t.children)},Lt=m.createContext({}),Wt={dropTargetId:void 0,index:void 0},e0=function(t){var e=m.useState(Wt.dropTargetId),n=e[0],r=e[1],i=m.useState(Wt.index),s=i[0],o=i[1],a=function(c,u){r(c),o(u)},l=function(){r(Wt.dropTargetId),o(Wt.index)};return V.createElement(Lt.Provider,{value:{dropTargetId:n,index:s,showPlaceholder:a,hidePlaceholder:l}},t.children)},t0=function(t,e){return t.text>e.text?1:t.text<e.text?-1:0},ut=function(t,e){return t.find(function(n){return n.id===e})},dc=function(t,e,n){if(n===0)return!1;var r=t.find(function(i){return i.id===n});return r===void 0?!1:r.parent===e?!0:dc(t,e,r.parent)},Vi=function(t){return typeof t=="object"&&t!==null&&"id"in t&&"parent"in t&&"text"in t},Ae=function(t,e,n){var r=n.tree,i=n.rootId,s=n.canDrop;if(t===null){if(e===i)return!0;var o=r.find(function(u){return u.id===e});return!!(o&&o.droppable)}else{var a=Vi(t)?t.id:null;if(s){var l=s(a,e);if(l!==void 0)return l}if(a===e)return!1;var c=r.find(function(d){return d.id===a}),o=r.find(function(d){return d.id===e});return c===void 0||a===null?e===i||!!o?.droppable:o===void 0?c.parent!==0:c.parent===e||!o.droppable?!1:!dc(r,a,e)}},n0=function(t,e,n){return t.map(function(r){return r.id===e?ue(ue({},r),{parent:n}):r})},hc=function(t,e,n){if(n===0)return 0;var r=t.filter(function(i){return i.parent===e});return r[n]?t.findIndex(function(i){return i.id===r[n].id}):t.findIndex(function(i){return i.id===r[n-1].id})+1},r0=function(t,e){return t.findIndex(function(n){return n.id===e})},fc=function(t,e,n,r){var i=r0(t,e),s=hc(t,n,r);return s=s>i?s-1:s,[i,s]},i0=function(t,e,n){var r=e<0?t.length+e:e;if(r>=0&&r<t.length){var i=n<0?t.length+n:n,s=t.splice(e,1)[0];t.splice(i,0,s)}},s0=function(t,e,n,r){var i=fc(t,e,n,r),s=i[0],o=i[1],a=K([],t,!0);return i0(a,s,o),a.map(function(l){return l.id===e?ue(ue({},l),{parent:n}):l})},o0=function(t,e){var n=t.getBoundingClientRect(),r=n.top+n.height/2;return e>r?"down":"up"},Lr=function(t,e){var n="",r=0;return t.forEach(function(i,s){var o,a=o0(i,((o=e.getClientOffset())===null||o===void 0?void 0:o.y)||0);n===""?n=a:n!==a&&(n=a,r=s),s===t.length-1&&a==="down"&&(r=s+1)}),r},Bo=function(t,e,n){var r=e.closest('[role="list"]'),i=r?.querySelectorAll(':scope > [role="listitem"]');return i?Lr(i,n):null},a0=function(t,e,n){var r=t.getBoundingClientRect(),i=n.dropTargetOffset;if(i===0)return"middle";var s=r.top+i,o=r.bottom-i;return e>o?"lower":e<s?"upper":"middle"},Vr=function(t,e,n,r){var i;if(!e)return null;if(t===null){var s=e.querySelectorAll(':scope > [role="listitem"]');return{id:r.rootId,index:Lr(s,n)}}var o=n.getItem(),a=e.querySelector('[role="list"]'),l=a0(e,((i=n.getClientOffset())===null||i===void 0?void 0:i.y)||0,r);if(a){if(l==="upper")if(Ae(o,t.parent,r)){var c=Bo(t,e,n);return c===null?null:{id:t.parent,index:c}}else return{id:t.id,index:0};var s=a.querySelectorAll(':scope > [role="listitem"]');return{id:t.id,index:Lr(s,n)}}else{if(l==="middle")return{id:t.id,index:0};if(Ae(o,t.parent,r)){var c=Bo(t,e,n);return c===null?null:{id:t.parent,index:c}}return null}},gn=function(t,e){var n=[],r=function(i,s){var o=i.filter(function(a){return s.includes(a.parent)});o.length>0&&(n=K(K([],n,!0),o,!0),r(i,o.map(function(a){return a.id})))};return r(t,[e]),n},l0=function(t){return t===void 0&&(t={}),{backends:[{id:"html5",backend:Vf,options:t.html5,transition:By},{id:"touch",backend:Yy,options:t.touch||{enableMouseEvents:!0},preview:!0,transition:Fy}]}},tn=function(t,e){return t.some(function(n){return n.parent===e})},pc=m.createContext({}),c0=function(t){var e=m0(t.tree,t.initialOpen),n=e[0],r=e[1],i=r.handleToggle,s=r.handleCloseAll,o=r.handleOpenAll,a=r.handleOpen,l=r.handleClose;m.useImperativeHandle(t.treeRef,function(){return{open:function(f){return a(f,t.onChangeOpen)},close:function(f){return l(f,t.onChangeOpen)},openAll:function(){return o(t.onChangeOpen)},closeAll:function(){return s(t.onChangeOpen)}}});var c=De().getMonitor(),u=t.canDrop,d=t.canDrag,h=ue(ue({extraAcceptTypes:[],listComponent:"ul",listItemComponent:"li",placeholderComponent:"li",sort:!0,insertDroppableFirst:!0,enableAnimateExpand:!1,dropTargetOffset:0,initialOpen:!1},t),{openIds:n,onDrop:function(f,p,g){if(f){var b={dragSourceId:f.id,dropTargetId:p,dragSource:f,dropTarget:ut(t.tree,p),monitor:c},y=t.tree;if(ut(y,f.id)||(y=K(K([],y,!0),[f],!1)),t.sort===!1){var T=fc(y,f.id,p,g),x=T[1];b.destinationIndex=x,b.relativeIndex=g,t.onDrop(s0(y,f.id,p,g),b);return}t.onDrop(n0(y,f.id,p),b)}else{var b={dropTargetId:p,dropTarget:ut(t.tree,p),monitor:c};t.sort===!1&&(b.destinationIndex=hc(t.tree,p,g),b.relativeIndex=g),t.onDrop(t.tree,b)}},canDrop:u?function(f,p){return u(t.tree,{dragSourceId:f??void 0,dropTargetId:p,dragSource:c.getItem(),dropTarget:ut(t.tree,p),monitor:c})}:void 0,canDrag:d?function(f){return d(ut(t.tree,f))}:void 0,onToggle:function(f){return i(f,t.onChangeOpen)}});return V.createElement(pc.Provider,{value:h},t.children)},u0=function(t){return V.createElement(c0,ue({},t),V.createElement(Qy,null,V.createElement(e0,null,t.children)))},d0=function(t){var e=m.useContext(uc);m.useEffect(function(){if(t.current){var n=t.current,r=function(u){var d=u.target;(d instanceof HTMLInputElement||d instanceof HTMLTextAreaElement)&&e.lock()},i=function(u){var d=u.target;(d instanceof HTMLInputElement||d instanceof HTMLTextAreaElement)&&e.unlock()},s=function(u){return r(u)},o=function(u){return i(u)},a=function(u){return r(u)},l=function(u){return i(u)},c=new MutationObserver(function(){document.activeElement===document.body&&e.unlock()});return c.observe(n,{subtree:!0,childList:!0}),n.addEventListener("mouseover",s),n.addEventListener("mouseout",o),n.addEventListener("focusin",a),n.addEventListener("focusout",l),function(){c.disconnect(),n.removeEventListener("mouseover",s),n.removeEventListener("mouseout",o),n.removeEventListener("focusin",a),n.removeEventListener("focusout",l)}}},[t,e]),m.useEffect(function(){var n;(n=t.current)===null||n===void 0||n.setAttribute("draggable",e.isLock?"false":"true")},[t,e.isLock])},In={TREE_ITEM:Symbol()},gc=null,mc=function(t){var e=t.target;if(e instanceof HTMLElement){var n=e.closest('[role="listitem"]');t.currentTarget===n&&(gc=n)}},_o=function(t){return mc(t)},zo=function(t){return mc(t)},h0=function(t,e){var n=ke();m.useEffect(function(){var a=e.current;return a?.addEventListener("dragstart",_o),a?.addEventListener("touchstart",zo,{passive:!0}),function(){a?.removeEventListener("dragstart",_o),a?.removeEventListener("touchstart",zo)}},[e]);var r=ff({type:In.TREE_ITEM,item:function(a){var l=ue({ref:e},t);return n.onDragStart&&n.onDragStart(l,a),l},end:function(a,l){var c=a;n.onDragEnd&&n.onDragEnd(c,l)},canDrag:function(){var a=n.canDrag;return gc!==e.current?!1:a?a(t.id):!0},collect:function(a){return{isDragging:a.isDragging()}}}),i=r[0].isDragging,s=r[1],o=r[2];return[i,s,o]},f0=function(t,e,n){var r=m.useRef(0),i=m.useRef(0),s=function(){r.current+=1,r.current===1&&!e&&(i.current=window.setTimeout(function(){return n(t)},500))},o=function(){r.current-=1,r.current===0&&window.clearTimeout(i.current)},a=function(){i.current>0&&window.clearTimeout(i.current),r.current=0,i.current=0};return{onDragEnter:s,onDragLeave:o,onDrop:a}},p0=function(t){var e=ke(),n=m.useContext(Lt),r=ga({accept:K([In.TREE_ITEM],e.extraAcceptTypes,!0),drop:function(l,c){var u=e.rootId,d=e.onDrop,h=n.dropTargetId,f=n.index;c.isOver({shallow:!0})&&h!==void 0&&f!==void 0&&d(Vi(l)?l:null,u,f),n.hidePlaceholder()},canDrop:function(l,c){var u=e.rootId;return c.isOver({shallow:!0})?l===void 0?!1:Ae(l,u,e):!1},hover:function(l,c){if(c.isOver({shallow:!0})){var u=e.rootId,d=n.dropTargetId,h=n.index,f=n.showPlaceholder,p=n.hidePlaceholder,g=Vr(null,t.current,c,e);if(g===null||!Ae(l,u,e)){p();return}(g.id!==d||g.index!==h)&&f(g.id,g.index)}},collect:function(l){var c=l.getItem();return{isOver:l.isOver({shallow:!0})&&l.canDrop(),dragSource:c}}}),i=r[0],s=i.isOver,o=i.dragSource,a=r[1];return[s,o,a]},g0=function(t,e){var n=ke(),r=m.useContext(Lt),i=ga({accept:K([In.TREE_ITEM],n.extraAcceptTypes,!0),drop:function(c,u){var d=r.dropTargetId,h=r.index;u.isOver({shallow:!0})&&d!==void 0&&h!==void 0&&n.onDrop(Vi(c)?c:null,d,h),r.hidePlaceholder()},canDrop:function(c,u){if(u.isOver({shallow:!0})){var d=Vr(t,e.current,u,n);return d===null?!1:Ae(c,d.id,n)}return!1},hover:function(c,u){if(u.isOver({shallow:!0})){var d=r.dropTargetId,h=r.index,f=r.showPlaceholder,p=r.hidePlaceholder,g=Vr(t,e.current,u,n);if(g===null||!Ae(c,g.id,n)){p();return}(g.id!==d||g.index!==h)&&f(g.id,g.index)}},collect:function(c){var u=c.getItem();return{isOver:c.isOver({shallow:!0})&&c.canDrop(),dragSource:u}}}),s=i[0],o=s.isOver,a=s.dragSource,l=i[1];return[o,a,l]},m0=function(t,e){var n=m.useMemo(function(){return e===!0?t.filter(function(d){return tn(t,d.id)}).map(function(d){return d.id}):Array.isArray(e)?e:[]},[e]),r=m.useState(n),i=r[0],s=r[1];m.useEffect(function(){return s(n)},[n]);var o=function(d,h){var f=i.includes(d)?i.filter(function(p){return p!==d}):K(K([],i,!0),[d],!1);s(f),h&&h(f)},a=function(d){s([]),d&&d([])},l=function(d){var h=t.filter(function(f){return tn(t,f.id)}).map(function(f){return f.id});s(h),d&&d(h)},c=function(d,h){var f=[];if(Array.isArray(d)){var p=t.filter(function(g){return d.includes(g.id)&&tn(t,g.id)});f=K(K([],i,!0),p.map(function(g){return g.id}),!0).filter(function(g,b,y){return y.indexOf(g)===b})}else f=i.includes(d)?i:K(K([],i,!0),[d],!1);s(f),h&&h(f)},u=function(d,h){var f=i.filter(function(p){return Array.isArray(d)?!d.includes(p):p!==d});s(f),h&&h(f)};return[i,{handleToggle:o,handleCloseAll:a,handleOpenAll:l,handleOpen:c,handleClose:u}]},v0=function(){return pf(function(t){var e=t.getItemType();return{item:t.getItem(),clientOffset:t.getClientOffset(),isDragging:t.isDragging()&&e===In.TREE_ITEM}})},ke=function(){var t=m.useContext(pc);if(!t)throw new Error("useTreeContext must be used under TreeProvider");return t},y0=function(t,e){var n=ke(),r=n.rootId,i=n.rootProps,s=n.classes,o=s?.container||"";return e&&s?.dropTarget&&(o="".concat(o," ").concat(s.dropTarget)),t===r&&s?.root&&(o="".concat(o," ").concat(s.root)),t===r&&i?.className&&(o="".concat(o," ").concat(i.className)),o=o.trim(),o},b0=function(t,e,n){e.current?n(e):n(t),m.useEffect(function(){e.current?n(e):n(t)},[e.current])},T0=function(t){var e=ke(),n=m.useContext(Lt),r=m.useRef(null),i=m.useRef(null),s=e.tree.find(function(D){return D.id===t.id}),o=e.openIds,a=e.classes,l=e.enableAnimateExpand,c=o.includes(t.id),u=h0(s,r),d=u[0],h=u[1],f=u[2],p=g0(s,r),g=p[0],b=p[1],y=p[2];b0(r,i,h),Ae(b,t.id,e)&&y(r),m.useEffect(function(){e.dragPreviewRender?f(Lf(),{captureDraggingState:!0}):i.current&&f(r)},[f,e.dragPreviewRender]),d0(r);var T=m.useCallback(function(){e.onToggle(s.id)},[s.id,e]),x=e.listItemComponent,w=e.canDrag?e.canDrag(t.id):!0,S=n.dropTargetId===t.id,C={depth:t.depth,isOpen:c,isDragging:d,isDropTarget:S,draggable:w,hasChild:tn(e.tree,t.id),containerRef:r,handleRef:i,onToggle:T},I="";return a?.listItem&&(I=typeof a.listItem=="string"?a.listItem:a.listItem(s,C)),g&&a?.dropTarget&&(I="".concat(I," ").concat(a.dropTarget)),d&&a?.draggingSource&&(I="".concat(I," ").concat(a.draggingSource)),V.createElement(x,{ref:r,className:I,role:"listitem"},e.render(s,C),l&&C.hasChild&&V.createElement(Xy,{isVisible:c},V.createElement(jr,{parentId:t.id,depth:t.depth+1})),!l&&C.hasChild&&c&&V.createElement(jr,{parentId:t.id,depth:t.depth+1}))},$o=function(t){var e=ke(),n=e.placeholderRender,r=e.placeholderComponent,i=e.classes,s=m.useContext(Lt),o=De(),a=o.getMonitor(),l=a.getItem();if(!n||!l)return null;var c=t.dropTargetId===s.dropTargetId&&(t.index===s.index||t.index===void 0&&t.listCount===s.index),u=a.getTargetIds();return!c||!u.length?null:V.createElement(r,{className:i?.placeholder||""},n(l,{depth:t.depth}))},jr=function(t){var e=ke(),n=m.useRef(null),r=e.tree.filter(function(g){return g.parent===t.parentId}),i=r,s=typeof e.sort=="function"?e.sort:t0;if(e.insertDroppableFirst){var o=r.filter(function(g){return g.droppable}),a=r.filter(function(g){return!g.droppable});e.sort===!1?i=K(K([],o,!0),a,!0):(o=o.sort(s),a=a.sort(s),i=K(K([],o,!0),a,!0))}else e.sort!==!1&&(i=r.sort(s));var l=p0(n),c=l[0],u=l[1],d=l[2];t.parentId===e.rootId&&Ae(u,e.rootId,e)&&d(n);var h=y0(t.parentId,c),f=e.rootProps||{},p=e.listComponent;return V.createElement(p,ue({ref:n,role:"list"},f,{className:h}),i.map(function(g,b){return V.createElement(V.Fragment,{key:g.id},V.createElement($o,{depth:t.depth,listCount:i.length,dropTargetId:t.parentId,index:b}),V.createElement(T0,{id:g.id,depth:t.depth}))}),V.createElement($o,{depth:t.depth,listCount:i.length,dropTargetId:t.parentId}))},x0={height:"100%",left:0,pointerEvents:"none",position:"fixed",top:0,width:"100%",zIndex:100},S0=function(t){var e=t.clientOffset;if(!e)return{};var n=e.x,r=e.y,i="translate(".concat(n,"px, ").concat(r,"px)");return{pointerEvents:"none",transform:i}},w0=function(){var t=ke(),e=v0(),n=e.isDragging,r=e.clientOffset;return!n||!r?null:V.createElement("div",{style:x0},V.createElement("div",{style:S0(e)},t.dragPreviewRender&&t.dragPreviewRender(e)))};function D0(t,e){return V.createElement(u0,ue({},t,{treeRef:e}),t.dragPreviewRender&&V.createElement(w0,null),V.createElement(jr,{parentId:t.rootId,depth:0}))}var C0=m.forwardRef(D0);function E0({filter:t,setFilter:e,closeModal:n}){const[r,i]=m.useState(t.isShowZeroedAccounts??!1),{control:s,handleSubmit:o}=Wo({defaultValues:{...t}}),{selectableBusinesses:a,fetching:l}=Bc(),{userContext:c}=m.useContext(_c),u=h=>{h.isShowZeroedAccounts=r??!1,h.fromDate?.trim()===""&&(h.fromDate=void 0),h.toDate?.trim()===""&&(h.toDate=void 0),e(h),n()};function d(){e({}),n()}return v.jsxs(v.Fragment,{children:[l?v.jsx("div",{children:"Loading..."}):v.jsx("div",{}),v.jsxs("form",{onSubmit:o(u),className:"flex flex-col gap-2",children:[v.jsx(An,{name:"ownerIds",control:s,defaultValue:void 0,render:({field:h,fieldState:f})=>v.jsx(Pu,{...h,data:a,value:h.value??(c?.context.adminBusinessId?[c?.context.adminBusinessId]:void 0),disabled:l,label:"Owners",placeholder:"Scroll to see all options",maxDropdownHeight:160,searchable:!0,error:f.error?.message})}),v.jsx(An,{name:"fromDate",control:s,defaultValue:t.fromDate,rules:{pattern:{value:Bi,message:"Date must be im format yyyy-mm-dd"}},render:({field:h,fieldState:f})=>v.jsx(_i,{...h,onChange:p=>{const g=p?typeof p=="string"?p:rn(p,"yyyy-MM-dd"):void 0;g!==h.value&&h.onChange(g)},value:h.value?new Date(h.value):void 0,label:"From Date",error:f.error?.message})}),v.jsx(An,{name:"toDate",control:s,defaultValue:t.toDate,rules:{pattern:{value:Bi,message:"Date must be im format yyyy-mm-dd"}},render:({field:h,fieldState:f})=>v.jsx(_i,{...h,onChange:p=>{const g=p?typeof p=="string"?p:rn(p,"yyyy-MM-dd"):void 0;g!==h.value&&h.onChange(g)},value:h.value?new Date(h.value):void 0,label:"To Date",error:f.error?.message})}),v.jsxs("div",{className:"flex items-center space-x-2",children:[v.jsx(Go,{checked:r??!1,onCheckedChange:()=>i(h=>!h)}),v.jsx(Ko,{htmlFor:"enable-dnd",children:"Show zeroed accounts"})]}),v.jsxs("div",{className:"flex justify-center mt-5 gap-3",children:[v.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",children:"Filter"}),v.jsx("button",{type:"button",className:"text-white bg-orange-500 border-0 py-2 px-8 focus:outline-hidden hover:bg-orange-600 rounded-sm text-lg",onClick:d,children:"Clear"}),v.jsx("button",{type:"button",className:"text-white bg-rose-500 border-0 py-2 px-8 focus:outline-hidden hover:bg-rose-600 rounded-sm text-lg",onClick:n,children:"Cancel"})]})]})]})}function O0({filter:t,setFilter:e}){const[n,r]=m.useState(!1),[i,s]=m.useState(!Fi(t)),{get:o,set:a}=ea();function l(u){return Object.entries(u??{}).filter(([h,f])=>f!==void 0&&Array.isArray(f)&&f.length>0).length>0}function c(u){zc(u,t)||(e(u),s(l(u)))}return m.useEffect(()=>{const u=Fi(t)?null:encodeURIComponent(JSON.stringify(t)),d=o(mn);u!==d&&a(mn,u)},[t,o,a]),v.jsxs(_r,{open:n,onOpenChange:r,children:[v.jsx(zr,{asChild:!0,children:v.jsx(Fc,{inline:!0,size:16,disabled:!i,children:v.jsx(ee,{variant:"outline",onClick:()=>r(!0),className:"p-2",children:v.jsx(Ou,{size:20})})})}),v.jsxs($r,{className:"w-100 max-w-screen-md",children:[v.jsx(Ur,{children:v.jsx(Hr,{children:"Conto report filters"})}),v.jsx(E0,{filter:t,setFilter:c,closeModal:()=>r(!1)})]})]})}const P0="deleteDynamicReportTemplate",M0=()=>{const[{fetching:t},e]=qo($c),n=m.useCallback(async r=>{const i=`Error deleting report template "${r.name}"`,s=`${P0}-${r.name}`;Pe.loading("Deleting report template",{id:s});try{const o=await e(r),a=Yo(o,i,s);if(a)return Pe.success("Success",{id:s,description:`Report template "${a.deleteDynamicReportTemplate}" deleted`}),a.deleteDynamicReportTemplate}catch(o){console.error(`${i}: ${o}`),Pe.error("Error",{id:s,description:i,duration:1e5,closeButton:!0})}},[e]);return{fetching:t,deleteDynamicReportTemplate:n}};function I0({closeModal:t,setTemplate:e,template:n}){const[r,i]=m.useState([]),[s,o]=m.useState({}),[a,l]=m.useState([]),[{data:c,fetching:u},d]=rr({query:Uc}),{deleteDynamicReportTemplate:h}=M0(),f=m.useCallback(async y=>{await h({name:y}),d()},[h,d]),p=m.useCallback(y=>{e(y),t()},[e,t]),g=m.useMemo(()=>[{accessorKey:"name",header:({column:T})=>v.jsxs(ee,{variant:"ghost",onClick:()=>T.toggleSorting(T.getIsSorted()==="asc"),children:["Name",v.jsx(Gi,{})]}),cell:({row:T})=>v.jsx("div",{className:"lowercase",children:T.getValue("name")})},{accessorKey:"updated",header:({column:T})=>v.jsxs(ee,{variant:"ghost",onClick:()=>T.toggleSorting(T.getIsSorted()==="asc"),children:["Last Updated",v.jsx(Gi,{})]}),cell:({row:T})=>v.jsx("div",{className:"lowercase",children:rn(T.getValue("updated"),"dd/MM/yyyy HH:mm:ss")})},{id:"actions",cell:({row:T})=>{const{name:x}=T.original;return v.jsxs(Zo,{children:[v.jsx(Jo,{asChild:!0,children:v.jsxs(ee,{variant:"ghost",className:"h-8 w-8 p-0",children:[v.jsx("span",{className:"sr-only",children:"Open menu"}),v.jsx(ta,{})]})}),v.jsxs(Qo,{align:"end",children:[v.jsx(Qc,{children:"Actions"}),v.jsx(eu,{}),v.jsx(sn,{onClick:()=>f(x),children:"Delete"}),v.jsx(sn,{onClick:()=>p(x),children:"Select"})]})]})}}],[f,p]),b=Hc({data:c?.allDynamicReports||[],columns:g,onSortingChange:i,getCoreRowModel:qc(),getPaginationRowModel:Kc(),getSortedRowModel:Gc(),onRowSelectionChange:o,onColumnFiltersChange:l,getFilteredRowModel:Wc(),state:{sorting:r,rowSelection:s,columnFilters:a}});return v.jsxs("div",{className:"w-full h-[450px] relative",children:[u&&v.jsx("div",{className:"absolute bg-white/60 z-10 h-full w-full flex items-center justify-center",children:v.jsx("div",{className:"flex items-center",children:v.jsx("span",{className:"text-3xl mr-4",children:v.jsx(Xo,{className:"h-10 w-10 animate-spin mr-2 self-center"})})})}),v.jsx("div",{className:"flex items-center py-4",children:v.jsx(Wr,{placeholder:"Filter templates...",value:b.getColumn("name")?.getFilterValue()??"",onChange:y=>b.getColumn("name")?.setFilterValue(y.target.value),className:"max-w-sm"})}),v.jsx("div",{className:"rounded-md border",children:v.jsxs(Yc,{children:[v.jsx(Xc,{children:b.getHeaderGroups().map(y=>v.jsx(Nn,{children:y.headers.map(T=>v.jsx(Zc,{children:T.isPlaceholder?null:zi(T.column.columnDef.header,T.getContext())},T.id))},y.id))}),v.jsx(Jc,{children:b.getRowModel().rows?.length?b.getRowModel().rows.map(y=>v.jsx(Nn,{"data-state":y.original.name===n&&"selected",children:y.getVisibleCells().map(T=>v.jsx($i,{children:zi(T.column.columnDef.cell,T.getContext())},T.id))},y.id)):v.jsx(Nn,{children:v.jsx($i,{colSpan:g.length,className:"h-24 text-center",children:"No results."})})})]})}),v.jsxs("div",{className:"flex items-center justify-end space-x-2 py-4",children:[v.jsxs("div",{className:"flex-1 text-sm text-muted-foreground",children:[b.getFilteredSelectedRowModel().rows.length," of"," ",b.getFilteredRowModel().rows.length," row(s) selected."]}),v.jsxs("div",{className:"space-x-2",children:[v.jsx(ee,{variant:"outline",size:"sm",onClick:()=>b.previousPage(),disabled:!b.getCanPreviousPage(),children:"Previous"}),v.jsx(ee,{variant:"outline",size:"sm",onClick:()=>b.nextPage(),disabled:!b.getCanNextPage(),children:"Next"})]})]})]})}function R0({template:t,setTemplate:e}){const[n,r]=m.useState(!1);return v.jsxs(_r,{open:n,onOpenChange:r,children:[v.jsx(yn,{content:"Manage templates",children:v.jsx(zr,{asChild:!0,children:v.jsx(ee,{variant:"outline",onClick:()=>r(!0),className:"p-2",children:v.jsx(Iu,{size:20})})})}),v.jsxs($r,{className:"max-w-screen-md",children:[v.jsx(Ur,{children:v.jsx(Hr,{children:"Conto report templates"})}),v.jsx(I0,{closeModal:()=>r(!1),template:t,setTemplate:e})]})]})}const A0="insertDynamicReportTemplate",N0=()=>{const[{fetching:t},e]=qo(tu),n=m.useCallback(async r=>{const i=`Error inserting report template "${r.name}"`,s=`${A0}-${r.name}`;Pe.loading("Saving report template",{id:s});try{const o=await e(r),a=Yo(o,i,s);if(a)return Pe.success("Success",{id:s,description:`Report template "${a.insertDynamicReportTemplate.name}" saved`}),a.insertDynamicReportTemplate}catch(o){console.error(`${i}: ${o}`),Pe.error("Error",{id:s,description:i,duration:1e5,closeButton:!0})}},[e]);return{fetching:t,insertDynamicReportTemplate:n}},k0=uu({name:Ui().min(5,{message:"Name must be at least 5 characters long"}),template:Ui()});function L0({tree:t,setFetching:e,closeModal:n}){const r=m.useMemo(()=>{const l=t.filter(u=>u.data?.sortCode==null&&u.data?.value==null);return JSON.stringify(l.map(u=>({id:u.id,parent:u.parent,text:u.text,droppable:u.droppable??void 0,data:u.data?{hebrewText:u.data.hebrewText??void 0,value:u.data.value,sortCode:u.data.sortCode,isOpen:u.data.isOpen,descendantSortCodes:u.data.descendantSortCodes,descendantFinancialEntities:u.data.descendantFinancialEntities,mergedSortCodes:u.data.mergedSortCodes}:void 0})))},[t]),i=Wo({resolver:nu(k0),defaultValues:{name:`template-${rn(new Date,"yyyy-MM-dd")}`,template:r}}),{insertDynamicReportTemplate:s,fetching:o}=N0(),a=m.useCallback(async l=>{try{await s({...l,template:r}),n()}catch(c){console.error(c),i.setError("root",{message:"Failed to save template"})}},[n,i,s,r]);return m.useEffect(()=>{e(o)},[o,e]),v.jsx(ru,{...i,children:v.jsxs("form",{onSubmit:i.handleSubmit(a),className:"flex flex-col gap-2",children:[v.jsx(iu,{control:i.control,name:"name",render:({field:l})=>v.jsxs(su,{children:[v.jsx(ou,{children:"Template Name"}),v.jsx(au,{children:v.jsx(Wr,{...l,required:!0})}),v.jsx(lu,{})]})}),v.jsxs(cu,{children:[v.jsx(ee,{disabled:o,type:"submit",children:"Save"}),v.jsx(ee,{disabled:o,variant:"outline",onClick:n,children:"Cancel"})]})]})})}function V0({tree:t}){const[e,n]=m.useState(!1),[r,i]=m.useState(!1);return v.jsxs(_r,{open:e,onOpenChange:n,children:[v.jsx(zr,{asChild:!0,children:v.jsx(yn,{content:"Save template",children:v.jsx(ee,{variant:"outline",disabled:r,onClick:()=>n(!0),className:"p-2",children:v.jsx(Au,{size:20})})})}),v.jsxs($r,{className:"w-100 max-w-screen-md",children:[v.jsx(Ur,{children:v.jsx(Hr,{children:"Save Conto report template"})}),v.jsx(L0,{tree:t,setFetching:i,closeModal:()=>n(!1)})]})]})}const j0=({tree:t,filters:e})=>{const n=m.useCallback(async()=>{const r=F0(e.fromDate,e.toDate),i=B0(t),s="conto_report"+r;return{fileContent:i,fileName:s}},[e.fromDate,e.toDate,t]);return t.length?v.jsx(Su,{createFileVariables:n}):v.jsx("div",{})};function F0(t,e){return t&&e?`_${t}_to_${e}`:t?`_since_${t}`:e?`_until_${e}`:""}const B0=t=>{const e=t.filter(s=>s.parent===Br);if(!e.length)return"No Report Data";const n=[{content:"Account",depth:0,amount:"ILS Amount",suffix:"",type:"CATEGORY"}],{rows:r,maxDepth:i}=vc(e,t,0);return n.push(...r),n.map(s=>{const{depth:o}=s;let a=o,l=i-o;switch(s.type){case"SORT_CODE":a=i-1,l=1;break;case"FINANCIAL_ENTITY":a=i,l=0;break}return`${",".repeat(a)}${nr(s.content)},${nr(s.suffix??"")}${",".repeat(l)},${nr(s.amount)}`}).join(`\r
|
|
107
|
+
`)};function vc(t,e,n){if(t.length===0)return{rows:[],maxDepth:n,sum:0};let r=n;const i=[];let s=0;return t.map(o=>{if(o.data?.value!=null){s+=o.data.value;const d={content:o.text,depth:n,amount:o.data.value,suffix:"",type:"FINANCIAL_ENTITY"};i.push(d);return}const a=gn(e,o.id),l=a.filter(d=>d.parent===o.id),c={content:o.text,suffix:o.data?.sortCode??"",depth:n,amount:a.reduce((d,h)=>d+(h.data?.value??0),0),type:o.data?.sortCode?"SORT_CODE":"CATEGORY"};i.push(c);const u=vc(l,e,n+1);i.push(...u.rows),u.maxDepth>r&&(r=u.maxDepth)}),{rows:i,maxDepth:r,sum:s}}function nr(t){return t===""?"":Number.isNaN(Number(t))?t.replace(/"/g,'""').replace(/,/g,"."):Number(t).toFixed(2)}const Fr=t=>t.droppable?t.open?v.jsx(Lu,{size:30}):v.jsx(Bu,{size:30}):v.jsx(du,{}),_0=t=>{const{item:e}=t.monitorProps;return v.jsxs("div",{className:"items-center bg-zinc-600 rounded shadow-[0_12px_24px_-6px_rgba(0,0,0,0.25),0_0_0_1px_rgba(0,0,0,0.08)] text-white text-sm inline-grid grid-cols-[auto_auto] gap-2 py-1 px-2 pointer-events-none",children:[v.jsx("div",{className:"items-center flex",children:v.jsx(Fr,{droppable:e.droppable||!1})}),v.jsx("div",{className:"items-center flex",children:e.text})]})},z0=mu(vu.Ils,{trailingZeroDisplay:"stripIfInteger"}),$0=t=>{const{id:e,text:n,droppable:r}=t.node,[i,s]=m.useState(!1),[o,a]=m.useState(n),[l,c]=m.useState(!0),u=t.depth*24,d=T=>{T.stopPropagation(),t.onToggle(t.node.id)},h=()=>{s(!0)},f=()=>{a(n),s(!1)},p=T=>{a(T.target.value)},g=()=>{s(!1),t.onTextChange(e,o)},b=f0(e,t.isOpen,t.onToggle),y=r&&!t.node.data?.sortCode;return v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"items-center grid grid-cols-[auto_auto_1fr_auto] h-10 pe-2",style:{paddingInlineStart:u},...b,children:[t.node.droppable?v.jsxs("button",{className:"cursor-pointer",onClick:d,children:[v.jsx(Fr,{droppable:r||!1,open:t.isOpen}),!t.isOpen&&v.jsx("div",{className:"relative -top-5 font-bold text-xs",children:t.descendants.filter(T=>!T.droppable).length})]}):v.jsx(Fr,{droppable:r||!1,open:t.isOpen}),v.jsx("div",{className:"ps-2",children:i&&y?v.jsxs("div",{className:"items-center grid grid-cols-[repeat(3,auto)] justify-start ",children:[v.jsx(Wr,{className:"text-sm py-2 w-48",value:o,onChange:p}),v.jsx(Ji,{className:"p-1",onClick:g,disabled:o==="",children:v.jsx(hu,{className:"text-xl"})}),v.jsx(Ji,{className:"p-1",onClick:f,children:v.jsx(fu,{className:"text-xl"})})]}):v.jsxs("div",{className:"items-center grid grid-cols-[repeat(4,auto)] justify-start",children:[v.jsx(sr,{variant:"body2",className:"pr-2",children:t.node.text}),t.node.data?.sortCode&&v.jsxs(Hi,{variant:"outline",children:["Sort Code ",t.node.data?.sortCode]}),v.jsx(Hi,{children:z0.format(t.node.data?.value==null?t.descendants.filter(T=>!T.droppable).reduce((T,x)=>T+(x.data?.value??0),0):t.node.data.value)}),y&&v.jsxs(Zo,{children:[v.jsx(Jo,{asChild:!0,children:v.jsx(ee,{variant:"ghost",size:"sm",className:"p-1",children:v.jsx(ta,{size:20})})}),v.jsx(Qo,{className:"w-56",children:v.jsxs(pu,{children:[v.jsxs(sn,{onClick:h,children:["Edit Category",v.jsx(Wi,{children:v.jsx(zu,{size:15})})]}),y&&v.jsxs(sn,{onClick:()=>t.onDeleteCategory(e),children:["Delete Category",v.jsx(Wi,{children:v.jsx(gu,{size:15,color:"red"})})]})]})})]}),!r&&v.jsx("div",{className:"pl-2",children:v.jsx(yn,{content:"Expand records",children:v.jsx(ee,{variant:"outline",size:"icon",className:"size-7.5",onClick:()=>c(T=>!T),children:l?v.jsx(Cu,{className:"size-5"}):v.jsx(Eu,{className:"size-5"})})})})]})})]}),!r&&l&&v.jsx("div",{children:v.jsx(wu,{businessID:t.node.id,filter:t.filter})})]})},U0=t=>{const e=t.depth*24;return v.jsx("div",{className:"bg-[#1967d2] h-0.5 absolute -translate-y-2/4 right-0 top-0",style:{left:e}})},Uo=({tree:t,onDrop:e,rootId:n,handleIsOpenChange:r,handleTextChange:i,handleDeleteCategory:s,filter:o,enableDnd:a})=>v.jsx(C0,{tree:t,onDrop:e,rootId:n,classes:{root:"box-border h-full p-4",draggingSource:"opacity-30",placeholder:"relative"},render:m.useCallback((l,{depth:c,isOpen:u,onToggle:d})=>v.jsx($0,{node:l,depth:c,isOpen:u,onToggle:()=>{d(),r(l.id,!u)},onTextChange:i,onDeleteCategory:s,descendants:gn(t,l.id),filter:o}),[t,i,s,r,o]),dragPreviewRender:m.useCallback(l=>v.jsx(_0,{monitorProps:l}),[]),sort:!1,insertDroppableFirst:!1,canDrag:()=>a,canDrop:(l,{dragSource:c,dropTargetId:u})=>{if(!a)return!1;if(c?.parent===u)return!0},dropTargetOffset:10,placeholderRender:(l,{depth:c})=>v.jsx(U0,{node:l,depth:c}),initialOpen:t.filter(l=>l.data?.isOpen).map(l=>l.id)}),et="bank",Br="report",mn="contoReportFilters";function H0(t){const e=new Map,n=new Map;return t.map(({data:r,id:i})=>{r?.descendantSortCodes?.length&&r.descendantSortCodes.map(s=>e.set(s,i)),r?.descendantFinancialEntities?.length&&r.descendantFinancialEntities.map(s=>n.set(s,i))}),{sortCodeMap:e,financialEntitiesMap:n}}function W0(t,e,n){const r=[...t];return e.map(i=>{if(r.find(o=>o.id===i.id))return;const s=n.get(i.key)??void 0;r.push({id:i.id,parent:s??et,droppable:!0,text:i.name,data:{sortCode:i.key,isOpen:!1}})}),r}function G0(t,e,n,r){const i=[...t];return e.map(s=>{const o=s.total.raw*-1;if(!r&&Math.abs(o)<.005)return;const a=i.find(c=>c.id===s.business.id);if(a){a.data?.value!==o&&(a.data={...a.data,isOpen:!1,value:o});return}let l=n.get(s.business.id);l||(i.find(c=>c.id===s.business.sortCode?.id)?l=s.business.sortCode.id:l=et),i.push({id:s.business.id,parent:l,droppable:!1,text:s.business.name,data:{value:o,isOpen:!1}})}),i}function K0(t){const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz".split("");t||=Math.floor(Math.random()*e.length);let n="";for(let r=0;r<t;r++)n+=e[Math.floor(Math.random()*e.length)];return n}const ab=()=>{const{setFiltersContext:t}=m.useContext(yu),[e,n]=m.useState([]),[r,i]=m.useState(!1),[s,o]=m.useState(void 0),{get:a}=ea(),[l,c]=m.useState(a(mn)?JSON.parse(decodeURIComponent(a(mn))):{}),[{data:u,fetching:d,error:h}]=rr({query:Tu,variables:{filters:{fromDate:l?.fromDate,toDate:l?.toDate,ownerIds:l?.ownerIds}}}),{sortCodes:f,fetching:p}=bu(),[{data:g,fetching:b,error:y},T]=rr({query:xu,variables:{name:s??""},pause:!0}),x=m.useCallback((L,{dragSourceId:R,dropTargetId:U,dragSource:Z})=>{const j=new Set(L.map(k=>k.id)),W=Z?.parent,B=Z?.data?.sortCode!=null,fe=Z?.data?.value!=null;n([...L,...e.filter(k=>!j.has(k.id))].map(k=>{if(k.id===R)return{...k,parent:U};if(B||fe){if(k.id===U)return{...k,data:{isOpen:!0,...k.data,descendantFinancialEntities:fe?[...k.data?.descendantFinancialEntities??[],R]:k.data?.descendantFinancialEntities,descendantSortCodes:B?[...k.data?.descendantSortCodes??[],R]:k.data?.descendantSortCodes}};if(k.id===W)return{...k,data:{isOpen:!0,...k.data,descendantFinancialEntities:fe&&k.data?.descendantFinancialEntities?.length?k.data.descendantFinancialEntities.filter(Ce=>Ce!==R):k.data?.descendantFinancialEntities,descendantSortCodes:fe&&k.data?.descendantSortCodes?.length?k.data.descendantSortCodes.filter(Ce=>Ce!==R):k.data?.descendantSortCodes}}}return k}))},[n,e]),w=m.useCallback(L=>{n(e.filter(R=>R.id!==L).map(R=>R.parent===L?{...R,parent:et}:R))},[n,e]),S=m.useCallback(()=>{const L={id:`synthetic-${K0(8)}`,parent:et,droppable:!0,text:"New Category",data:{isOpen:!1}};n([...e,L])},[n,e]),C=(L,R)=>{n(e.map(U=>U.id===L?{...U,text:R}:U))},I=(L,R)=>{n(e.map(U=>U.id===L?{...U,data:{...U.data,isOpen:R}}:U))};m.useEffect(()=>{s&&s!==""&&T()},[s,T]),m.useEffect(()=>{const L=()=>{i(R=>!R)};t(v.jsxs("div",{className:"flex flex-row gap-2",children:[v.jsx(j0,{tree:e,filters:l}),v.jsx(R0,{template:s,setTemplate:o}),v.jsx(V0,{tree:e}),v.jsx(yn,{content:"Add new category",children:v.jsx(ee,{variant:"outline",onClick:S,className:"gap-2 p-2",children:v.jsx(ju,{size:20})})}),v.jsx(O0,{filter:l,setFilter:c}),v.jsxs("div",{className:"flex items-center space-x-2",children:[v.jsx(Go,{id:"enable-dnd",checked:r,onCheckedChange:L}),v.jsxs(Ko,{htmlFor:"enable-dnd",children:["Form is ",r?"editable":"locked"]})]})]}))},[t,r,l,c,S,e,s]);const D=m.useMemo(()=>u&&u?.businessTransactionsSumFromLedgerRecords.__typename!=="CommonError"?u.businessTransactionsSumFromLedgerRecords.businessTransactionsSum:[],[u]),N=m.useCallback(()=>{n(L=>{const{sortCodeMap:R,financialEntitiesMap:U}=H0(L),Z=W0(L,f,R);return G0(Z,D,U,l.isShowZeroedAccounts)})},[f,D,l.isShowZeroedAccounts,n]);m.useEffect(()=>{if(!b&&g){const L=g.dynamicReport.template.map(R=>({...R,data:{...R.data,hebrewText:R.data.hebrewText??void 0}}));n(L),N()}},[g,b,N]),m.useEffect(()=>{N()},[f,D,l.isShowZeroedAccounts,N]),m.useEffect(()=>{h&&(console.error(h),Pe.error("Error",{description:"Unable to fetch businesses summary"}))},[h]),m.useEffect(()=>{y&&(console.error(y),Pe.error("Error",{description:"Unable to fetch template"}))},[y]);const A=gn(e,Br),H=gn(e,et),q=m.useMemo(()=>!f&&p||!u&&d,[f,p,u,d]);return v.jsx($h,{backend:jy,options:l0(),children:v.jsxs("div",{className:"h-full grid grid-cols-[auto_1fr] relative",children:[q&&v.jsx("div",{className:"absolute bg-white/60 z-10 h-full w-full flex items-center justify-center",children:v.jsx("div",{className:"flex items-center",children:v.jsx("span",{className:"text-3xl mr-4",children:v.jsx(Xo,{className:"h-10 w-10 animate-spin mr-2 self-center"})})})}),v.jsxs("div",{className:"border-r border-solid corder-color-zinc-100 relative",children:[v.jsx(sr,{variant:"h5",className:"px-4",children:"Bank"}),v.jsx(Uo,{rootId:et,tree:H,onDrop:x,handleTextChange:C,handleDeleteCategory:w,handleIsOpenChange:I,enableDnd:r,filter:l})]}),v.jsxs("div",{children:[v.jsx(sr,{variant:"h5",className:"px-4",children:"Report"}),v.jsx(Uo,{rootId:Br,tree:A,onDrop:x,handleTextChange:C,handleDeleteCategory:w,handleIsOpenChange:I,enableDnd:r,filter:l})]})]})})};export{mn as CONTO_REPORT_FILTERS_KEY,ab as ContoReport,Br as REPORT_TREE_ROOT_ID};
|